#define PORT_NUM 2000 /* port number to listen on */
#define DEVELOPER_ID 0
#define CLIENT_ID 4
-#define CLIENT_VERSION 734 /* This version of WebCit */
+#define CLIENT_VERSION 735 /* This version of WebCit */
#define MINIMUM_CIT_VERSION 730 /* min required Citadel ver */
-#define LIBCITADEL_MIN 109 /* min required libcitadel ver */
+#define LIBCITADEL_MIN 110 /* min required libcitadel ver */
#define DEFAULT_HOST "localhost" /* Default Citadel server */
#define DEFAULT_PORT "504"
#define LB (1) /* Internal escape chars */
/**
* \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? */
};
/**
long msgnum; /**< the message number on the citadel server */
char from[128]; /**< the author */
char to[128]; /**< the recipient */
- char subj[128]; /**< the title / subject */
+ char subj[256]; /**< the title / subject */
int hasattachments; /**< does it have atachments? */
int is_new; /**< is it yet read? */
};
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 */
extern char wizard_filename[];
extern time_t if_modified_since;
extern int follow_xff;
+extern HashList *HandlerHash;
void do_setup_wizard(void);
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 *);
void print_menu_box(char* Title, char *Class, int nLines, ...);
long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks);
void escputs(char *strbuf);
-void url(char *buf);
+void url(char *buf, size_t bufsize);
void escputs1(char *strbuf, int nbsp, int nolinebreaks);
void msgesc(char *target, size_t tlen, char *strbuf);
void msgescputs(char *strbuf);
void display_task(long msgnum, int unread);
void display_note(long msgnum, int unread);
void updatenote(void);
+void ajax_update_note(void);
void do_calendar_view(void);
void do_tasks_view(void);
void free_calendar_buffer(void);
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);
void http_datestring(char *buf, size_t n, time_t xtime);
+typedef void (*WebcitHandlerFunc)(void);
+typedef struct _WebcitHandler{
+ WebcitHandlerFunc F;
+ int IsAjax;
+} WebcitHandler;
+void WebcitAddUrlHandler(const char * UrlString, long UrlSLen, WebcitHandlerFunc F, int IsAjax);
+
+
+
/* These should be empty, but we have them for testing */
#define DEFAULT_HTTPAUTH_USER ""
#define DEFAULT_HTTPAUTH_PASS ""