forked from boytm/mproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsd_getopt.h
47 lines (37 loc) · 918 Bytes
/
bsd_getopt.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
/* bsd_getopt.h
*
* Chris Collins <[email protected]>
*/
/** header created for NetBSD getopt/getopt_long */
#ifndef HAVE_GETOPT_LONG
#ifndef _BSD_GETOPT_H
#define _BSD_GETOPT_H
#ifdef WIN32
#include <tchar.h>
#else
#define TCHAR char
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern int opterr; /* prevent the error message by setting opterr to 0 */
extern int optind;
extern int optopt;
extern int optreset;
extern TCHAR *optarg;
struct option {
TCHAR *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, TCHAR * const *nargv, const TCHAR *options);
extern int getopt_long(int nargc, TCHAR * const *nargv, const TCHAR *options, const struct option *long_options, int *idx);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* _BSD_GETOPT_H */
#endif