summaryrefslogtreecommitdiff
path: root/lib/args.h
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-06 00:39:44 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-06 00:39:44 -0400
commitd8f2c10b7108fff6b7e437291093a1cadc15ab9f (patch)
tree3fc50a19d6fbb9c94a8fe147cd2a6c4ba7f59b8d /lib/args.h
parentansii c (diff)
downloadlazysphere-d8f2c10b7108fff6b7e437291093a1cadc15ab9f.tar.gz
lazysphere-d8f2c10b7108fff6b7e437291093a1cadc15ab9f.tar.bz2
lazysphere-d8f2c10b7108fff6b7e437291093a1cadc15ab9f.zip
refactor
Diffstat (limited to '')
-rw-r--r--lib/args.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/args.h b/lib/args.h
new file mode 100644
index 0000000..0b89fca
--- /dev/null
+++ b/lib/args.h
@@ -0,0 +1,18 @@
+#ifndef ARGS_H
+#define ARGS_H
+
+#define UNUSED(x) (void)(x)
+#define ARG_UNUSED 0
+#define ARG_USED 1
+#define ARG_IGNORE 2
+#define ARG_INVALID 3
+
+void check_arg (char* arg);
+
+void global_help(void (*help)(void));
+
+void parse_help (int argc, char** argv, void (*help)(void));
+
+int parse_args (int argc, char** argv, void (*help)(void), int (*short_arg)(char, char*), int (*long_arg)(char*, char*));
+
+#endif