Add a getBoolConfigParam function
git-svn-id: https://svn.musicpd.org/mpd/trunk@4417 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
74c4f5364d
commit
b892028b96
13
src/conf.c
13
src/conf.c
@ -362,6 +362,19 @@ char *getConfigParamValue(char *name)
|
|||||||
return param->value;
|
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 *getBlockParam(ConfigParam * param, char *name)
|
||||||
{
|
{
|
||||||
BlockParam *ret = NULL;
|
BlockParam *ret = NULL;
|
||||||
|
@ -85,6 +85,8 @@ ConfigParam *getNextConfigParam(char *name, ConfigParam * last);
|
|||||||
|
|
||||||
char *getConfigParamValue(char *name);
|
char *getConfigParamValue(char *name);
|
||||||
|
|
||||||
|
int getBoolConfigParam(char *name);
|
||||||
|
|
||||||
BlockParam *getBlockParam(ConfigParam * param, char *name);
|
BlockParam *getBlockParam(ConfigParam * param, char *name);
|
||||||
|
|
||||||
ConfigParam *parseConfigFilePath(char *name, int force);
|
ConfigParam *parseConfigFilePath(char *name, int force);
|
||||||
|
Loading…
Reference in New Issue
Block a user