| 3 |
* article_cache |
* article_cache |
| 4 |
* - convert article content from DB to local cache with LML conversion and line offset index |
* - convert article content from DB to local cache with LML conversion and line offset index |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
#ifdef HAVE_CONFIG_H |
| 10 |
|
#include "config.h" |
| 11 |
|
#endif |
| 12 |
|
|
| 13 |
#include "article_cache.h" |
#include "article_cache.h" |
| 14 |
#include "lml.h" |
#include "lml.h" |
| 15 |
#include "log.h" |
#include "log.h" |
| 23 |
#include <sys/mman.h> |
#include <sys/mman.h> |
| 24 |
#include <sys/stat.h> |
#include <sys/stat.h> |
| 25 |
|
|
| 26 |
#define ARTICLE_HEADER_MAX_LEN 4096 |
enum _article_cache_constant_t |
| 27 |
#define ARTICLE_CONTENT_MAX_LEN 1024 * 1024 * 4 // 4MB |
{ |
| 28 |
#define ARTICLE_FOOTER_MAX_LEN 4096 |
ARTICLE_HEADER_MAX_LEN = 4096, |
| 29 |
#define SUB_DT_MAX_LEN 50 |
ARTICLE_FOOTER_MAX_LEN = 4096, |
| 30 |
|
SUB_DT_MAX_LEN = 50, |
| 31 |
|
}; |
| 32 |
|
|
| 33 |
static const char *BBS_article_footer_color[] = { |
static const char *BBS_article_footer_color[] = { |
| 34 |
"\033[31m", |
"\033[31m", |