cleanup webcit.h; utils.c, remove unneeded stuff
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 23 Jul 2011 22:16:32 +0000 (22:16 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:39:29 +0000 (21:39 +0000)
21 files changed:
webcit/calendar.h
webcit/calendar_tools.c
webcit/context_loop.c
webcit/cookie_conversion.c
webcit/downloads.c
webcit/graphics.c
webcit/marchlist.c
webcit/paramhandling.c
webcit/roomops.c
webcit/roomops.h
webcit/serv_func.c
webcit/sieve.c
webcit/summary.c
webcit/sysdep.c
webcit/tcp_sockets.h [new file with mode: 0644]
webcit/useredit.c
webcit/utils.c
webcit/utils.h [new file with mode: 0644]
webcit/webcit.c
webcit/webcit.h
webcit/webserver.c

index ad358d23ce53448735d8e36163e0147f73a05f06..755d931019a27a7e99b72a2ef4cf18819deddf44 100644 (file)
@@ -79,4 +79,23 @@ int tasks_LoadMsgFromServer(SharedMessageStatus *Stat,
                            message_summary* Msg, 
                            int is_new, 
                            int i);
+
+void display_edit_task(void);
+void display_edit_event(void);
+
+icaltimezone *get_default_icaltimezone(void);
+void display_icaltimetype_as_webform(struct icaltimetype *, char *, int);
+void icaltime_from_webform(struct icaltimetype *result, char *prefix);
+void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
+void partstat_as_string(char *buf, icalproperty *attendee);
+icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp);
+void check_attendee_availability(icalcomponent *supplied_vevent);
+int ical_ctdl_is_overlap(
+                        struct icaltimetype t1start,
+                        struct icaltimetype t1end,
+                        struct icaltimetype t2start,
+                        struct icaltimetype t2end
+);
+
+
 #endif
index 4a8b9160bd905cd57e59338794b7b5be9cbb41e7..b2c12afc70e28363714ea579d4c63001ec44c3b7 100644 (file)
@@ -21,6 +21,7 @@
 #include "webcit.h"
 #include "webserver.h"
 #include "time.h"
