1 // Main Citadel header file
3 // Copyright (c) 1987-2022 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.
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"
19 #include "sysconfig.h"
28 #define REV_LEVEL 972 // This version
29 #define REV_MIN 591 // Oldest compatible database
30 #define EXPORT_REV_MIN 931 // Oldest compatible export files
31 #define LIBCITADEL_MIN 951 // Minimum required version of libcitadel
32 #define SERVER_TYPE 0 // zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations
34 // hats off to https://stackoverflow.com/questions/5459868/concatenate-int-to-string-using-c-preprocessor
35 #define STR_HELPER(x) #x
36 #define STR(x) STR_HELPER(x)
37 #define CITADEL "Citadel Server " STR(REV_LEVEL)
39 #ifdef LIBCITADEL_VERSION_NUMBER
40 #if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN
41 #error libcitadel is too old. Please upgrade it before continuing.
45 // This is the user name and password for the default administrator account
46 // that is created when Citadel Server is started with an empty database.
47 #define DEFAULT_ADMIN_USERNAME "admin"
48 #define DEFAULT_ADMIN_PASSWORD "citadel"
50 // Various length constants
51 #define ROOMNAMELEN 128 // The size of a roomname string
52 #define USERNAME_SIZE 64 // The size of a username string
53 #define MAX_EDITORS 5 // number of external editors supported ; must be at least 1
55 // Message expiration policy stuff
56 typedef struct ExpirePolicy ExpirePolicy;
62 #define EXPIRE_NEXTLEVEL 0 // Inherit expiration policy
63 #define EXPIRE_MANUAL 1 // Don't expire messages at all
64 #define EXPIRE_NUMMSGS 2 // Keep only latest n messages
65 #define EXPIRE_AGE 3 // Expire messages after n days
67 // Bits which may appear in MMflags.
68 #define MM_VALID 4 // New users need validating
71 #define MES_NORMAL 65 // Normal message
72 #define MES_ANONONLY 66 // "****" header
73 #define MES_ANONOPT 67 // "Anonymous" header
75 // Floor record. The floor number is implicit in its location in the file.
77 unsigned short f_flags; // flags
78 char f_name[256]; // name of floor
79 int f_ref_count; // reference count
80 struct ExpirePolicy f_ep; // default expiration policy
83 #define F_INUSE 1 // floor is in use
85 // Values used internally for function call returns, etc.
86 #define NEWREGISTER 0 // new user to register
87 #define REREGISTER 1 // existing user reregistering
89 // number of items which may be handled by the CONF command
90 #define NUM_CONFIGS 71
92 #define TRACE syslog(LOG_DEBUG, "\033[7m Checkpoint: %s : %d \033[0m", __FILE__, __LINE__)
95 #define LONG_MAX 2147483647L
98 // Authentication modes
99 #define AUTHMODE_NATIVE 0 // Native (self-contained or "black box")
100 #define AUTHMODE_HOST 1 // Authenticate against the host OS user database
101 #define AUTHMODE_LDAP 2 // Authenticate using LDAP server with POSIX schema
102 #define AUTHMODE_LDAP_AD 3 // Authenticate using LDAP server with Active Directory schema