]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.h
* Finished gzip compression of dynamic pages (when browser supports it)
[citadel.git] / webcit / webcit.h
index 9797ed593bf413224ca591a86de0ffd2f2c10e4b..4aac82df13adc3984ea2b00c16c34bbf7ebd91f0 100644 (file)
@@ -1,5 +1,9 @@
 /* $Id$ */
 
+#ifdef WITH_ZLIB
+#include <zlib.h>
+#endif
+
 #define SIZ                    4096            /* generic buffer size */
 
 #define TRACE fprintf(stderr, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v3.23"  /* who's in da house */
+#define SERVER                 "WebCit v4.00"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         323
+#define CLIENT_VERSION         400
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */
 #define USERCONFIGROOM         "My Citadel Config"
 
 
-/* Room flags (from Citadel) */
-#define QR_PERMANENT   1       /* Room does not purge              */
-#define QR_INUSE       2       /* Set if in use, clear if avail    */
-#define QR_PRIVATE     4       /* Set for any type of private room */
-#define QR_PASSWORDED  8       /* Set if there's a password too    */
-#define QR_GUESSNAME   16      /* Set if it's a guessname room     */
-#define QR_DIRECTORY   32      /* Directory room                   */
-#define QR_UPLOAD      64      /* Allowed to upload                */
-#define QR_DOWNLOAD    128     /* Allowed to download              */
-#define QR_VISDIR      256     /* Visible directory                */
-#define QR_ANONONLY    512     /* Anonymous-Only room              */
-#define QR_ANONOPT     1024    /* Anonymous-Option room            */
-#define QR_NETWORK     2048    /* Shared network room              */
-#define QR_PREFONLY    4096    /* Preferred status needed to enter */
-#define QR_READONLY    8192    /* Aide status required to post     */
-#define QR_MAILBOX     16384   /* Set if this is a private mailbox */
+/*
+ * Room flags (from Citadel)
+ *
+ * bucket one...
+ */
+#define QR_PERMANENT   1               /* Room does not purge              */
+#define QR_INUSE       2               /* Set if in use, clear if avail    */
+#define QR_PRIVATE     4               /* Set for any type of private room */
+#define QR_PASSWORDED  8               /* Set if there's a password too    */
+#define QR_GUESSNAME   16              /* Set if it's a guessname room     */
+#define QR_DIRECTORY   32              /* Directory room                   */
+#define QR_UPLOAD      64              /* Allowed to upload                */
+#define QR_DOWNLOAD    128             /* Allowed to download              */
+#define QR_VISDIR      256             /* Visible directory                */
+#define QR_ANONONLY    512             /* Anonymous-Only room              */
+#define QR_ANONOPT     1024            /* Anonymous-Option room            */
+#define QR_NETWORK     2048            /* Shared network room              */
+#define QR_PREFONLY    4096            /* Preferred status needed to enter */
+#define QR_READONLY    8192            /* Aide status required to post     */
+#define QR_MAILBOX     16384           /* Set if this is a private mailbox */
+
+/*
+ * bucket two...
+ */
+#define QR2_SYSTEM     1               /* System room; hide by default     */
+#define QR2_SELFLIST   2               /* Self-service mailing list mgmt   */
 
 
 struct httprequest {
@@ -151,8 +165,13 @@ struct wcsession {
        struct urlcontent *urlstrings;
        int HaveExpressMessages;        /* Nonzero if incoming msgs exist */
        struct wcsubst *vars;
-       char *preferences;
        char this_page[SIZ];            /* address of current page */
+       char http_host[SIZ];            /* HTTP Host: header */
+       char *preferences;
+#ifdef WITH_ZLIB
+       int gzcompressed;               /* nonzero if compressed output */
+       gzFile gzfd;                    /* stream to send compressed */
+#endif
 };
 
 #define extract(dest,source,parmnum)   extract_token(dest,source,parmnum,'|')
@@ -253,7 +272,6 @@ void serv_write(char *buf, int nbytes);
 void serv_puts(char *string);
 void serv_printf(const char *format,...);
 void load_floorlist(void);
-void select_floor_to_edit_pic(void);
 void display_reg(int);
 void register_user(void);
 void display_changepw(void);
@@ -275,7 +293,7 @@ void display_menubar(int);
 void embed_room_banner(char *);
 void smart_goto(char *);
 void worker_entry(void);
-void session_loop(struct httprequest *);
+void session_loop(struct httprequest *, int gzip);
 void fmt_date(char *buf, time_t thetime);
 void httpdate(char *buf, time_t thetime);
 void end_webcit_session(void);
@@ -319,3 +337,7 @@ void display_floorconfig(char *);
 void delete_floor(void);
 void create_floor(void);
 void rename_floor(void);
+void do_listsub(void);
+void toggle_self_service(void);
+void summary(void);
+ssize_t write(int fd, const void *buf, size_t count);