#ifndef MAILBOX_LIST_INDEX_H
#define MAILBOX_LIST_INDEX_H
/* Mailbox list index basically contains:
Header contains ID => name mapping. The name isn't the full mailbox name,
but rather each hierarchy level has its own ID and name. For example a
"foo" and "bar" names.
The records contain { parent_uid, uid, name_id } field that can be used to
build the whole mailbox tree. parent_uid=0 means root, otherwise it's the
parent node's uid.
Each record also contains GUID for each selectable mailbox. If a mailbox
is recreated using the same name, its GUID also changes. Note however that
the UID doesn't change, because the UID refers to the mailbox name, not to
the mailbox itself.
The records may contain also extensions for allowing mailbox_get_status()
to return values directly from the mailbox list index. Storage backends
may also add their own extensions to figure out if a record is up to date.
*/
#include "module-context.h"
#include "mail-types.h"
#include "mail-storage.h"
#include "mailbox-list-private.h"
struct mail_index_view;
struct mailbox_index_vsize;
struct mailbox_vfuncs;
/* stored in mail_index_record.flags: */
enum mailbox_list_index_flags {
/* set during syncing for mailboxes that still exist */
};
struct mailbox_list_index_header {
/* array of { uint32_t id; char name[]; } */
};
struct mailbox_list_index_record {
/* points to given id in header */
/* parent mailbox's UID, 0 = root */
/* the following fields are temporarily zero while unknown,
also permanently zero for \NoSelect and \Nonexistent mailboxes: */
};
struct mailbox_list_index_msgs_record {
};
struct mailbox_list_index_node {
/* extension data is corrupted on disk - need to update it */
bool corrupted_ext;
/* flags are corrupted on disk - need to update it */
bool corrupted_flags;
const char *name;
};
struct mailbox_list_index {
const char *path;
/* uin32_t id => name */
/* uint32_t uid => node */
};
struct mailbox_list_index_iterate_context {
};
struct mailbox_list_index_node *
struct mailbox_list_index_node *
struct mailbox_list_index_node *node);
struct mail_index_view *view);
/* Refresh the index, but only if it hasn't been refreshed "recently"
(= within this same ioloop run) */
/* Refresh the index regardless of when the last refresh was done. */
struct mailbox_list_index_node *
const char *name);
struct mailbox_list_iterate_context *
const char *const *patterns,
enum mailbox_list_iter_flags flags);
const struct mailbox_info *
struct mail_index_view *view,
struct mailbox_status *status_r,
struct mailbox_index_vsize *vsize_r);
enum mailbox_info_flags *flags);
const struct mailbox_update *update);
struct mailbox_list_notify **notify_r);
const struct mailbox_list_notify_rec **rec_r);
void *context);
void mailbox_list_index_status_init_mailbox(struct mailbox_vfuncs *v);
struct mailbox_vfuncs *v);
enum mailbox_sync_flags flags);
#endif