aboutsummaryrefslogtreecommitdiff
path: root/src/utils/args.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/args.h')
-rw-r--r--src/utils/args.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/utils/args.h b/src/utils/args.h
new file mode 100644
index 0000000..ddf086d
--- /dev/null
+++ b/src/utils/args.h
@@ -0,0 +1,28 @@
+#ifndef UTILS_ARGS_H
+#define UTILS_ARGS_H
+
+#include <stdbool.h>
+
+struct option
+{
+ char short_name[16];
+ char name[32];
+ bool has_param;
+ // first: args struct; second: param;
+ void (*handle)(void *, const char *);
+};
+
+// ALR stands for Args Load Result
+enum alr
+{
+ ALR_OK,
+ ALR_INVALID_OPTION
+};
+
+/*
+ * opt_length: options length
+ * args: args struct
+ */
+enum alr process_args(int argc, char **argv, struct option *options, int opt_length, void *args);
+
+#endif \ No newline at end of file