Add scripts/Makefile.am
[quvi.git] / src / cmdline.h
blobdb16aed052b8bc1fd85069d115e817f7d7e8834c
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 const char *category_http_help;
64 /**< @brief Category HTTP website scripts help description. */
65 const char *category_mms_help;
66 /**< @brief Category MMS website scripts help description. */
67 const char *category_rtsp_help;
68 /**< @brief Category RTSP website scripts help description. */
69 const char *category_rtmp_help;
70 /**< @brief Category RTMP website scripts help description. */
71 const char *category_all_help;
72 /**< @brief All website script categories help description. */
73 char *page_title_arg; /**< @brief Check that parsed page title matches arg. */
74 char *page_title_orig; /**< @brief Check that parsed page title matches arg original value given at command line. */
75 const char *page_title_help;
76 /**< @brief Check that parsed page title matches arg help description. */
77 char *video_id_arg; /**< @brief Check that parsed video ID matches arg. */
78 char *video_id_orig;/**< @brief Check that parsed video ID matches arg original value given at command line. */
79 const char *video_id_help;
80 /**< @brief Check that parsed video ID matches arg help description. */
81 double file_length_arg; /**< @brief Check that parsed video length matches arg. */
82 char *file_length_orig; /**< @brief Check that parsed video length matches arg original value given at command line. */
83 const char *file_length_help;
84 /**< @brief Check that parsed video length matches arg help description. */
85 char *file_suffix_arg; /**< @brief Check that parsed video suffix matches arg. */
86 char *file_suffix_orig; /**< @brief Check that parsed video suffix matches arg original value given at command line. */
87 const char *file_suffix_help;
88 /**< @brief Check that parsed video suffix matches arg help description. */
89 const char *test_all_help;
90 /**< @brief Run all built-in tests of category QUVIPROTO_HTTP help description. */
91 const char *dump_help;
92 /**< @brief Dump video details with --test-all help description. */
93 char *test_arg; /**< @brief Pattern to match to built-in test URLs. */
94 char *test_orig; /**< @brief Pattern to match to built-in test URLs original value given at command line. */
95 const char *test_help;
96 /**< @brief Pattern to match to built-in test URLs help description. */
97 char *format_arg; /**< @brief Video format to query (default='default'). */
98 char *format_orig; /**< @brief Video format to query original value given at command line. */
99 const char *format_help;
100 /**< @brief Video format to query help description. */
101 char *agent_arg; /**< @brief Identify as arg (default='Mozilla/5.0'). */
102 char *agent_orig; /**< @brief Identify as arg original value given at command line. */
103 const char *agent_help;
104 /**< @brief Identify as arg help description. */
105 char *proxy_arg; /**< @brief Use proxy for HTTP connections. */
106 char *proxy_orig; /**< @brief Use proxy for HTTP connections original value given at command line. */
107 const char *proxy_help;
108 /**< @brief Use proxy for HTTP connections help description. */
109 const char *no_proxy_help;
110 /**< @brief Disable use of HTTP proxy help description. */
111 int connect_timeout_arg; /**< @brief Seconds connecting allowed to take (default='30'). */
112 char *connect_timeout_orig; /**< @brief Seconds connecting allowed to take original value given at command line. */
113 const char *connect_timeout_help;
114 /**< @brief Seconds connecting allowed to take help description. */
116 unsigned int help_given; /**< @brief Whether help was given. */
117 unsigned int version_given; /**< @brief Whether version was given. */
118 unsigned int license_given; /**< @brief Whether license was given. */
119 unsigned int support_given; /**< @brief Whether support was given. */
120 unsigned int xml_given; /**< @brief Whether xml was given. */
121 unsigned int old_given; /**< @brief Whether old was given. */
122 unsigned int quiet_given; /**< @brief Whether quiet was given. */
123 unsigned int verbose_libcurl_given; /**< @brief Whether verbose-libcurl was given. */
124 unsigned int exec_given; /**< @brief Whether exec was given. */
125 unsigned int no_shortened_given; /**< @brief Whether no-shortened was given. */
126 unsigned int no_verify_given; /**< @brief Whether no-verify was given. */
127 unsigned int category_http_given; /**< @brief Whether category-http was given. */
128 unsigned int category_mms_given; /**< @brief Whether category-mms was given. */
129 unsigned int category_rtsp_given; /**< @brief Whether category-rtsp was given. */
130 unsigned int category_rtmp_given; /**< @brief Whether category-rtmp was given. */
131 unsigned int category_all_given; /**< @brief Whether category-all was given. */
132 unsigned int page_title_given; /**< @brief Whether page-title was given. */
133 unsigned int video_id_given;/**< @brief Whether video-id was given. */
134 unsigned int file_length_given; /**< @brief Whether file-length was given. */
135 unsigned int file_suffix_given; /**< @brief Whether file-suffix was given. */
136 unsigned int test_all_given;/**< @brief Whether test-all was given. */
137 unsigned int dump_given; /**< @brief Whether dump was given. */
138 unsigned int test_given; /**< @brief Whether test was given. */
139 unsigned int format_given; /**< @brief Whether format was given. */
140 unsigned int agent_given; /**< @brief Whether agent was given. */
141 unsigned int proxy_given; /**< @brief Whether proxy was given. */
142 unsigned int no_proxy_given;/**< @brief Whether no-proxy was given. */
143 unsigned int connect_timeout_given; /**< @brief Whether connect-timeout was given. */
145 char **inputs;/**< @brief unamed options (options without names) */
146 unsigned inputs_num;/**< @brief unamed options number */
149 /** @brief The additional parameters to pass to parser functions */
150 struct cmdline_parser_params {
151 int override;
152 /**< @brief whether to override possibly already present options (default 0) */
153 int initialize;
154 /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
155 int check_required;
156 /**< @brief whether to check that all required options were provided (default 1) */
157 int check_ambiguity;
158 /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
159 int print_errors;
160 /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
163 /** @brief the purpose string of the program */
164 extern const char *gengetopt_args_info_purpose;
165 /** @brief the usage string of the program */
166 extern const char *gengetopt_args_info_usage;
167 /** @brief all the lines making the help output */
168 extern const char *gengetopt_args_info_help[];
171 * The command line parser
172 * @param argc the number of command line options
173 * @param argv the command line options
174 * @param args_info the structure where option information will be stored
175 * @return 0 if everything went fine, NON 0 if an error took place
177 int cmdline_parser(int argc, char **argv,
178 struct gengetopt_args_info *args_info);
181 * The command line parser (version with additional parameters - deprecated)
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 override whether to override possibly already present options
186 * @param initialize whether to initialize the option structure my_args_info
187 * @param check_required whether to check that all required options were provided
188 * @return 0 if everything went fine, NON 0 if an error took place
189 * @deprecated use cmdline_parser_ext() instead
191 int cmdline_parser2(int argc, char **argv,
192 struct gengetopt_args_info *args_info,
193 int override, int initialize, int check_required);
196 * The command line parser (version with additional parameters)
197 * @param argc the number of command line options
198 * @param argv the command line options
199 * @param args_info the structure where option information will be stored
200 * @param params additional parameters for the parser
201 * @return 0 if everything went fine, NON 0 if an error took place
203 int cmdline_parser_ext(int argc, char **argv,
204 struct gengetopt_args_info *args_info,
205 struct cmdline_parser_params *params);
208 * Save the contents of the option struct into an already open FILE stream.
209 * @param outfile the stream where to dump options
210 * @param args_info the option struct to dump
211 * @return 0 if everything went fine, NON 0 if an error took place
213 int cmdline_parser_dump(FILE * outfile,
214 struct gengetopt_args_info *args_info);
217 * Save the contents of the option struct into a (text) file.
218 * This file can be read by the config file parser (if generated by gengetopt)
219 * @param filename the file where to save
220 * @param args_info the option struct to save
221 * @return 0 if everything went fine, NON 0 if an error took place
223 int cmdline_parser_file_save(const char *filename,
224 struct gengetopt_args_info *args_info);
227 * Print the help
229 void cmdline_parser_print_help(void);
231 * Print the version
233 void cmdline_parser_print_version(void);
236 * Initializes all the fields a cmdline_parser_params structure
237 * to their default values
238 * @param params the structure to initialize
240 void cmdline_parser_params_init(struct cmdline_parser_params *params);
243 * Allocates dynamically a cmdline_parser_params structure and initializes
244 * all its fields to their default values
245 * @return the created and initialized cmdline_parser_params structure
247 struct cmdline_parser_params *cmdline_parser_params_create(void);
250 * Initializes the passed gengetopt_args_info structure's fields
251 * (also set default values for options that have a default)
252 * @param args_info the structure to initialize
254 void cmdline_parser_init(struct gengetopt_args_info *args_info);
256 * Deallocates the string fields of the gengetopt_args_info structure
257 * (but does not deallocate the structure itself)
258 * @param args_info the structure to deallocate
260 void cmdline_parser_free(struct gengetopt_args_info *args_info);
263 * The config file parser (deprecated version)
264 * @param filename the name of the config file
265 * @param args_info the structure where option information will be stored
266 * @param override whether to override possibly already present options
267 * @param initialize whether to initialize the option structure my_args_info
268 * @param check_required whether to check that all required options were provided
269 * @return 0 if everything went fine, NON 0 if an error took place
270 * @deprecated use cmdline_parser_config_file() instead
272 int cmdline_parser_configfile(const char *filename,
273 struct gengetopt_args_info *args_info,
274 int override, int initialize,
275 int check_required);
278 * The config file parser
279 * @param filename the name of the config file
280 * @param args_info the structure where option information will be stored
281 * @param params additional parameters for the parser
282 * @return 0 if everything went fine, NON 0 if an error took place
284 int cmdline_parser_config_file(const char *filename,
285 struct gengetopt_args_info *args_info,
286 struct cmdline_parser_params *params);
289 * Checks that all the required options were specified
290 * @param args_info the structure to check
291 * @param prog_name the name of the program that will be used to print
292 * possible errors
293 * @return
295 int cmdline_parser_required(struct gengetopt_args_info *args_info,
296 const char *prog_name);
298 #ifdef __cplusplus
300 #endif /* __cplusplus */
301 #endif /* CMDLINE_H */