summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-08-24 22:41:44 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-08-24 22:41:44 -0700
commit1a616a1b469a00279ac6d42cffcd2b23da492c60 (patch)
treef99d7ef5784236dc52089ee3fb592a71ac930066 /common/os_calls.c
parent9538ca422b03c003d30cba30f3907723a22f3ea1 (diff)
downloadxrdp-proprietary-1a616a1b469a00279ac6d42cffcd2b23da492c60.tar.gz
xrdp-proprietary-1a616a1b469a00279ac6d42cffcd2b23da492c60.zip
move text2bool to os_calls
Diffstat (limited to 'common/os_calls.c')
-rw-r--r--common/os_calls.c15
1 files changed, 15 insertions, 0 deletions
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;
+}