From: Timo Sirainen Date: Wed, 6 Nov 2024 13:04:01 +0000 (+0200) Subject: config: Remove config_parsed_get_module_parsers() wrapper X-Git-Tag: 2.4.0~295 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5e9f7a37548e63ff0892812d3e99564ba35ebf8;p=thirdparty%2Fdovecot%2Fcore.git config: Remove config_parsed_get_module_parsers() wrapper --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 4526064ce6..9bdf6ea77a 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -2492,12 +2492,6 @@ config_parsed_get_filter_parsers(struct config_parsed *config) return config->filter_parsers; } -const struct config_module_parser * -config_parsed_get_module_parsers(struct config_parsed *config) -{ - return config->module_parsers; -} - const char * config_module_parsers_get_setting(const struct config_module_parser *module_parsers, const char *info_name, const char *key) diff --git a/src/config/config-parser.h b/src/config/config-parser.h index 53c2e53def..a7f16ff042 100644 --- a/src/config/config-parser.h +++ b/src/config/config-parser.h @@ -80,9 +80,6 @@ config_parsed_get_global_filter_parser(struct config_parsed *config); /* Returns all filters */ struct config_filter_parser *const * config_parsed_get_filter_parsers(struct config_parsed *config); -/* Returns all module_parsers. The array is terminated with info=NULL. */ -const struct config_module_parser * -config_parsed_get_module_parsers(struct config_parsed *config); /* Fill settings parser with settings from the given module parser. */ void config_fill_set_parser(struct setting_parser_context *parser, const struct config_module_parser *p, diff --git a/src/config/doveconf.c b/src/config/doveconf.c index e1750a7782..433393258a 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -987,9 +987,11 @@ static void hostname_verify_format(const char *arg) static void check_wrong_config(const char *config_path) { const char *base_dir, *symlink_path, *prev_path, *error; + struct config_filter_parser *global_filter = + config_parsed_get_global_filter_parser(config); base_dir = config_module_parsers_get_setting( - config_parsed_get_module_parsers(config), + global_filter->module_parsers, "master_service", "base_dir"); symlink_path = t_strconcat(base_dir, "/"PACKAGE".conf", NULL); if (t_readlink(symlink_path, &prev_path, &error) < 0) { @@ -1193,9 +1195,11 @@ int main(int argc, char *argv[]) } } else { const char *info, *mail_path, *version; + struct config_filter_parser *global_filter = + config_parsed_get_global_filter_parser(config); mail_path = config_module_parsers_get_setting( - config_parsed_get_module_parsers(config), + global_filter->module_parsers, "mail_storage", "mail_path"); info = sysinfo_get(mail_path); if (*info != '\0') diff --git a/src/config/test-config-parser.c b/src/config/test-config-parser.c index ffffb1932b..78000655f4 100644 --- a/src/config/test-config-parser.c +++ b/src/config/test-config-parser.c @@ -126,8 +126,9 @@ static void test_config_parser(void) /* get the parsed output */ pool_t pool = pool_alloconly_create("test settings", 128); - const struct config_module_parser *p = - config_parsed_get_module_parsers(config); + struct config_filter_parser *global_filter = + config_parsed_get_global_filter_parser(config); + const struct config_module_parser *p = global_filter->module_parsers; struct setting_parser_context *set_parser = settings_parser_init(pool, p->info, 0); config_fill_set_parser(set_parser, p, TRUE); @@ -153,7 +154,8 @@ static void test_config_parser(void) &config, &error) == 1); p_clear(pool); - p = config_parsed_get_module_parsers(config); + global_filter = config_parsed_get_global_filter_parser(config); + p = global_filter->module_parsers; set_parser = settings_parser_init(pool, p->info, 0); config_fill_set_parser(set_parser, p, TRUE); set = settings_parser_get_set(set_parser);