parser = &ctx->parsers[i];
T_BEGIN {
- settings_export(ctx, parser->root, FALSE,
- settings_parser_get(parser->parser),
+ void *set = settings_parser_get_root_set(parser->parser, parser->root);
+ settings_export(ctx, parser->root, FALSE, set,
settings_parser_get_changes(parser->parser));
} T_END;
if (strcmp(l->root->module_name, module) != 0)
continue;
- set = settings_parser_get(l->parser);
+ set = settings_parser_get_root_set(l->parser, l->root);
for (def = l->root->defines; def->key != NULL; def++) {
if (strcmp(def->key, name) == 0) {
value = CONST_PTR_OFFSET(set, def->offset);
/* get the parsed output */
const struct test_settings *set =
- settings_parser_get(config_module_parsers[0].parser);
+ settings_parser_get_root_set(config_module_parsers[0].parser,
+ config_module_parsers[0].root);
test_assert_strcmp(set->key, "value");
test_assert_strcmp(set->key2, "\\$escape \\escape \\\"escape\\\"");
test_assert_strcmp(set->key3, "yetanother value value nothervalue right here");
/* try again unexpanded */
test_assert(config_parse_file(TEST_CONFIG_FILE, 0, &error) == 1);
- set = settings_parser_get(config_module_parsers[0].parser);
+ set = settings_parser_get_root_set(config_module_parsers[0].parser,
+ config_module_parsers[0].root);
test_assert_strcmp(set->key, "value");
test_assert_strcmp(set->key2, "\\$escape \\escape \\\"escape\\\"");
"strlist/z=c",
};
-static void test_settings_parser_get(void)
+static void test_settings_parser(void)
{
struct test_settings {
bool bool_true;
.parent_offset = SIZE_MAX,
};
- test_begin("settings_parser_get");
+ test_begin("settings_parser");
pool_t pool = pool_alloconly_create("settings parser", 1024);
struct setting_parser_context *ctx =
test_assert(settings_parser_check(ctx, pool, NULL));
/* check what we got */
- struct test_settings *settings = settings_parser_get(ctx);
+ struct test_settings *settings =
+ settings_parser_get_root_set(ctx, &root);
test_assert(settings != NULL);
test_assert(settings->bool_true == TRUE);
int main(void)
{
static void (*const test_functions[])(void) = {
- test_settings_parser_get,
+ test_settings_parser,
NULL
};
return test_run(test_functions);
if (!settings_parser_check(ctx, test_pool, &error))
i_fatal("Failed to parse settings: %s",
error);
- struct stats_settings *set = settings_parser_get(ctx);
+ struct stats_settings *set =
+ settings_parser_get_root_set(ctx, &stats_setting_parser_info);
settings_parser_unref(&ctx);
return set;
}