make-w32.sh: generate ChangeLog
[quvi.git] / src / cmdline.h
blobcf018e30ad552985490facccca132295d6e54adb
1 /** @file cmdline.h
2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.4
4 * http://www.gnu.org/software/gengetopt.
5 * DO NOT modify this file, since it can be overwritten
6 * @author GNU Gengetopt by Lorenzo Bettini */
8 #ifndef CMDLINE_H
9 #define CMDLINE_H
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
16 #include <stdio.h> /* for FILE */
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
22 #ifndef CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define CMDLINE_PARSER_PACKAGE "quvi"
25 #endif
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28 /** @brief the complete program name (used for help and version) */
29 #define CMDLINE_PARSER_PACKAGE_NAME "quvi"
30 #endif
32 #ifndef CMDLINE_PARSER_VERSION
33 /** @brief the program version */
34 #define CMDLINE_PARSER_VERSION ""
35 #endif
37 /** @brief Where the command line options are stored */
38 struct gengetopt_args_info {
39 const char *help_help;
40 /**< @brief Print help and exit help description. */
41 const char *version_help;
42 /**< @brief Print version and exit help description. */
43 const char *license_help;
44 /**< @brief Print license and exit help description. */
45 const char *support_help;
46 /**< @brief Print supported websites and exit help description. */
47 const char *xml_help;
48 /**< @brief Print details in XML help description. */
49 const char *old_help;
50 /**< @brief Print details in original format help description. */
51 const char *quiet_help;
52 /**< @brief Turn off output to stderr help description. */
53 const char *verbose_libcurl_help;
54 /**< @brief Turn on libcurl verbose mode help description. */
55 char *exec_arg; /**< @brief Invoke arg after parsing. */
56 char *exec_orig; /**< @brief Invoke arg after parsing original value given at command line. */
57 const char *exec_help;
58 /**< @brief Invoke arg after parsing help description. */
59 const char *no_shortened_help;
60 /**< @brief Do not decompress shortened URLs help description. */
61 const char *no_verify_help;
62 /**< @brief Do not verify video link help description. */
63 char *page_title_arg; /**< @brief Check that parsed page title matches arg. */
64 char *page_title_orig; /**< @brief Check that parsed page title matches arg original value given at command line. */
65 const char *page_title_help;
66 /**< @brief Check that parsed page title matches arg help description. */
67 char *video_id_arg; /**< @brief Check that parsed video ID matches arg. */
68 char *video_id_orig;/**< @brief Check that parsed video ID matches arg original value given at command line. */
69 const char *video_id_help;
70 /**< @brief Check that parsed video ID matches arg help description. */
71 double file_length_arg; /**< @brief Check that parsed video length matches arg. */
72 char *file_length_orig; /**< @brief Check that parsed video length matches arg original value given at command line. */
73 const char *file_length_help;
74 /**< @brief Check that parsed video length matches arg help description. */
75 char *file_suffix_arg; /**< @brief Check that parsed video suffix matches arg. */
76 char *file_suffix_orig; /**< @brief Check that parsed video suffix matches arg original value given at command line. */
77 const char *file_suffix_help;
78 /**< @brief Check that parsed video suffix matches arg help description. */
79 const char *test_all_help;
80 /**< @brief Run built-in tests help description. */
81 const char *dump_help;
82 /**< @brief Dump video details with --test-all help description. */
83 char *test_arg; /**< @brief Pattern to match to built-in test URLs. */
84 char *test_orig; /**< @brief Pattern to match to built-in test URLs original value given at command line. */
85 const char *test_help;
86 /**< @brief Pattern to match to built-in test URLs help description. */
87 char *format_arg; /**< @brief Video format to query (default='default'). */
88 char *format_orig; /**< @brief Video format to query original value given at command line. */
89 const char *format_help;
90 /**< @brief Video format to query help description. */
91 char *agent_arg; /**< @brief Identify as arg (default='Mozilla/5.0'). */
92 char *agent_orig; /**< @brief Identify as arg original value given at command line. */
93 const char *agent_help;
94 /**< @brief Identify as arg help description. */
95 char *proxy_arg; /**< @brief Use proxy for HTTP connections. */
96 char *proxy_orig; /**< @brief Use proxy for HTTP connections original value given at command line. */
97 const char *proxy_help;
98 /**< @brief Use proxy for HTTP connections help description. */
99 const char *no_proxy_help;
100 /**< @brief Disable use of HTTP proxy help description. */
101 int connect_timeout_arg; /**< @brief Seconds connecting allowed to take (default='30'). */
102 char *connect_timeout_orig; /**< @brief Seconds connecting allowed to take original value given at command line. */
103 const char *connect_timeout_help;
104 /**< @brief Seconds connecting allowed to take help description. */
106 unsigned int help_given; /**< @brief Whether help was given. */
107 unsigned int version_given; /**< @brief Whether version was given. */
108 unsigned int license_given; /**< @brief Whether license was given. */
109 unsigned int support_given; /**< @brief Whether support was given. */
110 unsigned int xml_given; /**< @brief Whether xml was given. */
111 unsigned int old_given; /**< @brief Whether old was given. */
112 unsigned int quiet_given; /**< @brief Whether quiet was given. */
113 unsigned int verbose_libcurl_given; /**< @brief Whether verbose-libcurl was given. */
114 unsigned int exec_given; /**< @brief Whether exec was given. */
115 unsigned int no_shortened_given; /**< @brief Whether no-shortened was given. */
116 unsigned int no_verify_given; /**< @brief Whether no-verify was given. */
117 unsigned int page_title_given; /**< @brief Whether page-title was given. */
118 unsigned int video_id_given;/**< @brief Whether video-id was given. */
119 unsigned int file_length_given; /**< @brief Whether file-length was given. */
120 unsigned int file_suffix_given; /**< @brief Whether file-suffix was given. */
121 unsigned int test_all_given;/**< @brief Whether test-all was given. */
122 unsigned int dump_given; /**< @brief Whether dump was given. */
123 unsigned int test_given; /**< @brief Whether test was given. */
124 unsigned int format_given; /**< @brief Whether format was given. */
125 unsigned int agent_given; /**< @brief Whether agent was given. */
126 unsigned int proxy_given; /**< @brief Whether proxy was given. */
127 unsigned int no_proxy_given;/**< @brief Whether no-proxy was given. */
128 unsigned int connect_timeout_given; /**< @brief Whether connect-timeout was given. */
130 char **inputs;/**< @brief unamed options (options without names) */
131 unsigned inputs_num;/**< @brief unamed options number */
134 /** @brief The additional parameters to pass to parser functions */
135 struct cmdline_parser_params {
136 int override;
137 /**< @brief whether to override possibly already present options (default 0) */
138 int initialize;
139 /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
140 int check_required;
141 /**< @brief whether to check that all required options were provided (default 1) */
142 int check_ambiguity;
143 /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
144 int print_errors;
145 /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
148 /** @brief the purpose string of the program */
149 extern const char *gengetopt_args_info_purpose;
150 /** @brief the usage string of the program */
151 extern const char *gengetopt_args_info_usage;
152 /** @brief all the lines making the help output */
153 extern const char *gengetopt_args_info_help[];
156 * The command line parser
157 * @param argc the number of command line options
158 * @param argv the command line options
159 * @param args_info the structure where option information will be stored
160 * @return 0 if everything went fine, NON 0 if an error took place
162 int cmdline_parser(int argc, char **argv,
163 struct gengetopt_args_info *args_info);
166 * The command line parser (version with additional parameters - deprecated)
167 * @param argc the number of command line options
168 * @param argv the command line options
169 * @param args_info the structure where option information will be stored
170 * @param override whether to override possibly already present options
171 * @param initialize whether to initialize the option structure my_args_info
172 * @param check_required whether to check that all required options were provided
173 * @return 0 if everything went fine, NON 0 if an error took place
174 * @deprecated use cmdline_parser_ext() instead
176 int cmdline_parser2(int argc, char **argv,
177 struct gengetopt_args_info *args_info,
178 int override, int initialize, int check_required);
181 * The command line parser (version with additional parameters)
182 * @param argc the number of command line options
183 * @param argv the command line options
184 * @param args_info the structure where option information will be stored
185 * @param params additional parameters for the parser
186 * @return 0 if everything went fine, NON 0 if an error took place
188 int cmdline_parser_ext(int argc, char **argv,
189 struct gengetopt_args_info *args_info,
190 struct cmdline_parser_params *params);
193 * Save the contents of the option struct into an already open FILE stream.
194 * @param outfile the stream where to dump options
195 * @param args_info the option struct to dump
196 * @return 0 if everything went fine, NON 0 if an error took place
198 int cmdline_parser_dump(FILE * outfile,
199 struct gengetopt_args_info *args_info);
202 * Save the contents of the option struct into a (text) file.
203 * This file can be read by the config file parser (if generated by gengetopt)
204 * @param filename the file where to save
205 * @param args_info the option struct to save
206 * @return 0 if everything went fine, NON 0 if an error took place
208 int cmdline_parser_file_save(const char *filename,
209 struct gengetopt_args_info *args_info);
212 * Print the help
214 void cmdline_parser_print_help(void);
216 * Print the version
218 void cmdline_parser_print_version(void);
221 * Initializes all the fields a cmdline_parser_params structure
222 * to their default values
223 * @param params the structure to initialize
225 void cmdline_parser_params_init(struct cmdline_parser_params *params);
228 * Allocates dynamically a cmdline_parser_params structure and initializes
229 * all its fields to their default values
230 * @return the created and initialized cmdline_parser_params structure
232 struct cmdline_parser_params *cmdline_parser_params_create(void);
235 * Initializes the passed gengetopt_args_info structure's fields
236 * (also set default values for options that have a default)
237 * @param args_info the structure to initialize
239 void cmdline_parser_init(struct gengetopt_args_info *args_info);
241 * Deallocates the string fields of the gengetopt_args_info structure
242 * (but does not deallocate the structure itself)
243 * @param args_info the structure to deallocate
245 void cmdline_parser_free(struct gengetopt_args_info *args_info);
248 * The config file parser (deprecated version)
249 * @param filename the name of the config file
250 * @param args_info the structure where option information will be stored
251 * @param override whether to override possibly already present options
252 * @param initialize whether to initialize the option structure my_args_info
253 * @param check_required whether to check that all required options were provided
254 * @return 0 if everything went fine, NON 0 if an error took place
255 * @deprecated use cmdline_parser_config_file() instead
257 int cmdline_parser_configfile(const char *filename,
258 struct gengetopt_args_info *args_info,
259 int override, int initialize,
260 int check_required);
263 * The config file parser
264 * @param filename the name of the config file
265 * @param args_info the structure where option information will be stored
266 * @param params additional parameters for the parser
267 * @return 0 if everything went fine, NON 0 if an error took place
269 int cmdline_parser_config_file(const char *filename,
270 struct gengetopt_args_info *args_info,
271 struct cmdline_parser_params *params);
274 * Checks that all the required options were specified
275 * @param args_info the structure to check
276 * @param prog_name the name of the program that will be used to print
277 * possible errors
278 * @return
280 int cmdline_parser_required(struct gengetopt_args_info *args_info,
281 const char *prog_name);
283 #ifdef __cplusplus
285 #endif /* __cplusplus */
286 #endif /* CMDLINE_H */