imap-fetch.h revision 88ea893b45d3ed8d68000921db9156c03cbe1b00
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen/* Returns 1 = ok, 0 = client output buffer full, call again, -1 = error.
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen mail = NULL for deinit. */
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainentypedef int imap_fetch_handler_t(struct imap_fetch_context *ctx,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen /* Returns FALSE if arg is invalid. */
1d738cce754bc64bbc66d3355ebdaf3f6eac55f1Timo Sirainen int (*init)(struct imap_fetch_context *ctx, const char *name,
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen struct mailbox_header_lookup_ctx *all_headers_ctx;
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainen array_t ARRAY_DEFINE(handlers, struct imap_fetch_context_handler);
e925f007930955f10fa8728509a44f7a53d2b13eTimo Sirainen int (*cont_handler)(struct imap_fetch_context *ctx);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenvoid imap_fetch_handlers_register(const struct imap_fetch_handler *handlers,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenvoid imap_fetch_add_handler(struct imap_fetch_context *ctx, int buffered,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainen imap_fetch_handler_t *handler, void *context);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenstruct imap_fetch_context *imap_fetch_init(struct client_command_context *cmd);
90c23747727c85f80e4e8eed7968f0edbeac7ac5Timo Sirainenint imap_fetch_deinit(struct imap_fetch_context *ctx);
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenint imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name,
eddd9bf1a1369aea4a2715f6be1137da6d17d293Timo Sirainenvoid imap_fetch_begin(struct imap_fetch_context *ctx,
b397665e90fa0fc7c6a9156fdd6cf28b571e8e39Timo Sirainenint imap_fetch(struct imap_fetch_context *ctx);
b397665e90fa0fc7c6a9156fdd6cf28b571e8e39Timo Sirainenint fetch_body_section_init(struct imap_fetch_context *ctx, const char *name,
4bc96ba6f1d67a90a75fa131bcd2cd508ea5a05aTimo Sirainenint fetch_rfc822_init(struct imap_fetch_context *ctx, const char *name,