/[LeafOK_CVS]/lbbs/include/common.h
ViewVC logotype

Diff of /lbbs/include/common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.20 by sysadm, Tue May 6 05:31:26 2025 UTC Revision 1.62 by sysadm, Wed Nov 5 01:51:20 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                    common.h  -  description  /*
3                                                           -------------------   * common
4          Copyright            : (C) 2004-2025 by Leaflet   *   - common definitions
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7     */
 /***************************************************************************  
  *                                                                         *  
  *   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.                                   *  
  *                                                                         *  
  ***************************************************************************/  
8    
9  #ifndef _COMMON_H_  #ifndef _COMMON_H_
10  #define _COMMON_H_  #define _COMMON_H_
11    
12  #include <stddef.h>  #include <stddef.h>
13    #include <libssh/libssh.h>
14    #include <libssh/server.h>
15    
16  #define LINE_BUFFER_LEN 1024  enum common_constant_t
17  #define FILE_PATH_LEN 4096  {
18  #define MAX_FILE_LINES 65536      LINE_BUFFER_LEN = 1024,
19        FILE_PATH_LEN = 4096,
20    
21        // Screen
22        SCREEN_ROWS = 24,
23        SCREEN_COLS = 80,
24    
25        // Network
26        MAX_CLIENT_LIMIT = 2000,
27        MAX_CLIENT_PER_IP_LIMIT = 100,
28        IP_ADDR_LEN = 50,
29        MAX_EVENTS = 10,
30    };
31    
32  // Version  // Version
33  extern char app_version[256];  extern const char APP_INFO[];
34    
35  // Enviroment  // Enviroment
36  #define CONF_BBSNET "conf/bbsnet.conf"  extern const char CONF_BBSD[];
37    extern const char CONF_MENU[];
38  #define LOG_FILE_INFO "log/bbsd.log"  extern const char CONF_BBSNET[];
39  #define LOG_FILE_ERROR "log/error.log"  extern const char CONF_TOP10_MENU[];
40    extern const char SSH_HOST_KEYFILE[];
41  #define DATA_WELCOME "data/welcome.txt"  
42  #define DATA_REGISTER "data/register.txt"  extern const char LOG_FILE_INFO[];
43  #define DATA_GOODBYE "data/goodbye.txt"  extern const char LOG_FILE_ERROR[];
44  #define DATA_LICENSE "data/license.txt"  
45  #define DATA_COPYRIGHT "data/copyright.txt"  extern const char DATA_WELCOME[];
46  #define DATA_LOGIN_ERROR "data/login_error.txt"  extern const char DATA_REGISTER[];
47  #define DATA_ACTIVE_BOARD "data/active_board.txt"  extern const char DATA_GOODBYE[];
48  #define DATA_READ_HELP "data/read_help.txt"  extern const char DATA_LICENSE[];
49    extern const char DATA_COPYRIGHT[];
50  #define VAR_MAX_USER_ONLINE "var/max_user_online.dat"  extern const char DATA_VERSION[];
51    extern const char DATA_LOGIN_ERROR[];
52    extern const char DATA_ACTIVE_BOARD[];
53    extern const char DATA_READ_HELP[];
54    extern const char DATA_EDITOR_HELP[];
55    
56    extern const char VAR_BBS_TOP[];
57    
58    extern const char VAR_ARTICLE_BLOCK_SHM[];
59    extern const char VAR_SECTION_LIST_SHM[];
60    extern const char VAR_TRIE_DICT_SHM[];
61    extern const char VAR_USER_LIST_SHM[];
62    
63    extern const char VAR_ARTICLE_CACHE_DIR[];
64    extern const char VAR_GEN_EX_MENU_DIR[];
65    extern const char VAR_SECTION_AID_LOC_DIR[];
66    
67    // File loader
68    extern const char *data_files_load_startup[];
69    extern const int data_files_load_startup_count;
70    
71  // Network  // Network
72  extern int socket_server;  extern int socket_server[2];
73  extern int socket_client;  extern int socket_client;
74  extern char hostaddr_server[50];  extern char hostaddr_client[IP_ADDR_LEN];
 extern char hostaddr_client[50];  
 extern int port_server;  
75  extern int port_client;  extern int port_client;
76    
77  // Signal  // SSHv2
78  #define SIG_RELOAD_MENU 0x22  extern int SSH_v2;
79    extern ssh_bind sshbind;
80  extern const char *str_space(char *string, int length);  extern ssh_session SSH_session;
81  extern const char *get_time_str(char *string, size_t length);  extern ssh_channel SSH_channel;
82    
83  // Signal handler  // Signal handler
84  extern void reload_bbs_menu(int);  extern void sig_hup_handler(int);
85  extern void system_exit(int);  extern void sig_term_handler(int);
86  extern void child_exit(int);  extern void sig_chld_handler(int);
87    
88  // System  // System
89  extern int SYS_exit;  extern volatile int SYS_server_exit;
90  extern int SYS_child_process_count;  extern volatile int SYS_child_process_count;
91    extern volatile int SYS_child_exit;
92    extern volatile int SYS_conf_reload;
93    
94  #endif //_COMMON_H_  #endif //_COMMON_H_


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1