]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.h
* shuffle auth arround...
[citadel.git] / webcit / webcit.h
index 6a2b13589e2e54cd933a6eb75fc440526fde66c8..c4bc03e700b8f8072eae7846d4f8b44598e3e238 100644 (file)
@@ -346,8 +346,6 @@ typedef struct _addrbookent {
 } addrbookent;
 
 
-
-
 #define AJAX (1<<0)
 #define ANONYMOUS (1<<1)
 #define NEED_URL (1<<2)
@@ -364,15 +362,10 @@ typedef void (*WebcitHandlerFunc)(void);
 typedef struct  _WebcitHandler{
        WebcitHandlerFunc F;
        long Flags;
+       StrBuf *Name;
 } WebcitHandler;
 void WebcitAddUrlHandler(const char * UrlString, long UrlSLen, WebcitHandlerFunc F, long Flags);
 
-
-
-
-
-
-
 typedef struct _headereval {
        ExamineMsgHeaderFunc evaluator;
        int Type;
@@ -405,7 +398,9 @@ enum {
 };
 const char *ReqStrs[eNONE];
 
-
+#define NO_AUTH 0
+#define AUTH_COOKIE 1
+#define AUTH_BASIC 2
 
 typedef struct _ParsedHttpHdrs {
        int http_sock;                          /**< HTTP server socket */
@@ -416,7 +411,7 @@ typedef struct _ParsedHttpHdrs {
        const WebcitHandler *Handler;
        
        int DontNeedAuth;
-       int got_cookie;
+       int got_auth;
        long ContentLength;
        time_t if_modified_since;
        int gzip_ok;                            /**< Nonzero if Accept-encoding: gzip */
@@ -435,10 +430,6 @@ typedef struct _ParsedHttpHdrs {
        StrBuf *browser_host;
        StrBuf *user_agent;
 
-       StrBuf *UrlFragment1;                   /**< first urlfragment, if NEED_URL is specified by the handler*/
-       StrBuf *UrlFragment2;                   /**< second urlfragment, if NEED_URL is specified by the handler*/
-       StrBuf *UrlFragment3;                   /**< third urlfragment, if NEED_URL is specified by the handler*/
-       StrBuf *UrlFragment4;                   /**< fourth urlfragment, if NEED_URL is specified by the handler*/
        StrBuf *this_page;                      /**< URL of current page */
        StrBuf *PlainArgs; /*TODO: freeme*/
        HashList *urlstrings;                   /**< variables passed to webcit in a URL */
@@ -569,6 +560,7 @@ typedef struct _HttpHeader {
        int HaveEvaluator;
 } OneHttpHeader;
 
+void RegisterHeaderHandler(const char *Name, long Len, Header_Evaluator F);
 
 
 /* values for WC->current_iconbar */
@@ -695,7 +687,7 @@ void output_headers(    int do_httpheaders,
 void output_custom_content_header(const char *ctype);
 void wprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
 void hprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
-void output_static(void);
+void output_static(const char* What);
 
 void print_menu_box(char* Title, char *Class, int nLines, ...);
 long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks);
@@ -840,7 +832,6 @@ void http_transmit_thing(const char *content_type, int is_static);
 long unescape_input(char *buf);
 void do_selected_iconbar(void);
 void spawn_another_worker_thread(void);
-void display_rss(const StrBuf *roomname);
 void StrEndTab(StrBuf *Target, int tabnum, int num_tabs);
 void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs);
 void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]);