citadel.h is now citadel_defs.h
[citadel.git] / citadel / server / citadel_defs.h
1 // Definitions for the Citadel Server
2 //
3 // Copyright (c) 1987-2023 by the citadel.org team
4 //
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.
8
9 #ifndef CITADEL_H
10 #define CITADEL_H
11
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"
17
18 #include "sysdep.h"
19 #include <limits.h>
20 #include "sysconfig.h"
21 #include "typesize.h"
22 #include "ipcdef.h"
23
24
25 #define REV_LEVEL 972           // This version
26 #define REV_MIN         591             // Oldest compatible database
27 #define EXPORT_REV_MIN  931             // Oldest compatible export files
28 #define LIBCITADEL_MIN  951             // Minimum required version of libcitadel
29 #define SERVER_TYPE     0               // zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations
30
31 // hats off to https://stackoverflow.com/questions/5459868/concatenate-int-to-string-using-c-preprocessor
32 #define STR_HELPER(x) #x
33 #define STR(x) STR_HELPER(x)
34 #define CITADEL "Citadel Server " STR(REV_LEVEL)
35
36 #ifdef LIBCITADEL_VERSION_NUMBER
37 #if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN
38 #error libcitadel is too old.  Please upgrade it before continuing.
39 #endif
40 #endif
41
42 // This is the user name and password for the default administrator account
43 // that is created when Citadel Server is started with an empty database.
44 #define DEFAULT_ADMIN_USERNAME  "admin"
45 #define DEFAULT_ADMIN_PASSWORD  "citadel"
46
47 // Various length constants
48 #define ROOMNAMELEN     128             // The size of a roomname string
49 #define USERNAME_SIZE   64              // The size of a username string
50 #define MAX_EDITORS     5               // number of external editors supported ; must be at least 1
51
52 // Bits which may appear in MMflags.
53 #define MM_VALID        4               // New users need validating
54
55 // Miscellaneous
56 #define MES_NORMAL      65              // Normal message
57 #define MES_ANONONLY    66              // "****" header
58 #define MES_ANONOPT     67              // "Anonymous" header
59
60 // Values used internally for function call returns, etc.
61 #define NEWREGISTER     0               // new user to register
62 #define REREGISTER      1               // existing user reregistering
63
64 // number of items which may be handled by the CONF command
65 #define NUM_CONFIGS 71
66
67 #define TRACE   syslog(LOG_DEBUG, "\033[7m  Checkpoint: %s : %d  \033[0m", __FILE__, __LINE__)
68
69 #ifndef LONG_MAX
70 #define LONG_MAX 2147483647L
71 #endif
72
73 // Authentication modes
74 #define AUTHMODE_NATIVE         0       // Native (self-contained or "black box")
75 #define AUTHMODE_HOST           1       // Authenticate against the host OS user database
76 #define AUTHMODE_LDAP           2       // Authenticate using LDAP server with POSIX schema
77 #define AUTHMODE_LDAP_AD        3       // Authenticate using LDAP server with Active Directory schema
78
79 #endif // CITADEL_H