diff options
author | J. Alexander Treuman <jat@spatialrift.net> | 2006-07-21 17:06:20 +0000 |
---|---|---|
committer | J. Alexander Treuman <jat@spatialrift.net> | 2006-07-21 17:06:20 +0000 |
commit | b892028b9602f0f7922a5406047706eb36454469 (patch) | |
tree | 4e5a10fc6a9004ec725566fa6d2919935dbcf98a /src/conf.c | |
parent | 74c4f5364df84f7fe7a944a4f690a11766e90f6f (diff) | |
download | mpd-b892028b9602f0f7922a5406047706eb36454469.tar.gz mpd-b892028b9602f0f7922a5406047706eb36454469.tar.xz mpd-b892028b9602f0f7922a5406047706eb36454469.zip |
Add a getBoolConfigParam function
git-svn-id: https://svn.musicpd.org/mpd/trunk@4417 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/conf.c')
-rw-r--r-- | src/conf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c index 77dafbbcf..2a5ea9e5f 100644 --- a/src/conf.c +++ b/src/conf.c @@ -362,6 +362,19 @@ char *getConfigParamValue(char *name) return param->value; } +int getBoolConfigParam(char *name) +{ + ConfigParam *param; + + param = getConfigParam(name); + if (!param) return -1; + + if (strcmp("yes", param->value) == 0) return 1; + else if (strcmp("no", param->value) == 0) return 0; + + return -1; +} + BlockParam *getBlockParam(ConfigParam * param, char *name) { BlockParam *ret = NULL; |