mbox-settings.c revision 61618d4c58080570f689614fec204ae14e90cef2
b9f30617c2c96d54acbc4f85ed17b939c4f28916Timo Sirainen/* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "lib.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "settings-parser.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "mail-storage-settings.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include "mbox-settings.h"
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#include <stddef.h>
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#undef DEF
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen#define DEF(type, name) \
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen { type, #name, offsetof(struct mbox_settings, name), NULL }
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_define mbox_setting_defines[] = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_STR, mbox_read_locks),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_STR, mbox_write_locks),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_UINT, mbox_lock_timeout),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_UINT, mbox_dotlock_change_timeout),
61618d4c58080570f689614fec204ae14e90cef2Timo Sirainen DEF(SET_SIZE, mbox_min_index_size),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_dirty_syncs),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_very_dirty_syncs),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen DEF(SET_BOOL, mbox_lazy_writes),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen SETTING_DEFINE_LIST_END
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct mbox_settings mbox_default_settings = {
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_read_locks) "fcntl",
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_write_locks) "dotlock fcntl",
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_lock_timeout) 5*60,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_dotlock_change_timeout) 2*60,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_min_index_size) 0,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_dirty_syncs) TRUE,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_very_dirty_syncs) FALSE,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(mbox_lazy_writes) TRUE
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_parser_info mbox_setting_parser_info = {
1cfdcb36985904eff281fc6d7ea2d13b3c375980Timo Sirainen MEMBER(module_name) "mbox",
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(defines) mbox_setting_defines,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(defaults) &mbox_default_settings,
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
383d0e8c24451468d6bea17e4b55d74de744abe6Timo Sirainen MEMBER(type_offset) (size_t)-1,
383d0e8c24451468d6bea17e4b55d74de744abe6Timo Sirainen MEMBER(struct_size) sizeof(struct mbox_settings),
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen MEMBER(parent_offset) (size_t)-1,
383d0e8c24451468d6bea17e4b55d74de744abe6Timo Sirainen MEMBER(parent) &mail_user_setting_parser_info
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen};
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainenconst struct setting_parser_info *mbox_get_setting_parser_info(void)
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen{
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen return &mbox_setting_parser_info;
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen}