aboutsummaryrefslogtreecommitdiffstats
path: root/src/config/ConfigGlobal.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-24 16:55:17 +0100
committerMax Kellermann <max@duempel.org>2014-01-24 16:55:17 +0100
commit9b1fbdbca63f03c357a2f9c01fca281f62b3570c (patch)
treef093e063f77625e1380e7b1e8f5654a4be254d85 /src/config/ConfigGlobal.hxx
parent97391fd4b975eab7049c31c88b8a118be430c427 (diff)
downloadmpd-9b1fbdbca63f03c357a2f9c01fca281f62b3570c.tar.gz
mpd-9b1fbdbca63f03c357a2f9c01fca281f62b3570c.tar.xz
mpd-9b1fbdbca63f03c357a2f9c01fca281f62b3570c.zip
ConfigGlobal: add config_find_block()
Merge duplicate code.
Diffstat (limited to 'src/config/ConfigGlobal.hxx')
-rw-r--r--src/config/ConfigGlobal.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/config/ConfigGlobal.hxx b/src/config/ConfigGlobal.hxx
index abce424de..84ef7dd5f 100644
--- a/src/config/ConfigGlobal.hxx
+++ b/src/config/ConfigGlobal.hxx
@@ -53,6 +53,17 @@ config_get_param(enum ConfigOption option)
return config_get_next_param(option, nullptr);
}
+/**
+ * Find a block with a matching attribute.
+ *
+ * @param option the blocks to search
+ * @param key the attribute name
+ * @param value the expected attribute value
+ */
+gcc_pure
+const config_param *
+config_find_block(ConfigOption option, const char *key, const char *value);
+
/* Note on gcc_pure: Some of the functions declared pure are not
really pure in strict sense. They have side effect such that they
validate parameter's value and signal an error if it's invalid.