gk_getopt.h
Go to the documentation of this file.
1 
10 #ifndef _GK_GETOPT_H_
11 #define _GK_GETOPT_H_
12 
13 
14 /* Externals from getopt.c */
15 extern char *gk_optarg;
16 extern int gk_optind;
17 extern int gk_opterr;
18 extern int gk_optopt;
19 
20 
28 struct gk_option {
29  char *name;
30  int has_arg;
34  int *flag;
35  int val;
46 };
47 
48 /* Names for the values of the `has_arg' field of `struct gk_option'. */
49 #define no_argument 0
50 #define required_argument 1
51 #define optional_argument 2
52 
53 
54 /* Function prototypes */
55 extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
56 extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
57  struct gk_option *__longopts, int *__longind);
58 extern int gk_getopt_long_only (int __argc, char **__argv,
59  char *__shortopts, struct gk_option *__longopts, int *__longind);
60 
61 
62 
63 #endif
64 
The structure that stores the information about the command-line options.
Definition: gk_getopt.h:28
char * name
Definition: gk_getopt.h:29
int gk_optind
Index in ARGV of the next element to be scanned.
Definition: getopt.c:68
char * gk_optarg
For communication arguments to the caller.
Definition: getopt.c:56
int gk_opterr
Controls error reporting for unrecognized options.
Definition: getopt.c:81
int has_arg
Definition: gk_getopt.h:30
int * flag
Definition: gk_getopt.h:34
int gk_getopt_long(int __argc, char **__argv, char *__shortopts, struct gk_option *__longopts, int *__longind)
Parse command-line arguments with long options.
Definition: getopt.c:834
int val
Definition: gk_getopt.h:35
int gk_getopt_long_only(int __argc, char **__argv, char *__shortopts, struct gk_option *__longopts, int *__longind)
Parse command-line arguments with only long options.
Definition: getopt.c:850
int gk_optopt
Stores unknown option characters.
Definition: getopt.c:92
int gk_getopt(int __argc, char **__argv, char *__shortopts)
Parse command-line arguments.
Definition: getopt.c:770


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:08