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 
gk_optopt
int gk_optopt
Stores unknown option characters.
Definition: getopt.c:92
gk_option::name
char * name
Definition: gk_getopt.h:29
gk_opterr
int gk_opterr
Controls error reporting for unrecognized options.
Definition: getopt.c:81
gk_option::has_arg
int has_arg
Definition: gk_getopt.h:30
gk_option
The structure that stores the information about the command-line options.
Definition: gk_getopt.h:28
gk_optarg
char * gk_optarg
For communication arguments to the caller.
Definition: getopt.c:56
gk_option::flag
int * flag
Definition: gk_getopt.h:34
gk_optind
int gk_optind
Index in ARGV of the next element to be scanned.
Definition: getopt.c:68
gk_getopt_long
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
gk_getopt_long_only
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
gk_option::val
int val
Definition: gk_getopt.h:35
gk_getopt
int gk_getopt(int __argc, char **__argv, char *__shortopts)
Parse command-line arguments.
Definition: getopt.c:770


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:22