diff options
author | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2020-09-25 09:55:46 +0200 |
---|---|---|
committer | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2020-09-25 09:55:46 +0200 |
commit | 74a155389c20d4e546050c756b7fa94e445e1c1d (patch) | |
tree | a629f8a0c93eb1eaafcd361a79a30a68fc66d465 /src/misc.c | |
parent | 3a85053e4e72e7bd19790032e5851d2a6c785e9e (diff) | |
download | wlclock-74a155389c20d4e546050c756b7fa94e445e1c1d.tar.gz wlclock-74a155389c20d4e546050c756b7fa94e445e1c1d.tar.bz2 |
Implement all configuration options and signal handling
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; +} + |