--- lbbs/include/common.h 2025/06/28 01:30:19 1.47 +++ lbbs/include/common.h 2025/11/04 14:58:55 1.60 @@ -1,18 +1,10 @@ -/*************************************************************************** - common.h - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * common + * - common definitions + * + * Copyright (C) 2004-2025 Leaflet + */ #ifndef _COMMON_H_ #define _COMMON_H_ @@ -25,14 +17,13 @@ #define FILE_PATH_LEN 4096 // Version -#define APP_NAME "LBBS" -#define APP_VER "1.2.1" -#define APP_INFO (APP_NAME " version " APP_VER " build on " __DATE__ " " __TIME__) +#define APP_INFO (PACKAGE_STRING " build on " __DATE__ " " __TIME__) // Enviroment #define CONF_BBSD "conf/bbsd.conf" #define CONF_MENU "var/menu_merged.conf" #define CONF_BBSNET "conf/bbsnet.conf" +#define CONF_TOP10_MENU "var/bbs_top_menu.conf" #define SSH_HOST_KEYFILE "conf/ssh_host_rsa_key" #define LOG_FILE_INFO "log/bbsd.log" @@ -43,22 +34,26 @@ #define DATA_GOODBYE "data/goodbye.txt" #define DATA_LICENSE "data/license.txt" #define DATA_COPYRIGHT "data/copyright.txt" +#define DATA_VERSION "data/version.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 DATA_EDITOR_HELP "data/editor_help.txt" #define VAR_BBS_TOP "var/bbs_top.txt" #define VAR_ARTICLE_BLOCK_SHM "var/article_block_shm.~" #define VAR_SECTION_LIST_SHM "var/section_list_shm.~" #define VAR_TRIE_DICT_SHM "var/trie_dict_shm.~" +#define VAR_USER_LIST_SHM "var/user_list_shm.~" #define VAR_ARTICLE_CACHE_DIR "var/articles/" #define VAR_GEN_EX_MENU_DIR "var/gen_ex/" +#define VAR_SECTION_AID_LOC_DIR "var/section_aid_loc/" // File loader extern const char *data_files_load_startup[]; -extern int data_files_load_startup_count; +extern const int data_files_load_startup_count; // Screen #define SCREEN_ROWS 24 @@ -70,9 +65,6 @@ extern int data_files_load_startup_count #define IP_ADDR_LEN 50 #define MAX_EVENTS 10 -// User -#define BBS_MAX_USER_LIMIT 100000 - extern int socket_server[2]; extern int socket_client; extern char hostaddr_client[IP_ADDR_LEN]; @@ -84,8 +76,6 @@ extern ssh_bind sshbind; extern ssh_session SSH_session; extern ssh_channel SSH_channel; -extern const char *get_time_str(char *string, size_t length); - // Signal handler extern void sig_hup_handler(int); extern void sig_term_handler(int); @@ -97,7 +87,4 @@ extern volatile int SYS_child_process_co extern volatile int SYS_child_exit; extern volatile int SYS_conf_reload; -// Network -extern const char *ip_mask(char *s, int level, char mask); - #endif //_COMMON_H_