]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Add settings_parser_get_root_set_dup()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 26 Feb 2022 21:58:26 +0000 (22:58 +0100)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 30 Nov 2022 12:39:36 +0000 (14:39 +0200)
src/lib-settings/settings-parser.c
src/lib-settings/settings-parser.h

index d2726b108601ee428ccb1355292e52fd2b7fe8ee..ef243d758654831c09b27fd9e19e10d2817c3eea 100644 (file)
@@ -279,6 +279,13 @@ void *settings_parser_get_root_set(const struct setting_parser_context *ctx,
        i_panic("Couldn't find settings for root %s", root->module_name);
 }
 
+void *settings_parser_get_root_set_dup(const struct setting_parser_context *ctx,
+                                      const struct setting_parser_info *root,
+                                      pool_t pool)
+{
+       return settings_dup(root, settings_parser_get_root_set(ctx, root), pool);
+}
+
 void *settings_parser_get_changes(struct setting_parser_context *ctx)
 {
        i_assert(ctx->root_count == 1);
index 4a3c002363962e3df659f2735944dce69f165ef4..5823e0940218583392cd79b0e906e108115e293d 100644 (file)
@@ -155,6 +155,10 @@ void **settings_parser_get_list(const struct setting_parser_context *ctx);
    the function panics. */
 void *settings_parser_get_root_set(const struct setting_parser_context *ctx,
                                   const struct setting_parser_info *root);
+/* Combine settings_parser_get_root_set() and settings_dup(). */
+void *settings_parser_get_root_set_dup(const struct setting_parser_context *ctx,
+                                      const struct setting_parser_info *root,
+                                      pool_t pool);
 /* Like settings_parser_get(), but return change struct. */
 void *settings_parser_get_changes(struct setting_parser_context *ctx);
 /* Returns the setting parser's roots (same as given to init()). */