mdbox-storage.c revision e5fd6dfd0a492e4708d4dbb7971d7fc5d7b8fd85
/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mkdir-parents.h"
#include "mail-index-modseq.h"
#include "mail-index-alloc-cache.h"
#include "mailbox-log.h"
#include "dbox-mail.h"
#include "dbox-save.h"
#include "mdbox-map.h"
#include "mdbox-file.h"
#include "mdbox-sync.h"
#include "mdbox-storage-rebuild.h"
#include "mdbox-storage.h"
#define MDBOX_LIST_CONTEXT(obj) \
struct mdbox_mailbox_list {
};
extern struct mail_storage mdbox_storage;
extern struct mailbox mdbox_mailbox;
extern struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs;
static struct mail_storage *mdbox_storage_alloc(void)
{
struct mdbox_storage *storage;
}
static int
const char **error_r)
{
const char *dir;
*error_r = "dbox: MAILBOXDIR must not be empty";
return -1;
}
return 0;
}
{
if (mdbox_storage_rebuild(storage) < 0)
return;
}
}
struct mailbox *
{
struct mdbox_mailbox *mbox;
struct index_mailbox_context *ibox;
/* dbox can't work without index files */
sizeof(struct mdbox_mail_index_record),
sizeof(uint32_t));
mbox->hdr_ext_id =
sizeof(struct mdbox_index_header), 0, 0);
mbox->guid_ext_id =
0, MAIL_GUID_128_SIZE, 1);
}
struct mdbox_index_header *hdr)
{
const void *data;
if (data_size < MDBOX_INDEX_HEADER_MIN_SIZE &&
"dbox %s: Invalid dbox header size",
return -1;
}
return 0;
}
struct mail_index_transaction *trans,
const struct mailbox_update *update)
{
sizeof(new_hdr.mailbox_guid));
}
}
}
const struct mailbox_update *update)
{
struct mail_index_transaction *trans;
const struct mail_index_header *hdr;
return -1;
else if (uid_validity == 0) {
/* set uidvalidity */
}
}
}
}
if (mail_index_transaction_commit(&trans) < 0) {
return -1;
}
return 0;
}
const struct mailbox_update *update)
{
int ret;
return ret;
}
static int
{
struct mdbox_index_header hdr;
/* regenerate it */
return -1;
}
return 0;
}
static int
{
return -1;
}
}
{
struct dbox_map_transaction_context *map_trans;
const struct mail_index_header *hdr;
const struct mdbox_mail_index_record *dbox_rec;
const void *data;
bool expunged;
int ret;
/* get a list of all map_uids in this mailbox */
/* no multi-mails */
break;
}
}
/* unreference the map_uids */
if (ret == 0)
return ret;
}
{
if (mdbox_mailbox_unref_mails(mbox) < 0)
return -1;
}
return index_storage_mailbox_delete(box);
}
static int
bool rename_children)
{
rename_children) < 0)
return -1;
}
struct mailbox_list *list)
{
struct mdbox_mailbox_list *mlist;
}
struct mail_storage mdbox_storage = {
.v = {
NULL,
}
};
struct mailbox mdbox_mailbox = {
.v = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
};
struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs = {
};