From 95596fb8fac8e94eccdcde087d4972cd82b21903 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 30 May 2012 17:26:10 +0200 Subject: add option_is_set() helper function for config parsing. Guenther Signed-off-by: Simo Sorce --- proxy/src/gp_config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'proxy/src') diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c index bae52e1..384f0a4 100644 --- a/proxy/src/gp_config.c +++ b/proxy/src/gp_config.c @@ -79,6 +79,18 @@ static int get_int_value(dictionary *dict, return ret; } +static bool option_is_set(const char *s) +{ + if (strcasecmp(s, "1") == 0 || + strcasecmp(s, "on") == 0 || + strcasecmp(s, "true") == 0 || + strcasecmp(s, "yes")) { + return true; + } + + return false; +} + static int get_krb5_mech_cfg(struct gp_service *svc, dictionary *dict, const char *secname) -- cgit