+#include "calendar.h"
 
 /* Hour strings */
 char *hourname[] = {
index 6c449c55421e6c5bce5c131d489a4091f364822c..032606708316f7a51358af7c86d547ba9bdc621b 100644 (file)
@@ -39,6 +39,10 @@ extern HashList *HandlerHash;
 int num_threads_existing = 1;          /* Number of worker threads which exist. */
 int num_threads_executing = 1;         /* Number of worker threads currently executing. */
 
+extern void session_loop(void);
+void spawn_another_worker_thread(void);
+
+
 void DestroyHttpHeaderHandler(void *V)
 {
        OneHttpHeader *pHdr;
index 0e66c905d0c84607971c73fd71bb2c241cd2a272..b0dffbe58247b2d217f43df6cc52b3aef31c5e6d 100644 (file)
@@ -25,6 +25,7 @@
  */
 static char *unset = "; expires=28-May-1971 18:10:00 GMT";
 typedef unsigned char byte;          /* Byte type used by cookie_to_stuff() */
+extern const char *get_selected_language(void);
 
 /*
  * Pack all session info into one easy-to-digest cookie. Healthy and delicious!
index 1a5789c25884f53a49294fa88f86890cf62f69f7..fc06c379bbf047a25bfaa93e0262f34cc86ccefd 100644 (file)
@@ -19,6 +19,8 @@
 #include "webcit.h"
 #include "webserver.h"
 
+extern void output_static(const char* What);
+
 extern char* static_dirs[];
 
 typedef struct _FileListStruct {
index f798cc3e5bf1cb99e0eb70b7a499ebaa8cd2b78b..2a2a856a5e0192cb47881691bcd30b02d4e862a8 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "webcit.h"
 
+extern void output_static(const char* What);
+
 void display_graphics_upload(char *filename)
 {
        char buf[SIZ];
index bcfbb4872924e06ac2e52aa852d4cb9fedd6645d..175f780e787fe41a29fa445075db7dcbedd1c7a2 100644 (file)
@@ -230,9 +230,6 @@ void _gotonext(void) {
 }
 
 
-void dotskip(void) {
-       smart_goto(sbstr("room"));
-}
 
 
 int ConditionalHaveUngoto(StrBuf *Target, WCTemplputParams *TP)
index ed1a1a5879aa1adc1d7d24fda3342d7809f7e089..aadadab9f2a1fa7566e925ac7a7d8a8a2b31d850 100644 (file)
@@ -437,11 +437,11 @@ void diagnostics(void)
        wc_printf("Session: %d<hr />\n", WC->wc_session);
        wc_printf("Command: <br><PRE>\n");
 /*     
-StrEscPuts(WC->UrlFragment1);
+StrEscAppend(WC->WBuf, NULL, WC->UrlFragment1, 0, 0);
        wc_printf("<br>\n");
-       StrEscPuts(WC->UrlFragment2);
+StrEscAppend(WC->WBuf, NULL, WC->UrlFragment12 0, 0);
        wc_printf("<br>\n");
-       StrEscPuts(WC->UrlFragment3);
+StrEscAppend(WC->WBuf, NULL, WC->UrlFragment3, 0, 0);
 */
        wc_printf("</PRE><hr />\n");
        wc_printf("Variables: <br><PRE>\n");
index bcbbe24cb535e70a5a9a9c0a7d9f07b1dfdbc4b3..5029030bb9d231c5fa8398645f5824a0f933d504 100644 (file)
@@ -113,6 +113,11 @@ void _DBG_QR2(long QR2)
 /*******************************************************************************
  ***************************** Goto Commands ***********************************
  ******************************************************************************/
+
+void dotskip(void) {
+       smart_goto(sbstr("room"));
+}
+
 void dotgoto(void) {
        if (!havebstr("room")) {
                readloop(readnew, eUseDefault);
index b0f9caa0ee838c27c7d26b7518a6e0caede8f0b8..516c00d783846452011691cc629355e5a3a6fdc5 100644 (file)
@@ -127,6 +127,14 @@ void LoadXRoomPic(void);
 void LoadXRoomInfoText(void);
 void LoadXRoomXCountFiles(void);
 
+long gotoroom(const StrBuf *gname);
+
+void slrp_highest(void);
+void remove_march(const StrBuf *aaa);
+void dotskip(void);
+void smart_goto(const StrBuf *next_room);
+void free_march_list(wcsession *wcf);
+
 /*
  * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL
  */
index 105bf9a483e3fc5e74e7fea4e71f1676e94f20d0..14a4d655937151e456e1269cad7c6ea03d20fd22 100644 (file)
@@ -379,48 +379,6 @@ void FmOut(StrBuf *Target, char *align, StrBuf *Source)
 }
 
 
-/*
- * Read Citadel variformat text and spit it out as HTML in a form
- * suitable for embedding in another message (forward/quote).
- * (NO LINEBREAKS ALLOWED HERE!)
- */
-void pullquote_fmout(void) {
-       int intext = 0;
-       int bq = 0;
-       char buf[SIZ];
-
-       while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-
-               if ((intext == 1) && (isspace(buf[0]))) {
-                       wc_printf("<br>");
-               }
-               intext = 1;
-
-               /*
-                * Quoted text should be displayed in italics and in a
-                * different colour.  This code understands Citadel-style
-                * " >" quotes and will convert to <BLOCKQUOTE> tags.
-                */
-               if ((bq == 0) && (!strncmp(buf, " >", 2))) {
-                       wc_printf("<BLOCKQUOTE>");
-                       bq = 1;
-               } else if ((bq == 1) && (strncmp(buf, " >", 2))) {
-                       wc_printf("</BLOCKQUOTE>");
-                       bq = 0;
-               }
-               if ((bq == 1) && (!strncmp(buf, " >", 2))) {
-                       strcpy(buf, &buf[2]);
-               }
-
-               msgescputs(buf);
-       }
-       if (bq == 1) {
-               wc_printf("</I>");
-       }
-}
-
-
-
 
 /*
  *  Transmit message text (in memory) to the server.
index aaf4b1d7abb000a5abcd41c4a3b90f99414b874d..38d7b8c6bf5e06b575c0c2387bcd03bd4bac79ee 100644 (file)
@@ -42,6 +42,7 @@ void osr_sanitize(char *str) {
 }
 
 void display_add_remove_scripts(char *message);
+void display_rules_editor_inner_div(void);
 
 
 
index 6372245a003b84145e906a89c607a4f52f5b9402..ecb90c0b19be3bccbc3ec1d141bacd777b4e2ae1 100644 (file)
@@ -21,6 +21,8 @@
 #include "webcit.h"
 #include "calendar.h"
 
+extern int calendar_summary_view(void);
+
 /*
  * Display today's date in a friendly format
  */
@@ -209,7 +211,6 @@ InitModule_SUMMARY
        WebcitAddUrlHandler(HKEY("new_messages_html"), "", 0, new_messages_section, AJAX);
        WebcitAddUrlHandler(HKEY("tasks_inner_html"), "", 0, tasks_section, AJAX);
        WebcitAddUrlHandler(HKEY("calendar_inner_html"), "", 0, calendar_section, AJAX);
-       WebcitAddUrlHandler(HKEY("mini_calendar"), "", 0, ajax_mini_calendar, AJAX);
 
 }
 
index 442c83283d0169141f47f4d0fb67853c4c52ccf7..16c8e4f61b8cf3d649141b4852280f41a47e12f2 100644 (file)
@@ -83,6 +83,7 @@ int verbosity = 9;            /* Logging level */
 
 extern void *context_loop(ParsedHttpHdrs *Hdr);
 extern void *housekeeping_loop(void);
+extern void do_housekeeping(void);
 
 char ctdl_key_dir[PATH_MAX]=SSL_DIR;
 char file_crpt_file_key[PATH_MAX]="";
diff --git a/webcit/tcp_sockets.h b/webcit/tcp_sockets.h
new file mode 100644 (file)
index 0000000..4219fe8
--- /dev/null
@@ -0,0 +1,19 @@
+int uds_connectsock(char *);
+int tcp_connectsock(char *, char *);
+int serv_getln(char *strbuf, int bufsize);
+int StrBuf_ServGetln(StrBuf *buf);
+int GetServerStatus(StrBuf *Line, long* FullState);
+int serv_puts(const char *string);
+
+int serv_write(const char *buf, int nbytes);
+int serv_putbuf(const StrBuf *string);
+int serv_printf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
+int serv_read_binary(StrBuf *Ret, size_t total_len, StrBuf *Buf);
+int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize);
+int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize);
+int read_server_text(StrBuf *Buf, long *nLines);
+
+void text_to_server(char *ptr);
+void text_to_server_qp(char *ptr);
+void server_to_text(void);
+int lingering_close(int fd);
index c6dee8107671907cacb7ffeca71c723b8a27326f..57aaae864676efad02894694df23e4efe8ee5914 100644 (file)
@@ -643,6 +643,24 @@ void display_edit_address_book_entry(const char *username, long usernum) {
        FreeStrBuf(&roomname);
 }
 
