const struct setting_parser_info *info = all_infos[info_idx];
struct config_parser_key *config_key, *old_config_key;
const char *name;
+ unsigned int i = 0;
- for (unsigned int i = 0; info->defines[i].key != NULL; i++) {
+ for (i = 0; info->defines[i].key != NULL; i++) {
const struct setting_define *def = &info->defines[i];
+ if ((info->defines[i].flags & SET_FLAG_EOL) != 0) {
+ i_panic("struct %s key %s contains SET_FLAG_EOL",
+ info->name, def->key);
+ }
+
+ i_assert((def->flags & SET_FLAG_EOL) == 0);
if (def->type == SET_STR ||
def->type == SET_STR_NOVARS ||
def->type == SET_ENUM) {
DLLIST_PREPEND(&old_config_key, config_key);
hash_table_update(ctx->all_keys, def->key, config_key);
}
+ if ((info->defines[i].flags & SET_FLAG_EOL) == 0) {
+ i_panic("struct %s is missing SETTING_DEFINE_LIST_END",
+ info->name);
+ }
}
static void
};
enum setting_flags {
SET_FLAG_HIDDEN = BIT(0),
+ /* Used only for SETTING_DEFINE_LIST_END */
+ SET_FLAG_EOL = BIT(1),
};
enum setting_apply_flags {
SETTING_APPLY_FLAG_NO_EXPAND = BIT(1),
};
-#define SETTING_DEFINE_LIST_END { 0, 0, NULL, 0, NULL, NULL, NULL }
+#define SETTING_DEFINE_LIST_END { 0, SET_FLAG_EOL, NULL, 0, NULL, NULL, NULL }
struct setting_filter_array_order {
const struct setting_parser_info *info;