mailbox-list-private.h revision 266697d2af982a9e52573404a1dd9cf0898bf43c
#ifndef MAILBOX_LIST_PRIVATE_H
#define MAILBOX_LIST_PRIVATE_H
#include "mail-namespace.h"
#include "mailbox-list.h"
struct dirent;
struct imap_match_glob;
struct mailbox_tree_context;
struct mailbox_list_vfuncs {
struct mailbox_list *(*alloc)(void);
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). */
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r);
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;
struct mailbox_list_vfuncs v;
/* private: */
struct mail_namespace *ns;
struct mailbox_list_settings set;
enum mailbox_list_flags flags;
/* -1 if not set yet. use mailbox_list_get_permissions() to set them */
char *error_string;
enum mail_error error;
bool temporary_error;
};
struct mailbox_list_iterate_context {
struct mailbox_list *list;
enum mailbox_list_iter_flags flags;
bool failed;
};
/* 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,
const char **error_r);
const char *name);
struct mailbox_tree_context *tree_ctx,
bool match_parents, const char *name);
#endif