]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_tools.c
* Removed the defunct METADATA parameters to our unfinished LIST-EXTENDED implementation.
[citadel.git] / citadel / modules / imap / imap_tools.c
index 0e62a407c34900af08df5453813cad6d4c96c2ac..6dda4a4cfb2bfb51b00338c562cc97ff48b71631 100644 (file)
@@ -18,7 +18,7 @@
 #include "room_ops.h"
 #include "internet_addressing.h"
 #include "imap_tools.h"
-
+#include "ctdl_module.h"
 
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
 
 /* String handling helpers */
 
-/* This code uses some pretty narsty string manipulation. To make everything
+/* This code uses some pretty nasty string manipulation. To make everything
  * manageable, we use this semi-high-level string manipulation API. Strings are
- * always \0-terminated, despite the fact that we keep track of the size. */
-
+ * always \0-terminated, despite the fact that we keep track of the size.
+ */
 struct string {
        char* buffer;
        int maxsize;
@@ -211,7 +211,7 @@ static char* toimap(char* destp, char* destend, char* src)
 
        *destp = 0;
        string_init(&dest, destp, destend-destp);
-       /* lprintf(CTDL_DEBUG, "toimap %s\r\n", src); */
+       /* CtdlLogPrintf(CTDL_DEBUG, "toimap %s\r\n", src); */
 
        for (;;)
        {
@@ -277,7 +277,7 @@ static char* toimap(char* destp, char* destend, char* src)
 
        if (state == 1)
                utf7_closeb64(&dest, v, i);
-       /* lprintf(CTDL_DEBUG, "    -> %s\r\n", destp); */
+       /* CtdlLogPrintf(CTDL_DEBUG, "    -> %s\r\n", destp); */
        return string_end(&dest);
 }
 
@@ -295,7 +295,7 @@ static char* fromimap(char* destp, char* destend, char* src)
 
        *destp = 0;
        string_init(&dest, destp, destend-destp);
-       /* lprintf(CTDL_DEBUG, "fromimap %s\r\n", src); */
+       /* CtdlLogPrintf(CTDL_DEBUG, "fromimap %s\r\n", src); */
 
        do {
                c = *p++;
@@ -353,7 +353,7 @@ static char* fromimap(char* destp, char* destend, char* src)
                        }
        } while (c != '\0');
 
-       /* lprintf(CTDL_DEBUG, "      -> %s\r\n", destp); */
+       /* CtdlLogPrintf(CTDL_DEBUG, "      -> %s\r\n", destp); */
        return string_end(&dest);
 }
 
@@ -582,7 +582,7 @@ int imap_roomname(char *rbuf, int bufsize, char *foldername)
        ret = (0 | IR_MAILBOX);
 
 exit:
-       lprintf(CTDL_DEBUG, "(That translates to \"%s\")\n", rbuf);
+       CtdlLogPrintf(CTDL_DEBUG, "(That translates to \"%s\")\n", rbuf);
        return(ret);
 }
 
@@ -772,6 +772,10 @@ int imap_datecmp(char *datestr, time_t msgtime) {
        int msgday, msgmonth, msgyear;
        struct tm msgtm;
 
+       char *imap_datecmp_ascmonths[12] = {
+               "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+       };
+
        if (datestr == NULL) return(0);
 
        /* Expecting a date in the form dd-Mmm-yyyy */
@@ -783,7 +787,7 @@ int imap_datecmp(char *datestr, time_t msgtime) {
        year = atoi(yearstr);
        month = 0;
        for (i=0; i<12; ++i) {
-               if (!strcasecmp(monthstr, ascmonths[i])) {
+               if (!strcasecmp(monthstr, imap_datecmp_ascmonths[i])) {
                        month = i;
                }
        }