LibOFX: cmdline.h Source File

LibOFX

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

cmdline.h
Go to the documentation of this file.
1
8 #ifndef CMDLINE_H
9 #define CMDLINE_H
10
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15
16 #include <stdio.h> /* for FILE */
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21
22 #ifndef CMDLINE_PARSER_PACKAGE
23
24 #define CMDLINE_PARSER_PACKAGE PACKAGE
25 #endif
26
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28
29 #ifdef PACKAGE_NAME
30 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME
31 #else
32 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE
33 #endif
34 #endif
35
36 #ifndef CMDLINE_PARSER_VERSION
37
38 #define CMDLINE_PARSER_VERSION VERSION
39 #endif
40
42 struct gengetopt_args_info
43 {
44 const char *help_help;
45 const char *version_help;
46 char * import_format_arg;
47 char * import_format_orig;
48 const char *import_format_help;
49 const char *list_import_formats_help;
50 int msg_parser_flag;
51 const char *msg_parser_help;
52 int msg_debug_flag;
53 const char *msg_debug_help;
54 int msg_warning_flag;
55 const char *msg_warning_help;
56 int msg_error_flag;
57 const char *msg_error_help;
58 int msg_info_flag;
59 const char *msg_info_help;
60 int msg_status_flag;
61 const char *msg_status_help;
63 unsigned int help_given ;
64 unsigned int version_given ;
65 unsigned int import_format_given ;
66 unsigned int list_import_formats_given ;
67 unsigned int msg_parser_given ;
68 unsigned int msg_debug_given ;
69 unsigned int msg_warning_given ;
70 unsigned int msg_error_given ;
71 unsigned int msg_info_given ;
72 unsigned int msg_status_given ;
74 char **inputs ;
75 unsigned inputs_num ;
76 } ;
77
79 struct cmdline_parser_params
80 {
81 int override;
82 int initialize;
83 int check_required;
84 int check_ambiguity;
85 int print_errors;
86 } ;
87
89 extern const char *gengetopt_args_info_purpose;
91 extern const char *gengetopt_args_info_usage;
93 extern const char *gengetopt_args_info_description;
95 extern const char *gengetopt_args_info_help[];
96
104 int cmdline_parser (int argc, char **argv,
105 struct gengetopt_args_info *args_info);
106
118 int cmdline_parser2 (int argc, char **argv,
119 struct gengetopt_args_info *args_info,
120 int override, int initialize, int check_required);
121
130 int cmdline_parser_ext (int argc, char **argv,
131 struct gengetopt_args_info *args_info,
132 struct cmdline_parser_params *params);
133
140 int cmdline_parser_dump(FILE *outfile,
141 struct gengetopt_args_info *args_info);
142
150 int cmdline_parser_file_save(const char *filename,
151 struct gengetopt_args_info *args_info);
152
156 void cmdline_parser_print_help(void);
160 void cmdline_parser_print_version(void);
161
167 void cmdline_parser_params_init(struct cmdline_parser_params *params);
168
174 struct cmdline_parser_params *cmdline_parser_params_create(void);
175
181 void cmdline_parser_init (struct gengetopt_args_info *args_info);
187 void cmdline_parser_free (struct gengetopt_args_info *args_info);
188
196 int cmdline_parser_required (struct gengetopt_args_info *args_info,
197 const char *prog_name);
198
199
200 #ifdef __cplusplus
201 }
202 #endif /* __cplusplus */
203 #endif /* CMDLINE_H */
gengetopt_args_info::msg_info_flag
int msg_info_flag
Output informational messages about the progress of the library (default=on).
Definition: cmdline.h:58
cmdline_parser_params::initialize
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: cmdline.h:82
gengetopt_args_info::msg_status_help
const char * msg_status_help
Output status messages help description.
Definition: cmdline.h:61
gengetopt_args_info::msg_warning_flag
int msg_warning_flag
Output warning messages about abnormal conditions and unknown constructs (default=on).
Definition: cmdline.h:54
gengetopt_args_info::import_format_arg
char * import_format_arg
Force the file format of the file(s) specified (default='AUTODETECT').
Definition: cmdline.h:46
gengetopt_args_info::msg_warning_given
unsigned int msg_warning_given
Whether msg_warning was given.
Definition: cmdline.h:69
gengetopt_args_info
Where the command line options are stored.
Definition: cmdline.h:42
gengetopt_args_info::msg_error_given
unsigned int msg_error_given
Whether msg_error was given.
Definition: cmdline.h:70
gengetopt_args_info::help_given
unsigned int help_given
Whether help was given.
Definition: cmdline.h:63
gengetopt_args_info_help
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: cmdline.c:36
gengetopt_args_info::msg_debug_given
unsigned int msg_debug_given
Whether msg_debug was given.
Definition: cmdline.h:68
gengetopt_args_info_usage
const char * gengetopt_args_info_usage
the usage string of the program
Definition: cmdline.c:30
cmdline_parser_file_save
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Definition: cmdline.c:263
gengetopt_args_info::msg_status_given
unsigned int msg_status_given
Whether msg_status was given.
Definition: cmdline.h:72
gengetopt_args_info::msg_parser_given
unsigned int msg_parser_given
Whether msg_parser was given.
Definition: cmdline.h:67
gengetopt_args_info::msg_debug_flag
int msg_debug_flag
Output messages meant for debuging (default=off).
Definition: cmdline.h:52
gengetopt_args_info::list_import_formats_given
unsigned int list_import_formats_given
Whether list-import-formats was given.
Definition: cmdline.h:66
gengetopt_args_info::msg_parser_help
const char * msg_parser_help
Output file parsing messages help description.
Definition: cmdline.h:51
cmdline_parser_params
The additional parameters to pass to parser functions.
Definition: cmdline.h:79
gengetopt_args_info_purpose
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: cmdline.c:28
gengetopt_args_info::list_import_formats_help
const char * list_import_formats_help
List available import file formats 'import-format' command help description.
Definition: cmdline.h:49
gengetopt_args_info::import_format_given
unsigned int import_format_given
Whether import-format was given.
Definition: cmdline.h:65
cmdline_parser_dump
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Definition: cmdline.c:226
gengetopt_args_info::import_format_orig
char * import_format_orig
Force the file format of the file(s) specified original value given at command line.
Definition: cmdline.h:47
cmdline_parser_print_version
void cmdline_parser_print_version(void)
Definition: cmdline.c:117
cmdline_parser_init
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Definition: cmdline.c:152
gengetopt_args_info::msg_error_help
const char * msg_error_help
Output error messages help description.
Definition: cmdline.h:57
gengetopt_args_info::import_format_help
const char * import_format_help
Force the file format of the file(s) specified help description.
Definition: cmdline.h:48
gengetopt_args_info_description
const char * gengetopt_args_info_description
the description string of the program
Definition: cmdline.c:34
gengetopt_args_info::version_help
const char * version_help
Print version and exit help description.
Definition: cmdline.h:45
cmdline_parser2
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
Definition: cmdline.c:326
cmdline_parser_params_init
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Definition: cmdline.c:163
gengetopt_args_info::msg_error_flag
int msg_error_flag
Output error messages (default=on).
Definition: cmdline.h:56
gengetopt_args_info::msg_debug_help
const char * msg_debug_help
Output messages meant for debuging help description.
Definition: cmdline.h:53
cmdline_parser
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: cmdline.c:304
cmdline_parser_print_help
void cmdline_parser_print_help(void)
Definition: cmdline.c:143
gengetopt_args_info::inputs_num
unsigned inputs_num
unamed options number
Definition: cmdline.h:75
cmdline_parser_ext
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
Definition: cmdline.c:310
gengetopt_args_info::help_help
const char * help_help
Print help and exit help description.
Definition: cmdline.h:44
gengetopt_args_info::msg_status_flag
int msg_status_flag
Output status messages (default=on).
Definition: cmdline.h:60
gengetopt_args_info::msg_parser_flag
int msg_parser_flag
Output file parsing messages (default=off).
Definition: cmdline.h:50
cmdline_parser_params::print_errors
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: cmdline.h:85
cmdline_parser_params::check_ambiguity
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: cmdline.h:84
cmdline_parser_params::check_required
int check_required
whether to check that all required options were provided (default 1)
Definition: cmdline.h:83
gengetopt_args_info::msg_info_help
const char * msg_info_help
Output informational messages about the progress of the library help description. ...
Definition: cmdline.h:59
gengetopt_args_info::msg_info_given
unsigned int msg_info_given
Whether msg_info was given.
Definition: cmdline.h:71
gengetopt_args_info::inputs
char ** inputs
unamed options (options without names)
Definition: cmdline.h:74
cmdline_parser_free
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Definition: cmdline.c:283
cmdline_parser_params_create
struct cmdline_parser_params * cmdline_parser_params_create(void)
Definition: cmdline.c:176
cmdline_parser_required
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Definition: cmdline.c:349
gengetopt_args_info::msg_warning_help
const char * msg_warning_help
Output warning messages about abnormal conditions and unknown constructs help description.
Definition: cmdline.h:55
gengetopt_args_info::version_given
unsigned int version_given
Whether version was given.
Definition: cmdline.h:64