]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Remove config_parsed_get_module_parsers() wrapper
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 6 Nov 2024 13:04:01 +0000 (15:04 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:00 +0000 (10:40 +0200)
src/config/config-parser.c
src/config/config-parser.h
src/config/doveconf.c
src/config/test-config-parser.c

index 4526064ce654630545bcba491ddf4d4843cbde2c..9bdf6ea77a3134bbd644f9521370adeaa46a1405 100644 (file)
@@ -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)
index 53c2e53def32f5d7528f6919ab9f08168ac9fe2b..a7f16ff042ca2894de93a4af858b59d37303f77c 100644 (file)
@@ -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,
index e1750a7782373623ced189568515324700771c30..433393258a20629c64597bc3e57338d63684a397 100644 (file)
@@ -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')
index ffffb1932bbfa9e26ad0307dd458297dfab8ab3a..78000655f4ab749674bafe131b91c5eec4de1ac7 100644 (file)
@@ -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);