mailbox-list-private.h revision 5a0b68eeaf48cd1655057f36f19357146bf08e1d
#ifndef MAILBOX_LIST_PRIVATE_H
#define MAILBOX_LIST_PRIVATE_H
#include "mail-namespace.h"
#include "mailbox-list.h"
#include "mail-storage-settings.h"
#define MAILBOX_LIST_NAME_MAILDIRPLUSPLUS "maildir++"
#define MAILBOX_LIST_NAME_IMAPDIR "imapdir"
#define MAILBOX_LIST_NAME_FS "fs"
#define MAILBOX_LOG_FILE_NAME "dovecot.mailbox.log"
enum mailbox_log_record_type;
struct dirent;
struct imap_match_glob;
struct mailbox_tree_context;
struct mailbox_list_vfuncs {
struct mailbox_list *(*alloc)(void);
struct mail_storage **storage_r);
const char *pattern);
const char *name);
const char *name);
enum mailbox_list_path_type type);
const char *name,
enum mailbox_name_status *status);
struct mailbox_list_iterate_context *
const char *const *patterns,
enum mailbox_list_iter_flags flags);
const struct mailbox_info *
/* Returns -1 if error, 0 if it's not a valid mailbox, 1 if it is.
flags may be updated (especially the children flags). */
const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r);
bool rename_children);
/* called by rename_mailbox() just before running the actual rename() */
const char *oldname,
struct mailbox_list *newlist,
const char *newname);
};
struct mailbox_list_module_register {
unsigned int id;
};
union mailbox_list_module_context {
struct mailbox_list_vfuncs super;
struct mailbox_list_module_register *reg;
};
struct mailbox_list {
const char *name;
char hierarchy_sep;
enum mailbox_list_properties props;
struct mailbox_list_vfuncs v;
/* private: */
struct mail_namespace *ns;
struct mailbox_list_settings set;
const struct mail_storage_settings *mail_set;
enum mailbox_list_flags flags;
/* -1 if not set yet. use mailbox_list_get_permissions() to set them */
/* origin (e.g. path) where the file_create_gid was got from */
const char *file_create_gid_origin;
struct mailbox_log *changelog;
char *error_string;
enum mail_error error;
bool temporary_error;
unsigned int changelog_disabled:1;
};
struct mailbox_list_iterate_context {
struct mailbox_list *list;
enum mailbox_list_iter_flags flags;
bool failed;
};
struct mailbox_list_iter_update_context {
struct mailbox_list_iterate_context *iter_ctx;
struct mailbox_tree_context *tree_ctx;
struct imap_match_glob *glob;
unsigned int update_only:1;
unsigned int match_parents:1;
};
/* Modules should use do "my_id = mailbox_list_module_id++" and
use objects' module_contexts[id] for their own purposes. */
extern struct mailbox_list_module_register mailbox_list_module_register;
void mailbox_lists_init(void);
void mailbox_lists_deinit(void);
int mailbox_list_settings_parse(const char *data,
struct mailbox_list_settings *set,
struct mail_namespace *ns,
const char **error_r);
const char *name);
const char *name);
const char **name);
enum mailbox_log_record_type type,
#endif