* fix groupdav handling
[citadel.git] / webcit / webcit.h
index cf085c2be3aee19b93a519f0ee5507b02406993d..b1f619ea0a9dcd49db3d846f4cf0c4de149e82e6 100644 (file)
@@ -402,41 +402,51 @@ const char *ReqStrs[eNONE];
 #define AUTH_COOKIE 1
 #define AUTH_BASIC 2
 
-typedef struct _ParsedHttpHdrs {
-       int http_sock;                          /**< HTTP server socket */
-       const char *Pos;
-       StrBuf *ReadBuf;
 
+
+typedef struct _HdrRefs {
        long eReqType;                          /**< eGET, ePOST.... */
-       const WebcitHandler *Handler;
-       
-       int DontNeedAuth;
-       int got_auth;
+       int desired_session;
        int SessionKey;
+
+       int got_auth;
+       int DontNeedAuth;
        long ContentLength;
        time_t if_modified_since;
        int gzip_ok;                            /**< Nonzero if Accept-encoding: gzip */
+       int prohibit_caching;
+       int dav_depth;
 
-       StrBuf *c_username;
-       StrBuf *c_password;
-       StrBuf *c_roomname;
-       StrBuf *RawCookie;
-       int desired_session;
-
+       /* these are references into Hdr->HTTPHeaders, so we don't need to free them. */
        StrBuf *ContentType;
-
-       StrBuf *RawLine;/* TODO: freeme */
+       StrBuf *RawCookie;
        StrBuf *ReqLine;
        StrBuf *http_host;                      /**< HTTP Host: header */
        StrBuf *browser_host;
        StrBuf *user_agent;
        StrBuf *plainauth;
+       StrBuf *dav_ifmatch;
 
+       const WebcitHandler *Handler;
+} HdrRefs;
+
+typedef struct _ParsedHttpHdrs {
+       int http_sock;                          /**< HTTP server socket */
+       const char *Pos;
+       StrBuf *ReadBuf;
+
+       StrBuf *c_username;
+       StrBuf *c_password;
+       StrBuf *c_roomname;
+       StrBuf *c_language;
        StrBuf *this_page;                      /**< URL of current page */
-       StrBuf *PlainArgs; /*TODO: freeme*/
+       StrBuf *PlainArgs; 
+
        HashList *urlstrings;                   /**< variables passed to webcit in a URL */
        HashList *HTTPHeaders;                  /**< the headers the client sent us */
        int nWildfireHeaders;                   /**< how many wildfire headers did we already send? */
+
+       HdrRefs HR;
 } ParsedHttpHdrs;
 
 
@@ -565,11 +575,6 @@ typedef struct _HttpHeader {
 void RegisterHeaderHandler(const char *Name, long Len, Header_Evaluator F);
 
 
-/* values for WC->current_iconbar */
-enum {
-       current_iconbar_menu,     /* view the icon menue */
-       current_iconbar_roomlist  /* view the roomtree */
-};
 enum {
        S_SELECT,
        S_SHUTDOWN,
@@ -630,13 +635,20 @@ void InitialiseSemaphores(void);
 void begin_critical_section(int which_one);
 void end_critical_section(int which_one);
 
-
-void stuff_to_cookie(char *cookie, size_t clen, int session,
-                       StrBuf *user, StrBuf *pass, StrBuf *room);
-void cookie_to_stuff(StrBuf *cookie, int *session,
-                    StrBuf *user,
-                    StrBuf *pass,
-                    StrBuf *room);
+void stuff_to_cookie(char *cookie, size_t clen,
+               int session,
+               StrBuf *user,
+               StrBuf *pass,
+               StrBuf *room,
+               char *language
+);
+void cookie_to_stuff(StrBuf *cookie,
+               int *session,
+               StrBuf *user,
+               StrBuf *pass,
+               StrBuf *room,
+               StrBuf *language
+);
 void locate_host(StrBuf *TBuf, int);
 void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_response);
 void openid_manual_create(void);
@@ -714,12 +726,8 @@ void text_to_server(char *ptr);
 void text_to_server_qp(char *ptr);
 void confirm_delete_msg(void);
 void display_success(char *);
-void authorization_required(const char *message);
 void CheckAuthBasic(ParsedHttpHdrs *hdr);
 void GetAuthBasic(ParsedHttpHdrs *hdr);
-
-int ReEstablish_Session(void);
-
 void server_to_text(void);
 void save_edit(char *description, char *enter_cmd, int regoto);
 void display_edit(char *description, char *check_cmd,
@@ -861,14 +869,6 @@ void summary(void);
 int is_mobile_ua(char *user_agent);
 
 void embed_room_banner(char *, int);
-#define FLOOR_PARAM_LEN 3
-extern const char FLOOR_PARAM_NAMES[(FLOOR_PARAM_LEN + 1)][15];
-extern const int FLOOR_PARAM_NAMELEN[(FLOOR_PARAM_LEN + 1)];
-#define FPKEY(a) FLOOR_PARAM_NAMES[a], FLOOR_PARAM_NAMELEN[a]
-#define ROOM_PARAM_LEN 8
-extern const char ROOM_PARAM_NAMES[(ROOM_PARAM_LEN + 1)][20];
-extern const int ROOM_PARAM_NAMELEN[(ROOM_PARAM_LEN +1)];
-#define RPKEY(a) ROOM_PARAM_NAMES[a], ROOM_PARAM_NAMELEN[a]
 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
 HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
 int SortRoomsByListOrder(const void *room1, const void *room2);
@@ -916,5 +916,3 @@ typedef void (*IcalCallbackFunc)(icalcomponent *, long, char*, int, struct calvi
 #define WC_TIMEFORMAT_AMPM 1
 #define WC_TIMEFORMAT_24 2
 
-
-void LoadIconSettings(void);