index-storage.h revision cc977f55ce66b63e8b37c20fce58d0ef516f0f29
#ifndef INDEX_STORAGE_H
#define INDEX_STORAGE_H
#include "file-dotlock.h"
#include "mail-storage-private.h"
#include "mail-index-private.h"
/* Max. mmap()ed size for a message */
/* Block size when read()ing message. */
#define MAILBOX_FULL_SYNC_INTERVAL 5
enum mailbox_lock_notify_type {
/* Mailbox is locked, will abort in secs_left */
/* Mailbox lock looks stale, will override in secs_left */
};
struct index_mailbox {
struct mail_storage *storage;
enum mailbox_open_flags open_flags;
struct mail_index *index;
struct mail_index_view *view;
struct mail_cache *cache;
struct mail_vfuncs *mail_vfuncs;
struct index_notify_file *notify_files;
struct index_notify_io *notify_ios;
struct mail_cache_field *cache_fields;
unsigned int mail_cache_min_mail_count;
unsigned int readonly:1;
unsigned int keep_recent:1;
unsigned int keep_locked:1;
unsigned int sent_diskspace_warning:1;
unsigned int sent_readonly_flags_warning:1;
unsigned int notify_pending:1;
unsigned int move_to_memory:1;
unsigned int fsync_disable:1;
};
struct index_transaction_context {
struct mail_index_transaction_vfuncs super;
struct index_mailbox *ibox;
int mail_ref_count;
struct mail_index_transaction *trans;
struct mail_index_view *trans_view;
struct mail_cache_view *cache_view;
struct mail_cache_transaction_ctx *cache_trans;
unsigned int cache_trans_failed:1;
};
unsigned int secs_left);
struct mail_index *
void index_storage_destroy_unrefed(void);
enum mailbox_open_flags flags,
bool move_to_memory);
struct mail_index_view *view,
const char *path);
enum mailbox_sync_flags flags);
struct mailbox_sync_context *
bool failed);
struct mailbox_sync_rec *sync_rec_r);
struct mailbox_status *status_r);
enum mailbox_status_items items,
struct mailbox_status *status_r);
struct mailbox_header_lookup_ctx *
struct mail_search_context *
const enum mail_sort_type *sort_program);
void index_transaction_init(struct index_transaction_context *t,
struct index_mailbox *ibox);
int index_transaction_finish_commit(struct index_transaction_context *t,
void index_transaction_finish_rollback(struct index_transaction_context *t);
struct mailbox_transaction_context *
enum mailbox_transaction_flags flags);
int index_transaction_commit(struct mailbox_transaction_context *t,
void index_transaction_rollback(struct mailbox_transaction_context *t);
#endif