4 * main Citadel/UX header file
5 * see copyright.txt for copyright information
8 /* system customizations are in sysconfig.h */
13 /* Build Citadel with the calendar service only if the header *and*
14 * library for libical are both present.
18 #define CITADEL_WITH_CALENDAR_SERVICE 1
24 #include "sysconfig.h"
33 * Text description of this software
35 #define CITADEL "Citadel/UX 6.06"
38 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
39 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
40 * whose data files are compatible with the current version. If the data files
41 * are older than REV_MIN, none of the programs will work until the setup
42 * program is run again to bring things up to date.
44 #define REV_LEVEL 606 /* This version */
45 #define REV_MIN 591 /* Oldest compatible version */
47 #define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
48 obtain SERVER_TYPE codes for your implementations */
51 * This is a better implementation of tolower() than that found on some
52 * systems (there are operating systems out there on which tolower() will
53 * screw up if you give it a character that is already lower case).
58 #define tolower(x) ( ((x>='A')&&(x<='Z')) ? (x+'a'-'A') : x )
61 /* Various length constants */
63 #define UGLISTLEN 100 /* you get a ungoto list of this size */
64 #define ROOMNAMELEN 128 /* The size of a roomname string */
65 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
66 * it is BIG becuase there is a hostname
67 * in the nonce, as per the APOP RFC.
70 #define USERNAME_SIZE 64 /* The size of a username string */
71 #define MAX_EDITORS 5 /* # of external editors supported */
72 /* MUST be at least 1 */
75 * Message expiration policy stuff
82 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
83 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
84 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
85 #define EXPIRE_AGE 3 /* Expire messages after n days */
89 * Global system configuration
92 char c_nodename[16]; /* Unqualified "short" nodename */
93 char c_fqdn[64]; /* Fully Qualified Domain Name */
94 char c_humannode[21]; /* Long name of system */
95 char c_phonenum[16]; /* Dialup number of system */
96 uid_t c_bbsuid; /* UID of the bbs-only user */
97 char c_creataide; /* room creator = room aide flag */
98 int c_sleeping; /* watchdog timer setting */
99 char c_initax; /* initial access level */
100 char c_regiscall; /* call number to register on */
101 char c_twitdetect; /* twit detect flag */
102 char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
103 char c_moreprompt[80]; /* paginator prompt */
104 char c_restrict; /* restrict Internet mail flag */
105 long c_msgbase; /* size of message base (obsolete) */
106 char c_bbs_city[32]; /* physical location of server */
107 char c_sysadm[26]; /* name of system administrator */
108 char c_bucket_dir[15]; /* bit bucket for files... */
109 int c_setup_level; /* what rev level we've setup to */
110 int c_maxsessions; /* maximum concurrent sessions */
111 char c_net_password[20]; /* system net password (obsolete) */
112 int c_port_number; /* Cit listener port (usually 504) */
113 int c_ipgm_secret; /* Internal program authentication */
114 struct ExpirePolicy c_ep; /* System default msg expire policy */
115 int c_userpurge; /* System default user purge (days) */
116 int c_roompurge; /* System default room purge (days) */
117 char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
118 char c_createax; /* Axlevel required to create rooms */
119 long c_maxmsglen; /* Maximum message length */
120 int c_min_workers; /* Lower limit on number of threads */
121 int c_max_workers; /* Upper limit on number of threads */
122 int c_pop3_port; /* POP3 listener port (usually 110) */
123 int c_smtp_port; /* SMTP listener port (usually 25) */
124 int c_unused_1; /* Nothin' here anymore... */
125 int c_aide_zap; /* Are Aides allowed to zap rooms? */
126 int c_imap_port; /* IMAP listener port (usually 143) */
127 time_t c_net_freq; /* how often to run the networker */
128 char c_disable_newu; /* disable NEWU command */
129 char c_aide_mailboxes; /* give Aides access to mailboxes */
130 char c_baseroom[ROOMNAMELEN]; /* Name of baseroom (Lobby) */
131 char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
136 char march_name[ROOMNAMELEN];
137 unsigned int march_flags;
142 #define NODENAME config.c_nodename
143 #define FQDN config.c_fqdn
144 #define HUMANNODE config.c_humannode
145 #define PHONENUM config.c_phonenum
146 #define BBSUID config.c_bbsuid
147 #define CREATAIDE config.c_creataide
148 #define REGISCALL config.c_regiscall
149 #define TWITDETECT config.c_twitdetect
150 #define TWITROOM config.c_twitroom
151 #define RESTRICT_INTERNET config.c_restrict
153 /* Defines the actual user record */
155 struct usersupp { /* User record */
156 int version; /* Cit vers. which created this rec */
157 uid_t uid; /* Associate with a unix account? */
158 char password[32]; /* password (for BBS-only users) */
159 unsigned flags; /* See US_ flags below */
160 long timescalled; /* Total number of logins */
161 long posted; /* Number of messages posted (ever) */
162 cit_uint8_t axlevel; /* Access level */
163 long usernum; /* User number (never recycled) */
164 time_t lastcall; /* Last time the user called */
165 int USuserpurge; /* Purge time (in days) for user */
166 char fullname[64]; /* Name for Citadel messages & mail */
167 cit_uint8_t USscreenwidth; /* Screen width (for textmode users)*/
168 cit_uint8_t USscreenheight; /* Screen height(for textmode users)*/
173 * This is the control record for the message base...
176 long MMhighest; /* highest message number in file */
177 unsigned MMflags; /* Global system flags */
178 long MMnextuser; /* highest user number on system */
179 long MMnextroom; /* highest room number on system */
180 int version; /* Server-hosted upgrade level */
183 /* Bits which may appear in CitControl.MMflags. Note that these don't
184 * necessarily pertain to the message base -- it's just a good place to
185 * store any global flags.
187 #define MM_VALID 4 /* New users need validating */
193 char QRname[ROOMNAMELEN]; /* Name of room */
194 char QRpasswd[10]; /* Only valid if it's a private rm */
195 long QRroomaide; /* User number of room aide */
196 long QRhighest; /* Highest message NUMBER in room */
197 time_t QRgen; /* Generation number of room */
198 unsigned QRflags; /* See flag values below */
199 char QRdirname[15]; /* Directory name, if applicable */
200 long QRinfo; /* Info file update relative to msgs*/
201 char QRfloor; /* Which floor this room is on */
202 time_t QRmtime; /* Date/time of last post */
203 struct ExpirePolicy QRep; /* Message expiration policy */
204 long QRnumber; /* Globally unique room number */
205 char QRorder; /* Sort key for room listing order */
206 unsigned QRflags2; /* Additional flags */
207 int QRdefaultview; /* How to display the contents */
210 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
211 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
212 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
213 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
217 * Events which might show up in the Citadel Log
219 #define CL_CONNECT 8 /* Connect to server */
220 #define CL_LOGIN 16 /* CLfullname logged in */
221 #define CL_NEWUSER 32 /* CLfullname is a new user */
222 #define CL_BADPW 64 /* Bad attempt at CLfullname's pw */
223 #define CL_TERMINATE 128 /* Logout - proper termination */
224 #define CL_DROPCARR 256 /* Logout - dropped carrier */
225 #define CL_SLEEPING 512 /* Logout - sleeping */
226 #define CL_PWCHANGE 1024 /* CLfullname changed passwords */
230 #define MES_NORMAL 65 /* Normal message */
231 #define MES_ANONONLY 66 /* "****" header */
232 #define MES_ANONOPT 67 /* "Anonymous" header */
234 #define MES_ERROR (-1) /* Can't send message due to bad address */
235 #define MES_LOCAL 0 /* Local message, do no network processing */
236 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
237 #define MES_IGNET 2 /* Process recipient and send via Cit net */
239 /****************************************************************************/
242 * Floor record. The floor number is implicit in its location in the file.
245 unsigned short f_flags; /* flags */
246 char f_name[256]; /* name of floor */
247 int f_ref_count; /* reference count */
248 struct ExpirePolicy f_ep; /* default expiration policy */
251 #define F_INUSE 1 /* floor is in use */
255 * Values used internally for function call returns, etc.
258 #define NEWREGISTER 0 /* new user to register */
259 #define REREGISTER 1 /* existing user reregistering */
261 #define READ_HEADER 2
262 #define READ_MSGBODY 3
264 /* commands we can send to the sttybbs() routine */
265 #define SB_NO_INTR 0 /* set to bbs mode, i/q disabled */
266 #define SB_YES_INTR 1 /* set to bbs mode, i/q enabled */
267 #define SB_SAVE 2 /* save settings */
268 #define SB_RESTORE 3 /* restore settings */
269 #define SB_LAST 4 /* redo the last command sent */
274 /* server exit codes */
275 #define EXIT_NORMAL 0 /* server terminated normally */
276 /* 1 through 63 reserved for signals */
277 #define EXIT_NULL 64 /* EOF on server command input */
279 /* citadel.rc stuff */
280 #define RC_NO 0 /* always no */
281 #define RC_YES 1 /* always yes */
282 #define RC_DEFAULT 2 /* setting depends on user config */
286 KA_NO, /* no keepalives */
287 KA_YES, /* full keepalives */
288 KA_HALF /* half keepalives */
291 /* for <;G>oto and <;S>kip commands */
292 #define GF_GOTO 0 /* <;G>oto floor mode */
293 #define GF_SKIP 1 /* <;S>kip floor mode */
294 #define GF_ZAP 2 /* <;Z>ap floor mode */
297 * MIME types used in Citadel for configuration stuff
299 #define SPOOLMIME "application/x-citadel-delivery-list"
300 #define INTERNETCFG "application/x-citadel-internet-config"
301 #define IGNETCFG "application/x-citadel-ignet-config"
302 #define IGNETMAP "application/x-citadel-ignet-map"
303 #define FILTERLIST "application/x-citadel-filter-list"
304 #define SPAMSTRINGS "application/x-citadel-spam-strings"
306 #define TRACE lprintf(9, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
309 #define LONG_MAX 2147483647L
316 #define VIEW_BBS 0 /* Traditional Citadel BBS view */
317 #define VIEW_MAILBOX 1 /* Mailbox summary */
318 #define VIEW_ADDRESSBOOK 2 /* Address book view */
327 #define tmpnam(x) CtdlTempFileName(__FILE__, __LINE__)
332 #define tmpfile() CtdlTempFile()
334 #endif /* CITADEL_H */