maildir-storage.h revision 8a6fc472a12c5ec09e2bd19f1b3acd553d75ff91
#ifndef __MAILDIR_STORAGE_H
#define __MAILDIR_STORAGE_H
#define MAILDIR_STORAGE_NAME "maildir"
#define MAILDIR_SUBSCRIPTION_FILE_NAME "subscriptions"
#define MAILDIR_INDEX_PREFIX "dovecot.index"
#define MAILDIR_UNLINK_DIRNAME "DOVECOT-TRASHED"
/* "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'
/* How often to scan tmp/ directory for old files (based on dir's atime) */
/* Delete files having ctime older than this from tmp/. 36h is standard. */
#define MAILDIR_SAVE_FLAG_HARDLINK 0x10000000
#define MAILDIR_SAVE_FLAG_DELETED 0x20000000
#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 *temp_prefix;
unsigned int copy_with_hardlinks:1;
unsigned int copy_preserve_filename:1;
unsigned int save_size_in_filename:1;
unsigned int stat_dirs:1;
};
enum maildir_dirty_flags {
MAILDIR_DIRTY_NEW = 0x01,
MAILDIR_DIRTY_CUR = 0x02
};
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;
};
extern struct mail_vfuncs maildir_mail_vfuncs;
/* Return -1 = error, 0 = file not found, 1 = ok */
#ifdef CONTEXT_TYPE_SAFETY
#else
#endif
void maildir_transaction_created(struct mail_index_transaction *t);
void maildir_transaction_class_init(void);
void maildir_transaction_class_deinit(void);
struct maildir_save_context *
struct mail_keywords *keywords,
const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
unsigned int maildir_hash(const void *p);
#endif