From: Timo Sirainen Date: Sun, 18 Dec 2022 22:04:00 +0000 (+0200) Subject: config: config_export_init() - Remove unused modules parameter X-Git-Tag: 2.4.0~3073 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fc197e730243c214524a443ad0a4220c4928551;p=thirdparty%2Fdovecot%2Fcore.git config: config_export_init() - Remove unused modules parameter --- diff --git a/src/config/config-dump-full.c b/src/config/config-dump-full.c index 84ba2a7655..af305c8050 100644 --- a/src/config/config-dump-full.c +++ b/src/config/config-dump-full.c @@ -91,7 +91,7 @@ config_dump_full_sections(struct ostream *output, unsigned int section_idx) for (; *filters != NULL && ret == 0; filters++) T_BEGIN { config_dump_full_write_filter(output, &(*filters)->filter); - export_ctx = config_export_init(NULL, + export_ctx = config_export_init( CONFIG_DUMP_SCOPE_SET, CONFIG_DUMP_FLAG_HIDE_LIST_DEFAULTS, config_dump_full_callback, &dump_ctx); @@ -118,8 +118,7 @@ int config_dump_full(struct ostream *output, const char **import_environment_r) }; flags = CONFIG_DUMP_FLAG_CHECK_SETTINGS; - export_ctx = config_export_init(NULL, - CONFIG_DUMP_SCOPE_CHANGED, flags, + export_ctx = config_export_init(CONFIG_DUMP_SCOPE_CHANGED, flags, config_dump_full_callback, &dump_ctx); i_zero(&empty_filter); config_export_by_filter(export_ctx, &empty_filter); diff --git a/src/config/config-request.c b/src/config/config-request.c index a8a99e2de5..edb089c9fa 100644 --- a/src/config/config-request.c +++ b/src/config/config-request.c @@ -22,7 +22,6 @@ struct config_export_context { config_request_callback_t *callback; void *context; - const char *const *modules; enum config_dump_flags flags; const struct config_module_parser *parsers; struct config_module_parser *dup_parsers; @@ -378,8 +377,7 @@ settings_export(struct config_export_context *ctx, } struct config_export_context * -config_export_init(const char *const *modules, - enum config_dump_scope scope, +config_export_init(enum config_dump_scope scope, enum config_dump_flags flags, config_request_callback_t *callback, void *context) { @@ -390,7 +388,6 @@ config_export_init(const char *const *modules, ctx = p_new(pool, struct config_export_context, 1); ctx->pool = pool; - ctx->modules = modules == NULL ? NULL : p_strarray_dup(pool, modules); ctx->flags = flags; ctx->callback = callback; ctx->context = context; @@ -407,7 +404,7 @@ void config_export_by_filter(struct config_export_context *ctx, const char *error; if (config_filter_parsers_get(config_filter, ctx->pool, - ctx->modules, filter, + NULL, filter, &ctx->dup_parsers, &ctx->output, &error) < 0) { i_error("%s", error); @@ -473,9 +470,6 @@ int config_export_finish(struct config_export_context **_ctx, ctx->section_idx = *section_idx; for (i = 0; ctx->parsers[i].root != NULL; i++) { parser = &ctx->parsers[i]; - if (!config_module_want_parser(config_module_parsers, - ctx->modules, parser->root)) - continue; T_BEGIN { settings_export(ctx, parser->root, FALSE, diff --git a/src/config/config-request.h b/src/config/config-request.h index 15ff578ca3..cda6fd9073 100644 --- a/src/config/config-request.h +++ b/src/config/config-request.h @@ -40,8 +40,7 @@ bool config_export_type(string_t *str, const void *value, enum setting_type type, bool dump_default, bool *dump_r) ATTR_NULL(3); struct config_export_context * -config_export_init(const char *const *modules, - enum config_dump_scope scope, +config_export_init(enum config_dump_scope scope, enum config_dump_flags flags, config_request_callback_t *callback, void *context) ATTR_NULL(1, 5); diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 296c3a81d9..cebcb4b9a2 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -153,7 +153,7 @@ config_dump_human_init(enum config_dump_scope scope, bool check_settings) CONFIG_DUMP_FLAG_CALLBACK_ERRORS; if (check_settings) flags |= CONFIG_DUMP_FLAG_CHECK_SETTINGS; - ctx->export_ctx = config_export_init(NULL, scope, flags, + ctx->export_ctx = config_export_init(scope, flags, config_request_get_strings, ctx); return ctx; } @@ -1030,7 +1030,7 @@ int main(int argc, char *argv[]) struct config_export_context *ctx; unsigned int section_idx = 0; - ctx = config_export_init(NULL, scope, + ctx = config_export_init(scope, CONFIG_DUMP_FLAG_CHECK_SETTINGS, config_request_simple_stdout, setting_name_filters); @@ -1065,7 +1065,7 @@ int main(int argc, char *argv[]) struct config_export_context *ctx; unsigned int section_idx = 0; - ctx = config_export_init(NULL, CONFIG_DUMP_SCOPE_SET, + ctx = config_export_init(CONFIG_DUMP_SCOPE_SET, CONFIG_DUMP_FLAG_CHECK_SETTINGS, config_request_putenv, NULL); config_export_by_filter(ctx, &filter);