Still waiting for the computer. Or rather, for other computers.
[citadel.git] / citadel / server / modules / imap / imap_tools.h
1
2 // since we work with shifted pointers to ConstStrs in some places, 
3 // we can't just say we want to cut the n'th of Cmd, we have to pass it in
4 // and rely on that CutMe references Cmd->CmdBuf; else peek won't work out
5 // and len will differ.
6 void TokenCutRight(citimap_command *Cmd, ConstStr *CutMe, int n);
7
8 // since we just move Key around here, Cmd is just here so the syntax is identical.
9 void TokenCutLeft(citimap_command *Cmd, ConstStr *CutMe, int n);
10
11 void MakeStringOf(StrBuf *Buf, int skip);
12
13 int CmdAdjust(citimap_command *Cmd, int nArgs, int Realloc);
14
15 void imap_strout(ConstStr *args);
16 void imap_strbuffer(StrBuf *Reply, ConstStr *args);
17 void plain_imap_strbuffer(StrBuf *Reply, char *buf);
18 int imap_parameterize(citimap_command *Cmd);
19 long imap_mailboxname(char *buf, int bufsize, struct ctdlroom *qrbuf);
20 int imap_roomname(char *buf, int bufsize, const char *foldername);
21 int imap_is_message_set(const char *);
22 int imap_mailbox_matches_pattern(const char *pattern, char *mailboxname);
23 int imap_datecmp(const char *datestr, time_t msgtime);
24
25 // Imap Append Printf, send to the outbuffer
26 void IAPrintf(const char *Format, ...) __attribute__((__format__(__printf__,1,2)));
27
28 void iaputs(const char *Str, long Len);
29 #define IAPuts(Msg) iaputs(HKEY(Msg))
30 // give it a naughty name since its ugly.
31 #define _iaputs(Msg) iaputs(Msg, strlen(Msg))
32
33 // outputs a static message prepended by the sequence no
34 void ireply(const char *Msg, long len);
35 #define IReply(msg) ireply(HKEY(msg))
36 // outputs a dynamic message prepended by the sequence no
37 void IReplyPrintf(const char *Format, ...);
38
39
40 // output a string like that {%ld}%s
41 void IPutStr(const char *Msg, long Len);
42 #define IPutCStr(_ConstStr) IPutStr(CKEY(_ConstStr))
43 #define IPutCParamStr(n) IPutStr(CKEY(Params[n]))
44 #define IPutMsgField(Which) IPutStr(CM_KEY(msg, Which))
45 void IUnbuffer (void);