]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Remove config_export_get_*() wrapper functions
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 6 Nov 2024 12:16:26 +0000 (14:16 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:14 +0000 (12:34 +0200)
Use config_module_parsers_get_setting() directly.

src/config/config-dump-full.c
src/config/config-request.c
src/config/config-request.h

index e5005030ded6846851cdf9629a28a2702f5eac60..b6c9fdba1384e83419832cc888a9d1caf7cd037a 100644 (file)
@@ -618,7 +618,10 @@ int config_dump_full(struct config_parsed *config,
        const char *final_path = NULL;
        switch (dest) {
        case CONFIG_DUMP_FULL_DEST_RUNDIR: {
-               const char *base_dir = config_export_get_base_dir(export_ctx);
+               const char *base_dir =
+                       config_module_parsers_get_setting(
+                               filter_parser->module_parsers,
+                               "master_service", "base_dir");
                final_path = t_strdup_printf("%s/dovecot.conf.binary", base_dir);
                str_append(path, final_path);
                str_append_c(path, '.');
@@ -653,8 +656,11 @@ int config_dump_full(struct config_parsed *config,
        o_stream_cork(output);
 
        if (import_environment_r != NULL) {
-               *import_environment_r =
-                       t_strdup(config_export_get_import_environment(export_ctx));
+               const char *value =
+                       config_module_parsers_get_setting(
+                               filter_parser->module_parsers,
+                               "master_service", "import_environment");
+               *import_environment_r = t_strdup(value);
        }
 
        uint64_t blob_size = UINT64_MAX;
index 78c13bb1c727926945cf2a430cea6240099a4cac..0fe6ded4d71aa336a63a78fa13e1dda9e260e608 100644 (file)
@@ -394,19 +394,6 @@ unsigned int config_export_get_parser_count(struct config_export_context *ctx)
        return i;
 }
 
-const char *
-config_export_get_import_environment(struct config_export_context *ctx)
-{
-       return config_module_parsers_get_setting(ctx->module_parsers,
-               "master_service", "import_environment");
-}
-
-const char *config_export_get_base_dir(struct config_export_context *ctx)
-{
-       return config_module_parsers_get_setting(ctx->module_parsers,
-                                                "master_service", "base_dir");
-}
-
 void config_export_free(struct config_export_context **_ctx)
 {
        struct config_export_context *ctx = *_ctx;
index 29af027f1a7a601a7d1f70497a38180babc039ff..8d7c463fb0461047b6f9d642689bef1f73cca87f 100644 (file)
@@ -63,9 +63,6 @@ config_export_init(enum config_dump_scope scope,
 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);
-const char *
-config_export_get_import_environment(struct config_export_context *ctx);
-const char *config_export_get_base_dir(struct config_export_context *ctx);
 int config_export_all_parsers(struct config_export_context **ctx);
 const struct setting_parser_info *
 config_export_parser_get_info(struct config_export_context *ctx,