]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Added settings_check() to check specific setting structure.
authorTimo Sirainen <tss@iki.fi>
Tue, 20 Oct 2009 22:03:34 +0000 (18:03 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 20 Oct 2009 22:03:34 +0000 (18:03 -0400)
--HG--
branch : HEAD

src/lib-settings/settings-parser.c
src/lib-settings/settings-parser.h

index 7c939b9306c6ed823074cdc7fafd18099133faf4..9e6117a8cec5ee6272f665f41890beebc2c81ab3 100644 (file)
@@ -690,9 +690,8 @@ int settings_parse_exec(struct setting_parser_context *ctx,
        return ret;
 }
 
-static bool
-settings_parser_check_info(const struct setting_parser_info *info, pool_t pool,
-                          void *set, const char **error_r)
+bool settings_check(const struct setting_parser_info *info, pool_t pool,
+                   void *set, const char **error_r)
 {
        const struct setting_define *def;
        const ARRAY_TYPE(void_array) *val;
@@ -714,8 +713,8 @@ settings_parser_check_info(const struct setting_parser_info *info, pool_t pool,
 
                children = array_get(val, &count);
                for (i = 0; i < count; i++) {
-                       if (!settings_parser_check_info(def->list_info, pool,
-                                                       children[i], error_r))
+                       if (!settings_check(def->list_info, pool,
+                                           children[i], error_r))
                                return FALSE;
                }
        }
@@ -728,10 +727,9 @@ bool settings_parser_check(struct setting_parser_context *ctx, pool_t pool,
        unsigned int i;
 
        for (i = 0; i < ctx->root_count; i++) {
-               if (!settings_parser_check_info(ctx->roots[i].info, pool,
-                                               ctx->roots[i].set_struct,
-                                               error_r))
-                   return FALSE;
+               if (!settings_check(ctx->roots[i].info, pool,
+                                   ctx->roots[i].set_struct, error_r))
+                       return FALSE;
        }
        return TRUE;
 }
index 5e0172cdb4d561cb7db6f26daa02cfa7f4667bfc..be3afe8fbfb4b27b6ee5b2abbfe4b08de4553c78 100644 (file)
@@ -129,6 +129,8 @@ int settings_parse_exec(struct setting_parser_context *ctx,
 /* Call all check_func()s to see if currently parsed settings are valid. */
 bool settings_parser_check(struct setting_parser_context *ctx, pool_t pool,
                           const char **error_r);
+bool settings_check(const struct setting_parser_info *info, pool_t pool,
+                   void *set, const char **error_r);
 
 /* While parsing values, specifies if STR_VARS strings are already expanded. */
 void settings_parse_set_expanded(struct setting_parser_context *ctx,