From 1a616a1b469a00279ac6d42cffcd2b23da492c60 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 24 Aug 2013 22:41:44 -0700 Subject: move text2bool to os_calls --- common/os_calls.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'common/os_calls.c') diff --git a/common/os_calls.c b/common/os_calls.c index f5f5cd60..1939ddc9 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -2935,3 +2935,18 @@ g_time3(void) return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); #endif } + +/*****************************************************************************/ +/* returns boolean */ +int APP_CC +g_text2bool(const char *s) +{ + if ( (g_atoi(s) != 0) || + (0 == g_strcasecmp(s, "true")) || + (0 == g_strcasecmp(s, "on")) || + (0 == g_strcasecmp(s, "yes"))) + { + return 1; + } + return 0; +} -- cgit v1.2.1