| 1 |
/*************************************************************************** |
/*************************************************************************** |
| 2 |
file_section_list.c - description |
test_section_list.c - description |
| 3 |
------------------- |
------------------- |
| 4 |
Copyright : (C) 2004-2025 by Leaflet |
Copyright : (C) 2004-2025 by Leaflet |
| 5 |
Email : leaflet@leafok.com |
Email : leaflet@leafok.com |
| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
|
#include "section_list.h" |
|
|
#include "trie_dict.h" |
|
| 17 |
#include "bbs.h" |
#include "bbs.h" |
| 18 |
#include "log.h" |
#include "log.h" |
| 19 |
|
#include "section_list.h" |
| 20 |
|
#include "trie_dict.h" |
| 21 |
|
#include <errno.h> |
| 22 |
#include <stdio.h> |
#include <stdio.h> |
| 23 |
#include <unistd.h> |
#include <unistd.h> |
|
#include <errno.h> |
|
| 24 |
|
|
| 25 |
#define ARTICLE_BLOCK_SHM_FILE "~article_block_shm.dat" |
#define ARTICLE_BLOCK_SHM_FILE "~article_block_shm.dat" |
| 26 |
#define SECTION_LIST_SHM_FILE "~section_list_shm.dat" |
#define SECTION_LIST_SHM_FILE "~section_list_shm.dat" |
| 33 |
|
|
| 34 |
const char *stitle[] = { |
const char *stitle[] = { |
| 35 |
" Test Section ", |
" Test Section ", |
| 36 |
"ĸABC", |
"字母组合ABC", |
| 37 |
"__123"}; |
"_数字_123"}; |
| 38 |
|
|
| 39 |
const char *master_name[] = { |
const char *master_name[] = { |
| 40 |
"sysadm", |
"sysadm", |
| 70 |
return -1; |
return -1; |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
log_std_redirect(STDOUT_FILENO); |
log_common_redir(STDOUT_FILENO); |
| 74 |
log_err_redirect(STDERR_FILENO); |
log_error_redir(STDERR_FILENO); |
| 75 |
|
|
| 76 |
// - 1 to make blocks allocated is less than required, to trigger error handling |
// - 1 to make blocks allocated is less than required, to trigger error handling |
| 77 |
block_count = BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK; |
block_count = BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK; |