summaryrefslogtreecommitdiff
path: root/src/libmowgli/ext/getopt_long.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmowgli/ext/getopt_long.h')
-rw-r--r--src/libmowgli/ext/getopt_long.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libmowgli/ext/getopt_long.h b/src/libmowgli/ext/getopt_long.h
index 94c90a9..84653ab 100644
--- a/src/libmowgli/ext/getopt_long.h
+++ b/src/libmowgli/ext/getopt_long.h
@@ -35,30 +35,34 @@
/*
* Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
*/
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
-typedef struct {
+typedef struct
+{
/* name of long option */
const char *name;
+
/*
* one of no_argument, required_argument, and optional_argument:
* whether option takes an argument
*/
int has_arg;
+
/* if not NULL, set *flag to val when option found */
int *flag;
+
/* if flag not NULL, value to set *flag to; else return value */
int val;
+
/* internal value */
int iflag;
} mowgli_getopt_option_t;
-extern int mowgli_getopt(int nargc, char * const *nargv, const char *options);
+extern int mowgli_getopt(int nargc, char *const *nargv, const char *options);
-extern int mowgli_getopt_long(int, char * const *, const char *,
- const mowgli_getopt_option_t *, int *);
+extern int mowgli_getopt_long(int, char *const *, const char *, const mowgli_getopt_option_t *, int *);
extern int mowgli_opterr;
extern int mowgli_optind;