#ifndef MAIL_TRANSACTION_LOG_VIEW_H
#define MAIL_TRANSACTION_LOG_VIEW_H
#include "buffer.h"
#include "mail-transaction-log.h"
struct dotlock_settings;
/* Synchronization can take a while sometimes, especially when copying lots of
mails. */
struct modseq_cache {
};
struct mail_transaction_log_file {
/* refcount=0 is a valid state. files start that way, and they're
freed only when mail_transaction_logs_clean() is called. */
int refcount;
char *filepath;
int fd;
void *mmap_base;
/* points to the next uncommitted transaction. usually same as EOF. */
/* highest modseq at sync_offset */
/* saved_tail_offset is the offset that was last written to transaction
log. max_tail_offset is what should be written to the log the next
time a transaction is written. transaction log handling may update
max_tail_offset automatically by making it skip external transactions
after the last saved offset (to avoid re-reading them needlessly). */
/* don't give warnings about saved_tail_offset shrinking if
sync_offset is less than this. */
/* if we've seen _INDEX_[UN9DELETED transaction in this file,
this is the offset. otherwise (uoff_t)-1 */
};
struct mail_transaction_log {
/* files is a linked list of all the opened log files. the list is
sorted by the log file sequence, so that transaction views can use
them easily. head contains a pointer to the newest log file. */
/* open_file is used temporarily while opening the log file.
if _open() failed, it's left there for _create(). */
unsigned int dotlock_count;
};
void
const char *fmt, ...)
struct dotlock_settings *set_r);
struct mail_transaction_log_file *
struct mail_transaction_log_file *
const char *path);
/* Returns 1 if log was opened, 0 if it didn't exist or was already open,
-1 if error. */
const char **reason_r);
bool reset);
struct mail_transaction_log_file **file_r,
const char **reason_r);
/* Returns 1 if ok, 0 if file is corrupted or offset range is invalid,
-1 if I/O error */
const char **reason_r);
const char *lock_reason);
const char *lock_reason);
unsigned int version);
struct mail_transaction_log_file *file,
const char **error_r);
struct mail_transaction_log_file *file,
#endif