view src/lib-storage/fail-mail-storage.c @ 14133:ba770cba5598

Updated copyright notices to include year 2012.
author Timo Sirainen <tss@iki.fi>
date Sun, 12 Feb 2012 18:55:28 +0200
parents 6a285db79b76
children b52f4852e5f8
line wrap: on
line source

/* Copyright (c) 2009-2012 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "array.h"
#include "mail-storage-private.h"
#include "fail-mail-storage.h"

extern struct mail_storage fail_storage;

static struct mail_storage *fail_storage_alloc(void)
{
	struct mail_storage *storage;
	pool_t pool;

	pool = pool_alloconly_create("fail mail storage", 1024);
	storage = p_new(pool, struct mail_storage, 1);
	*storage = fail_storage;
	storage->pool = pool;
	return storage;
}

static void
fail_storage_get_list_settings(const struct mail_namespace *ns ATTR_UNUSED,
			      struct mailbox_list_settings *set)
{
	if (set->layout == NULL)
		set->layout = "fail";
	if (set->subscription_fname == NULL)
		set->subscription_fname = "subscriptions";
}

struct mail_storage fail_storage = {
	.name = "fail",
	.class_flags = 0,

	.v = {
		NULL,
		fail_storage_alloc,
		NULL,
		NULL,
		NULL,
		fail_storage_get_list_settings,
		NULL,
		fail_mailbox_alloc,
		NULL
	}
};

struct mail_storage *fail_mail_storage_create(void)
{
	struct mail_storage *storage;

	storage = fail_storage_alloc();
	storage->refcount = 1;
	storage->storage_class = &fail_storage;
	p_array_init(&storage->module_contexts, storage->pool, 5);
	return storage;
}