| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
| 17 |
|
#include "article_favor.h" |
| 18 |
#include "article_view_log.h" |
#include "article_view_log.h" |
| 19 |
#include "bbs.h" |
#include "bbs.h" |
| 20 |
#include "bbs_cmd.h" |
#include "bbs_cmd.h" |
| 39 |
|
|
| 40 |
int bbs_info() |
int bbs_info() |
| 41 |
{ |
{ |
| 42 |
prints("欢迎光临 \033[1;33m%s \033[32m[%s] \033[37m( %s )\r\n", |
prints("欢迎光临 \033[1;33m%s \033[32m[%s] \033[37m( %s )\033[m\r\n", |
| 43 |
BBS_name, BBS_server, APP_INFO); |
BBS_name, BBS_server, APP_INFO); |
| 44 |
|
|
| 45 |
return iflush(); |
return iflush(); |
| 340 |
goto cleanup; |
goto cleanup; |
| 341 |
} |
} |
| 342 |
|
|
| 343 |
|
// Load article favorite |
| 344 |
|
if (article_favor_load(BBS_priv.uid, &BBS_article_favor, 0) < 0) |
| 345 |
|
{ |
| 346 |
|
log_error("article_favor_load() error\n"); |
| 347 |
|
goto cleanup; |
| 348 |
|
} |
| 349 |
|
|
| 350 |
// Init editor memory pool |
// Init editor memory pool |
| 351 |
if (editor_memory_pool_init() < 0) |
if (editor_memory_pool_init() < 0) |
| 352 |
{ |
{ |
| 371 |
log_error("article_view_log_save_inc() error\n"); |
log_error("article_view_log_save_inc() error\n"); |
| 372 |
} |
} |
| 373 |
|
|
| 374 |
|
// Save incremental article favorite |
| 375 |
|
if (article_favor_save_inc(&BBS_article_favor) < 0) |
| 376 |
|
{ |
| 377 |
|
log_error("article_favor_save_inc() error\n"); |
| 378 |
|
} |
| 379 |
|
|
| 380 |
cleanup: |
cleanup: |
| 381 |
// Cleanup editor memory pool |
// Cleanup editor memory pool |
| 382 |
editor_memory_pool_cleanup(); |
editor_memory_pool_cleanup(); |
| 384 |
// Unload article view log |
// Unload article view log |
| 385 |
article_view_log_unload(&BBS_article_view_log); |
article_view_log_unload(&BBS_article_view_log); |
| 386 |
|
|
| 387 |
|
// Unload article favor |
| 388 |
|
article_favor_unload(&BBS_article_favor); |
| 389 |
|
|
| 390 |
// Detach menu in shared memory |
// Detach menu in shared memory |
| 391 |
detach_menu_shm(&bbs_menu); |
detach_menu_shm(&bbs_menu); |
| 392 |
|
|