1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#ifndef _BSD_GETOPT_H
#define _BSD_GETOPT_H
/* bsd_getopt.h
*
* Chris Collins <chris@collins.id.au>
*/
/** header created for NetBSD getopt/getopt_long */
#ifndef HAVE_GETOPT_LONG
extern int opterr;
extern int optind;
extern int optopt;
extern int optreset;
extern char *optarg;
struct option {
char *name;
int has_arg;
int *flag;
int val;
};
#define no_argument 0
#define required_argument 1
#define optional_argument 2
extern int getopt(int nargc, char * const *nargv, const char *options);
extern int getopt_long(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx);
#endif
#endif /* _BSD_GETOPT_H */
|