summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2020-09-25 09:55:46 +0200
committerLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2020-09-25 09:55:46 +0200
commit74a155389c20d4e546050c756b7fa94e445e1c1d (patch)
treea629f8a0c93eb1eaafcd361a79a30a68fc66d465 /src/misc.c
parent3a85053e4e72e7bd19790032e5851d2a6c785e9e (diff)
downloadwlclock-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.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;
+}
+