--- lbbs/include/common.h 2004/10/19 17:11:39 1.7 +++ lbbs/include/common.h 2025/05/04 14:54:55 1.19 @@ -1,9 +1,9 @@ /*************************************************************************** - common.h - description - ------------------- - begin : Mon Oct 18 2004 - copyright : (C) 2004 by Leaflet - email : leaflet@leafok.com + common.h - description + ------------------- + begin : Mon Oct 18 2004 + copyright : (C) 2004 by Leaflet + email : leaflet@leafok.com ***************************************************************************/ /*************************************************************************** @@ -15,23 +15,36 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef _COMMON_H_ +#define _COMMON_H_ -//Enviroment -extern char app_home_dir[256]; +#include -//Network +#define LINE_BUFFER_LEN 1024 +#define FILE_PATH_LEN 4096 +#define MAX_FILE_LINES 65536 + +// Version +extern char app_version[256]; + +// Enviroment +#define CONF_BBSNET "conf/bbsnet.conf" + +#define LOG_FILE_INFO "log/bbsd.log" +#define LOG_FILE_ERROR "log/error.log" + +#define DATA_WELCOME "data/welcome.txt" +#define DATA_REGISTER "data/register.txt" +#define DATA_GOODBYE "data/goodbye.txt" +#define DATA_LICENSE "data/license.txt" +#define DATA_COPYRIGHT "data/copyright.txt" +#define DATA_LOGIN_ERROR "data/login_error.txt" +#define DATA_ACTIVE_BOARD "data/active_board.txt" +#define DATA_READ_HELP "data/read_help.txt" + +#define VAR_MAX_USER_ONLINE "var/max_user_online.dat" + +// Network extern int socket_server; extern int socket_client; extern char hostaddr_server[50]; @@ -39,7 +52,19 @@ extern char hostaddr_client[50]; extern int port_server; extern int port_client; -//Database -extern char DB_host[256]; -extern char DB_username[50]; -extern char DB_password[50]; +// Signal +#define SIG_RELOAD_MENU 0x22 + +extern const char *str_space(char *string, int length); +extern const char *get_time_str(char *string, size_t length); + +// Signal handler +extern void reload_bbs_menu(int); +extern void system_exit(int); +extern void child_exit(int); + +// System +extern int SYS_exit; +extern int SYS_child_process_count; + +#endif //_COMMON_H_