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