mail-transaction-log-view.c revision 7471f28b16b81f9af413c879b3efb16eeafd2bd9
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch/* Copyright (c) 2003-2010 Dovecot authors, see the included COPYING file */
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschmail_transaction_log_view_open(struct mail_transaction_log *log)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch view = i_new(struct mail_transaction_log_view, 1);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch array_append(&view->file_refs, &view->head, 1);
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschmail_transaction_log_view_unref_all(struct mail_transaction_log_view *view)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch struct mail_transaction_log_file *const *files;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch unsigned int i, count;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (i = 0; i < count; i++)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschvoid mail_transaction_log_view_close(struct mail_transaction_log_view **_view)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch struct mail_transaction_log_view *view = *_view;
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (p = &view->log->views; *p != NULL; p = &(*p)->next) {
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschvoid mail_transaction_log_views_close(struct mail_transaction_log *log)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch for (view = log->views; view != NULL; view = view->next)
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Boschint mail_transaction_log_view_set(struct mail_transaction_log_view *view,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch uint32_t min_file_seq, uoff_t min_file_offset,
6ae6496c225238a2c55a8cd96744ad976c44a726Stephan Bosch uint32_t max_file_seq, uoff_t max_file_offset,
bool *reset_r)
int ret;
if (min_file_seq == 0) {
min_file_offset = 0;
if (max_file_seq == 0) {
min_file_offset = 0;
if (ret <= 0) {
if (ret < 0)
if (min_file_offset == 0) {
if (ret <= 0)
return ret;
&file) > 0) {
return TRUE;
return last;
const char *fmt, ...)
T_BEGIN {
} T_END;
return FALSE;
} else if (count == 0) {
return FALSE;
return FALSE;
return FALSE;
return TRUE;
const void *data)
return FALSE;
return FALSE;
if (rec_size == 0) {
return FALSE;
switch (rec_type) {
case MAIL_TRANSACTION_APPEND:
return FALSE;
case MAIL_TRANSACTION_EXPUNGE:
sizeof(struct mail_transaction_expunge));
return FALSE;
sizeof(struct mail_transaction_flag_update));
case MAIL_TRANSACTION_KEYWORD_UPDATE: {
unsigned int seqset_offset;
return FALSE;
sizeof(struct mail_transaction_keyword_reset));
return FALSE;
return TRUE;
const void **data_r)
const void *data;
int ret;
T_BEGIN {
} T_END;
if (ret > 0) {
return ret;
const void **data_r)
const void *data;
int ret = 0;
if (ret <= 0) {
if (ret < 0)
return ret;