/[LeafOK_CVS]/lbbs/include/article_cache.h
ViewVC logotype

Annotation of /lbbs/include/article_cache.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Sat Jan 3 10:27:14 2026 UTC (2 months, 1 week ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
Content type: text/x-chdr
Update copyright info

1 sysadm 1.9 /* SPDX-License-Identifier: GPL-3.0-or-later */
2     /*
3     * article_cache
4     * - convert article content from DB to local cache with LML conversion and line offset index
5     *
6 sysadm 1.12 * Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com>
7 sysadm 1.9 */
8 sysadm 1.1
9     #ifndef _ARTICLE_CACHE_H_
10     #define _ARTICLE_CACHE_H_
11    
12     #include "common.h"
13 sysadm 1.7 #include "section_list.h"
14 sysadm 1.1 #include "str_process.h"
15    
16 sysadm 1.11 enum article_cache_constant_t
17     {
18     ARTICLE_CONTENT_MAX_LEN = 1024 * 1024 * 4, // 4MB
19     };
20    
21 sysadm 1.1 struct article_cache_t
22     {
23 sysadm 1.4 void *p_mmap;
24 sysadm 1.6 size_t mmap_len;
25 sysadm 1.2 char *p_data;
26 sysadm 1.1 size_t data_len;
27     long line_total;
28     long line_offsets[MAX_SPLIT_FILE_LINES];
29     };
30     typedef struct article_cache_t ARTICLE_CACHE;
31    
32 sysadm 1.5 extern int article_cache_generate(const char *cache_dir, const ARTICLE *p_article, const SECTION_LIST *p_section,
33     const char *content, const char *sub_ip, int overwrite);
34 sysadm 1.8 extern void article_cache_cleanup(void);
35 sysadm 1.1
36     extern int article_cache_load(ARTICLE_CACHE *p_cache, const char *cache_dir, const ARTICLE *p_article);
37     extern int article_cache_unload(ARTICLE_CACHE *p_cache);
38    
39     #endif //_ARTICLE_CACHE_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1