+#define CLIENT_VERSION 811
+#define CLIENT_TYPE 0
+//copycat of: /#include "server.h"
+
+#define ROOMNAMELEN 128 /* The size of a roomname string */
+
+// copycat of citadel_dirs.h
+void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, int dbg);
+
+//copycat of: /#include "citadel.h"
+/* commands we can send to the stty_ctdl() routine */
+#define SB_NO_INTR 0 /* set to Citadel client mode, i/q disabled */
+#define SB_YES_INTR 1 /* set to Citadel client mode, i/q enabled */
+#define SB_SAVE 2 /* save settings */
+#define SB_RESTORE 3 /* restore settings */
+#define SB_LAST 4 /* redo the last command sent */
+
+#define UGLISTLEN 100 /* you get a ungoto list of this size */
+
+#define USERNAME_SIZE 64 /* The size of a username string */
+#define MAX_EDITORS 5 /* # of external editors supported */
+ /* MUST be at least 1 */
+
+#define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
+ * it is BIG becuase there is a hostname
+ * in the nonce, as per the APOP RFC.
+ */
+
+/*
+ * S_KEEPALIVE is a watchdog timer. It is used to send "keep
+ * alive" messages to the server to prevent the server from assuming the
+ * client is dead and terminating the session. 30 seconds is the recommended
+ * value; I can't think of any good reason to change it.
+ */
+#define S_KEEPALIVE 30
+
+#define READ_HEADER 2
+#define READ_MSGBODY 3
+
+#define NUM_CONFIGS 70
+
+
+
+/*
+ * This struct stores a list of rooms with new messages which the client
+ * fetches from the server. This allows the client to "march" through
+ * relevant rooms without having to ask the server each time where to go next.
+ */
+typedef struct ExpirePolicy ExpirePolicy;
+struct ExpirePolicy {
+ int expire_mode;
+ int expire_value;
+};
+
+typedef struct march march;
+struct march {
+ struct march *next;
+ char march_name[ROOMNAMELEN];
+ unsigned int march_flags;
+ char march_floor;
+ char march_order;
+ unsigned int march_flags2;
+ int march_access;
+};
+/*
+ * User records.
+ */
+typedef struct ctdluser ctdluser;
+struct ctdluser { /* User record */
+ int version; /* Cit vers. which created this rec */
+ uid_t uid; /* Associate with a unix account? */
+ char password[32]; /* password */
+ unsigned flags; /* See US_ flags below */
+ long timescalled; /* Total number of logins */
+ long posted; /* Number of messages ever submitted */
+ uint8_t axlevel; /* Access level */
+ long usernum; /* User number (never recycled) */
+ time_t lastcall; /* Date/time of most recent login */
+ int USuserpurge; /* Purge time (in days) for user */
+ char fullname[64]; /* Display name (primary identifier) */
+};
+typedef struct ctdlroom ctdlroom;
+struct ctdlroom {
+ char QRname[ROOMNAMELEN]; /* Name of room */
+ char QRpasswd[10]; /* Only valid if it's a private rm */
+ long QRroomaide; /* User number of room aide */
+ long QRhighest; /* Highest message NUMBER in room */
+ time_t QRgen; /* Generation number of room */
+ unsigned QRflags; /* See flag values below */
+ char QRdirname[15]; /* Directory name, if applicable */
+ long QRinfo; /* Info file update relative to msgs*/
+ char QRfloor; /* Which floor this room is on */
+ time_t QRmtime; /* Date/time of last post */
+ struct ExpirePolicy QRep; /* Message expiration policy */
+ long QRnumber; /* Globally unique room number */
+ char QRorder; /* Sort key for room listing order */
+ unsigned QRflags2; /* Additional flags */
+ int QRdefaultview; /* How to display the contents */
+};
+
+
+/////////////