]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/serv_imap.h
* imap_fetch_rfc822(): migrate to strbuf
[citadel.git] / citadel / modules / imap / serv_imap.h
index c7d932a97e1dc34301bcd161d67c2fd8b89745d3..5d96ea95d77c37ee952025e3b991cb64553443fd 100644 (file)
@@ -2,16 +2,20 @@
  */
 
 
+#define GLOBAL_UIDVALIDITY_VALUE       1L
+
+
 void imap_cleanup_function(void);
 void imap_greeting(void);
 void imap_command_loop(void);
-int imap_grabroom(char *returned_roomname, char *foldername, int zapped_ok);
+int imap_grabroom(char *returned_roomname, const char *foldername, int zapped_ok);
 void imap_free_transmitted_message(void);
 int imap_do_expunge(void);
 void imap_rescan_msgids(void);
 
 
-struct citimap {
+
+typedef struct __citimap {
        int authstate;
        char authseq[SIZ];
        int selected;                   /* set to 1 if in the SELECTED state */
@@ -21,13 +25,13 @@ struct citimap {
        time_t last_mtime;              /* For checking whether the room was modified... */
        long *msgids;
        unsigned int *flags;
-       char *transmitted_message;      /* for APPEND command... */
-       size_t transmitted_length;
+       StrBuf *TransmittedMessage;     /* for APPEND command... */
+
+       citimap_command Cmd;            /* our current commandline */
 
        /* Cache most recent RFC822 FETCH because client might load in pieces */
-       char *cached_rfc822_data;
+       StrBuf *cached_rfc822;
        long cached_rfc822_msgnum;
-       size_t cached_rfc822_len;
        char cached_rfc822_withbody;    /* 1 = body cached; 0 = only headers cached */
 
        /* Cache most recent BODY FETCH because client might load in pieces */
@@ -36,7 +40,7 @@ struct citimap {
        char cached_bodypart[SIZ];
        long cached_bodymsgnum;
        char cached_body_withbody;      /* 1 = body cached; 0 = only headers cached */
-};
+} citimap;
 
 /*
  * values of 'authstate'
@@ -45,7 +49,9 @@ enum {
        imap_as_normal,
        imap_as_expecting_username,
        imap_as_expecting_password,
-       imap_as_expecting_plainauth
+       imap_as_expecting_plainauth,
+       imap_as_expecting_multilineusername,
+       imap_as_expecting_multilinepassword
 };
 
 /* Flags for the above struct.  Note that some of these are for internal use,
@@ -64,7 +70,7 @@ enum {
 #define IMAP_RECENT            64      /* reportable but not setable */
 
 
-#define IMAP CC->IMAP
+#define IMAP ((citimap *)CC->session_specific_data)
 
 /*
  * When loading arrays of message ID's into memory, increase the buffer to