From 9650bc35b4aa4ffc35cf99d0e1db64dda5d801c8 Mon Sep 17 00:00:00 2001 From: gramanas Date: Wed, 8 Jun 2022 13:54:49 +0300 Subject: Move from getopt to foodopts --- src/foodopts.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/foodopts.h') diff --git a/src/foodopts.h b/src/foodopts.h index 544dd3f..c8b0686 100644 --- a/src/foodopts.h +++ b/src/foodopts.h @@ -11,6 +11,25 @@ * the parsing results. * */ +struct foodoption { + const char *name; + int has_arg; + int *flag; + int val; + /* Extra values */ + const char *help; + const char *arg; +}; + +int +get_foodopt(int argc, char *const argv[], + const char *optstring, + const struct foodoption *longopts, + int *longindex); + +void +foodopt_help(char * argv0, + const struct foodoption *longopts); #endif /* __FOODOPTS_H */ -- cgit v1.2.3