+/*
+ *  burge a user 
+ *  username the name of the user to remove
+ */
+void delete_user(char *username) {
+       wcsession *WCC = WC;
+       StrBuf *Buf;
+       
+       Buf = NewStrBuf();
+       serv_printf("ASUP %s|0|0|0|0|0|", username);
+       StrBuf_ServGetln(Buf);
+       if (GetServerStatus(Buf, NULL) != 2) 
+               StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
+
+       select_user_to_edit( bstr("username"));
+       FreeStrBuf(&Buf);
+}
+               
 
 void display_edituser(const char *supplied_username, int is_new) {
        const char *Pos;
@@ -760,24 +778,6 @@ void edituser(void) {
        }
 }
 
-/*
- *  burge a user 
- *  username the name of the user to remove
- */
-void delete_user(char *username) {
-       wcsession *WCC = WC;
-       StrBuf *Buf;
-       
-       Buf = NewStrBuf();
-       serv_printf("ASUP %s|0|0|0|0|0|", username);
-       StrBuf_ServGetln(Buf);
-       if (GetServerStatus(Buf, NULL) != 2) 
-               StrBufAppendBuf(WCC->ImportantMsg, Buf, 4);
-
-       select_user_to_edit( bstr("username"));
-       FreeStrBuf(&Buf);
-}
-               
 
 
 /*
index 3e465e20b90ed8cef2cd1c6859a48c56ed71344c..4a822814609ee26811bb6eb15c0ad4dc036d468a 100644 (file)
@@ -127,35 +127,14 @@ long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks)
         return (bptr - target);
 }
 
-
-void escputs1(const char *strbuf, int nbsp, int nolinebreaks)
-{
-       StrEscAppend(WC->WBuf, NULL, strbuf, nbsp, nolinebreaks);
-}
-
-void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks)
-{
-       StrEscAppend(WC->WBuf, strbuf, NULL, nbsp, nolinebreaks);
-}
-
 /* 
  * static wrapper for ecsputs1
  */
 void escputs(const char *strbuf)
 {
-       escputs1(strbuf, 0, 0);
+       StrEscAppend(WC->WBuf, NULL, strbuf, 0, 0);
 }
 
