dsync-transaction-log-scan.h revision 08e9fec5ba9e1a26e658c4224207d666b6ced27d
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#ifndef DSYNC_TRANSACTION_LOG_SCAN_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#define DSYNC_TRANSACTION_LOG_SCAN_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
678d0463849ba777106eb7875f27db07a5d8e3dfTimo SirainenHASH_TABLE_DEFINE_TYPE(dsync_uid_mail_change,
a75d470c9223a75801418fcdda258885c36317e0Timo Sirainen void *, struct dsync_mail_change *);
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenstruct mail_index_view;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenstruct dsync_transaction_log_scan;
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenint dsync_transaction_log_scan_init(struct mail_index_view *view,
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint32_t highest_wanted_uid,
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint64_t modseq,
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen struct dsync_transaction_log_scan **scan_r);
08e9fec5ba9e1a26e658c4224207d666b6ced27dTimo SirainenHASH_TABLE_TYPE(dsync_uid_mail_change)
08e9fec5ba9e1a26e658c4224207d666b6ced27dTimo Sirainendsync_transaction_log_scan_get_hash(struct dsync_transaction_log_scan *scan);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen/* Returns TRUE if the entire transaction log was scanned */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenbool dsync_transaction_log_scan_has_all_changes(struct dsync_transaction_log_scan *scan);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen/* If the given UID has been expunged after the initial log scan, create/update
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen a change record for it and return it. */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenstruct dsync_mail_change *
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainendsync_transaction_log_scan_find_new_expunge(struct dsync_transaction_log_scan *scan,
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen uint32_t uid);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenvoid dsync_transaction_log_scan_deinit(struct dsync_transaction_log_scan **scan);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#endif