3 #include "mem_config.h"
13 extern int opterr; /* if error message should be printed */
14 extern int optind; /* index into parent argv vector */
15 extern char *optarg; /* argument associated with option */
17 struct option /* specification for a long form option... */
19 const char *name; /* option name, without leading hyphens */
20 int has_arg; /* does it take an argument? */
21 int *flag; /* where to save its status, or NULL */
22 int val; /* its associated status value */
25 enum /* permitted values for its `has_arg' field... */
27 no_argument = 0, /* option never takes an argument */
28 required_argument, /* option always requires an argument */
29 optional_argument /* option may take an argument */
32 int getopt(int nargc, char * const *nargv, const char *options);
33 int getopt_long(int nargc, char * const *nargv, const char *options,
34 const struct option *long_options, int *idx);
35 int getopt_long_only(int nargc, char * const *nargv, const char *options,
36 const struct option *long_options, int *idx);
42 #endif // HAVE_GETOPT_H