Ninja
getopt.h
Go to the documentation of this file.
1 #ifndef GETOPT_H
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_ARG 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. */
27 
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 */
const char * name
Definition: getopt.h:16
struct GETOPT_LONG_OPTION_T GETOPT_LONG_OPTION_T
int getopt_long(int argc, char **argv, const char *shortopts, const GETOPT_LONG_OPTION_T *longopts, int *longind)
int optopt
int getopt(int argc, char **argv, char *optstring)
char * optarg
int optind
int getopt_long_only(int argc, char **argv, const char *shortopts, const GETOPT_LONG_OPTION_T *longopts, int *longind)
GETOPT_LONG_OPTION_T option
Definition: getopt.h:28
int opterr