5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#ifndef IMAP_MASTER_CONNECTION_H
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#define IMAP_MASTER_CONNECTION_H
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenstruct imap_master_connection;
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainentypedef void
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenimap_master_connection_send_callback_t(void *context, struct ostream *output);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainentypedef void
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenimap_master_connection_read_callback_t(void *context, const char *reply);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
17062405030a3fa095e43d5b8b71afc5536f0a22Timo Sirainen/* Returns 1 = success, 0 = retry later, -1 = error */
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenint imap_master_connection_init(const char *path,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen imap_master_connection_send_callback_t *send_callback,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen imap_master_connection_read_callback_t *read_callback,
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen void *context,
17062405030a3fa095e43d5b8b71afc5536f0a22Timo Sirainen struct imap_master_connection **conn_r,
17062405030a3fa095e43d5b8b71afc5536f0a22Timo Sirainen const char **error_r);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid imap_master_connection_deinit(struct imap_master_connection **conn);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid imap_master_connections_init(void);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainenvoid imap_master_connections_deinit(void);
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen
5ef28f68edef46f69961b19b7c1dcd8ec5a955e8Timo Sirainen#endif