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
35 * (We used to define this ourselves, but why bother when
36 * the GNU build tools do it for us?)
38 #define CITADEL PACKAGE_STRING
41 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
42 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
43 * whose data files are compatible with the current version. If the data files
44 * are older than REV_MIN, none of the programs will work until the setup
45 * program is run again to bring things up to date. EXPORT_REV_MIN is the
46 * oldest version of Citadel whose export files we can read. The latter is
47 * usually more strict because you're not really supposed to dump/load and
48 * upgrade at the same time.
50 #define REV_LEVEL 703 /* This version */
51 #define REV_MIN 591 /* Oldest compatible database */
52 #define EXPORT_REV_MIN 701 /* Oldest compatible export files */
54 #define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
55 obtain SERVER_TYPE codes for your implementations */
57 /* Various length constants */
59 #define UGLISTLEN 100 /* you get a ungoto list of this size */
60 #define ROOMNAMELEN 128 /* The size of a roomname string */
61 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
62 * it is BIG becuase there is a hostname
63 * in the nonce, as per the APOP RFC.
66 #define USERNAME_SIZE 64 /* The size of a username string */
67 #define MAX_EDITORS 5 /* # of external editors supported */
68 /* MUST be at least 1 */
71 * Message expiration policy stuff
78 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
79 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
80 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
81 #define EXPIRE_AGE 3 /* Expire messages after n days */
85 * This struct stores a list of rooms with new messages which the client
86 * fetches from the server. This allows the client to "march" through
87 * relevant rooms without having to ask the server each time where to go next.
91 char march_name[ROOMNAMELEN];
92 unsigned int march_flags;
95 unsigned int march_flags2;
99 #define NODENAME config.c_nodename
100 #define FQDN config.c_fqdn
101 #define HUMANNODE config.c_humannode
102 #define PHONENUM config.c_phonenum
103 #define CTDLUID config.c_ctdluid
104 #define CREATAIDE config.c_creataide
105 #define REGISCALL config.c_regiscall
106 #define TWITDETECT config.c_twitdetect
107 #define TWITROOM config.c_twitroom
108 #define RESTRICT_INTERNET config.c_restrict
113 struct ctdluser { /* User record */
114 int version; /* Cit vers. which created this rec */
115 uid_t uid; /* Associate with a unix account? */
116 char password[32]; /* password (for Citadel-only users)*/
117 unsigned flags; /* See US_ flags below */
118 long timescalled; /* Total number of logins */
119 long posted; /* Number of messages posted (ever) */
120 cit_uint8_t axlevel; /* Access level */
121 long usernum; /* User number (never recycled) */
122 time_t lastcall; /* Last time the user called */
123 int USuserpurge; /* Purge time (in days) for user */
124 char fullname[64]; /* Name for Citadel messages & mail */
125 cit_uint8_t USscreenwidth; /* Screen width (for textmode users)*/
126 cit_uint8_t USscreenheight; /* Screen height(for textmode users)*/
130 /* Bits which may appear in CitControl.MMflags. Note that these don't
131 * necessarily pertain to the message base -- it's just a good place to
132 * store any global flags.
134 #define MM_VALID 4 /* New users need validating */
140 char QRname[ROOMNAMELEN]; /* Name of room */
141 char QRpasswd[10]; /* Only valid if it's a private rm */
142 long QRroomaide; /* User number of room aide */
143 long QRhighest; /* Highest message NUMBER in room */
144 time_t QRgen; /* Generation number of room */
145 unsigned QRflags; /* See flag values below */
146 char QRdirname[15]; /* Directory name, if applicable */
147 long QRinfo; /* Info file update relative to msgs*/
148 char QRfloor; /* Which floor this room is on */
149 time_t QRmtime; /* Date/time of last post */
150 struct ExpirePolicy QRep; /* Message expiration policy */
151 long QRnumber; /* Globally unique room number */
152 char QRorder; /* Sort key for room listing order */
153 unsigned QRflags2; /* Additional flags */
154 int QRdefaultview; /* How to display the contents */
157 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
158 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
159 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
160 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
166 #define MES_NORMAL 65 /* Normal message */
167 #define MES_ANONONLY 66 /* "****" header */
168 #define MES_ANONOPT 67 /* "Anonymous" header */
170 #define MES_ERROR (-1) /* Can't send message due to bad address */
171 #define MES_LOCAL 0 /* Local message, do no network processing */
172 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
173 #define MES_IGNET 2 /* Process recipient and send via Cit net */
175 /****************************************************************************/
178 * Floor record. The floor number is implicit in its location in the file.
181 unsigned short f_flags; /* flags */
182 char f_name[256]; /* name of floor */
183 int f_ref_count; /* reference count */
184 struct ExpirePolicy f_ep; /* default expiration policy */
187 #define F_INUSE 1 /* floor is in use */
191 * Values used internally for function call returns, etc.
194 #define NEWREGISTER 0 /* new user to register */
195 #define REREGISTER 1 /* existing user reregistering */
197 #define READ_HEADER 2
198 #define READ_MSGBODY 3
200 /* commands we can send to the stty_ctdl() routine */
201 #define SB_NO_INTR 0 /* set to Citadel client mode, i/q disabled */
202 #define SB_YES_INTR 1 /* set to Citadel client mode, i/q enabled */
203 #define SB_SAVE 2 /* save settings */
204 #define SB_RESTORE 3 /* restore settings */
205 #define SB_LAST 4 /* redo the last command sent */
210 /* server exit codes */
211 #define EXIT_NORMAL 0 /* server terminated normally */
212 /* 1 through 63 reserved for signals */
213 #define EXIT_NULL 64 /* EOF on server command input */
215 /* citadel.rc stuff */
216 #define RC_NO 0 /* always no */
217 #define RC_YES 1 /* always yes */
218 #define RC_DEFAULT 2 /* setting depends on user config */
222 KA_NO, /* no keepalives */
223 KA_YES, /* full keepalives */
224 KA_HALF /* half keepalives */
227 /* for <;G>oto and <;S>kip commands */
228 #define GF_GOTO 0 /* <;G>oto floor mode */
229 #define GF_SKIP 1 /* <;S>kip floor mode */
230 #define GF_ZAP 2 /* <;Z>ap floor mode */
233 * MIME types used in Citadel for configuration stuff
235 #define SPOOLMIME "application/x-citadel-delivery-list"
236 #define INTERNETCFG "application/x-citadel-internet-config"
237 #define IGNETCFG "application/x-citadel-ignet-config"
238 #define IGNETMAP "application/x-citadel-ignet-map"
239 #define FILTERLIST "application/x-citadel-filter-list"
240 #define SIEVECONFIG "application/x-citadel-sieve-config"
242 #define TRACE lprintf(CTDL_DEBUG, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
245 #define LONG_MAX 2147483647L
252 #define VIEW_BBS 0 /* Bulletin board view */
253 #define VIEW_MAILBOX 1 /* Mailbox summary */
254 #define VIEW_ADDRESSBOOK 2 /* Address book view */
255 #define VIEW_CALENDAR 3 /* Calendar view */
256 #define VIEW_TASKS 4 /* Tasks view */
257 #define VIEW_NOTES 5 /* Notes view */
258 #define VIEW_WIKI 6 /* Wiki view */
259 #define VIEW_CALBRIEF 7 /* Brief Calendar view */
260 #define VIEW_SIEVE 8 /* Sieve manage rules store */
266 #endif /* CITADEL_H */