From 69ab93a8240d6272c3fbd86e65b7baca516ec8de Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 28 Dec 2009 13:08:15 -0800 Subject: Add a function to check if a config option is set to a non-empty value --- Alc/alcConfig.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Alc/alcConfig.c') diff --git a/Alc/alcConfig.c b/Alc/alcConfig.c index eee64845..dbdf9639 100644 --- a/Alc/alcConfig.c +++ b/Alc/alcConfig.c @@ -294,6 +294,12 @@ const char *GetConfigValue(const char *blockName, const char *keyName, const cha return def; } +int ConfigValueExists(const char *blockName, const char *keyName) +{ + const char *val = GetConfigValue(blockName, keyName, ""); + return !!val[0]; +} + int GetConfigValueInt(const char *blockName, const char *keyName, int def) { const char *val = GetConfigValue(blockName, keyName, ""); -- cgit v1.2.3