}
}
-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)
{
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);