diff options
Diffstat (limited to 'Alc/alcConfig.c')
-rw-r--r-- | Alc/alcConfig.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c index b6e46139..de42f154 100644 --- a/Alc/alcConfig.c +++ b/Alc/alcConfig.c @@ -313,3 +313,12 @@ float GetConfigValueFloat(const char *blockName, const char *keyName, float def) return (float)strtod(val, NULL); #endif } + +int GetConfigValueBool(const char *blockName, const char *keyName, float def) +{ + const char *val = GetConfigValue(blockName, keyName, ""); + + if(!val[0]) return !!def; + return (strcasecmp(val, "true") == 0 || strcasecmp(val, "yes") == 0 || + strcasecmp(val, "on") == 0 || atoi(val) != 0); +} |