This allows changing the struct contents without breaking compiling.
#define DEF_NOPREFIX(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct auth_settings)
#define DEFLIST(field, name, defines) \
- { SET_DEFLIST, name, offsetof(struct auth_settings, field), defines }
+ { .type = SET_DEFLIST, .key = name, \
+ .offset = offsetof(struct auth_settings, field), \
+ .list_info = defines }
static const struct setting_define auth_setting_defines[] = {
DEF(STR, mechanisms),
DEF(BOOL, verbose_proctitle),
DEF(STR, dict_db_config),
- { SET_STRLIST, "dict", offsetof(struct dict_server_settings, dicts), NULL },
+ { .type = SET_STRLIST, .key = "dict",
+ .offset = offsetof(struct dict_server_settings, dicts) },
SETTING_DEFINE_LIST_END
};
DEF(STR, doveadm_socket_path),
DEF(UINT, doveadm_worker_count),
DEF(IN_PORT, doveadm_port),
- { SET_ALIAS, "doveadm_proxy_port", 0, NULL },
+ { .type = SET_ALIAS, .key = "doveadm_proxy_port" },
DEF(ENUM, doveadm_ssl),
DEF(STR, doveadm_username),
DEF(STR, doveadm_password),
DEF(STR, doveadm_http_rawlog_dir),
DEF(STR, dsync_hashed_headers),
- { SET_STRLIST, "plugin", offsetof(struct doveadm_settings, plugin_envs), NULL },
+ { .type = SET_STRLIST, .key = "plugin",
+ .offset = offsetof(struct doveadm_settings, plugin_envs) },
SETTING_DEFINE_LIST_END
};
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct imap_settings)
#define DEFLIST(field, name, defines) \
- { SET_DEFLIST, name, offsetof(struct imap_settings, field), defines }
+ { .type = SET_DEFLIST, .key = name, \
+ .offset = offsetof(struct imap_settings, field), \
+ .list_info = defines }
static const struct setting_define imap_setting_defines[] = {
DEF(BOOL, verbose_proctitle),
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct lda_settings)
#define DEFLIST(field, name, defines) \
- { SET_DEFLIST, name, offsetof(struct lda_settings, field), defines }
+ { .type = SET_DEFLIST, .key = name, \
+ .offset = offsetof(struct lda_settings, field), \
+ .list_info = defines }
static const struct setting_define lda_setting_defines[] = {
DEF(STR, hostname),
SETTING_DEFINE_STRUCT_BOOL("bool_true", bool_true, struct test_settings),
SETTING_DEFINE_STRUCT_BOOL("bool_false", bool_false, struct test_settings),
SETTING_DEFINE_STRUCT_UINT("uint", uint, struct test_settings),
- { .type = SET_UINT_OCT, "uint_oct",
+ { .type = SET_UINT_OCT, .key = "uint_oct",
offsetof(struct test_settings, uint_oct), NULL },
SETTING_DEFINE_STRUCT_TIME("secs", secs, struct test_settings),
SETTING_DEFINE_STRUCT_TIME_MSECS("msecs", msecs, struct test_settings),
SETTING_DEFINE_STRUCT_SIZE("size", size, struct test_settings),
SETTING_DEFINE_STRUCT_IN_PORT("port", port, struct test_settings),
SETTING_DEFINE_STRUCT_STR("str", str, struct test_settings),
- { .type = SET_STR_VARS, "expand_str",
+ { .type = SET_STR_VARS, .key = "expand_str",
offsetof(struct test_settings, expand_str), NULL },
- { .type = SET_STRLIST, "strlist",
+ { .type = SET_STRLIST, .key = "strlist",
offsetof(struct test_settings, strlist), NULL },
SETTING_DEFINE_LIST_END
};
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct smtp_submit_settings)
#define DEFLIST(field, name, defines) \
- { SET_DEFLIST, name, offsetof(struct smtp_submit_settings, field), defines }
+ { .type = SET_DEFLIST, .key = name, \
+ .offset = offsetof(struct smtp_submit_settings, field), \
+ .list_info = defines }
static const struct setting_define smtp_submit_setting_defines[] = {
DEF(STR, hostname),
static const struct setting_define mail_storage_setting_defines[] = {
DEF(STR_VARS, mail_location),
- { SET_ALIAS, "mail", 0, NULL },
+ { .type = SET_ALIAS, .key = "mail" },
DEF(STR_VARS, mail_attachment_fs),
DEF(STR_VARS, mail_attachment_dir),
DEF(STR, mail_attachment_hash),
static const struct setting_define mailbox_setting_defines[] = {
DEF(STR, name),
- { SET_ENUM, "auto", offsetof(struct mailbox_settings, autocreate), NULL } ,
+ { .type = SET_ENUM, .key = "auto",
+ .offset = offsetof(struct mailbox_settings, autocreate) } ,
DEF(STR, special_use),
DEF(STR, driver),
DEF(STR, comment),
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct mail_namespace_settings)
#define DEFLIST_UNIQUE(field, name, defines) \
- { SET_DEFLIST_UNIQUE, name, \
- offsetof(struct mail_namespace_settings, field), defines }
+ { .type = SET_DEFLIST_UNIQUE, .key = name, \
+ .offset = offsetof(struct mail_namespace_settings, field), \
+ .list_info = defines }
static const struct setting_define mail_namespace_setting_defines[] = {
DEF(STR, name),
DEF(STR, separator),
DEF(STR_VARS, prefix),
DEF(STR_VARS, location),
- { SET_ALIAS, "mail", 0, NULL },
- { SET_ALIAS, "mail_location", 0, NULL },
+ { .type = SET_ALIAS, .key = "mail" },
+ { .type = SET_ALIAS, .key = "mail_location" },
DEF(STR_VARS, alias_for),
DEF(BOOL, inbox),
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct mail_user_settings)
#define DEFLIST_UNIQUE(field, name, defines) \
- { SET_DEFLIST_UNIQUE, name, \
- offsetof(struct mail_user_settings, field), defines }
+ { .type = SET_DEFLIST_UNIQUE, .key = name, \
+ .offset = offsetof(struct mail_user_settings, field), \
+ .list_info = defines }
static const struct setting_define mail_user_setting_defines[] = {
DEF(STR, base_dir),
DEF(STR_VARS, postmaster_address),
DEFLIST_UNIQUE(namespaces, "namespace", &mail_namespace_setting_parser_info),
- { SET_STRLIST, "plugin", offsetof(struct mail_user_settings, plugin_envs), NULL },
+ { .type = SET_STRLIST, .key = "plugin",
+ .offset = offsetof(struct mail_user_settings, plugin_envs) },
SETTING_DEFINE_LIST_END
};
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct service_settings)
#define DEFLIST_UNIQUE(field, name, defines) \
- { SET_DEFLIST_UNIQUE, name, offsetof(struct service_settings, field), defines }
+ { .type = SET_DEFLIST_UNIQUE, .key = name, \
+ .offset = offsetof(struct service_settings, field), \
+ .list_info = defines }
static const struct setting_define service_setting_defines[] = {
DEF(STR, name),
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct master_settings)
#define DEFLIST_UNIQUE(field, name, defines) \
- { SET_DEFLIST_UNIQUE, name, offsetof(struct master_settings, field), defines }
+ { .type = SET_DEFLIST_UNIQUE, .key = name, \
+ .offset = offsetof(struct master_settings, field), \
+ .list_info = defines }
static const struct setting_define master_setting_defines[] = {
DEF(STR, base_dir),
#include "fs-crypt-settings.h"
static const struct setting_define fs_crypt_setting_defines[] = {
- { SET_STRLIST, "plugin", offsetof(struct fs_crypt_settings, plugin_envs), NULL },
+ { .type = SET_STRLIST, .key = "plugin",
+ .offset = offsetof(struct fs_crypt_settings, plugin_envs) },
SETTING_DEFINE_LIST_END
};
#define DEF(type, name) \
SETTING_DEFINE_STRUCT_##type(#name, name, struct pop3_settings)
#define DEFLIST(field, name, defines) \
- { SET_DEFLIST, name, offsetof(struct pop3_settings, field), defines }
+ { .type = SET_DEFLIST, .key = name, \
+ .offset = offsetof(struct pop3_settings, field), \
+ .list_info = defines }
static const struct setting_define pop3_setting_defines[] = {
DEF(BOOL, verbose_proctitle),
SETTING_DEFINE_STRUCT_##type(#name, name, struct stats_settings)
#undef DEFLIST_UNIQUE
#define DEFLIST_UNIQUE(field, name, defines) \
- { SET_DEFLIST_UNIQUE, name, \
- offsetof(struct stats_settings, field), defines }
+ { .type = SET_DEFLIST_UNIQUE, .key = name, \
+ .offset = offsetof(struct stats_settings, field), \
+ .list_info = defines }
static const struct setting_define stats_setting_defines[] = {
DEF(STR, stats_http_rawlog_dir),