OLD | NEW |
1 #ifndef _GETOPT_H | 1 #ifndef _GETOPT_H |
2 #define _GETOPT_H | 2 #define _GETOPT_H |
3 | 3 |
4 #ifdef __cplusplus | 4 #ifdef __cplusplus |
5 extern "C" { | 5 extern "C" { |
6 #endif | 6 #endif |
7 | 7 |
8 int getopt(int, char * const [], const char *); | 8 int getopt(int, char* const[], const char*); |
9 extern char *optarg; | 9 extern char* optarg; |
10 extern int optind, opterr, optopt, optreset; | 10 extern int optind, opterr, optopt, optreset; |
11 | 11 |
12 struct option | 12 struct option { |
13 { | 13 const char* name; |
14 » const char *name; | 14 int has_arg; |
15 » int has_arg; | 15 int* flag; |
16 » int *flag; | 16 int val; |
17 » int val; | |
18 }; | 17 }; |
19 | 18 |
20 int getopt_long(int, char *const *, const char *, const struct option *, int *); | 19 int getopt_long(int, char* const*, const char*, const struct option*, int*); |
21 int getopt_long_only(int, char *const *, const char *, const struct option *, in
t *); | 20 int getopt_long_only(int, |
| 21 char* const*, |
| 22 const char*, |
| 23 const struct option*, |
| 24 int*); |
22 | 25 |
23 #define no_argument 0 | 26 #define no_argument 0 |
24 #define required_argument 1 | 27 #define required_argument 1 |
25 #define optional_argument 2 | 28 #define optional_argument 2 |
26 | 29 |
27 #ifdef __cplusplus | 30 #ifdef __cplusplus |
28 } | 31 } |
29 #endif | 32 #endif |
30 | 33 |
31 #endif | 34 #endif |
OLD | NEW |