| 649 |
return p_section; |
return p_section; |
| 650 |
} |
} |
| 651 |
|
|
| 652 |
|
int section_list_update(SECTION_LIST *p_section, const char *sname, const char *stitle, const char *master_list) |
| 653 |
|
{ |
| 654 |
|
if (p_section == NULL || sname == NULL || stitle == NULL || master_list == NULL) |
| 655 |
|
{ |
| 656 |
|
log_error("NULL pointer error\n"); |
| 657 |
|
return -1; |
| 658 |
|
} |
| 659 |
|
|
| 660 |
|
strncpy(p_section->sname, sname, sizeof(p_section->sname) - 1); |
| 661 |
|
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
| 662 |
|
|
| 663 |
|
strncpy(p_section->stitle, stitle, sizeof(p_section->stitle) - 1); |
| 664 |
|
p_section->stitle[sizeof(p_section->stitle) - 1] = '\0'; |
| 665 |
|
|
| 666 |
|
strncpy(p_section->master_list, master_list, sizeof(p_section->master_list) - 1); |
| 667 |
|
p_section->master_list[sizeof(p_section->master_list) - 1] = '\0'; |
| 668 |
|
|
| 669 |
|
if (trie_dict_set(p_section_list_pool->p_trie_dict_section_by_name, sname, p_section_list_pool->section_count) != 1) |
| 670 |
|
{ |
| 671 |
|
log_error("trie_dict_set(section, %s, %d) error\n", sname, p_section_list_pool->section_count); |
| 672 |
|
return -2; |
| 673 |
|
} |
| 674 |
|
|
| 675 |
|
return 0; |
| 676 |
|
} |
| 677 |
|
|
| 678 |
void section_list_reset_articles(SECTION_LIST *p_section) |
void section_list_reset_articles(SECTION_LIST *p_section) |
| 679 |
{ |
{ |
| 680 |
p_section->article_count = 0; |
p_section->article_count = 0; |
| 690 |
p_section->ontop_article_count = 0; |
p_section->ontop_article_count = 0; |
| 691 |
} |
} |
| 692 |
|
|
| 693 |
SECTION_LIST *section_list_find_by_name(const char *sname, int64_t *p_index) |
SECTION_LIST *section_list_find_by_name(const char *sname) |
| 694 |
{ |
{ |
| 695 |
int64_t index; |
int64_t index; |
| 696 |
int ret; |
int ret; |
| 712 |
return NULL; |
return NULL; |
| 713 |
} |
} |
| 714 |
|
|
|
if (p_index != NULL) |
|
|
{ |
|
|
*p_index = index; |
|
|
} |
|
|
|
|
| 715 |
return (p_section_list_pool->sections + index); |
return (p_section_list_pool->sections + index); |
| 716 |
} |
} |
| 717 |
|
|
| 718 |
SECTION_LIST *section_list_find_by_sid(int32_t sid, int64_t *p_index) |
SECTION_LIST *section_list_find_by_sid(int32_t sid) |
| 719 |
{ |
{ |
| 720 |
int64_t index; |
int64_t index; |
| 721 |
int ret; |
int ret; |
| 740 |
return NULL; |
return NULL; |
| 741 |
} |
} |
| 742 |
|
|
|
if (p_index != NULL) |
|
|
{ |
|
|
*p_index = index; |
|
|
} |
|
|
|
|
| 743 |
return (p_section_list_pool->sections + index); |
return (p_section_list_pool->sections + index); |
| 744 |
} |
} |
| 745 |
|
|
| 753 |
|
|
| 754 |
if (p_section == NULL || p_article_src == NULL) |
if (p_section == NULL || p_article_src == NULL) |
| 755 |
{ |
{ |
| 756 |
log_error("section_list_append_article() NULL pointer error\n"); |
log_error("NULL pointer error\n"); |
| 757 |
return -1; |
return -1; |
| 758 |
} |
} |
| 759 |
|
|
| 1088 |
|
|
| 1089 |
if (p_section == NULL) |
if (p_section == NULL) |
| 1090 |
{ |
{ |
| 1091 |
log_error("section_list_find_article_with_offset() NULL pointer error\n"); |
log_error("NULL pointer error\n"); |
| 1092 |
return NULL; |
return NULL; |
| 1093 |
} |
} |
| 1094 |
|
|
| 1180 |
|
|
| 1181 |
if (p_section == NULL) |
if (p_section == NULL) |
| 1182 |
{ |
{ |
| 1183 |
log_error("section_list_calculate_page() NULL pointer error\n"); |
log_error("NULL pointer error\n"); |
| 1184 |
return -1; |
return -1; |
| 1185 |
} |
} |
| 1186 |
|
|
| 1339 |
|
|
| 1340 |
if (p_section_src == NULL || p_section_dest == NULL) |
if (p_section_src == NULL || p_section_dest == NULL) |
| 1341 |
{ |
{ |
| 1342 |
log_error("section_list_move_topic() NULL pointer error\n"); |
log_error("NULL pointer error\n"); |
| 1343 |
return -1; |
return -1; |
| 1344 |
} |
} |
| 1345 |
|
|