client.h revision fb8e400512210d49339775747a520411987d4353
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleytypedef int client_command_func_t(struct client *client);
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley unsigned int select_counter; /* increased when mailbox is changed */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley const char *cmd_tag; /* tag of command (allocated from parser pool), */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley const char *cmd_name; /* command name (allocated from parser pool) */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley unsigned int input_skip_line:1; /* skip all the data until we've
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley found a new line */
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley/* Create new client with specified input/output handles. socket specifies
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley if the handle is a socket. */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleystruct client *client_create(int hin, int hout, struct mail_storage *storage);
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley/* Disconnect client connection */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleyvoid client_disconnect_with_error(struct client *client, const char *msg);
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley/* Send a line of data to client */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleyvoid client_send_line(struct client *client, const char *data);
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley/* Send line of data to client, prefixed with client->tag */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleyvoid client_send_tagline(struct client *client, const char *data);
28c155e20d3ebf53581821572c6c3fe1724582c9Yassir Elley/* Send BAD command error to client. msg can be NULL. */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleyvoid client_send_command_error(struct client *client, const char *msg);
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley/* Read a number of arguments. Returns TRUE if everything was read or
19d3aba12c70528708be9440aca66038a291f29eYassir Elley FALSE if either needs more data or error occured. */
19d3aba12c70528708be9440aca66038a291f29eYassir Elleyint client_read_args(struct client *client, unsigned int count,
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley/* Reads a number of string arguments. ... is a list of pointers where to
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elley store the arguments. */
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir Elleyint client_read_string_args(struct client *client, unsigned int count, ...);