-
-/* 
- * static wrapper for ecsputs1
- */
-void StrEscPuts(const StrBuf *strbuf)
-{
-       StrEscputs1(strbuf, 0, 0);
-}
-
-
 /*
  * urlescape buffer and print it to the client
  */
@@ -164,13 +143,6 @@ void urlescputs(const char *strbuf)
        StrBufUrlescAppend(WC->WBuf, NULL, strbuf);
 }
 
-/*
- * urlescape buffer and print it to the client
- */
-void UrlescPutStrBuf(const StrBuf *strbuf)
-{
-       StrBufUrlescAppend(WC->WBuf, strbuf, NULL);
-}
 
 /**
  * urlescape buffer and print it as header 
@@ -181,102 +153,6 @@ void hurlescputs(const char *strbuf)
 }
 
 
-/*
- * Copy a string, escaping characters for JavaScript strings.
- */
-void jsesc(char *target, size_t tlen, char *strbuf)
-{
-       int len;
-       char *tend;
-       char *send;
-       char *tptr;
-       char *sptr;
-
-       target[0]='\0';
-       len = strlen (strbuf);
-       send = strbuf + len;
-       tend = target + tlen;
-       sptr = strbuf;
-       tptr = target;
-       
-       while (!IsEmptyStr(sptr) && 
-              (sptr < send) &&
-              (tptr < tend)) {
-              
-               if (*sptr == '<')
-                       *tptr = '[';
-               else if (*sptr == '>')
-                       *tptr = ']';
-               else if (*sptr == '\'') {
-                       if (tend - tptr < 3)
-                               return;
-                       *(tptr++) = '\\';
-                       *tptr = '\'';
-               }
-               else if (*sptr == '"') {
-                       if (tend - tptr < 8)
-                               return;
-                       *(tptr++) = '&';
-                       *(tptr++) = 'q';
-                       *(tptr++) = 'u';
-                       *(tptr++) = 'o';
-                       *(tptr++) = 't';
-                       *tptr = ';';
-               }
-               else if (*sptr == '&') {
-                       if (tend - tptr < 7)
-                               return;
-                       *(tptr++) = '&';
-                       *(tptr++) = 'a';
-                       *(tptr++) = 'm';
-                       *(tptr++) = 'p';
-                       *tptr = ';';
-               } else {
-                       *tptr = *sptr;
-               }
-               tptr++; sptr++;
-       }
-       *tptr = '\0';
-}
-
-/*
- * escape and print javascript
- */
-void jsescputs(char *strbuf)
-{
-       char outbuf[SIZ];
-       
-       jsesc(outbuf, SIZ, strbuf);
-       wc_printf("%s", outbuf);
-}
-
-/*
- * print a string to the client after cleaning it with msgesc() and stresc()
- */
-void msgescputs1( char *strbuf)
-{
-       StrBuf *OutBuf;
-
-       if ((strbuf == NULL) || IsEmptyStr(strbuf))
-               return;
-       OutBuf = NewStrBuf();
-       StrMsgEscAppend(OutBuf, NULL, strbuf);
-       StrEscAppend(WC->WBuf, OutBuf, NULL, 0, 0);
-       FreeStrBuf(&OutBuf);
-}
-
-/*
- * print a string to the client after cleaning it with msgesc()
- */
-void msgescputs(char *strbuf) {
-       if ((strbuf != NULL) && !IsEmptyStr(strbuf))
-               StrMsgEscAppend(WC->WBuf, NULL, strbuf);
-}
-
-
-
-
-
 /*
  * Output a string to the client as a CDATA block
  */
