diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/doveadm/doveadm-mail-iter.h | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/doveadm/doveadm-mail-iter.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/doveadm/doveadm-mail-iter.h b/src/doveadm/doveadm-mail-iter.h new file mode 100644 index 0000000..32cc232 --- /dev/null +++ b/src/doveadm/doveadm-mail-iter.h @@ -0,0 +1,34 @@ +#ifndef DOVEADM_MAIL_ITER_H +#define DOVEADM_MAIL_ITER_H + +#include "mailbox-list-iter.h" + +enum doveadm_mail_iter_flags { + /* Open the mailbox with MAILBOX_FLAG_READONLY */ + DOVEADM_MAIL_ITER_FLAG_READONLY = BIT(0), + /* Stop the iteration if client is detected to be disconnected. */ + DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT = BIT(1), +}; + +struct doveadm_mail_iter; +struct doveadm_mail_cmd_context; + +int doveadm_mail_iter_init(struct doveadm_mail_cmd_context *ctx, + const struct mailbox_info *info, + struct mail_search_args *search_args, + enum mail_fetch_field wanted_fields, + const char *const *wanted_headers, + enum doveadm_mail_iter_flags flags, + struct doveadm_mail_iter **iter_r) ATTR_NULL(6); +int doveadm_mail_iter_deinit(struct doveadm_mail_iter **iter); +int doveadm_mail_iter_deinit_sync(struct doveadm_mail_iter **iter); +int doveadm_mail_iter_deinit_keep_box(struct doveadm_mail_iter **iter, + struct mailbox **box_r); +void doveadm_mail_iter_deinit_rollback(struct doveadm_mail_iter **iter); +struct mailbox *doveadm_mail_iter_get_mailbox(struct doveadm_mail_iter *iter); + +bool doveadm_mail_iter_next(struct doveadm_mail_iter *iter, + struct mail **mail_r); + +#endif + |