| 3 |
* section_list |
* section_list |
| 4 |
* - data models and basic operations of section and article |
* - data models and basic operations of section and article |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
#ifndef _SECTION_LIST_H_ |
#ifndef _SECTION_LIST_H_ |
| 14 |
#include "menu.h" |
#include "menu.h" |
| 15 |
#include <time.h> |
#include <time.h> |
| 16 |
|
|
| 17 |
#define BBS_article_title_max_len 160 |
enum section_list_constant_t |
| 18 |
#define BBS_article_limit_per_section 50000 |
{ |
| 19 |
#define BBS_article_limit_per_page 20 |
BBS_article_title_max_len = 160, |
| 20 |
|
#if defined(__CYGWIN__) |
| 21 |
|
BBS_article_limit_per_section = 10000, |
| 22 |
|
#else |
| 23 |
|
BBS_article_limit_per_section = 50000, |
| 24 |
|
#endif |
| 25 |
|
BBS_article_limit_per_page = 20, |
| 26 |
|
|
| 27 |
#define BBS_ontop_article_limit_per_section 10 |
BBS_ontop_article_limit_per_section = 10, |
| 28 |
|
|
| 29 |
#define ARTICLE_PER_BLOCK 1000 |
BBS_article_count_per_block = 1000, |
| 30 |
|
}; |
| 31 |
|
|
| 32 |
struct article_t |
struct article_t |
| 33 |
{ |
{ |
| 91 |
|
|
| 92 |
extern SECTION_LIST_POOL *p_section_list_pool; |
extern SECTION_LIST_POOL *p_section_list_pool; |
| 93 |
|
|
| 94 |
// article_block_count * ARTICLE_PER_BLOCK should be |
// article_block_count * BBS_article_count_per_block should be |
| 95 |
// no less than BBS_article_limit_per_section * BBS_max_section, |
// no less than BBS_article_limit_per_section * BBS_max_section, |
| 96 |
// in order to allocate enough memory for blocks |
// in order to allocate enough memory for blocks |
| 97 |
extern int article_block_init(const char *filename, int block_count); |
extern int article_block_init(const char *filename, int block_count); |