mailbox-list-index-sync.c revision 167da29da7384c29a8a786e6ab5389d3e57f2224
/* Copyright (c) 2006-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "hash.h"
#include "mail-index.h"
#include "mailbox-list-index.h"
struct mailbox_list_index_sync_context {
struct mailbox_list_index *ilist;
char sep[2];
struct mail_index_sync_ctx *sync_ctx;
struct mail_index_view *view;
struct mail_index_transaction *trans;
};
static void
{
struct mailbox_list_index_record irec;
}
static struct mailbox_list_index_node *
struct mailbox_list_index_node *parent,
{
struct mailbox_list_index_node *node;
char *dup_name;
struct mailbox_list_index_node, 1);
/* we don't bother doing name deduplication here, even though it would
be possible. */
} else {
}
return node;
}
static uint32_t
const char *name,
{
unsigned int i;
/* find the last node that exists in the path */
break;
}
/* the entire path exists */
} else {
/* create missing parts of the path */
&seq);
}
}
return seq;
}
static void
const struct mailbox_list_index_node *node)
{
}
}
}
{
}
static void
{
const void *ext_data;
const char *name;
/* get all existing name IDs sorted */
/* add existing names to header (with deduplication) */
POINTER_CAST(*id_p));
}
}
/* make sure header size is ok in index and update it */
sizeof(struct mailbox_list_index_record),
sizeof(uint32_t));
}
}
static void
{
}
}
static void
struct mailbox_list_index_node *node)
{
struct mailbox_list_index_node **prev;
}
static void
struct mailbox_list_index_node *node)
{
&seq))
}
}
}
{
struct mailbox_list_iterate_context *iter;
const struct mail_index_header *hdr;
const struct mailbox_info *info;
const char *patterns[2];
return -1;
}
/* re-parse mailbox list now that it's refreshed and locked */
return -1;
}
if (hdr->uid_validity == 0) {
/* first time indexing, set uidvalidity */
}
/* clear EXISTS-flags, so after sync we know what can be expunged */
flags = 0;
T_BEGIN {
const char *name =
} T_END;
}
return -1;
}
/* new names added. this implicitly resets refresh flag */
T_BEGIN {
} T_END;
} else {
/* we're synced, reset refresh flag */
struct mailbox_list_index_header new_hdr;
new_hdr.refresh_flag = 0;
}
return -1;
}
return 0;
}