7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#ifndef DSYNC_MAILBOX_STATE_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#define DSYNC_MAILBOX_STATE_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#include "guid.h"
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenstruct dsync_mailbox_state {
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen guid_128_t mailbox_guid;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint32_t last_uidvalidity;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint32_t last_common_uid;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint64_t last_common_modseq;
6abf66a3731d52889517bd644595c540e3a9b3ecTimo Sirainen uint64_t last_common_pvt_modseq;
7d315281ae13a66e13da2b1ad006bdb883018278Timo Sirainen uint32_t last_messages_count;
34421746925a2e1850549fa0fa07ddeeb1a271e2Timo Sirainen bool changes_during_sync;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen};
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo SirainenARRAY_DEFINE_TYPE(dsync_mailbox_state, struct dsync_mailbox_state);
c307328f59c963eba21091ecd36c9435d42b47d8Timo SirainenHASH_TABLE_DEFINE_TYPE(dsync_mailbox_state, uint8_t *, struct dsync_mailbox_state *);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
c307328f59c963eba21091ecd36c9435d42b47d8Timo Sirainenvoid dsync_mailbox_states_export(const HASH_TABLE_TYPE(dsync_mailbox_state) states,
c307328f59c963eba21091ecd36c9435d42b47d8Timo Sirainen string_t *output);
c307328f59c963eba21091ecd36c9435d42b47d8Timo Sirainenint dsync_mailbox_states_import(HASH_TABLE_TYPE(dsync_mailbox_state) states,
c307328f59c963eba21091ecd36c9435d42b47d8Timo Sirainen pool_t pool, const char *input,
c307328f59c963eba21091ecd36c9435d42b47d8Timo Sirainen const char **error_r);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#endif