bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include "lib.h"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include "settings-parser.h"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include "mail-storage-settings.h"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include "mdbox-settings.h"
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include <stddef.h>
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#undef DEF
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DEF(type, name) \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen { type, #name, offsetof(struct mdbox_settings, name), NULL }
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_define mdbox_setting_defines[] = {
f6aaada6101dd43cd80fe965ff1ab9bfaf776252Timo Sirainen DEF(SET_BOOL, mdbox_preallocate_space),
61618d4c58080570f689614fec204ae14e90cef2Timo Sirainen DEF(SET_SIZE, mdbox_rotate_size),
9ff39148453aa6db8887ec1cde46bd7489109c09Timo Sirainen DEF(SET_TIME, mdbox_rotate_interval),
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen SETTING_DEFINE_LIST_END
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen};
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct mdbox_settings mdbox_default_settings = {
f6aaada6101dd43cd80fe965ff1ab9bfaf776252Timo Sirainen .mdbox_preallocate_space = FALSE,
378fcd5bd4d302fd88aaad30837050df57ab9fa2Martti Rannanjärvi .mdbox_rotate_size = 10*1024*1024,
5fb3f13537dffd15a31e997da133a721c0728af8Timo Sirainen .mdbox_rotate_interval = 0
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen};
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic const struct setting_parser_info mdbox_setting_parser_info = {
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .module_name = "mdbox",
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defines = mdbox_setting_defines,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .defaults = &mdbox_default_settings,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .type_offset = (size_t)-1,
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .struct_size = sizeof(struct mdbox_settings),
383d0e8c24451468d6bea17e4b55d74de744abe6Timo Sirainen
7bafda1813454621e03615e83d55bccfa7cc56bdTimo Sirainen .parent_offset = (size_t)-1,
04c3ac276103b56185119bcff9a66de7a8bb0e68Timo Sirainen .parent = &mail_user_setting_parser_info
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen};
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenconst struct setting_parser_info *mdbox_get_setting_parser_info(void)
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen{
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen return &mdbox_setting_parser_info;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen}