mail-index-transaction-private.h revision 1279090ba03f9c176976a69ab7718f0ed77b19af
25757faf029c369a8318349dafe952e2358df1d8Timo SirainenARRAY_DEFINE_TYPE(seq_array_array, ARRAY_TYPE(seq_array));
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen /* mask is in bytes, not bits */
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen unsigned char *mask;
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen unsigned char *data;
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen int (*commit)(struct mail_index_transaction *t,
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen uint32_t *log_file_seq_r, uoff_t *log_file_offset_r);
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen void (*rollback)(struct mail_index_transaction *t);
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen /* NOTE: If you add anything new, remember to update
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen mail_index_transaction_reset() to reset it. */
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen ARRAY_DEFINE(appends, struct mail_index_record);
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen /* lowest/highest sequence that updates flags/keywords */
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen uint32_t min_flagupdate_seq, max_flagupdate_seq;
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainen ARRAY_DEFINE(updates, struct mail_transaction_flag_update);
1f1e81aab38d833d1c9cdc244c91fd762e0080d4Timo Sirainen unsigned char pre_hdr_change[sizeof(struct mail_index_header)];
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen unsigned char pre_hdr_mask[sizeof(struct mail_index_header)];
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen unsigned char post_hdr_change[sizeof(struct mail_index_header)];
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen unsigned char post_hdr_mask[sizeof(struct mail_index_header)];
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen struct mail_index_transaction_ext_hdr_update);
137ea7ca34005345aa2304a940149b7f3774d727Timo Sirainen ARRAY_DEFINE(ext_resizes, struct mail_transaction_ext_intro);
2521482f3f897c83f7d5a2f9e17fe99fa4ba2cbeTimo Sirainen ARRAY_DEFINE(ext_resets, struct mail_transaction_ext_reset);
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen struct mail_index_transaction_keyword_update);
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen struct mail_cache_transaction_ctx *cache_trans_ctx;
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen /* Module-specific contexts. */
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen union mail_index_transaction_module_context *);
ccfc6441cadb577084daeb1f0aa3dd7bdfa2a220Timo Sirainen /* non-extension updates. flag updates don't change this because
137ea7ca34005345aa2304a940149b7f3774d727Timo Sirainen they may be added and removed, so be sure to check that the updates
2521482f3f897c83f7d5a2f9e17fe99fa4ba2cbeTimo Sirainen array is non-empty also. */
2521482f3f897c83f7d5a2f9e17fe99fa4ba2cbeTimo Sirainen /* extension updates */
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen#define MAIL_INDEX_TRANSACTION_HAS_CHANGES(t) \
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen ((t)->log_updates || (t)->log_ext_updates || \
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainen (array_is_created(&(t)->updates) && array_count(&(t)->updates) > 0))
73e19ec2d5069ea125dcd1ede5d8a70f701fd9a8Timo Sirainenextern void (*hook_mail_index_transaction_created)
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainenmail_index_transaction_lookup(struct mail_index_transaction *t, uint32_t seq);
12aad74464367f7e8be11eafe1af985bf7b1adecTimo Sirainenvoid mail_index_transaction_ref(struct mail_index_transaction *t);
e9503210d3521a6833ed62dc332fc42ffb0e7a13Timo Sirainenvoid mail_index_transaction_unref(struct mail_index_transaction **t);
43a66a0b16299bd4f7615acd85e98bd3832c54d5Timo Sirainenvoid mail_index_transaction_sort_appends(struct mail_index_transaction *t);
e9503210d3521a6833ed62dc332fc42ffb0e7a13Timo Sirainenuint32_t mail_index_transaction_get_next_uid(struct mail_index_transaction *t);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenvoid mail_index_transaction_set_log_updates(struct mail_index_transaction *t);
e9503210d3521a6833ed62dc332fc42ffb0e7a13Timo Sirainenmail_index_transaction_get_flag_update_pos(struct mail_index_transaction *t,
e9503210d3521a6833ed62dc332fc42ffb0e7a13Timo Sirainenbool mail_index_seq_array_lookup(const ARRAY_TYPE(seq_array) *array,
08aea01ef9a9d20703e0fcf8618e6195c0037a44Timo Sirainenbool mail_index_seq_array_add(ARRAY_TYPE(seq_array) *array, uint32_t seq,
d5abbb932a0a598f002da39a8b3326643b1b5efcTimo Sirainenint mail_index_transaction_finish(struct mail_index_transaction *t);
d5abbb932a0a598f002da39a8b3326643b1b5efcTimo Sirainenvoid mail_index_transaction_export(struct mail_index_transaction *t,