imapc-client.h revision 1af95e0fea59835842dafe207e86ebc53691c596
#ifndef IMAPC_CLIENT_H
#define IMAPC_CLIENT_H
enum imapc_command_state {
};
enum imapc_capability {
IMAPC_CAPABILITY_SASL_IR = 0x01,
IMAPC_CAPABILITY_LITERALPLUS = 0x02,
IMAPC_CAPABILITY_QRESYNC = 0x04,
IMAPC_CAPABILITY_IDLE = 0x08,
IMAPC_CAPABILITY_UIDPLUS = 0x10,
IMAPC_CAPABILITY_AUTH_PLAIN = 0x20,
IMAPC_CAPABILITY_STARTTLS = 0x40,
IMAPC_CAPABILITY_IMAP4REV1 = 0x400000000
};
struct imapc_capability_name {
const char *name;
enum imapc_capability capability;
};
extern const struct imapc_capability_name imapc_capability_names[];
enum imapc_client_ssl_mode {
};
struct imapc_client_settings {
const char *host;
unsigned int port;
const char *master_user;
const char *username;
const char *password;
const char *dns_client_socket_path;
const char *temp_path_prefix;
const char *ssl_ca_dir;
bool debug;
};
struct imapc_command_reply {
enum imapc_command_state state;
/* "[RESP TEXT]" produces key=RESP, value=TEXT.
"[RESP]" produces key=RESP, value=NULL
otherwise both are NULL */
const char *resp_text_key, *resp_text_value;
/* The full tagged reply, including [RESP TEXT]. */
const char *text_full;
/* Tagged reply text without [RESP TEXT] */
const char *text_without_resp;
};
struct imapc_arg_file {
/* file descriptor containing the value */
int fd;
/* parent_arg.list[list_idx] points to the IMAP_ARG_LITERAL_SIZE
argument */
const struct imap_arg *parent_arg;
unsigned int list_idx;
};
struct imapc_untagged_reply {
/* name of the untagged reply, e.g. EXISTS */
const char *name;
/* number at the beginning of the reply, or 0 if there wasn't any.
Set for EXISTS, EXPUNGE, etc. */
/* the rest of the reply can be read from these args. */
/* arguments whose contents are stored into files. only
"FETCH (BODY[" arguments can be here. */
const struct imapc_arg_file *file_args;
unsigned int file_args_count;
/* "* OK [RESP TEXT]" produces key=RESP, value=TEXT.
"* OK [RESP]" produces key=RESP, value=NULL
otherwise both are NULL */
const char *resp_text_key, *resp_text_value;
/* If this reply occurred while a mailbox was selected, this contains
the mailbox's untagged_context. */
void *untagged_box_context;
};
/* Called when tagged reply is received for command. */
void *context);
/* Called each time untagged input is received. */
void *context);
struct imapc_client *
void *context);
/* Stop immediately, don't finish even any already read pending replies.
They'll be finished when imapc_client_run() is again called. */
struct imapc_client_mailbox *
void *untagged_box_context);
const char *cmd,
void *context);
struct imapc_msgmap *
enum imapc_capability
const char **path_r);
#endif