CONFIG_DUMP_SCOPE_CHANGED, flags,
config_dump_full_callback, &dump_ctx);
}
- config_export_dup_module_parsers(export_ctx, config);
+ struct config_filter_parser *filter_parser =
+ config_parsed_get_global_filter_parser(config);
+ config_export_set_module_parsers(export_ctx, filter_parser->module_parsers);
string_t *path = t_str_new(128);
const char *final_path = NULL;
enum config_dump_flags flags;
const struct config_module_parser *module_parsers;
- struct config_module_parser *dup_module_parsers;
unsigned int section_idx;
};
return ctx;
}
-static struct config_module_parser *
-config_filter_parsers_dup(pool_t pool, struct config_filter_parser *global_filter)
-{
- struct config_module_parser *dest;
- unsigned int i, count;
-
- for (count = 0; global_filter->module_parsers[count].root != NULL; count++) ;
- dest = p_new(pool, struct config_module_parser, count + 1);
- for (i = 0; i < count; i++) {
- dest[i] = global_filter->module_parsers[i];
- dest[i].parser =
- settings_parser_dup(global_filter->module_parsers[i].parser, pool);
- }
- return dest;
-}
-
-void config_export_dup_module_parsers(struct config_export_context *ctx,
- struct config_parsed *config)
-{
- struct config_filter_parser *global_filter =
- config_parsed_get_global_filter_parser(config);
-
- ctx->dup_module_parsers =
- config_filter_parsers_dup(ctx->pool, global_filter);
- ctx->module_parsers = ctx->dup_module_parsers;
-}
-
void config_export_set_module_parsers(struct config_export_context *ctx,
const struct config_module_parser *module_parsers)
{
*_ctx = NULL;
- if (ctx->dup_module_parsers != NULL)
- config_module_parsers_free(ctx->dup_module_parsers);
hash_table_destroy(&ctx->keys);
pool_unref(&ctx->pool);
}
enum config_dump_flags flags,
config_request_callback_t *callback, void *context)
ATTR_NULL(1, 5);
-void config_export_dup_module_parsers(struct config_export_context *ctx,
- struct config_parsed *config);
void config_export_set_module_parsers(struct config_export_context *ctx,
const struct config_module_parser *parsers);
unsigned int config_export_get_parser_count(struct config_export_context *ctx);
o_stream_cork(output);
ctx = config_dump_human_init(scope);
- config_export_dup_module_parsers(ctx->export_ctx, config);
+ struct config_filter_parser *filter_parser =
+ config_parsed_get_global_filter_parser(config);
+ config_export_set_module_parsers(ctx->export_ctx,
+ filter_parser->module_parsers);
config_dump_human_output(ctx, output, 0, setting_name_filter, hide_passwords);
config_dump_human_deinit(ctx);
bool dump_section = FALSE;
ctx = config_dump_human_init(scope);
- config_export_dup_module_parsers(ctx->export_ctx, config);
+ struct config_filter_parser *filter_parser =
+ config_parsed_get_global_filter_parser(config);
+ config_export_set_module_parsers(ctx->export_ctx,
+ filter_parser->module_parsers);
if (config_export_all_parsers(&ctx->export_ctx, §ion_idx) < 0)
i_unreached(); /* settings aren't checked - this can't happen */
ctx = config_export_init(scope, 0,
config_request_simple_stdout,
setting_name_filters);
- config_export_dup_module_parsers(ctx, config);
+ struct config_filter_parser *filter_parser =
+ config_parsed_get_global_filter_parser(config);
+ config_export_set_module_parsers(ctx, filter_parser->module_parsers);
if (config_export_all_parsers(&ctx, §ion_idx) < 0)
i_unreached();
ret2 = 0;