Began removing $Id$ tags. This will be an ongoing process.
[citadel.git] / citadel / imap_tools.h
1 /*
2  * FDELIM defines which character we want to use as a folder delimiter
3  * in room names.  Originally we used a forward slash, but that caused
4  * rooms with names like "Sent/Received Pages" to get delimited, so we
5  * changed it to a backslash.  This is completely irrelevant to how Citadel
6  * speaks to IMAP clients -- the delimiter used in the IMAP protocol is
7  * a vertical bar, which is illegal in Citadel room names anyway.
8  */
9 #define FDELIM '\\'
10
11 typedef struct __citimap_command {
12         StrBuf *CmdBuf;                 /* our current commandline; gets chopped into: */
13         ConstStr *Params;               /* Commandline tokens */
14         int num_parms;                  /* Number of Commandline tokens available */
15         int avail_parms;                /* Number of ConstStr args is big */
16 } citimap_command;
17
18 /* 
19  * since we work with shifted pointers to ConstStrs in some places, 
20  * we can't just say we want to cut the n'th of Cmd, we have to pass it in
21  * and rely on that CutMe references Cmd->CmdBuf; else peek won't work out
22  * and len will differ.
23  */
24 void TokenCutRight(citimap_command *Cmd, 
25                    ConstStr *CutMe,
26                    int n);
27 /*
28  * since we just move Key around here, Cmd is just here so the syntax is identical.
29  */
30 void TokenCutLeft(citimap_command *Cmd, 
31                   ConstStr *CutMe,
32                   int n);
33 void MakeStringOf(StrBuf *Buf, int skip);
34
35 int CmdAdjust(citimap_command *Cmd, 
36               int nArgs,
37               int Realloc);
38
39
40 void imap_strout(ConstStr *args);
41 void plain_imap_strout(char *buf);
42 int imap_parameterize(citimap_command *Cmd);
43 int old_imap_parameterize(char** args, char *n);
44 void imap_mailboxname(char *buf, int bufsize, struct ctdlroom *qrbuf);
45 void imap_ial_out(struct internet_address_list *ialist);
46 int imap_roomname(char *buf, int bufsize, const char *foldername);
47 int imap_is_message_set(const char *);
48 int imap_mailbox_matches_pattern(const char *pattern, char *mailboxname);
49 int imap_datecmp(const char *datestr, time_t msgtime);
50
51 /*
52  * Flags that may be returned by imap_roomname()
53  * (the lower eight bits will be the floor number)
54  */
55 #define IR_MAILBOX      0x0100          /* Mailbox                       */
56 #define IR_EXISTS       0x0200          /* Room exists (not implemented) */
57 #define IR_BABOON       0x0000          /* Just had to put this here :)  */