aboutsummaryrefslogtreecommitdiffstats
path: root/src/conf.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-18 19:37:27 +0100
committerMax Kellermann <max@duempel.org>2009-01-18 19:37:27 +0100
commita531a1e65075d27574bc31d4bac7ab20cb750efd (patch)
treef06ad8e7359f0845d94d2b8a6f655a0cceb744c2 /src/conf.c
parent73e466cfef6497aff840cfac35d80d74e7b0fd0c (diff)
downloadmpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.gz
mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.tar.xz
mpd-a531a1e65075d27574bc31d4bac7ab20cb750efd.zip
conf: added config_get_block_string()
This replaces lots of getBlockParam() invocations.
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index a073f32a5..73990d45d 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -445,6 +445,18 @@ bool config_get_bool(const char *name, bool default_value)
return !!value;
}
+const char *
+config_get_block_string(struct config_param *param, const char *name,
+ const char *default_value)
+{
+ struct block_param *bp = getBlockParam(param, name);
+
+ if (bp == NULL)
+ return default_value;
+
+ return bp->value;
+}
+
bool
config_get_block_bool(struct config_param *param, const char *name,
bool default_value)