1 #ifndef PARSE_OPTIONS_H
2 #define PARSE_OPTIONS_H
11 enum parse_opt_flags {
12 PARSE_OPT_KEEP_DASHDASH = 1,
16 enum parse_opt_type type;
18 const char *long_name;
22 #define OPT_END() { OPTION_END }
23 #define OPT_BOOLEAN(s, l, v, h) { OPTION_BOOLEAN, (s), (l), (v) }
24 #define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v) }
25 #define OPT_STRING(s, l, v, a, h) { OPTION_STRING, (s), (l), (v) }
27 /* parse_options() will filter out the processed options and leave the
28 * non-option argments in argv[].
29 * Returns the number of arguments left in argv[].
31 extern int parse_options(int argc, const char **argv,
32 const struct option *options,
33 const char *usagestr, int flags);