mailbox-list-index-status.c revision 9afe1b3ac43a1f0b4ed8c6b2c369e76957228867
/* Copyright (c) 2006-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-index-modseq.h"
#include "mail-storage-private.h"
#include "mailbox-list-index.h"
#define INDEX_LIST_STORAGE_CONTEXT(obj) \
#define CACHED_STATUS_ITEMS \
struct index_list_mailbox {
union mailbox_module_context module_ctx;
};
static int
{
struct mailbox_list_index_node *node;
struct mail_index_view *view;
int ret;
return -1;
/* mailbox not found */
return 0;
}
/* our in-memory tree is out of sync */
ret = 1;
} else T_BEGIN {
} T_END;
if (ret != 0) {
/* error / mailbox has changed. we'll need to sync it. */
return ret < 0 ? -1 : 0;
}
return 1;
}
static bool
struct mailbox_status *status_r,
{
const void *data;
bool expunged;
const struct mailbox_list_index_record *rec;
else {
}
}
STATUS_RECENT | STATUS_UIDNEXT)) != 0) {
const struct mailbox_list_index_msgs_record *rec;
else {
}
}
if ((items & STATUS_HIGHESTMODSEQ) != 0) {
else
}
return ret;
}
static int
enum mailbox_status_items items,
struct mailbox_status *status_r)
{
struct mail_index_view *view;
int ret;
if (ret <= 0)
return ret;
return ret;
}
static int
struct mailbox_status *status_r)
{
return 0;
/* nonsynced / error, fallback to doing it the slow way */
}
}
static int
{
struct mail_index_transaction *trans;
struct mailbox_metadata metadata;
struct mailbox_status old_status;
/* update highest-modseq only if they're ever been used */
old_status.highest_modseq != 0) {
} else {
const void *data;
bool expunged;
}
if (hmodseq_changed &&
return 0;
if (rec_changed) {
struct mailbox_list_index_record rec;
const void *old_data;
bool expunged;
}
if (msgs_changed) {
struct mailbox_list_index_msgs_record msgs;
}
if (hmodseq_changed) {
}
}
static void
{
struct mailbox_list_index_node *node;
const struct mail_index_header *hdr;
struct mail_index_view *list_view;
struct mailbox_status status;
return;
}
else {
/* get STATUS info using the given view, rather than
using whatever state the mailbox is currently in */
else
if (status.highest_modseq == 0) {
/* modseqs not enabled yet, but we can't return 0 */
}
}
}
struct mailbox_sync_status *status_r)
{
return -1;
return 0;
}
static int
struct mail_transaction_commit_changes *changes_r)
{
struct mail_index_view *view;
return -1;
t = NULL;
return 0;
}
enum mailbox_info_flags *flags)
{
struct mail_index_view *view;
struct mailbox_status status;
int ret;
/* our in-memory tree is out of sync */
ret = 0;
} else T_BEGIN {
} T_END;
if (ret != 0) {
/* error / not up to date. don't waste time with it. */
return;
}
*flags |= MAILBOX_MARKED;
else
*flags |= MAILBOX_UNMARKED;
}
{
struct index_list_mailbox *ibox;
return;
}
{
sizeof(struct mailbox_list_index_msgs_record),
sizeof(uint32_t));
}
static struct mail_storage_hooks mailbox_list_index_status_hooks = {
};
void mailbox_list_index_status_init(void)
{
}