summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index dd4500d..289e00d 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1,3 +1,4 @@
+#include<stdbool.h>
#include<stdarg.h>
#include<stdio.h>
#include<stdlib.h>
@@ -28,3 +29,18 @@ void clocklog (struct Wlclock *clock, int level, const char *fmt, ...)
vfprintf(stderr, fmt, args);
va_end(args);
}
+
+bool is_boolean_true (const char *in)
+{
+ if ( ! strcmp(in, "true") || ! strcmp(in, "yes") || ! strcmp(in, "on") || ! strcmp(in, "1") )
+ return true;
+ return false;
+}
+
+bool is_boolean_false (const char *in)
+{
+ if ( ! strcmp(in, "false") || ! strcmp(in, "no") || ! strcmp(in, "off") || ! strcmp(in, "0") )
+ return true;
+ return false;
+}
+