Add a getBoolConfigParam function

git-svn-id: https://svn.musicpd.org/mpd/trunk@4417 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-07-21 17:06:20 +00:00
parent 74c4f5364d
commit b892028b96
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -85,6 +85,8 @@ ConfigParam *getNextConfigParam(char *name, ConfigParam * last);
char *getConfigParamValue(char *name);
int getBoolConfigParam(char *name);
BlockParam *getBlockParam(ConfigParam * param, char *name);
ConfigParam *parseConfigFilePath(char *name, int force);