client.h revision 8e7123b5a7bc814b11ac4bcf3afd30ef8110a9be
#ifndef __CLIENT_H
#define __CLIENT_H
struct client;
struct mail_storage;
struct imap_parser;
struct imap_arg;
struct mailbox_keywords {
char **keywords;
unsigned int keywords_count;
};
struct client {
int socket;
struct namespace *namespaces;
struct mailbox_keywords keywords;
unsigned int select_counter; /* increased when mailbox is changed */
unsigned int bad_counter;
struct imap_parser *parser;
const char *cmd_tag;
const char *cmd_name;
void *cmd_context;
unsigned int command_pending:1;
unsigned int input_pending:1;
unsigned int output_pending:1;
unsigned int cmd_param_error:1;
unsigned int rawlog:1;
found a new line */
};
if the handle is a socket. */
/* Disconnect client connection */
/* Send a line of data to client. Returns 1 if ok, 0 if buffer is getting full,
-1 if error */
/* Send line of data to client, prefixed with client->tag */
/* Send BAD command error to client. msg can be NULL. */
/* Read a number of arguments. Returns TRUE if everything was read or
FALSE if either needs more data or error occured. */
/* Reads a number of string arguments. ... is a list of pointers where to
store the arguments. */
void clients_init(void);
void clients_deinit(void);
void _client_input(void *context);
int _client_output(void *context);
#endif