diff --git a/webcit/utils.h b/webcit/utils.h
new file mode 100644 (file)
index 0000000..57cf13b
--- /dev/null
@@ -0,0 +1,7 @@
+void StrEscPuts(const StrBuf *strbuf);
+void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks);
+
+void urlescputs(const char *);
+void hurlescputs(const char *);
+long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks);
+void escputs(const char *strbuf);
index ac44ac1fd35ac2ffbb73d42f9ff2fbe6eeeced6a..6d9373edb6708071982e4536792b5757bdbf4838 100644 (file)
 StrBuf *csslocal = NULL;
 HashList *HandlerHash = NULL;
 
+void stuff_to_cookie(int unset_cookie);
+int GetConnected(void);
+
+
 void PutRequestLocalMem(void *Data, DeleteHashDataFunc DeleteIt)
 {
         wcsession *WCC = WC;
@@ -456,7 +460,7 @@ void ajax_servcmd(void)
         * This is kind of an ugly hack, but this is the only place it can go.
         * If the command was GEXP, then the instant messenger window must be
         * running, so reset the "last_pager_check" watchdog timer so
-        * that page_popup() doesn't try to open it a second time.
+        * that page_popup() doesn't try to open it a second time. TODO: page_popup isn't with us anymore.
         */
        if (!strncasecmp(bstr("g_cmd"), "GEXP", 4)) {
                WCC->last_pager_check = time(NULL);
index c4891d3e10ac70e22223a36bf13c5508b7a92658..567dc5d4e0b210c4e8e9c2d79ff63db685162a9e 100644 (file)
@@ -97,6 +97,9 @@
 #undef PACKAGE_TARNAME
 #undef PACKAGE_VERSION
 #undef PACKAGE_BUGREPORT
+
+typedef struct wcsession wcsession;
+
 #include "sysdep.h"
 
 #include "subst.h"
 #include "roomops.h"
 #include "preferences.h"
 
+#include "tcp_sockets.h"
+#include "utils.h"
 #ifdef HAVE_OPENSSL
 /* Work around RedHat's b0rken OpenSSL includes */
 #define OPENSSL_NO_KRB5
@@ -360,6 +365,14 @@ typedef struct _addrbookent {
 #define PARSE_REST_URL (1<<9)
 #define PROHIBIT_STARTPAGE (1<<10)
 
+
+#define DATEFMT_FULL 0
+#define DATEFMT_BRIEF 1
+#define DATEFMT_RAWDATE 2
+#define DATEFMT_LOCALEDATE 3
+void webcit_fmt_date(char *buf, size_t siz, time_t thetime, int Format);
+
+
 typedef enum _RESTDispatchID {
        ExistsID,
        PutID,
@@ -469,7 +482,6 @@ typedef struct _ParsedHttpHdrs {
  * One of these is kept for each active Citadel session.
  * HTTP transactions are bound to one at a time.
  */
-typedef struct wcsession wcsession;
 struct wcsession {
 /* infrastructural members */
        wcsession *next;                        /* Linked list */
@@ -617,25 +629,61 @@ extern char ctdl_key_dir[PATH_MAX];
 extern char file_crpt_file_key[PATH_MAX];
 extern char file_crpt_file_csr[PATH_MAX];
 extern char file_crpt_file_cer[PATH_MAX];
+
+void init_ssl(void);
+void endtls(void);
+void ssl_lock(int mode, int n, const char *file, int line);
+int starttls(int sock);
+extern SSL_CTX *ssl_ctx;  
+int client_read_sslbuffer(StrBuf *buf, int timeout);
+void client_write_ssl(const StrBuf *Buf);
 #endif
 
-extern char floorlist[128][SIZ];
-extern char *axdefs[];
-extern char *ctdlhost, *ctdlport;
-extern int http_port;
-extern char *server_cookie;
 extern int is_https;
-extern int setup_wizard;
-extern char wizard_filename[];
 extern int follow_xff;
+extern char *server_cookie;
+extern char *ctdlhost, *ctdlport;
+extern char *axdefs[];
 extern int num_threads_existing;
 extern int num_threads_executing;
+extern int setup_wizard;
+extern char wizard_filename[];
 
 void InitialiseSemaphores(void);
 void begin_critical_section(int which_one);
 void end_critical_section(int which_one);
 
-void stuff_to_cookie(int unset_cookie);
+
+extern void do_404(void);
+void http_redirect(const char *);
+
+
+#ifdef UBER_VERBOSE_DEBUGGING
+#define wc_printf(...) wcc_printf(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
+void wcc_printf(const char *FILE, const char *FUNCTION, long LINE, const char *format, ...);
+#else 
+void wc_printf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
+#endif
+
+void hprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
+
+void CheckAuthBasic(ParsedHttpHdrs *hdr);
+void GetAuthBasic(ParsedHttpHdrs *hdr);
+
+void sleeeeeeeeeep(int);
+
+size_t wc_strftime(char *s, size_t max, const char *format, const struct tm *tm);
+void fmt_time(char *buf, size_t siz, time_t thetime);
+void httpdate(char *buf, time_t thetime);
+time_t httpdate_to_timestamp(StrBuf *buf);
+
+
+
+
+void end_webcit_session(void);
+
+
+
 
 void cookie_to_stuff(StrBuf *cookie,
                int *session,
@@ -646,51 +694,30 @@ void cookie_to_stuff(StrBuf *cookie,
 );
 void locate_host(StrBuf *TBuf, int);
 void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_response);
-void openid_manual_create(void);
+
 void display_login(void);
 void display_openids(void);
 void display_default_landing_page(void);
 void do_welcome(void);
-void do_logout(void);
+
 void display_reg(int during_login);
 void display_main_menu(void);
 void display_aide_menu(void);
-void slrp_highest(void);
-ServInfo *get_serv_info(StrBuf *, StrBuf *);
+
 void RegisterEmbeddableMimeType(const char *MimeType, long MTLen, int Priority);
 void CreateMimeStr(void);
-int GetConnected(void);
-void DeleteServInfo(ServInfo **FreeMe);
-int uds_connectsock(char *);
-int tcp_connectsock(char *, char *);
-int serv_getln(char *strbuf, int bufsize);
-int StrBuf_ServGetln(StrBuf *buf);
-int GetServerStatus(StrBuf *Line, long* FullState);
-int serv_puts(const char *string);
-void who(void);
-void push_destination(void);
+
+
 void pop_destination(void);
-void robots_txt(void);
-extern void do_404(void);
 
-void ajax_mini_calendar(void);
 void fmout(char *align);
 void _fmout(StrBuf *Targt, char *align);
 void FmOut(StrBuf *Target, char *align, StrBuf *Source);
-void pullquote_fmout(void);
 void wDumpContent(int);
 
 
 void PutRequestLocalMem(void *Data, DeleteHashDataFunc DeleteIt);
 
-void UrlescPutStrBuf(const StrBuf *strbuf);
-void StrEscPuts(const StrBuf *strbuf);
-void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks);
-
-void urlescputs(const char *);
-void hurlescputs(const char *);
-void jsesc(char *, size_t, char *);
-void jsescputs(char *);
 void output_headers(    int do_httpheaders,
                        int do_htmlhead,
                        int do_room_banner,
@@ -700,64 +727,19 @@ void output_headers(    int do_httpheaders,
 void output_custom_content_header(const char *ctype);
 void cdataout(char *rawdata);
 
-#ifdef UBER_VERBOSE_DEBUGGING
-#define wc_printf(...) wcc_printf(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
-void wcc_printf(const char *FILE, const char *FUNCTION, long LINE, const char *format, ...);
-#else 
-void wc_printf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
-#endif
-
-void hprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
-void output_static(const char* What);
 
-long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks);
-void escputs(const char *strbuf);
 void url(char *buf, size_t bufsize);
 void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf);
-void escputs1(const char *strbuf, int nbsp, int nolinebreaks);
-void msgesc(char *target, size_t tlen, char *strbuf);
-void msgescputs(char *strbuf);
-void msgescputs1(char *strbuf);
-void dump_vars(void);
-
-void do_addrbook_view(addrbookent *addrbook, int num_ab);
-void fetch_ab_name(message_summary *Msg, char **namebuf);
+
+
 void display_vcard(StrBuf *Target, wc_mime_attachment *Mime, char alpha, int full, char **storename, long msgnum);
-void jsonMessageList(void);
-void new_summary_view(void);
-void text_to_server(char *ptr);
-void text_to_server_qp(char *ptr);
+
 void display_success(char *);
-void CheckAuthBasic(ParsedHttpHdrs *hdr);
-void GetAuthBasic(ParsedHttpHdrs *hdr);
-void server_to_text(void);
-void save_edit(char *description, char *enter_cmd, int regoto);
-void display_edit(char *description, char *check_cmd,
-                 char *read_cmd, char *save_cmd, int with_room_banner);
-long gotoroom(const StrBuf *gname);
-void remove_march(const StrBuf *aaa);
-void dotskip(void);
-void validate(void);
+
 void shutdown_sessions(void);
-void do_housekeeping(void);
-void smart_goto(const StrBuf *);
-void worker_entry(void);
-void session_loop(void);
-size_t wc_strftime(char *s, size_t max, const char *format, const struct tm *tm);
-void fmt_time(char *buf, size_t siz, time_t thetime);
-void httpdate(char *buf, time_t thetime);
-time_t httpdate_to_timestamp(StrBuf *buf);
-void end_webcit_session(void);
-void page_popup(void);
-void http_redirect(const char *);
-void clear_substs(struct wcsession *wc);
-void clear_local_substs(void);
 
 
 
-int lingering_close(int fd);
-long extract_token(char *dest, const char *source, int parmnum, char separator, int maxlen);
-void remove_token(char *source, int parmnum, char separator);
 StrBuf *load_mimepart(long msgnum, char *partnum);
 void MimeLoadData(wc_mime_attachment *Mime);
 void do_edit_vcard(long msgnum, char *partnum, 
@@ -767,97 +749,46 @@ void do_edit_vcard(long msgnum, char *partnum,
                   const char *force_room);
 
 void select_user_to_edit(const char *preselect);
-void delete_user(char *);
-void do_change_view(int);
-void folders(void);
-
 
-
-void offer_start_page(StrBuf *Target, WCTemplputParams *TP);
 void convenience_page(const char *titlebarcolor, const char *titlebarmsg, const char *messagetext);
 void output_html(const char *, int, int, StrBuf *, StrBuf *);
-void do_listsub(void);
+
 ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(wc_mime_attachment *Mime);
-void do_tasks_view(void);
-int calendar_summary_view(void);
-void free_march_list(wcsession *wcf);
-void display_rules_editor_inner_div(void);
+
 void generate_uuid(char *);
-void CtdlMakeTempFileName(char *, int);
+
 void address_book_popup(void);
 void begin_ajax_response(void);
 void end_ajax_response(void);
 
-void display_edit_task(void);
-void display_edit_event(void);
-icaltimezone *get_default_icaltimezone(void);
-void display_icaltimetype_as_webform(struct icaltimetype *, char *, int);
-void icaltime_from_webform(struct icaltimetype *result, char *prefix);
-void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
-void partstat_as_string(char *buf, icalproperty *attendee);
-icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp);
-void check_attendee_availability(icalcomponent *supplied_vevent);
-int ical_ctdl_is_overlap(
-                        struct icaltimetype t1start,
-                        struct icaltimetype t1end,
-                        struct icaltimetype t2start,
-                        struct icaltimetype t2end
-);
-
 
 extern char *months[];
 extern char *days[];
-int serv_write(const char *buf, int nbytes);
-int serv_putbuf(const StrBuf *string);
-int serv_printf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
-int serv_read_binary(StrBuf *Ret, size_t total_len, StrBuf *Buf);
-int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize);
-int StrBuf_ServGetBLOBBuffered(StrBuf *buf, long BlobSize);
-int read_server_text(StrBuf *Buf, long *nLines);
 long locate_user_vcard_in_this_room(message_summary **VCMsg,
                                    wc_mime_attachment **VCAtt);
-void sleeeeeeeeeep(int);
 void http_transmit_thing(const char *content_type, int is_static);
 long unescape_input(char *buf);
 void check_thread_pool_size(void);
-void spawn_another_worker_thread(void);
 void StrEndTab(StrBuf *Target, int tabnum, int num_tabs);
 void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs, StrBuf **Names);
 void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]);
 void tabbed_dialog(int num_tabs, char *tabnames[]);
 void begin_tab(int tabnum, int num_tabs);
 void end_tab(int tabnum, int num_tabs);
-void str_wiki_index(char *s);
-long guess_calhourformat(void);
+
+
 int get_time_format_cached (void);
-const char *get_selected_language(void);
 void display_wiki_pagelist(void);
 HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP);
 
