client.h revision a5a0a25a2aa6c85e1bbf0f281d515b45018e190e
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschtypedef int (*client_command_func_t)(struct client *client);
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch unsigned int select_counter; /* increased when mailbox is changed */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch const char *cmd_tag; /* tag of command (allocated from parser pool), */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch const char *cmd_name; /* command name (allocated from parser pool) */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch unsigned int cmd_uid:1; /* used UID command */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch unsigned int input_skip_line:1; /* skip all the data until we've
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch found a new line */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Create new client with specified input/output handles. socket specifies
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch if the handle is a socket. */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschstruct client *client_create(int hin, int hout, struct mail_storage *storage);
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Disconnect client connection */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Send a line of data to client */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschvoid client_send_line(struct client *client, const char *data);
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Send line of data to client, prefixed with client->tag */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschvoid client_send_tagline(struct client *client, const char *data);
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Send BAD command error to client. msg can be NULL. */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschvoid client_send_command_error(struct client *client, const char *msg);
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Read a number of arguments. Returns TRUE if everything was read or
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch FALSE if either needs more data or error occured. */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschint client_read_args(struct client *client, unsigned int count,
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch/* Reads a number of string arguments. ... is a list of pointers where to
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Bosch store the arguments. */
56dd928c164ec5c0d1158a1760154b58c5f1f6e7Stephan Boschint client_read_string_args(struct client *client, unsigned int count, ...);