mail-transaction-log-view.c revision 1cf72a848805fcf014b01c9d3665b6a157846a21
2454dfa32c93c20a8522c6ed42fe057baaac9f9aStephan Bosch/* Copyright (C) 2003-2004 Timo Sirainen */
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen /* a list of log files we've referenced. we have to keep this list
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen explicitly because more files may be added into the linked list
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen at any time. */
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen ARRAY_DEFINE(file_refs, struct mail_transaction_log_file *);
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen struct mail_transaction_log_file *cur, *head, *tail;
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainenmail_transaction_log_view_open(struct mail_transaction_log *log)
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen view = i_new(struct mail_transaction_log_view, 1);
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen array_append(&view->file_refs, &view->head, 1);
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainenmail_transaction_log_view_unref_all(struct mail_transaction_log_view *view)
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen struct mail_transaction_log_file *const *files;
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen unsigned int i, count;
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen for (i = 0; i < count; i++)
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainenvoid mail_transaction_log_view_close(struct mail_transaction_log_view **_view)
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen struct mail_transaction_log_view *view = *_view;
ed1e909434714837f583c9d180c2a16a1c2675c2Timo Sirainen for (p = &view->log->views; *p != NULL; p = &(*p)->next) {
int ret;
if (min_file_seq == 0) {
min_file_offset = 0;
if (max_file_seq == 0) {
min_file_offset = 0;
if (ret <= 0)
return ret;
if (min_file_offset == 0) {
if (ret <= 0) {
if (ret < 0)
if (ret <= 0)
return ret;
return TRUE;
return last;
const char *fmt, ...)
t_push();
t_pop();
const void *data)
return FALSE;
if (rec_size == 0) {
return FALSE;
t_push();
switch (rec_type) {
case MAIL_TRANSACTION_APPEND:
case MAIL_TRANSACTION_EXPUNGE:
sizeof(struct mail_transaction_expunge));
sizeof(struct mail_transaction_flag_update));
case MAIL_TRANSACTION_KEYWORD_UPDATE: {
unsigned int seqset_offset;
sizeof(struct mail_transaction_keyword_reset));
count = 0;
} else if (count == 0) {
rec_type);
t_pop();
return ret;
const void **data_r)
const void *data;
const void **data_r)
const void *data;
int ret = 0;
if (ret <= 0) {
if (ret < 0)
return ret;