diff options
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; +} + |