More removal of $Id$ tags
[citadel.git] / citadel / modules / imap / serv_imap.h
1 #define GLOBAL_UIDVALIDITY_VALUE        1L
2
3
4 void imap_cleanup_function(void);
5 void imap_greeting(void);
6 void imap_command_loop(void);
7 int imap_grabroom(char *returned_roomname, const char *foldername, int zapped_ok);
8 void imap_free_transmitted_message(void);
9 int imap_do_expunge(void);
10 void imap_rescan_msgids(void);
11
12
13
14 typedef struct __citimap {
15         int authstate;
16         char authseq[SIZ];
17         int selected;                   /* set to 1 if in the SELECTED state */
18         int readonly;                   /* mailbox is open read only */
19         int num_msgs;                   /* Number of messages being mapped */
20         int num_alloc;                  /* Number of messages for which we've allocated space */
21         time_t last_mtime;              /* For checking whether the room was modified... */
22         long *msgids;
23         unsigned int *flags;
24         StrBuf *TransmittedMessage;     /* for APPEND command... */
25
26         citimap_command Cmd;            /* our current commandline */
27
28         /* Cache most recent RFC822 FETCH because client might load in pieces */
29         StrBuf *cached_rfc822;
30         long cached_rfc822_msgnum;
31         char cached_rfc822_withbody;    /* 1 = body cached; 0 = only headers cached */
32
33         /* Cache most recent BODY FETCH because client might load in pieces */
34         char *cached_body;
35         size_t cached_body_len;
36         char cached_bodypart[SIZ];
37         long cached_bodymsgnum;
38         char cached_body_withbody;      /* 1 = body cached; 0 = only headers cached */
39 } citimap;
40
41 /*
42  * values of 'authstate'
43  */
44 enum {
45         imap_as_normal,
46         imap_as_expecting_username,
47         imap_as_expecting_password,
48         imap_as_expecting_plainauth,
49         imap_as_expecting_multilineusername,
50         imap_as_expecting_multilinepassword
51 };
52
53 /* Flags for the above struct.  Note that some of these are for internal use,
54  * and are not to be reported to IMAP clients.
55  */
56 #define IMAP_ANSWERED           1       /* reportable and setable */
57 #define IMAP_FLAGGED            2       /* reportable and setable */
58 #define IMAP_DELETED            4       /* reportable and setable */
59 #define IMAP_DRAFT              8       /* reportable and setable */
60 #define IMAP_SEEN               16      /* reportable and setable */
61
62 #define IMAP_MASK_SETABLE       0x1f
63 #define IMAP_MASK_SYSTEM        0xe0
64
65 #define IMAP_SELECTED           32      /* neither reportable nor setable */
66 #define IMAP_RECENT             64      /* reportable but not setable */
67
68
69 #define IMAP ((citimap *)CC->session_specific_data)
70
71 /*
72  * When loading arrays of message ID's into memory, increase the buffer to
73  * hold this many additional messages instead of calling realloc() each time.
74  */
75 #define REALLOC_INCREMENT 100