view src/lib-storage/index/dbox-common/dbox-sync-rebuild.h @ 14682:d0d7b810646b

Make sure we check all the functions' return values. Minor API changes to simplify this. Checked using a patched clang that adds attribute(warn_unused_result) to all functions. This commit fixes several error handling mistakes.
author Timo Sirainen <tss@iki.fi>
date Mon, 25 Jun 2012 01:14:03 +0300
parents 159605040ec0
children 89c319980584
line wrap: on
line source

#ifndef DBOX_SYNC_REBUILD_H
#define DBOX_SYNC_REBUILD_H

struct mailbox_list;

struct dbox_sync_rebuild_context {
	struct mailbox *box;

	struct mail_index_view *view;
	struct mail_index_transaction *trans;
	uint32_t cache_ext_id;
	uint32_t cache_reset_id;

	struct mail_index *backup_index;
	struct mail_index_view *backup_view;

	unsigned int cache_used:1;
};

struct dbox_sync_rebuild_context *
dbox_sync_index_rebuild_init(struct mailbox *box,
			     struct mail_index_view *view,
			     struct mail_index_transaction *trans);
void dbox_sync_index_rebuild_deinit(struct dbox_sync_rebuild_context **ctx);

void dbox_sync_rebuild_index_metadata(struct dbox_sync_rebuild_context *ctx,
				      uint32_t new_seq, uint32_t uid);
int dbox_sync_rebuild_verify_alt_storage(struct mailbox_list *list);

#endif