-#define DATEFMT_FULL 0
-#define DATEFMT_BRIEF 1
-#define DATEFMT_RAWDATE 2
-#define DATEFMT_LOCALEDATE 3
-void webcit_fmt_date(char *buf, size_t siz, time_t thetime, int Format);
-void summary(void);
-
 /* actual supported locales */
 void TmplGettext(StrBuf *Target, WCTemplputParams *TP);
-void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType);
+
 void set_selected_language(const char *);
 void go_selected_language(void);
 void stop_selected_language(void);
-
-#ifdef HAVE_OPENSSL
-void init_ssl(void);
-void endtls(void);
-void ssl_lock(int mode, int n, const char *file, int line);
-int starttls(int sock);
-extern SSL_CTX *ssl_ctx;  
-int client_read_sslbuffer(StrBuf *buf, int timeout);
-void client_write_ssl(const StrBuf *Buf);
-#endif
+const char *get_selected_language(void);
 
 void utf8ify_rfc822_string(char **buf);
 
@@ -866,8 +797,6 @@ long end_burst(void);
 
 void AppendImportantMessage(const char *pch, long len);
 
-extern char *hourname[];       /* Names of hours (12am, 1am, etc.) */
-
 void http_datestring(char *buf, size_t n, time_t xtime);
 
 
index e0887b58635a4c18db6fc889fd6792c5cdeadb42..cdb8367cd787172b0ad0873d3f4cab7e2a4d074c 100644 (file)
@@ -37,7 +37,7 @@ extern void graceful_shutdown_watcher(int signum);
 extern void graceful_shutdown(int signum);
 extern void start_daemon(char *pid_file);
 extern void webcit_calc_dirs_n_files(int relh, const char *basedir, int home, char *webcitdir, char *relhome);
-
+extern void worker_entry(void);
 extern void drop_root(uid_t UID);
 
 char socket_dir[PATH_MAX];                     /* where to talk to our citadel server */