mail-transaction-log.h revision 1175f27441385a7011629f295f42708f9a3a4ffc
#ifndef __MAIL_TRANSACTION_LOG_H
#define __MAIL_TRANSACTION_LOG_H
#define MAIL_TRANSACTION_LOG_PREFIX ".log"
struct mail_transaction_log_header {
};
enum mail_transaction_type {
MAIL_TRANSACTION_EXPUNGE = 0x00000001,
MAIL_TRANSACTION_APPEND = 0x00000002,
MAIL_TRANSACTION_FLAG_UPDATE = 0x00000004,
MAIL_TRANSACTION_CACHE_UPDATE = 0x00000008,
MAIL_TRANSACTION_HEADER_UPDATE = 0x00000010,
MAIL_TRANSACTION_EXTRA_REC_UPDATE = 0x00000020,
MAIL_TRANSACTION_TYPE_MASK = 0x0000ffff,
/* since we'll expunge mails based on data read from transaction log,
try to avoid the possibility of corrupted transaction log expunging
messages. this value is ORed to the actual MAIL_TRANSACTION_EXPUNGE
flag. if it's not present, assume corrupted log. */
MAIL_TRANSACTION_EXPUNGE_PROT = 0x0000cd90,
/* Mailbox synchronization noticed this change. */
MAIL_TRANSACTION_EXTERNAL = 0x10000000
};
struct mail_transaction_header {
};
struct mail_transaction_expunge {
};
struct mail_transaction_flag_update {
};
struct mail_transaction_cache_update {
};
struct mail_transaction_header_update {
};
struct mail_transaction_extra_rec_header {
};
struct mail_transaction_extra_rec_update {
};
struct mail_transaction_log *
struct mail_transaction_log_view *
/* Set view boundaries. Returns -1 if error, 0 if ok. */
int
enum mail_transaction_type type_mask);
/* Read next transaction record from current position. The position is updated.
Returns -1 if error, 0 if we're at end of the view, 1 if ok. */
const struct mail_transaction_header **hdr_r,
/* Returns the position of the record returned previously with
mail_transaction_log_view_next() */
void
/* Marks the log file in current position to be corrupted. */
void
const char *fmt, ...)
int
/* Write data to transaction log. This is atomic operation. Sequences in
updates[] and expunges[] are relative to given view, they're modified
to real ones. If nothing is written, log_file_seq_r and log_file_offset_r
will be set to 0. */
int mail_transaction_log_append(struct mail_index_transaction *t,
/* Lock transaction log for index synchronization. Log cannot be read or
written to while it's locked. Returns end offset. */
/* Returns the current head. Works only when log is locked. */
#endif