wprintf("</option>\n");
- List = NewHash();
+ List = NewHash(1, NULL);
serv_puts("LKRA");
serv_getln(buf, sizeof buf);
if (buf[0] == '1') while(len = serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
begin_ajax_response();
- List = NewHash();
+ List = NewHash(1, NULL);
wprintf("<div align=center><form onSubmit=\"return false;\">"
"<select multiple name=\"whichaddr\" id=\"whichaddr\" size=\"15\">\n");
strcpy(TheSession->httpauth_user, httpauth_user);
strcpy(TheSession->httpauth_pass, httpauth_pass);
- TheSession->hash_prefs = NewHash(); /* Get a hash table for the user preferences */
+ TheSession->hash_prefs = NewHash(1,NULL); /* Get a hash table for the user preferences */
pthread_mutex_init(&TheSession->SessionMutex, NULL);
pthread_mutex_lock(&SessionListMutex);
TheSession->nonce = rand();
HashList *List;
HashPos *it;
- List = NewHash();
+ List = NewHash(1, NULL);
len = sizeof("UTC") + 1;
ZName = malloc(len + 1);
memcpy(ZName, "UTC", len + 1);
*/
static char *unset = "; expires=28-May-1971 18:10:00 GMT";
+static HashList *HandlerHash = NULL;
+
+
+void WebcitAddUrlHandler(const char * UrlString, long UrlSLen, WebcitHandlerFunc F, int IsAjax)
+{
+ WebcitHandler *NewHandler;
+
+ if (HandlerHash == NULL)
+ HandlerHash = NewHash(1, NULL);
+
+ NewHandler = (WebcitHandler*) malloc(sizeof(WebcitHandler));
+ NewHandler->F = F;
+ NewHandler->IsAjax = IsAjax;
+
+ Put(HandlerHash, UrlString, UrlSLen, NewHandler, NULL);
+}
+
/**
* \brief remove escaped strings from i.e. the url string (like %20 for blanks)
* \param buf the buffer to examine
struct wcsession *WCC = WC;
if (WCC->urlstrings == NULL)
- WCC->urlstrings = NewHash();
+ WCC->urlstrings = NewHash(1, NULL);
eptr = buf + sizeof (buf);
up = url;
/** locate the = sign */
lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n", name, cbtype, length);
*/
if (WC->urlstrings == NULL)
- WC->urlstrings = NewHash();
+ WC->urlstrings = NewHash(1, NULL);
/* Form fields */
if ( (length > 0) && (IsEmptyStr(cbtype)) ) {
* Various commands...
*/
+
else if (!strcasecmp(action, "do_welcome")) {
do_welcome();
} else if (!strcasecmp(action, "blank")) {
else {
display_main_menu();
}
-
+}
SKIP_ALL_THIS_CRAP:
fflush(stdout);
if (content != NULL) {
#define CLIENT_ID 4
#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 */
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 ""
now = time(NULL);
}
- List = NewHash();
+ List = NewHash(1, NULL);
if (GetWholistSection(List, now)) {
it = GetNewHashPos();
now = time(NULL);
}
- List = NewHash();
+ List = NewHash(1, NULL);
if (GetWholistSection(List, now)) {
SortByPayload(List, CompareUserStruct);