dsync-transaction-log-scan.h revision 7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#ifndef DSYNC_TRANSACTION_LOG_SCAN_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen#define DSYNC_TRANSACTION_LOG_SCAN_H
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo 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);
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainenstruct hash_table *
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo 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