]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Remove unused settings_vars_have_key()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 26 Feb 2022 20:21:50 +0000 (21:21 +0100)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 30 Nov 2022 12:35:26 +0000 (14:35 +0200)
src/lib-settings/settings-parser.c
src/lib-settings/settings-parser.h

index 8bec3af5a443117b38e6d79bc515c2246652c45c..034e00ba53c0fb3234921c7f05a25c9ecff1251e 100644 (file)
@@ -1260,70 +1260,6 @@ void settings_parse_var_skip(struct setting_parser_context *ctx)
        }
 }
 
-bool settings_vars_have_key(const struct setting_parser_info *info, void *set,
-                           char var_key, const char *long_var_key,
-                           const char **key_r, const char **value_r)
-{
-       const struct setting_define *def;
-       const void *value;
-       void *const *children;
-       unsigned int i, count;
-
-       for (def = info->defines; def->key != NULL; def++) {
-               value = CONST_PTR_OFFSET(set, def->offset);
-               switch (def->type) {
-               case SET_BOOL:
-               case SET_UINT:
-               case SET_UINT_OCT:
-               case SET_TIME:
-               case SET_TIME_MSECS:
-               case SET_SIZE:
-               case SET_IN_PORT:
-               case SET_STR:
-               case SET_ENUM:
-               case SET_STRLIST:
-               case SET_ALIAS:
-                       break;
-               case SET_STR_VARS: {
-                       const char *const *val = value;
-
-                       if (*val == NULL)
-                               break;
-
-                       if (**val == SETTING_STRVAR_UNEXPANDED[0]) {
-                               if (var_has_key(*val + 1, var_key,
-                                               long_var_key)) {
-                                       *key_r = def->key;
-                                       *value_r = *val + 1;
-                                       return TRUE;
-                               }
-                       } else {
-                               i_assert(**val == SETTING_STRVAR_EXPANDED[0]);
-                       }
-                       break;
-               }
-               case SET_DEFLIST:
-               case SET_DEFLIST_UNIQUE: {
-                       const ARRAY_TYPE(void_array) *val = value;
-
-                       if (!array_is_created(val))
-                               break;
-
-                       children = array_get(val, &count);
-                       for (i = 0; i < count; i++) {
-                               if (settings_vars_have_key(def->list_info,
-                                                          children[i], var_key,
-                                                          long_var_key,
-                                                          key_r, value_r))
-                                       return TRUE;
-                       }
-                       break;
-               }
-               }
-       }
-       return FALSE;
-}
-
 static void settings_set_parent(const struct setting_parser_info *info,
                                void *child, void *parent)
 {
index 208540179db304425a070d2bebd8be7256ebaaec..1ccbd73d4eaa5a1ed42e21dc02740edfea7e8876 100644 (file)
@@ -225,11 +225,6 @@ int settings_var_expand_with_funcs(const struct setting_parser_info *info,
                                   const struct var_expand_table *table,
                                   const struct var_expand_func_table *func_table,
                                   void *func_context, const char **error_r);
-/* Go through all the settings and return the first one that has an unexpanded
-   setting containing the given %key. */
-bool settings_vars_have_key(const struct setting_parser_info *info, void *set,
-                           char var_key, const char *long_var_key,
-                           const char **key_r, const char **value_r);
 /* Duplicate the entire settings structure. */
 void *settings_dup(const struct setting_parser_info *info,
                   const void *set, pool_t pool);