citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
![]() ![]() |
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <libcitadel.h>
#include "../../citadel.h"
#include "../../sysdep_decls.h"
#include "../../internet_addressing.h"
#include "serv_imap.h"
#include "imap_tools.h"
#include "../../ctdl_module.h"
Go to the source code of this file.
Data Structures | |
struct | string |
Macros | |
#define | SHOW_ME_VAPPEND_PRINTF |
#define | string_append_s(s, p) string_append_sn((s), (p), -1) |
#define | WILDMAT_TRUE 1 |
#define | WILDMAT_FALSE 0 |
#define | WILDMAT_ABORT -1 |
#define | WILDMAT_DELIM '/' |
Functions | |
static void | string_init (struct string *s, char *buf, int bufsize) |
static char * | string_end (struct string *s) |
static void | string_append_sn (struct string *s, char *p, int len) |
static void | string_append_c (struct string *s, int c) |
int | utf8_getc (char **ptr) |
static void | utf7_closeb64 (struct string *out, int v, int i) |
static char * | toimap (char *destp, char *destend, char *src) |
static int | cfrommap (int c) |
static char * | fromimap (char *destp, char *destend, const char *src) |
void | MakeStringOf (StrBuf *Buf, int skip) |
void | TokenCutRight (citimap_command *Cmd, ConstStr *CutMe, int n) |
void | TokenCutLeft (citimap_command *Cmd, ConstStr *CutMe, int n) |
int | CmdAdjust (citimap_command *Cmd, int nArgs, int Realloc) |
int | imap_parameterize (citimap_command *Cmd) |
long | imap_mailboxname (char *buf, int bufsize, struct ctdlroom *qrbuf) |
int | imap_roomname (char *rbuf, int bufsize, const char *foldername) |
int | imap_is_message_set (const char *buf) |
static int | do_imap_match (const char *supplied_text, const char *supplied_p) |
int | imap_mailbox_matches_pattern (const char *pattern, char *mailboxname) |
int | imap_datecmp (const char *datestr, time_t msgtime) |
void | IAPrintf (const char *Format,...) |
void | iaputs (const char *Str, long Len) |
void | ireply (const char *Msg, long len) |
void | IReplyPrintf (const char *Format,...) |
void | IPutStr (const char *Msg, long Len) |
void | IUnbuffer (void) |
Variables | |
static char * | utf7_alphabet |
static unsigned char | utf7_rank [256] |
#define SHOW_ME_VAPPEND_PRINTF |
Definition at line 22 of file imap_tools.c.
#define string_append_s | ( | s, | |
p | |||
) | string_append_sn((s), (p), -1) |
Definition at line 76 of file imap_tools.c.
#define WILDMAT_ABORT -1 |
Definition at line 724 of file imap_tools.c.
#define WILDMAT_DELIM '/' |
Definition at line 725 of file imap_tools.c.
#define WILDMAT_FALSE 0 |
Definition at line 723 of file imap_tools.c.
#define WILDMAT_TRUE 1 |
Definition at line 722 of file imap_tools.c.
|
static |
Definition at line 371 of file imap_tools.c.
Referenced by fromimap().
int CmdAdjust | ( | citimap_command * | Cmd, |
int | nArgs, | ||
int | Realloc | ||
) |
Definition at line 428 of file imap_tools.c.
References __citimap_command::avail_parms, free(), malloc(), __citimap_command::num_parms, and __citimap_command::Params.
Referenced by imap_extract_data_items(), imap_parameterize(), and imap_uidfetch().
|
static |
Definition at line 730 of file imap_tools.c.
References do_imap_match(), SIZ, WILDMAT_ABORT, WILDMAT_DELIM, WILDMAT_FALSE, and WILDMAT_TRUE.
Referenced by do_imap_match(), and imap_mailbox_matches_pattern().
|
static |
Definition at line 297 of file imap_tools.c.
References cfrommap(), string_append_c(), string_append_sn(), string_end(), string_init(), and utf7_rank.
Referenced by imap_roomname().
void IAPrintf | ( | const char * | Format, |
... | |||
) |
Definition at line 898 of file imap_tools.c.
References IMAP.
Referenced by imap_append(), imap_auth_login_pass(), imap_auth_login_user(), imap_auth_plain(), imap_authenticate(), imap_copy(), imap_do_fetch_msg(), imap_do_search(), imap_do_store(), imap_fetch_body(), imap_fetch_bodystructure(), imap_fetch_bodystructure_part(), imap_fetch_internaldate(), imap_fetch_rfc822(), imap_fetch_uid(), imap_greeting(), imap_list(), imap_list_floors(), imap_listroom(), imap_login(), imap_logout(), imap_output_copyuid_response(), imap_rescan_msgids(), imap_select(), imap_status(), and imap_uidcopy().
void iaputs | ( | const char * | Str, |
long | Len | ||
) |
Definition at line 908 of file imap_tools.c.
References IMAP.
Referenced by imap_fetch_body(), imap_fetch_rfc822(), and imap_getacl().
int imap_datecmp | ( | const char * | datestr, |
time_t | msgtime | ||
) |
Definition at line 848 of file imap_tools.c.
Referenced by imap_do_search_msg().
int imap_is_message_set | ( | const char * | buf | ) |
Definition at line 690 of file imap_tools.c.
Referenced by imap_copy(), imap_do_search_msg(), imap_store(), imap_uidcopy(), and imap_uidstore().
int imap_mailbox_matches_pattern | ( | const char * | pattern, |
char * | mailboxname | ||
) |
Definition at line 833 of file imap_tools.c.
References do_imap_match(), and WILDMAT_TRUE.
Referenced by imap_list_floors(), and imap_listroom().
long imap_mailboxname | ( | char * | buf, |
int | bufsize, | ||
struct ctdlroom * | qrbuf | ||
) |
Definition at line 550 of file imap_tools.c.
References CtdlGetCachedFloor(), floor::f_name, MAILROOM, QR_MAILBOX, qrbuf, ctdlroom::QRflags, ctdlroom::QRfloor, ctdlroom::QRname, and toimap().
Referenced by imap_listroom(), imap_rename_backend(), and imap_status().
int imap_parameterize | ( | citimap_command * | Cmd | ) |
Definition at line 468 of file imap_tools.c.
References __citimap_command::avail_parms, CmdAdjust(), __citimap_command::CmdBuf, __citimap_command::num_parms, and __citimap_command::Params.
Referenced by imap_command_loop(), and imap_strip_headers().
int imap_roomname | ( | char * | rbuf, |
int | bufsize, | ||
const char * | foldername | ||
) |
Definition at line 601 of file imap_tools.c.
References CtdlGetCachedFloor(), floor::f_flags, F_INUSE, floor::f_name, FDELIM, fromimap(), IR_MAILBOX, MAILROOM, MAXFLOORS, and ROOMNAMELEN.
Referenced by imap_create(), imap_grabroom(), imap_rename(), imap_rename_backend(), and imap_select().
void IPutStr | ( | const char * | Msg, |
long | Len | ||
) |
Definition at line 955 of file imap_tools.c.
References IMAP, and __citimap::Reply.
Referenced by imap_fetch_bodystructure_part(), imap_fetch_bodystructure_post(), imap_fetch_envelope(), imap_getacl(), imap_list_floors(), imap_listrights(), imap_listroom(), imap_myrights(), imap_namespace(), imap_output_envelope_addr(), imap_output_envelope_from(), and imap_status().
void ireply | ( | const char * | Msg, |
long | len | ||
) |
Definition at line 914 of file imap_tools.c.
References __citimap::Cmd, IMAP, __citimap_command::Params, and __citimap::Reply.
void IReplyPrintf | ( | const char * | Format, |
... | |||
) |
Definition at line 931 of file imap_tools.c.
References __citimap::Cmd, IMAP, __citimap_command::Params, and __citimap::Reply.
Referenced by imap_append(), imap_authenticate(), imap_copy(), imap_expunge(), imap_list(), imap_login(), imap_rename(), imap_select(), and imap_subscribe().
void IUnbuffer | ( | void | ) |
Definition at line 986 of file imap_tools.c.
References cputbuf(), IMAP, and __citimap::Reply.
Referenced by imap_append(), imap_command_loop(), and imap_greeting().
void MakeStringOf | ( | StrBuf * | Buf, |
int | skip | ||
) |
Definition at line 383 of file imap_tools.c.
References IMAP, __citimap_command::num_parms, and __citimap_command::Params.
Referenced by imap_fetch(), imap_store(), imap_uidfetch(), and imap_uidstore().
|
static |
Definition at line 81 of file imap_tools.c.
References string::buffer, string::maxsize, string::size, and string_append_sn().
Referenced by fromimap(), toimap(), and utf7_closeb64().
|
static |
Definition at line 63 of file imap_tools.c.
References string::buffer, string::maxsize, and string::size.
Referenced by fromimap(), string_append_c(), and toimap().
|
static |
Definition at line 56 of file imap_tools.c.
References string::buffer, and string::size.
Referenced by fromimap(), and toimap().
|
static |
Definition at line 49 of file imap_tools.c.
References string::buffer, string::maxsize, and string::size.
Referenced by fromimap(), and toimap().
|
static |
Definition at line 215 of file imap_tools.c.
References string_append_c(), string_append_sn(), string_end(), string_init(), utf7_alphabet, utf7_closeb64(), and utf8_getc().
Referenced by imap_mailboxname().
void TokenCutLeft | ( | citimap_command * | Cmd, |
ConstStr * | CutMe, | ||
int | n | ||
) |
Definition at line 412 of file imap_tools.c.
Referenced by imap_do_search(), and imap_list().
void TokenCutRight | ( | citimap_command * | Cmd, |
ConstStr * | CutMe, | ||
int | n | ||
) |
Definition at line 395 of file imap_tools.c.
References __citimap_command::CmdBuf.
Referenced by imap_do_search(), and imap_list().
|
static |
Definition at line 200 of file imap_tools.c.
References string_append_c(), and utf7_alphabet.
Referenced by toimap().
int utf8_getc | ( | char ** | ptr | ) |
Definition at line 126 of file imap_tools.c.
Referenced by toimap().
|
static |
Definition at line 176 of file imap_tools.c.
Referenced by toimap(), and utf7_closeb64().
|
static |
Definition at line 179 of file imap_tools.c.
Referenced by fromimap().