1 // Preprocessor definitions for the Citadel Server
3 // Copyright (c) 1987-2023 by the citadel.org team
5 // This program is open source software. Use, duplication, or disclosure
6 // is subject to the terms of the GNU General Public License, version 3.
7 // The program is distributed without any warranty, expressed or implied.
10 #define CITADEL_DEFS_H
12 // Suppress these compiler warnings
13 #pragma GCC diagnostic ignored "-Wcast-qual"
14 #pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
15 #pragma GCC diagnostic ignored "-Wformat-truncation"
16 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
20 #include "sysconfig.h"
24 #define REV_LEVEL 972 // This version
25 #define REV_MIN 591 // Oldest compatible database
26 #define EXPORT_REV_MIN 931 // Oldest compatible export files
27 #define LIBCITADEL_MIN 951 // Minimum required version of libcitadel
28 #define SERVER_TYPE 0 // zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations
30 // hats off to https://stackoverflow.com/questions/5459868/concatenate-int-to-string-using-c-preprocessor
31 #define STR_HELPER(x) #x
32 #define STR(x) STR_HELPER(x)
33 #define CITADEL "Citadel Server " STR(REV_LEVEL)
35 #ifdef LIBCITADEL_VERSION_NUMBER
36 #if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN
37 #error libcitadel is too old. Please upgrade it before continuing.
41 // This is the user name and password for the default administrator account
42 // that is created when Citadel Server is started with an empty database.
43 #define DEFAULT_ADMIN_USERNAME "admin"
44 #define DEFAULT_ADMIN_PASSWORD "citadel"
46 // Various length constants
47 #define ROOMNAMELEN 128 // The size of a roomname string
48 #define USERNAME_SIZE 64 // The size of a username string
50 // Bits which may appear in MMflags.
51 #define MM_VALID 4 // New users need validating
54 #define MES_NORMAL 65 // Normal message
55 #define MES_ANONONLY 66 // "****" header
56 #define MES_ANONOPT 67 // "Anonymous" header
58 // Values used internally for function call returns, etc.
59 #define NEWREGISTER 0 // new user to register
60 #define REREGISTER 1 // existing user reregistering
62 // number of items which may be handled by the CONF command
63 #define NUM_CONFIGS 71
65 #define TRACE syslog(LOG_DEBUG, "\033[7m Checkpoint: %s : %d \033[0m", __FILE__, __LINE__)
68 #define LONG_MAX 2147483647L
71 // Authentication modes
72 #define AUTHMODE_NATIVE 0 // Native (self-contained or "black box")
73 #define AUTHMODE_HOST 1 // Authenticate against the host OS user database
74 #define AUTHMODE_LDAP 2 // Authenticate using LDAP server with POSIX schema
75 #define AUTHMODE_LDAP_AD 3 // Authenticate using LDAP server with Active Directory schema
77 // Found in struct CtdlMessage
78 #define CTDLMESSAGE_MAGIC 0x159d
79 #define CM_SKIP_HOOKS 0x01 // Don't run server-side handlers
82 #define F_INUSE 1 // floor is in use
84 #endif // CITADEL_DEFS_H