* we have now several bstrs:
[citadel.git] / webcit / webcit.h
index ce0be5daab2a10a80aafe72937c98f4cda7020f8..c9215c9abb6eb24420c38621c0b9cd681c74b240 100644 (file)
@@ -225,10 +225,11 @@ struct httprequest {
 /**
  * \brief      Linked list of session variables encoded in an x-www-urlencoded content type
  */
+typedef struct urlcontent urlcontent;
 struct urlcontent {
-       struct urlcontent *next;   /**< the next variable in the list */ 
        char url_key[32];          /**< the variable name */
        char *url_data;            /**< its value */
+       size_t url_data_size;      /**< how big is it? */
 };
 
 /**
@@ -383,7 +384,7 @@ struct wcsession {
        int num_summ;                           /**< number of messages in mailbox summary view */
        struct message_summary *summ;           /**< array of messages for mailbox summary view */
        int is_wap;                             /**< Client is a WAP gateway */
-       struct urlcontent *urlstrings;          /**< variables passed to webcit in a URL */
+       HashList *urlstrings;                   /**< variables passed to webcit in a URL */
        struct wcsubst *vars;                   /**< HTTP variable substitutions for this page */
        char this_page[512];                    /**< URL of current page */
        char http_host[512];                    /**< HTTP Host: header */
@@ -501,7 +502,33 @@ void fmout(char *align);
 void pullquote_fmout(void);
 void wDumpContent(int);
 void serv_printf(const char *format,...);
-char *bstr(char *key);
+
+/* TODO: get rid of the non-const-typecast */
+#define bstr(a) (char*) Bstr(a, sizeof(a) - 1)
+const char *BSTR(char *key);
+const char *Bstr(char *key, size_t keylen);
+
+#define xbstr(a, b) (char*) XBstr(a, sizeof(a) - 1, b)
+const char *XBstr(char *key, size_t keylen, size_t *len);
+const char *XBSTR(char *key, size_t *len);
+
+#define lbstr(a) LBstr(a, sizeof(a) - 1)
+long LBstr(char *key, size_t keylen);
+long LBSTR(char *key);
+
+#define ibstr(a) IBstr(a, sizeof(a) - 1)
+int IBstr(char *key, size_t keylen);
+int IBSTR(char *key);
+
+#define havebstr(a) HaveBstr(a, sizeof(a) - 1)
+int HaveBstr(char *key, size_t keylen);
+int HAVEBSTR(char *key);
+
+#define yesbstr(a) YesBstr(a, sizeof(a) - 1)
+int YesBstr(char *key, size_t keylen);
+int YESBSTR(char *key);
+
+
 void urlescputs(char *);
 void jsesc(char *, size_t, char *);
 void jsescputs(char *);
@@ -731,7 +758,7 @@ long locate_user_vcard(char *username, long usernum);
 void sleeeeeeeeeep(int);
 void http_transmit_thing(char *thing, size_t length, const char *content_type,
                         int is_static);
-void unescape_input(char *buf);
+long unescape_input(char *buf);
 void do_iconbar(void);
 void do_iconbar_roomlist(void);
 void do_selected_iconbar(void);