/[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.16 by sysadm, Wed Apr 30 09:18:19 2025 UTC Revision 1.69 by sysadm, Fri Nov 28 03:23:58 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                    common.h  -  description  /*
3                                                           -------------------   * common
4          begin                : Mon Oct 18 2004   *   - common definitions
5          copyright            : (C) 2004 by Leaflet   *
6          email                : leaflet@leafok.com   * 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 2 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    enum common_constant_t
17    {
18        LINE_BUFFER_LEN = 1024,
19        FILE_PATH_LEN = 4096,
20        FILE_NAME_LEN = 256,
21    
22        // Screen
23        SCREEN_ROWS = 24,
24        SCREEN_COLS = 80,
25    
26        TAB_SIZE = 4,
27    
28        // Network
29        MAX_CLIENT_LIMIT = 2000,
30        MAX_CLIENT_PER_IP_LIMIT = 1000,
31        IP_ADDR_LEN = 50,
32        MAX_EVENTS = 10,
33    };
34    
35  // Version  // Version
36  extern char app_version[256];  extern const char APP_INFO[];
37    extern const char COPYRIGHT_INFO[];
38    
39  // Enviroment  // Enviroment
40  extern char app_home_dir[256];  extern const char CONF_BBSD[];
41  extern char app_temp_dir[256];  extern const char CONF_MENU[];
42    extern const char CONF_BBSNET[];
43    extern const char CONF_BWF[];
44    extern const char CONF_TOP10_MENU[];
45    extern const char SSH_HOST_RSA_KEY_FILE[];
46    extern const char SSH_HOST_ED25519_KEY_FILE[];
47    
48    extern const char LOG_FILE_INFO[];
49    extern const char LOG_FILE_ERROR[];
50    
51    extern const char DATA_WELCOME[];
52    extern const char DATA_REGISTER[];
53    extern const char DATA_GOODBYE[];
54    extern const char DATA_LICENSE[];
55    extern const char DATA_COPYRIGHT[];
56    extern const char DATA_VERSION[];
57    extern const char DATA_LOGIN_ERROR[];
58    extern const char DATA_ACTIVE_BOARD[];
59    extern const char DATA_READ_HELP[];
60    extern const char DATA_EDITOR_HELP[];
61    
62    extern const char VAR_BBS_TOP[];
63    
64    extern const char VAR_ARTICLE_BLOCK_SHM[];
65    extern const char VAR_SECTION_LIST_SHM[];
66    extern const char VAR_TRIE_DICT_SHM[];
67    extern const char VAR_USER_LIST_SHM[];
68    
69    extern const char VAR_ARTICLE_CACHE_DIR[];
70    extern const char VAR_GEN_EX_MENU_DIR[];
71    extern const char VAR_SECTION_AID_LOC_DIR[];
72    
73    // File loader
74    extern const char *data_files_load_startup[];
75    extern const int data_files_load_startup_count;
76    
77  // Network  // Network
78  extern int socket_server;  extern char hostaddr_client[IP_ADDR_LEN];
 extern int socket_client;  
 extern char hostaddr_server[50];  
 extern char hostaddr_client[50];  
 extern int port_server;  
79  extern int port_client;  extern int port_client;
80    
81  // Database  // SSHv2
82  extern char DB_host[256];  extern int SSH_v2;
83  extern char DB_username[50];  extern ssh_session SSH_session;
84  extern char DB_password[50];  extern ssh_channel SSH_channel;
 extern char DB_database[50];  
 extern char DB_timezone[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);  
85    
86  // Signal handler  // Signal handler
87  extern void reload_bbs_menu(int);  extern void sig_hup_handler(int);
88  extern void system_exit(int);  extern void sig_term_handler(int);
89  extern void child_exit(int);  extern void sig_chld_handler(int);
90    
91  // System  // System
92  extern int SYS_exit;  extern volatile int SYS_server_exit;
93  extern int SYS_child_process_count;  extern volatile int SYS_child_process_count;
94    extern volatile int SYS_child_exit;
95    extern volatile int SYS_conf_reload;
96    
97  #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