mail-index-transaction-private.h revision 082e82792b8ac33ad42beac510441b37a3c50737
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub HrozekARRAY_DEFINE_TYPE(seq_array_array, ARRAY_TYPE(seq_array));
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek /* mask is in bytes, not bits */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek unsigned char *mask;
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek unsigned char *data;
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek void (*reset)(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek int (*commit)(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct mail_index_transaction_commit_result *result_r);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek void (*rollback)(struct mail_index_transaction *t);
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek /* NOTE: If you add anything new, remember to update
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozek mail_index_transaction_reset_v() to reset it. */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek /* lowest/highest sequence that updates flags/keywords */
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek uint32_t min_flagupdate_seq, max_flagupdate_seq;
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozek ARRAY(struct mail_transaction_modseq_update) modseq_updates;
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozek ARRAY(struct mail_transaction_expunge_guid) expunges;
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek unsigned char pre_hdr_change[sizeof(struct mail_index_header)];
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek unsigned char pre_hdr_mask[sizeof(struct mail_index_header)];
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek unsigned char post_hdr_change[sizeof(struct mail_index_header)];
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek unsigned char post_hdr_mask[sizeof(struct mail_index_header)];
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek ARRAY(struct mail_index_transaction_ext_hdr_update) ext_hdr_updates;
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek ARRAY(struct mail_transaction_ext_intro) ext_resizes;
e75a152157e054a2ed46acecbe8b5cfb9853773cJakub Hrozek ARRAY(struct mail_transaction_ext_reset) ext_resets;
f17d26a8db285622a5cd5f21c7488b62eedc2cf8Jakub Hrozek ARRAY(struct mail_index_transaction_keyword_update) keyword_updates;
2913240aee51ce81195148a4d814e967f66839c4Simo Sorce buffer_t *attribute_updates; /* [+-][ps]key\0.. */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek buffer_t *attribute_updates_suffix; /* <timestamp>[<value len>].. */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek /* Module-specific contexts. */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek ARRAY(union mail_index_transaction_module_context *) module_contexts;
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek /* non-extension updates. flag updates don't change this because
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek they may be added and removed, so be sure to check that the updates
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek array is non-empty also. */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek /* extension updates */
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek (array_is_created(&(t)->updates) && array_count(&(t)->updates) > 0) || \
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekextern void (*hook_mail_index_transaction_created)
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekmail_index_transaction_lookup(struct mail_index_transaction *t, uint32_t seq);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_ref(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_unref(struct mail_index_transaction **t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_reset_v(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_sort_appends(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_sort_expunges(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekuint32_t mail_index_transaction_get_next_uid(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_set_log_updates(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_update_day_headers(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekmail_index_transaction_get_flag_update_pos(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek unsigned int left_idx,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_lookup_latest_keywords(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekbool mail_index_cancel_flag_updates(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekbool mail_index_cancel_keyword_updates(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_finish(struct mail_index_transaction *t);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekvoid mail_index_transaction_export(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek struct mail_transaction_log_append_ctx *append_ctx);
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozekint mail_transaction_expunge_guid_cmp(const struct mail_transaction_expunge_guid *e1,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek const struct mail_transaction_expunge_guid *e2);
2913240aee51ce81195148a4d814e967f66839c4Simo Sorcemail_index_transaction_get_flag_update_pos(struct mail_index_transaction *t,
1f1e6cbc59868f06dee3ab4b3df660fcb77ce1c8Jakub Hrozek unsigned int left_idx,