return settings_find_key(ctx, key, &def, &link);
}
+const char *settings_parse_unalias(struct setting_parser_context *ctx,
+ const char *key)
+{
+ const struct setting_define *def;
+ struct setting_link *link;
+
+ if (!settings_find_key(ctx, key, &def, &link))
+ return NULL;
+
+ while (def->type == SET_ALIAS) {
+ i_assert(def != link->info->defines);
+ def--;
+ }
+ return def->key;
+}
+
const void *
settings_parse_get_value(struct setting_parser_context *ctx,
const char *key, enum setting_type *type_r)
/* Returns TRUE if the given key is a valid setting. */
bool settings_parse_is_valid_key(struct setting_parser_context *ctx,
const char *key);
+/* If key is an alias, return the primary key name. If key exists, return key
+ itself. If key doesn't exist, return NULL. */
+const char *settings_parse_unalias(struct setting_parser_context *ctx,
+ const char *key);
/* Returns pointer to value for a key, or NULL if not found. */
const void *
settings_parse_get_value(struct setting_parser_context *ctx,