Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #ifndef GETOPT_H | |
|
Mark Mentovai
2015/05/04 21:04:29
I believe this should actually be in third_party/g
scottmg
2015/05/04 23:26:36
Done.
| |
| 2 #define GETOPT_H | |
| 3 | |
| 4 /* include files needed by this include file */ | |
| 5 | |
| 6 /* macros defined by this include file */ | |
| 7 #define no_argument 0 | |
| 8 #define required_argument 1 | |
| 9 #define OPTIONAL_ARG 2 | |
| 10 | |
| 11 /* types defined by this include file */ | |
| 12 | |
| 13 /* GETOPT_LONG_OPTION_T: The type of long option */ | |
| 14 typedef struct GETOPT_LONG_OPTION_T | |
| 15 { | |
| 16 const char *name; /* the name of the long option */ | |
| 17 int has_arg; /* one of the above macros */ | |
| 18 int *flag; /* determines if getopt_long() returns a | |
| 19 * value for a long option; if it is | |
| 20 * non-NULL, 0 is returned as a function | |
| 21 * value and the value of val is stored in | |
| 22 * the area pointed to by flag. Otherwise, | |
| 23 * val is returned. */ | |
| 24 int val; /* determines the value to return if flag is | |
| 25 * NULL. */ | |
| 26 } GETOPT_LONG_OPTION_T; | |
| 27 | |
| 28 typedef GETOPT_LONG_OPTION_T option; | |
| 29 | |
| 30 #ifdef __cplusplus | |
| 31 extern "C" | |
| 32 { | |
| 33 #endif | |
| 34 | |
| 35 /* externally-defined variables */ | |
| 36 extern char *optarg; | |
| 37 extern int optind; | |
| 38 extern int opterr; | |
| 39 extern int optopt; | |
| 40 | |
| 41 /* function prototypes */ | |
| 42 int getopt (int argc, char **argv, char *optstring); | |
| 43 int getopt_long (int argc, char **argv, const char *shortopts, | |
| 44 const GETOPT_LONG_OPTION_T * longopts, int *longind); | |
| 45 int getopt_long_only (int argc, char **argv, const char *shortopts, | |
| 46 const GETOPT_LONG_OPTION_T * longopts, int *longind); | |
| 47 | |
| 48 #ifdef __cplusplus | |
| 49 }; | |
| 50 | |
| 51 #endif | |
| 52 | |
| 53 #endif /* GETOPT_H */ | |
| 54 | |
| 55 /* END OF FILE getopt.h */ | |
| OLD | NEW |