From d8f2c10b7108fff6b7e437291093a1cadc15ab9f Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 6 May 2023 00:39:44 -0400 Subject: refactor --- lib/args.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/args.h (limited to 'lib/args.h') 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 -- cgit v1.2.3-freya