| 25 |
#define BBS_article_limit_per_section 50000 |
#define BBS_article_limit_per_section 50000 |
| 26 |
#define BBS_article_limit_per_page 20 |
#define BBS_article_limit_per_page 20 |
| 27 |
|
|
| 28 |
|
#define BBS_ontop_article_limit_per_section 10 |
| 29 |
|
|
| 30 |
#define ARTICLE_PER_BLOCK 1000 |
#define ARTICLE_PER_BLOCK 1000 |
| 31 |
|
|
| 32 |
struct article_t |
struct article_t |
| 71 |
ARTICLE *p_page_first_article[BBS_article_limit_per_section / BBS_article_limit_per_page]; |
ARTICLE *p_page_first_article[BBS_article_limit_per_section / BBS_article_limit_per_page]; |
| 72 |
int32_t page_count; |
int32_t page_count; |
| 73 |
int32_t last_page_visible_article_count; |
int32_t last_page_visible_article_count; |
| 74 |
|
ARTICLE *p_ontop_articles[BBS_ontop_article_limit_per_section]; |
| 75 |
|
int32_t ontop_article_count; |
| 76 |
}; |
}; |
| 77 |
typedef struct section_list_t SECTION_LIST; |
typedef struct section_list_t SECTION_LIST; |
| 78 |
|
|
| 110 |
extern int section_list_append_article(SECTION_LIST *p_section, const ARTICLE *p_article_src); |
extern int section_list_append_article(SECTION_LIST *p_section, const ARTICLE *p_article_src); |
| 111 |
extern int section_list_set_article_visible(SECTION_LIST *p_section, int32_t aid, int8_t visible); |
extern int section_list_set_article_visible(SECTION_LIST *p_section, int32_t aid, int8_t visible); |
| 112 |
|
|
| 113 |
|
extern int section_list_update_article_ontop(SECTION_LIST *p_section, ARTICLE *p_article); |
| 114 |
|
extern int section_list_page_count_with_ontop(SECTION_LIST *p_section); |
| 115 |
|
extern int section_list_page_article_count_with_ontop(SECTION_LIST *p_section, int32_t page_id); |
| 116 |
|
|
| 117 |
// *p_page, *p_offset will be set as page / offset of the article with aid in *p_section (including both visible and invisible articles) |
// *p_page, *p_offset will be set as page / offset of the article with aid in *p_section (including both visible and invisible articles) |
| 118 |
// *pp_next will be set as pointer to the next article of the article with aid |
// *pp_next will be set as pointer to the next article of the article with aid |
| 119 |
// *pp_next will be set as head article of the section if the article with aid locates at the tail of the section |
// *pp_next will be set as head article of the section if the article with aid locates at the tail of the section |