1 /** @file cmdline.h 2 * @brief The header file for the command line option parser 3 * generated by GNU Gengetopt version 2.22.1 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 */ 7 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 /** @brief the program name */ 24 #define CMDLINE_PARSER_PACKAGE "lcalc" 25 #endif 26 27 #ifndef CMDLINE_PARSER_VERSION 28 /** @brief the program version */ 29 #define CMDLINE_PARSER_VERSION "1.22 July 14, 2009" 30 #endif 31 32 /** @brief Where the command line options are stored */ 33 struct gengetopt_args_info 34 { 35 const char *help_help; /**< @brief Print help and exit help description. */ 36 const char *version_help; /**< @brief Print version and exit help description. */ 37 int value_flag; /**< @brief compute L-function at x+iy. Should be used in conjuction with x and y options (default=off). */ 38 const char *value_help; /**< @brief compute L-function at x+iy. Should be used in conjuction with x and y options help description. */ 39 char * x_arg; /**< @brief Used with value,value-line-segment, and zeros-interval options (default='.5'). */ 40 char * x_orig; /**< @brief Used with value,value-line-segment, and zeros-interval options original value given at command line. */ 41 const char *x_help; /**< @brief Used with value,value-line-segment, and zeros-interval options help description. */ 42 char * y_arg; /**< @brief Used with value,value-line-segment, and zeros-interval options (default='0'). */ 43 char * y_orig; /**< @brief Used with value,value-line-segment, and zeros-interval options original value given at command line. */ 44 const char *y_help; /**< @brief Used with value,value-line-segment, and zeros-interval options help description. */ 45 char * value_file_arg; /**< @brief compute L-function at points specified in file. */ 46 char * value_file_orig; /**< @brief compute L-function at points specified in file original value given at command line. */ 47 const char *value_file_help; /**< @brief compute L-function at points specified in file help description. */ 48 int value_line_segment_flag; /**< @brief compute L-function along a line segment connecting (x,y) to (X,Y) at number-sample points (default=off). */ 49 const char *value_line_segment_help; /**< @brief compute L-function along a line segment connecting (x,y) to (X,Y) at number-sample points help description. */ 50 int use_dirichlet_series_arg; /**< @brief compute values of the L-function using specified number of terms of the Dirichlet series rather than an approximate functional equation.. */ 51 char * use_dirichlet_series_orig; /**< @brief compute values of the L-function using specified number of terms of the Dirichlet series rather than an approximate functional equation. original value given at command line. */ 52 const char *use_dirichlet_series_help; /**< @brief compute values of the L-function using specified number of terms of the Dirichlet series rather than an approximate functional equation. help description. */ 53 int hardy_flag; /**< @brief compute the Hardy Z function, i.e. the L-function rotated to be real on the critical line (default=off). */ 54 const char *hardy_help; /**< @brief compute the Hardy Z function, i.e. the L-function rotated to be real on the critical line help description. */ 55 char * X_arg; /**< @brief Used with value-line-segment (default='.5'). */ 56 char * X_orig; /**< @brief Used with value-line-segment original value given at command line. */ 57 const char *X_help; /**< @brief Used with value-line-segment help description. */ 58 char * Y_arg; /**< @brief Used with value-line-segment (default='100'). */ 59 char * Y_orig; /**< @brief Used with value-line-segment original value given at command line. */ 60 const char *Y_help; /**< @brief Used with value-line-segment help description. */ 61 int number_samples_arg; /**< @brief Used with value-line-segment, and interpolate options (default='1000'). */ 62 char * number_samples_orig; /**< @brief Used with value-line-segment, and interpolate options original value given at command line. */ 63 const char *number_samples_help; /**< @brief Used with value-line-segment, and interpolate options help description. */ 64 int zeros_arg; /**< @brief number of zeros to find. */ 65 char * zeros_orig; /**< @brief number of zeros to find original value given at command line. */ 66 const char *zeros_help; /**< @brief number of zeros to find help description. */ 67 int explicit_flag; /**< @brief test the explicit formula (beta-still in development) (default=off). */ 68 const char *explicit_help; /**< @brief test the explicit formula (beta-still in development) help description. */ 69 int zeros_interval_flag; /**< @brief number of zeros to find in an interval (1/2+ix,1/2+iy) using steps of size stepsize. Use with the x,y, and stepsize options (default=off). */ 70 const char *zeros_interval_help; /**< @brief number of zeros to find in an interval (1/2+ix,1/2+iy) using steps of size stepsize. Use with the x,y, and stepsize options help description. */ 71 char * stepsize_arg; /**< @brief Used with zeros-interval. */ 72 char * stepsize_orig; /**< @brief Used with zeros-interval original value given at command line. */ 73 const char *stepsize_help; /**< @brief Used with zeros-interval help description. */ 74 int derivative_arg; /**< @brief compute derivative. use -d -1 to specify logarithmic derivative.. */ 75 char * derivative_orig; /**< @brief compute derivative. use -d -1 to specify logarithmic derivative. original value given at command line. */ 76 const char *derivative_help; /**< @brief compute derivative. use -d -1 to specify logarithmic derivative. help description. */ 77 int elliptic_curve_flag; /**< @brief specify an elliptic curve over Q. Use with the a1 a2 a3 a4 a6 options (default=off). */ 78 const char *elliptic_curve_help; /**< @brief specify an elliptic curve over Q. Use with the a1 a2 a3 a4 a6 options help description. */ 79 char * a1_arg; /**< @brief Used with the elliptic-curve option. */ 80 char * a1_orig; /**< @brief Used with the elliptic-curve option original value given at command line. */ 81 const char *a1_help; /**< @brief Used with the elliptic-curve option help description. */ 82 char * a2_arg; /**< @brief Used with the elliptic-curve option. */ 83 char * a2_orig; /**< @brief Used with the elliptic-curve option original value given at command line. */ 84 const char *a2_help; /**< @brief Used with the elliptic-curve option help description. */ 85 char * a3_arg; /**< @brief Used with the elliptic-curve option. */ 86 char * a3_orig; /**< @brief Used with the elliptic-curve option original value given at command line. */ 87 const char *a3_help; /**< @brief Used with the elliptic-curve option help description. */ 88 char * a4_arg; /**< @brief Used with the elliptic-curve option. */ 89 char * a4_orig; /**< @brief Used with the elliptic-curve option original value given at command line. */ 90 const char *a4_help; /**< @brief Used with the elliptic-curve option help description. */ 91 char * a6_arg; /**< @brief Used with the elliptic-curve option. */ 92 char * a6_orig; /**< @brief Used with the elliptic-curve option original value given at command line. */ 93 const char *a6_help; /**< @brief Used with the elliptic-curve option help description. */ 94 char * file_input_arg; /**< @brief input a file with basic L-function data. */ 95 char * file_input_orig; /**< @brief input a file with basic L-function data original value given at command line. */ 96 const char *file_input_help; /**< @brief input a file with basic L-function data help description. */ 97 char * url_arg; /**< @brief input a web based file with basic L-function data. Specify the url of the file. */ 98 char * url_orig; /**< @brief input a web based file with basic L-function data. Specify the url of the file original value given at command line. */ 99 const char *url_help; /**< @brief input a web based file with basic L-function data. Specify the url of the file help description. */ 100 char * interpolate_arg; /**< @brief interpolate between two L-functions and find their zeros. Should be used in conjunction with file-input. */ 101 char * interpolate_orig; /**< @brief interpolate between two L-functions and find their zeros. Should be used in conjunction with file-input original value given at command line. */ 102 const char *interpolate_help; /**< @brief interpolate between two L-functions and find their zeros. Should be used in conjunction with file-input help description. */ 103 char * output_character_arg; /**< @brief if twisting, output the character (default='1'). */ 104 char * output_character_orig; /**< @brief if twisting, output the character original value given at command line. */ 105 const char *output_character_help; /**< @brief if twisting, output the character help description. */ 106 int output_data_arg; /**< @brief output basic data for the underlying L-function (default='10'). */ 107 char * output_data_orig; /**< @brief output basic data for the underlying L-function original value given at command line. */ 108 const char *output_data_help; /**< @brief output basic data for the underlying L-function help description. */ 109 int verbose_arg; /**< @brief verbosity > 0 outputs extra info (default='0'). */ 110 char * verbose_orig; /**< @brief verbosity > 0 outputs extra info original value given at command line. */ 111 const char *verbose_help; /**< @brief verbosity > 0 outputs extra info help description. */ 112 int precision_arg; /**< @brief number digits precision (default='14'). */ 113 char * precision_orig; /**< @brief number digits precision original value given at command line. */ 114 const char *precision_help; /**< @brief number digits precision help description. */ 115 int sacrifice_arg; /**< @brief number digits to sacrifice (default='2'). */ 116 char * sacrifice_orig; /**< @brief number digits to sacrifice original value given at command line. */ 117 const char *sacrifice_help; /**< @brief number digits to sacrifice help description. */ 118 int rank_compute_flag; /**< @brief compute the rank (default=off). */ 119 const char *rank_compute_help; /**< @brief compute the rank help description. */ 120 int rank_verify_arg; /**< @brief verify if specified rank is correct. */ 121 char * rank_verify_orig; /**< @brief verify if specified rank is correct original value given at command line. */ 122 const char *rank_verify_help; /**< @brief verify if specified rank is correct help description. */ 123 int rank_limit_arg; /**< @brief when doing quadratic twists limit to L-functions with specified rank. */ 124 char * rank_limit_orig; /**< @brief when doing quadratic twists limit to L-functions with specified rank original value given at command line. */ 125 const char *rank_limit_help; /**< @brief when doing quadratic twists limit to L-functions with specified rank help description. */ 126 int tau_flag; /**< @brief Ramanujan tau L-function (weight 12, full level) (default=off). */ 127 const char *tau_help; /**< @brief Ramanujan tau L-function (weight 12, full level) help description. */ 128 int twist_quadratic_flag; /**< @brief twist by fundamental quadratic characters, start <= discriminant <= finish. Use with start and finish options. (default=off). */ 129 const char *twist_quadratic_help; /**< @brief twist by fundamental quadratic characters, start <= discriminant <= finish. Use with start and finish options. help description. */ 130 char * start_arg; /**< @brief Used with various twisting options. */ 131 char * start_orig; /**< @brief Used with various twisting options original value given at command line. */ 132 const char *start_help; /**< @brief Used with various twisting options help description. */ 133 char * finish_arg; /**< @brief Used with various twisting options. Default has finish=start. */ 134 char * finish_orig; /**< @brief Used with various twisting options. Default has finish=start original value given at command line. */ 135 const char *finish_help; /**< @brief Used with various twisting options. Default has finish=start help description. */ 136 int twist_quadratic_even_flag; /**< @brief twist by fundamental quadratic characters, even functional eqn, start <= discriminant <= finish (default=off). */ 137 const char *twist_quadratic_even_help; /**< @brief twist by fundamental quadratic characters, even functional eqn, start <= discriminant <= finish help description. */ 138 int twist_primitive_flag; /**< @brief twist by all primitive Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate characters are considered equivalent (default=off). */ 139 const char *twist_primitive_help; /**< @brief twist by all primitive Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate characters are considered equivalent help description. */ 140 int twist_all_flag; /**< @brief twist by all Dirichlet characters with start <= conductor <= finish. (default=off). */ 141 const char *twist_all_help; /**< @brief twist by all Dirichlet characters with start <= conductor <= finish. help description. */ 142 int twist_all_no_conj_pairs_flag; /**< @brief twist by all Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate pairs of characters are considered equivalent (default=off). */ 143 const char *twist_all_no_conj_pairs_help; /**< @brief twist by all Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate pairs of characters are considered equivalent help description. */ 144 int twist_complex_no_conj_pairs_flag; /**< @brief twist by all complex primitive Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate pairs of characters are considered equivalent (default=off). */ 145 const char *twist_complex_no_conj_pairs_help; /**< @brief twist by all complex primitive Dirichlet characters with start <= conductor <= finish. For L-functions with complex Dirichlet coefficients, conjugate pairs of characters are considered equivalent help description. */ 146 int twist_generic_flag; /**< @brief twist by a generic complex Dirichlet characters with start <= conductor <= finish. (default=off). */ 147 const char *twist_generic_help; /**< @brief twist by a generic complex Dirichlet characters with start <= conductor <= finish. help description. */ 148 int degree_arg; /**< @brief can only be used in conjuction with twist-primitive (?). Select characters of specified degree. Not yet implemented. */ 149 char * degree_orig; /**< @brief can only be used in conjuction with twist-primitive (?). Select characters of specified degree. Not yet implemented original value given at command line. */ 150 const char *degree_help; /**< @brief can only be used in conjuction with twist-primitive (?). Select characters of specified degree. Not yet implemented help description. */ 151 int openmp_arg; /**< @brief whether to use openmp parallelization (beta- very little parallelization currently implemented) . Specify the number of threads to use.. */ 152 char * openmp_orig; /**< @brief whether to use openmp parallelization (beta- very little parallelization currently implemented) . Specify the number of threads to use. original value given at command line. */ 153 const char *openmp_help; /**< @brief whether to use openmp parallelization (beta- very little parallelization currently implemented) . Specify the number of threads to use. help description. */ 154 155 unsigned int help_given ; /**< @brief Whether help was given. */ 156 unsigned int version_given ; /**< @brief Whether version was given. */ 157 unsigned int value_given ; /**< @brief Whether value was given. */ 158 unsigned int x_given ; /**< @brief Whether x was given. */ 159 unsigned int y_given ; /**< @brief Whether y was given. */ 160 unsigned int value_file_given ; /**< @brief Whether value-file was given. */ 161 unsigned int value_line_segment_given ; /**< @brief Whether value-line-segment was given. */ 162 unsigned int use_dirichlet_series_given ; /**< @brief Whether use-dirichlet-series was given. */ 163 unsigned int hardy_given ; /**< @brief Whether hardy was given. */ 164 unsigned int X_given ; /**< @brief Whether X was given. */ 165 unsigned int Y_given ; /**< @brief Whether Y was given. */ 166 unsigned int number_samples_given ; /**< @brief Whether number-samples was given. */ 167 unsigned int zeros_given ; /**< @brief Whether zeros was given. */ 168 unsigned int explicit_given ; /**< @brief Whether explicit was given. */ 169 unsigned int zeros_interval_given ; /**< @brief Whether zeros-interval was given. */ 170 unsigned int stepsize_given ; /**< @brief Whether stepsize was given. */ 171 unsigned int derivative_given ; /**< @brief Whether derivative was given. */ 172 unsigned int elliptic_curve_given ; /**< @brief Whether elliptic-curve was given. */ 173 unsigned int a1_given ; /**< @brief Whether a1 was given. */ 174 unsigned int a2_given ; /**< @brief Whether a2 was given. */ 175 unsigned int a3_given ; /**< @brief Whether a3 was given. */ 176 unsigned int a4_given ; /**< @brief Whether a4 was given. */ 177 unsigned int a6_given ; /**< @brief Whether a6 was given. */ 178 unsigned int file_input_given ; /**< @brief Whether file-input was given. */ 179 unsigned int url_given ; /**< @brief Whether url was given. */ 180 unsigned int interpolate_given ; /**< @brief Whether interpolate was given. */ 181 unsigned int output_character_given ; /**< @brief Whether output-character was given. */ 182 unsigned int output_data_given ; /**< @brief Whether output-data was given. */ 183 unsigned int verbose_given ; /**< @brief Whether verbose was given. */ 184 unsigned int precision_given ; /**< @brief Whether precision was given. */ 185 unsigned int sacrifice_given ; /**< @brief Whether sacrifice was given. */ 186 unsigned int rank_compute_given ; /**< @brief Whether rank-compute was given. */ 187 unsigned int rank_verify_given ; /**< @brief Whether rank-verify was given. */ 188 unsigned int rank_limit_given ; /**< @brief Whether rank-limit was given. */ 189 unsigned int tau_given ; /**< @brief Whether tau was given. */ 190 unsigned int twist_quadratic_given ; /**< @brief Whether twist-quadratic was given. */ 191 unsigned int start_given ; /**< @brief Whether start was given. */ 192 unsigned int finish_given ; /**< @brief Whether finish was given. */ 193 unsigned int twist_quadratic_even_given ; /**< @brief Whether twist-quadratic-even was given. */ 194 unsigned int twist_primitive_given ; /**< @brief Whether twist-primitive was given. */ 195 unsigned int twist_all_given ; /**< @brief Whether twist-all was given. */ 196 unsigned int twist_all_no_conj_pairs_given ; /**< @brief Whether twist-all-no-conj-pairs was given. */ 197 unsigned int twist_complex_no_conj_pairs_given ; /**< @brief Whether twist-complex-no-conj-pairs was given. */ 198 unsigned int twist_generic_given ; /**< @brief Whether twist-generic was given. */ 199 unsigned int degree_given ; /**< @brief Whether degree was given. */ 200 unsigned int openmp_given ; /**< @brief Whether openmp was given. */ 201 202 } ; 203 204 /** @brief The additional parameters to pass to parser functions */ 205 struct cmdline_parser_params 206 { 207 int override; /**< @brief whether to override possibly already present options (default 0) */ 208 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ 209 int check_required; /**< @brief whether to check that all required options were provided (default 1) */ 210 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ 211 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ 212 } ; 213 214 /** @brief the purpose string of the program */ 215 extern const char *gengetopt_args_info_purpose; 216 /** @brief the usage string of the program */ 217 extern const char *gengetopt_args_info_usage; 218 /** @brief all the lines making the help output */ 219 extern const char *gengetopt_args_info_help[]; 220 221 /** 222 * The command line parser 223 * @param argc the number of command line options 224 * @param argv the command line options 225 * @param args_info the structure where option information will be stored 226 * @return 0 if everything went fine, NON 0 if an error took place 227 */ 228 int cmdline_parser (int argc, char * const *argv, 229 struct gengetopt_args_info *args_info); 230 231 /** 232 * The command line parser (version with additional parameters - deprecated) 233 * @param argc the number of command line options 234 * @param argv the command line options 235 * @param args_info the structure where option information will be stored 236 * @param override whether to override possibly already present options 237 * @param initialize whether to initialize the option structure my_args_info 238 * @param check_required whether to check that all required options were provided 239 * @return 0 if everything went fine, NON 0 if an error took place 240 * @deprecated use cmdline_parser_ext() instead 241 */ 242 int cmdline_parser2 (int argc, char * const *argv, 243 struct gengetopt_args_info *args_info, 244 int override, int initialize, int check_required); 245 246 /** 247 * The command line parser (version with additional parameters) 248 * @param argc the number of command line options 249 * @param argv the command line options 250 * @param args_info the structure where option information will be stored 251 * @param params additional parameters for the parser 252 * @return 0 if everything went fine, NON 0 if an error took place 253 */ 254 int cmdline_parser_ext (int argc, char * const *argv, 255 struct gengetopt_args_info *args_info, 256 struct cmdline_parser_params *params); 257 258 /** 259 * Save the contents of the option struct into an already open FILE stream. 260 * @param outfile the stream where to dump options 261 * @param args_info the option struct to dump 262 * @return 0 if everything went fine, NON 0 if an error took place 263 */ 264 int cmdline_parser_dump(FILE *outfile, 265 struct gengetopt_args_info *args_info); 266 267 /** 268 * Save the contents of the option struct into a (text) file. 269 * This file can be read by the config file parser (if generated by gengetopt) 270 * @param filename the file where to save 271 * @param args_info the option struct to save 272 * @return 0 if everything went fine, NON 0 if an error took place 273 */ 274 int cmdline_parser_file_save(const char *filename, 275 struct gengetopt_args_info *args_info); 276 277 /** 278 * Print the help 279 */ 280 void cmdline_parser_print_help(void); 281 /** 282 * Print the version 283 */ 284 void cmdline_parser_print_version(void); 285 286 /** 287 * Initializes all the fields a cmdline_parser_params structure 288 * to their default values 289 * @param params the structure to initialize 290 */ 291 void cmdline_parser_params_init(struct cmdline_parser_params *params); 292 293 /** 294 * Allocates dynamically a cmdline_parser_params structure and initializes 295 * all its fields to their default values 296 * @return the created and initialized cmdline_parser_params structure 297 */ 298 struct cmdline_parser_params *cmdline_parser_params_create(void); 299 300 /** 301 * Initializes the passed gengetopt_args_info structure's fields 302 * (also set default values for options that have a default) 303 * @param args_info the structure to initialize 304 */ 305 void cmdline_parser_init (struct gengetopt_args_info *args_info); 306 /** 307 * Deallocates the string fields of the gengetopt_args_info structure 308 * (but does not deallocate the structure itself) 309 * @param args_info the structure to deallocate 310 */ 311 void cmdline_parser_free (struct gengetopt_args_info *args_info); 312 313 /** 314 * Checks that all the required options were specified 315 * @param args_info the structure to check 316 * @param prog_name the name of the program that will be used to print 317 * possible errors 318 * @return 319 */ 320 int cmdline_parser_required (struct gengetopt_args_info *args_info, 321 const char *prog_name); 322 323 extern char *cmdline_parser_output_character_values[] ; /**< @brief Possible values for output-character. */ 324 325 326 #ifdef __cplusplus 327 } 328 #endif /* __cplusplus */ 329 #endif /* CMDLINE_H */ 330