mail-index-sync-private.h revision 91d4c7b37580b031ed7b0154ae10c643521803f3
970N/A#ifndef __MAIL_INDEX_SYNC_PRIVATE_H
970N/A#define __MAIL_INDEX_SYNC_PRIVATE_H
970N/A
970N/A#include "mail-transaction-log.h"
1072N/A
970N/Astruct uid_range {
970N/A uint32_t uid1, uid2;
970N/A};
970N/AARRAY_DEFINE_TYPE(uid_range, struct uid_range);
970N/A
970N/Astruct mail_index_sync_list {
970N/A const ARRAY_TYPE(uid_range) *array;
970N/A unsigned int idx;
970N/A unsigned int keyword_idx:31;
970N/A unsigned int keyword_remove:1;
970N/A};
970N/A
970N/Astruct mail_index_expunge_handler {
970N/A mail_index_expunge_handler_t *handler;
970N/A void *context;
970N/A void **sync_context;
970N/A uint32_t record_offset;
970N/A};
970N/A
970N/Astruct mail_index_sync_map_ctx {
970N/A struct mail_index_view *view;
970N/A uint32_t cur_ext_id;
970N/A
970N/A uint32_t ext_intro_seq;
970N/A uoff_t ext_intro_offset, ext_intro_end_offset;
970N/A
970N/A ARRAY_DEFINE(expunge_handlers, struct mail_index_expunge_handler);
970N/A ARRAY_DEFINE(extra_contexts, void *);
970N/A buffer_t *unknown_extensions;
970N/A
970N/A enum mail_index_sync_handler_type type;
970N/A
970N/A unsigned int sync_handlers_initialized:1;
970N/A unsigned int expunge_handlers_set:1;
970N/A unsigned int expunge_handlers_used:1;
970N/A unsigned int cur_ext_ignore:1;
970N/A unsigned int errors:1;
970N/A};
1105N/A
970N/Aextern struct mail_transaction_map_functions mail_index_map_sync_funcs;
970N/A
970N/Avoid mail_index_sync_map_init(struct mail_index_sync_map_ctx *sync_map_ctx,
970N/A struct mail_index_view *view,
970N/A enum mail_index_sync_handler_type type);
970N/Avoid mail_index_sync_map_deinit(struct mail_index_sync_map_ctx *sync_map_ctx);
970N/Aint mail_index_sync_map(struct mail_index_map **map,
970N/A enum mail_index_sync_handler_type type, bool force);
970N/A
970N/Aint mail_index_sync_record(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_header *hdr,
970N/A const void *data);
970N/A
970N/Astruct mail_index_map *
970N/Amail_index_sync_get_atomic_map(struct mail_index_sync_map_ctx *ctx);
970N/Avoid mail_index_sync_write_seq_update(struct mail_index_sync_map_ctx *ctx,
970N/A uint32_t seq1, uint32_t seq2);
970N/A
970N/Avoid mail_index_sync_init_expunge_handlers(struct mail_index_sync_map_ctx *ctx);
970N/Avoid
970N/Amail_index_sync_deinit_expunge_handlers(struct mail_index_sync_map_ctx *ctx);
970N/Avoid mail_index_sync_init_handlers(struct mail_index_sync_map_ctx *ctx);
970N/Avoid mail_index_sync_deinit_handlers(struct mail_index_sync_map_ctx *ctx);
970N/A
970N/Aint mail_index_sync_ext_intro(struct mail_index_sync_map_ctx *ctx,
1130N/A const struct mail_transaction_ext_intro *u);
970N/Aint mail_index_sync_ext_reset(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_ext_reset *u);
970N/Aint
970N/Amail_index_sync_ext_hdr_update(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_ext_hdr_update *u);
970N/Aint
970N/Amail_index_sync_ext_rec_update(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_ext_rec_update *u);
970N/A
970N/Aint mail_index_sync_keywords(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_header *hdr,
970N/A const struct mail_transaction_keyword_update *rec);
970N/Aint
970N/Amail_index_sync_keywords_reset(struct mail_index_sync_map_ctx *ctx,
970N/A const struct mail_transaction_header *hdr,
970N/A const struct mail_transaction_keyword_reset *r);
970N/A
970N/Avoid mail_index_sync_set_corrupted(struct mail_index_sync_map_ctx *ctx,
970N/A const char *fmt, ...) __attr_format__(2, 3);
970N/A
970N/A#ifdef DEBUG
970N/Avoid mail_index_map_check(struct mail_index_map *map);
970N/A#endif
970N/A
970N/A#endif
970N/A