summaryrefslogtreecommitdiffstats
path: root/src/lib-storage/mailbox-search-result-private.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib-storage/mailbox-search-result-private.h
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib-storage/mailbox-search-result-private.h')
-rw-r--r--src/lib-storage/mailbox-search-result-private.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib-storage/mailbox-search-result-private.h b/src/lib-storage/mailbox-search-result-private.h
new file mode 100644
index 0000000..983ac3c
--- /dev/null
+++ b/src/lib-storage/mailbox-search-result-private.h
@@ -0,0 +1,41 @@
+#ifndef MAILBOX_SEARCH_RESULT_PRIVATE_H
+#define MAILBOX_SEARCH_RESULT_PRIVATE_H
+
+#include "mail-storage.h"
+
+struct mail_search_result {
+ struct mailbox *box;
+ enum mailbox_search_result_flags flags;
+ struct mail_search_args *search_args;
+
+ /* UIDs of messages currently in the result */
+ ARRAY_TYPE(seq_range) uids;
+ /* UIDs of messages that will never match the result */
+ ARRAY_TYPE(seq_range) never_uids;
+ ARRAY_TYPE(seq_range) removed_uids, added_uids;
+
+ bool args_have_flags:1;
+ bool args_have_keywords:1;
+ bool args_have_modseq:1;
+};
+
+struct mail_search_result *
+mailbox_search_result_alloc(struct mailbox *box, struct mail_search_args *args,
+ enum mailbox_search_result_flags flags);
+
+/* called when initial search is done. */
+void mailbox_search_result_initial_done(struct mail_search_result *result);
+void mailbox_search_results_initial_done(struct mail_search_context *ctx);
+
+void mailbox_search_result_add(struct mail_search_result *result, uint32_t uid);
+void mailbox_search_result_remove(struct mail_search_result *result,
+ uint32_t uid);
+void mailbox_search_results_add(struct mail_search_context *ctx, uint32_t uid);
+void mailbox_search_results_remove(struct mailbox *box, uint32_t uid);
+
+void mailbox_search_result_never(struct mail_search_result *result,
+ uint32_t uid);
+void mailbox_search_results_never(struct mail_search_context *ctx,
+ uint32_t uid);
+
+#endif