4 * main Citadel header file
5 * see copyright.txt for copyright information
8 /* system customizations are in sysconfig.h */
12 /* #include <dmalloc.h> uncomment if using dmalloc */
14 /* Build Citadel with the calendar service only if the header *and*
15 * library for libical are both present.
19 #define CITADEL_WITH_CALENDAR_SERVICE 1
25 #include "sysconfig.h"
34 * Text description of this software
36 #define CITADEL "Citadel 6.51"
39 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
40 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
41 * whose data files are compatible with the current version. If the data files
42 * are older than REV_MIN, none of the programs will work until the setup
43 * program is run again to bring things up to date. EXPORT_REV_MIN is the
44 * oldest version of Citadel whose export files we can read. The latter is
45 * usually more strict because you're not really supposed to dump/load and
46 * upgrade at the same time.
48 #define REV_LEVEL 652 /* This version */
49 #define REV_MIN 591 /* Oldest compatible database */
50 #define EXPORT_REV_MIN 652 /* Oldest compatible export files */
52 #define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
53 obtain SERVER_TYPE codes for your implementations */
55 /* Various length constants */
57 #define UGLISTLEN 100 /* you get a ungoto list of this size */
58 #define ROOMNAMELEN 128 /* The size of a roomname string */
59 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
60 * it is BIG becuase there is a hostname
61 * in the nonce, as per the APOP RFC.
64 #define USERNAME_SIZE 64 /* The size of a username string */
65 #define MAX_EDITORS 5 /* # of external editors supported */
66 /* MUST be at least 1 */
69 * Message expiration policy stuff
76 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
77 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
78 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
79 #define EXPIRE_AGE 3 /* Expire messages after n days */
83 * This struct stores a list of rooms with new messages which the client
84 * fetches from the server. This allows the client to "march" through
85 * relevant rooms without having to ask the server each time where to go next.
89 char march_name[ROOMNAMELEN];
90 unsigned int march_flags;
93 unsigned int march_flags2;
97 #define NODENAME config.c_nodename
98 #define FQDN config.c_fqdn
99 #define HUMANNODE config.c_humannode
100 #define PHONENUM config.c_phonenum
101 #define CTDLUID config.c_ctdluid
102 #define CREATAIDE config.c_creataide
103 #define REGISCALL config.c_regiscall
104 #define TWITDETECT config.c_twitdetect
105 #define TWITROOM config.c_twitroom
106 #define RESTRICT_INTERNET config.c_restrict
111 struct ctdluser { /* User record */
112 int version; /* Cit vers. which created this rec */
113 uid_t uid; /* Associate with a unix account? */
114 char password[32]; /* password (for Citadel-only users)*/
115 unsigned flags; /* See US_ flags below */
116 long timescalled; /* Total number of logins */
117 long posted; /* Number of messages posted (ever) */
118 cit_uint8_t axlevel; /* Access level */
119 long usernum; /* User number (never recycled) */
120 time_t lastcall; /* Last time the user called */
121 int USuserpurge; /* Purge time (in days) for user */
122 char fullname[64]; /* Name for Citadel messages & mail */
123 cit_uint8_t USscreenwidth; /* Screen width (for textmode users)*/
124 cit_uint8_t USscreenheight; /* Screen height(for textmode users)*/
128 /* Bits which may appear in CitControl.MMflags. Note that these don't
129 * necessarily pertain to the message base -- it's just a good place to
130 * store any global flags.
132 #define MM_VALID 4 /* New users need validating */
138 char QRname[ROOMNAMELEN]; /* Name of room */
139 char QRpasswd[10]; /* Only valid if it's a private rm */
140 long QRroomaide; /* User number of room aide */
141 long QRhighest; /* Highest message NUMBER in room */
142 time_t QRgen; /* Generation number of room */
143 unsigned QRflags; /* See flag values below */
144 char QRdirname[15]; /* Directory name, if applicable */
145 long QRinfo; /* Info file update relative to msgs*/
146 char QRfloor; /* Which floor this room is on */
147 time_t QRmtime; /* Date/time of last post */
148 struct ExpirePolicy QRep; /* Message expiration policy */
149 long QRnumber; /* Globally unique room number */
150 char QRorder; /* Sort key for room listing order */
151 unsigned QRflags2; /* Additional flags */
152 int QRdefaultview; /* How to display the contents */
155 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
156 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
157 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
158 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
164 #define MES_NORMAL 65 /* Normal message */
165 #define MES_ANONONLY 66 /* "****" header */
166 #define MES_ANONOPT 67 /* "Anonymous" header */
168 #define MES_ERROR (-1) /* Can't send message due to bad address */
169 #define MES_LOCAL 0 /* Local message, do no network processing */
170 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
171 #define MES_IGNET 2 /* Process recipient and send via Cit net */
173 /****************************************************************************/
176 * Floor record. The floor number is implicit in its location in the file.
179 unsigned short f_flags; /* flags */
180 char f_name[256]; /* name of floor */
181 int f_ref_count; /* reference count */
182 struct ExpirePolicy f_ep; /* default expiration policy */
185 #define F_INUSE 1 /* floor is in use */
189 * Values used internally for function call returns, etc.
192 #define NEWREGISTER 0 /* new user to register */
193 #define REREGISTER 1 /* existing user reregistering */
195 #define READ_HEADER 2
196 #define READ_MSGBODY 3
198 /* commands we can send to the stty_ctdl() routine */
199 #define SB_NO_INTR 0 /* set to Citadel client mode, i/q disabled */
200 #define SB_YES_INTR 1 /* set to Citadel client mode, i/q enabled */
201 #define SB_SAVE 2 /* save settings */
202 #define SB_RESTORE 3 /* restore settings */
203 #define SB_LAST 4 /* redo the last command sent */
208 /* server exit codes */
209 #define EXIT_NORMAL 0 /* server terminated normally */
210 /* 1 through 63 reserved for signals */
211 #define EXIT_NULL 64 /* EOF on server command input */
213 /* citadel.rc stuff */
214 #define RC_NO 0 /* always no */
215 #define RC_YES 1 /* always yes */
216 #define RC_DEFAULT 2 /* setting depends on user config */
220 KA_NO, /* no keepalives */
221 KA_YES, /* full keepalives */
222 KA_HALF /* half keepalives */
225 /* for <;G>oto and <;S>kip commands */
226 #define GF_GOTO 0 /* <;G>oto floor mode */
227 #define GF_SKIP 1 /* <;S>kip floor mode */
228 #define GF_ZAP 2 /* <;Z>ap floor mode */
231 * MIME types used in Citadel for configuration stuff
233 #define SPOOLMIME "application/x-citadel-delivery-list"
234 #define INTERNETCFG "application/x-citadel-internet-config"
235 #define IGNETCFG "application/x-citadel-ignet-config"
236 #define IGNETMAP "application/x-citadel-ignet-map"
237 #define FILTERLIST "application/x-citadel-filter-list"
239 #define TRACE lprintf(CTDL_DEBUG, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
242 #define LONG_MAX 2147483647L
249 #define VIEW_BBS 0 /* Bulletin board view */
250 #define VIEW_MAILBOX 1 /* Mailbox summary */
251 #define VIEW_ADDRESSBOOK 2 /* Address book view */
252 #define VIEW_CALENDAR 3 /* Calendar view */
253 #define VIEW_TASKS 4 /* Tasks view */
254 #define VIEW_NOTES 5 /* Notes view */
260 #endif /* CITADEL_H */