--- lbbs/src/main.c 2004/10/21 17:28:46 1.6 +++ lbbs/src/main.c 2025/04/28 03:31:00 1.18 @@ -1,9 +1,9 @@ /*************************************************************************** - main.c - description - ------------------- - begin : Mon Oct 11 2004 - copyright : (C) 2004 by Leaflet - email : leaflet@leafok.com + main.c - description + ------------------- + begin : Mon Oct 11 2004 + copyright : (C) 2004 by Leaflet + email : leaflet@leafok.com ***************************************************************************/ /*************************************************************************** @@ -17,120 +17,150 @@ #include "bbs.h" #include "common.h" +#include "io.h" +#include "menu.h" +#include +#include +#include +#include -void -app_help(void) +void app_help(void) { - printf ( - "Usage: bbsd [-fhv] [...]\n\n" - "-f\t--foreground\t\tForce program run in foreground\n" - "-h\t--help\t\t\tDisplay this help message\n" - "-v\t--version\t\tDisplay version information\n" - "\t--display-log\t\tDisplay standard log information\n" - "\t--display-error-log\tDisplay error log information\n" - "\n If meet any bug, please report to \n\n" - ); + prints("Usage: bbsd [-fhv] [...]\n\n" + "-f\t--foreground\t\tForce program run in foreground\n" + "-h\t--help\t\t\tDisplay this help message\n" + "-v\t--version\t\tDisplay version information\n" + "\t--display-log\t\tDisplay standard log information\n" + "\t--display-error-log\tDisplay error log information\n" + "\n If meet any bug, please report to \n\n"); } -void -arg_error(void) +void arg_error(void) { - printf ("Invalid arguments\n"); - app_help(); + prints("Invalid arguments\n"); + app_help(); } -int -main (int argc, char *argv[]) +int main(int argc, char *argv[]) { - char log_dir[256], file_log_std[256], file_log_error[256], file_config[256]; - int i,j; - int daemon = 1, std_log_redir = 0, error_log_redir = 0; - - //Parse args - for (i=1; i 0) + { + log_std("."); + sleep(1); + } + + // Cleanup + unload_menu(&bbs_menu); + rmdir(app_temp_dir); - //Initialize socket server - net_server(BBS_address, BBS_port); - - return 0; + return 0; }