maildir-storage.h revision a3d22d3cb0e5436128ca7287cedc921f1789b2c8
#ifndef __MAILDIR_STORAGE_H
#define __MAILDIR_STORAGE_H
/* Hierarchy separator in Maildir++ filenames - shouldn't be changed */
#define MAILDIR_FS_SEP '.'
#define MAILDIR_FS_SEP_S "."
#define SUBSCRIPTION_FILE_NAME "subscriptions"
#define MAILDIR_INDEX_PREFIX "dovecot.index"
/* "base,S=123:2," means:
<base> [<extra sep> <extra data> [..]] <info sep> 2 <flags sep> */
#define MAILDIR_INFO_SEP ':'
#define MAILDIR_EXTRA_SEP ','
#define MAILDIR_FLAGS_SEP ','
#define MAILDIR_INFO_SEP_S ":"
#define MAILDIR_EXTRA_SEP_S ","
#define MAILDIR_FLAGS_SEP_S ","
/* ":2," is the standard flags separator */
#define MAILDIR_KEYWORD_FIRST 'a'
#define MAILDIR_KEYWORD_LAST 'z'
/* Maildir++ extension: include file size in the filename to avoid stat() */
#define MAILDIR_EXTRA_FILE_SIZE "S"
/* Something (can't remember what anymore) could use 'W' in filename to avoid
calculating file's virtual size (added missing CRs). */
#define MAILDIR_EXTRA_VIRTUAL_SIZE "W"
#include "index-storage.h"
#define STORAGE(maildir_storage) \
#define INDEX_STORAGE(maildir_storage) \
(&(maildir_storage)->storage)
struct timeval;
struct maildir_save_context;
struct maildir_copy_context;
struct maildir_storage {
struct index_storage storage;
const char *control_dir;
};
struct maildir_mailbox {
struct index_mailbox ibox;
struct maildir_storage *storage;
const char *path, *control_dir;
/* maildir sync: */
struct maildir_uidlist *uidlist;
struct maildir_keywords *keywords;
unsigned int private_flags_mask;
unsigned int syncing_commit:1;
};
struct maildir_transaction_context {
struct index_transaction_context ictx;
struct maildir_save_context *save_ctx;
struct maildir_copy_context *copy_ctx;
};
extern struct mail_vfuncs maildir_mail_vfuncs;
/* Return -1 = error, 0 = file not found, 1 = ok */
struct mailbox_list_context *
enum mailbox_list_flags flags);
struct mailbox_list *
struct mailbox_sync_context *
struct maildir_index_sync_context *
int partial);
struct mailbox_transaction_context *
enum mailbox_transaction_flags flags);
int maildir_transaction_commit(struct mailbox_transaction_context *t,
enum mailbox_sync_flags flags);
void maildir_transaction_rollback(struct mailbox_transaction_context *t);
struct mail_save_context *
int want_mail);
const char *fname,
enum mail_flags *flags_r,
unsigned int maildir_hash(const void *p);
#endif