mbox-settings.c revision 9743e5ac5bf6391157a4d1ab7119872b0979f8b7
842ae4bd224140319ae7feec1872b93dfd491143fielding/* Copyright (c) 2005-2011 Dovecot authors, see the included COPYING file */
842ae4bd224140319ae7feec1872b93dfd491143fielding
842ae4bd224140319ae7feec1872b93dfd491143fielding#include "lib.h"
842ae4bd224140319ae7feec1872b93dfd491143fielding#include "settings-parser.h"
842ae4bd224140319ae7feec1872b93dfd491143fielding#include "mail-storage-settings.h"
842ae4bd224140319ae7feec1872b93dfd491143fielding#include "mbox-settings.h"
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd#include <stddef.h>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd#undef DEF
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd#define DEF(type, name) \
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd { type, #name, offsetof(struct mbox_settings, name), NULL }
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcndstatic const struct setting_define mbox_setting_defines[] = {
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_STR, mbox_read_locks),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_STR, mbox_write_locks),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_TIME, mbox_lock_timeout),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_TIME, mbox_dotlock_change_timeout),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_SIZE, mbox_min_index_size),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_BOOL, mbox_dirty_syncs),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_BOOL, mbox_very_dirty_syncs),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_BOOL, mbox_lazy_writes),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd DEF(SET_ENUM, mbox_md5),
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse SETTING_DEFINE_LIST_END
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse};
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic const struct mbox_settings mbox_default_settings = {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .mbox_read_locks = "fcntl",
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .mbox_write_locks = "dotlock fcntl",
e18e68b42830409bf48de0df9eed3fe363664aa7aaron .mbox_lock_timeout = 5*60,
70535d6421eb979ac79d8f49d31cd94d75dd8b2fjorton .mbox_dotlock_change_timeout = 2*60,
8464a9c46b967001e38fe3c8afff51a649e9de51dougm .mbox_min_index_size = 0,
579fd9e90990eee18b5e504eb4c0d2ce18f76208aaron .mbox_dirty_syncs = TRUE,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .mbox_very_dirty_syncs = FALSE,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .mbox_lazy_writes = TRUE,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .mbox_md5 = "apop3d:all"
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse};
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrsestatic const struct setting_parser_info mbox_setting_parser_info = {
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .module_name = "mbox",
bb0b94431dc9a1591a0a38a6c48925c6d9213c83rse .defines = mbox_setting_defines,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .defaults = &mbox_default_settings,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .type_offset = (size_t)-1,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .struct_size = sizeof(struct mbox_settings),
05413593151a238718198cc04ca849b2426be106rse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .parent_offset = (size_t)-1,
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse .parent = &mail_user_setting_parser_info
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse};
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrseconst struct setting_parser_info *mbox_get_setting_parser_info(void)
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse{
434ad3e8e769a6a7a78c15f3ae2f7ae3adbfbb49wrowe return &mbox_setting_parser_info;
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse}
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse