| 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; |