1 /** @file cmdline.h 2 * @brief The header file for the command line option parser 3 * generated by GNU Gengetopt version 2.23 4 * http://www.gnu.org/software/gengetopt. 5 * DO NOT modify this file, since it can be overwritten 6 * @author GNU Gengetopt */ 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 (used for printing errors) */ 24 #define CMDLINE_PARSER_PACKAGE "Kinfold" 25 #endif 26 27 #ifndef CMDLINE_PARSER_PACKAGE_NAME 28 /** @brief the complete program name (used for help and version) */ 29 #define CMDLINE_PARSER_PACKAGE_NAME "Kinfold" 30 #endif 31 32 #ifndef CMDLINE_PARSER_VERSION 33 /** @brief the program version */ 34 #define CMDLINE_PARSER_VERSION VERSION 35 #endif 36 37 /** @brief Where the command line options are stored */ 38 struct gengetopt_args_info 39 { 40 const char *help_help; /**< @brief Print help and exit help description. */ 41 const char *full_help_help; /**< @brief Print help, including hidden options, and exit help description. */ 42 const char *version_help; /**< @brief Print version and exit help description. */ 43 int dangle_arg; /**< @brief <0|1|2> set dangling end model to (none|normal|double) (default='2'). */ 44 char * dangle_orig; /**< @brief <0|1|2> set dangling end model to (none|normal|double) original value given at command line. */ 45 const char *dangle_help; /**< @brief <0|1|2> set dangling end model to (none|normal|double) help description. */ 46 float Temp_arg; /**< @brief simulation temperature (default='37'). */ 47 char * Temp_orig; /**< @brief simulation temperature original value given at command line. */ 48 const char *Temp_help; /**< @brief simulation temperature help description. */ 49 char * Par_arg; /**< @brief read energy-parameter-file. */ 50 char * Par_orig; /**< @brief read energy-parameter-file original value given at command line. */ 51 const char *Par_help; /**< @brief read energy-parameter-file help description. */ 52 int logML_flag; /**< @brief use logarithmic multiloop energies instead of linear (default=on). */ 53 const char *logML_help; /**< @brief use logarithmic multiloop energies instead of linear help description. */ 54 int noShift_flag; /**< @brief turn off shift-moves (default=off). */ 55 const char *noShift_help; /**< @brief turn off shift-moves help description. */ 56 int noLP_flag; /**< @brief forbid structures with isolated base-pairs (default=off). */ 57 const char *noLP_help; /**< @brief forbid structures with isolated base-pairs help description. */ 58 char * seed_arg; /**< @brief set random number seed specify 3 integers as int=int=int (default='clock'). */ 59 char * seed_orig; /**< @brief set random number seed specify 3 integers as int=int=int original value given at command line. */ 60 const char *seed_help; /**< @brief set random number seed specify 3 integers as int=int=int help description. */ 61 float time_arg; /**< @brief set maxtime of simulation (default='500'). */ 62 char * time_orig; /**< @brief set maxtime of simulation original value given at command line. */ 63 const char *time_help; /**< @brief set maxtime of simulation help description. */ 64 int num_arg; /**< @brief set number of trajectories (default='1'). */ 65 char * num_orig; /**< @brief set number of trajectories original value given at command line. */ 66 const char *num_help; /**< @brief set number of trajectories help description. */ 67 int start_flag; /**< @brief read start structure from stdin (otherwise use open chain) (default=off). */ 68 const char *start_help; /**< @brief read start structure from stdin (otherwise use open chain) help description. */ 69 int stop_flag; /**< @brief read stop structure(s) from stdin (otherwise use MFE) (default=off). */ 70 const char *stop_help; /**< @brief read stop structure(s) from stdin (otherwise use MFE) help description. */ 71 int met_flag; /**< @brief use Metropolis rule for rates (not Kawasaki rule) (default=off). */ 72 const char *met_help; /**< @brief use Metropolis rule for rates (not Kawasaki rule) help description. */ 73 int fpt_flag; /**< @brief compute first passage time (stop when a stop-structure is reached) (default=on). */ 74 const char *fpt_help; /**< @brief compute first passage time (stop when a stop-structure is reached) help description. */ 75 int rect_flag; /**< @brief compute recurrence time (of a start structure which is contained in stop structures) (default=off). */ 76 const char *rect_help; /**< @brief compute recurrence time (of a start structure which is contained in stop structures) help description. */ 77 float grow_arg; /**< @brief grow chain every <float> time units (default='0'). */ 78 char * grow_orig; /**< @brief grow chain every <float> time units original value given at command line. */ 79 const char *grow_help; /**< @brief grow chain every <float> time units help description. */ 80 int glen_arg; /**< @brief initial size of growing chain (default='15'). */ 81 char * glen_orig; /**< @brief initial size of growing chain original value given at command line. */ 82 const char *glen_help; /**< @brief initial size of growing chain help description. */ 83 double phi_arg; /**< @brief set phi value. */ 84 char * phi_orig; /**< @brief set phi value original value given at command line. */ 85 const char *phi_help; /**< @brief set phi value help description. */ 86 char * pbounds_arg; /**< @brief specify 3 floats for phi_min, phi_inc, phi_max in the form <d1=d2=d3>. */ 87 char * pbounds_orig; /**< @brief specify 3 floats for phi_min, phi_inc, phi_max in the form <d1=d2=d3> original value given at command line. */ 88 const char *pbounds_help; /**< @brief specify 3 floats for phi_min, phi_inc, phi_max in the form <d1=d2=d3> help description. */ 89 char * log_arg; /**< @brief set basename of log-file (default='kinout'). */ 90 char * log_orig; /**< @brief set basename of log-file original value given at command line. */ 91 const char *log_help; /**< @brief set basename of log-file help description. */ 92 int silent_flag; /**< @brief no output to stdout (default=off). */ 93 const char *silent_help; /**< @brief no output to stdout help description. */ 94 int verbose_flag; /**< @brief more information to stdout (default=off). */ 95 const char *verbose_help; /**< @brief more information to stdout help description. */ 96 int lmin_flag; /**< @brief output only local minima to stdout (default=off). */ 97 const char *lmin_help; /**< @brief output only local minima to stdout help description. */ 98 float cut_arg; /**< @brief only print structures with E <= MFE + <float> to stdout (default='20'). */ 99 char * cut_orig; /**< @brief only print structures with E <= MFE + <float> to stdout original value given at command line. */ 100 const char *cut_help; /**< @brief only print structures with E <= MFE + <float> to stdout help description. */ 101 102 unsigned int help_given ; /**< @brief Whether help was given. */ 103 unsigned int full_help_given ; /**< @brief Whether full-help was given. */ 104 unsigned int version_given ; /**< @brief Whether version was given. */ 105 unsigned int dangle_given ; /**< @brief Whether dangle was given. */ 106 unsigned int Temp_given ; /**< @brief Whether Temp was given. */ 107 unsigned int Par_given ; /**< @brief Whether Par was given. */ 108 unsigned int logML_given ; /**< @brief Whether logML was given. */ 109 unsigned int noShift_given ; /**< @brief Whether noShift was given. */ 110 unsigned int noLP_given ; /**< @brief Whether noLP was given. */ 111 unsigned int seed_given ; /**< @brief Whether seed was given. */ 112 unsigned int time_given ; /**< @brief Whether time was given. */ 113 unsigned int num_given ; /**< @brief Whether num was given. */ 114 unsigned int start_given ; /**< @brief Whether start was given. */ 115 unsigned int stop_given ; /**< @brief Whether stop was given. */ 116 unsigned int met_given ; /**< @brief Whether met was given. */ 117 unsigned int fpt_given ; /**< @brief Whether fpt was given. */ 118 unsigned int rect_given ; /**< @brief Whether rect was given. */ 119 unsigned int grow_given ; /**< @brief Whether grow was given. */ 120 unsigned int glen_given ; /**< @brief Whether glen was given. */ 121 unsigned int phi_given ; /**< @brief Whether phi was given. */ 122 unsigned int pbounds_given ; /**< @brief Whether pbounds was given. */ 123 unsigned int log_given ; /**< @brief Whether log was given. */ 124 unsigned int silent_given ; /**< @brief Whether silent was given. */ 125 unsigned int verbose_given ; /**< @brief Whether verbose was given. */ 126 unsigned int lmin_given ; /**< @brief Whether lmin was given. */ 127 unsigned int cut_given ; /**< @brief Whether cut was given. */ 128 129 } ; 130 131 /** @brief The additional parameters to pass to parser functions */ 132 struct cmdline_parser_params 133 { 134 int override; /**< @brief whether to override possibly already present options (default 0) */ 135 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ 136 int check_required; /**< @brief whether to check that all required options were provided (default 1) */ 137 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ 138 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ 139 } ; 140 141 /** @brief the purpose string of the program */ 142 extern const char *gengetopt_args_info_purpose; 143 /** @brief the usage string of the program */ 144 extern const char *gengetopt_args_info_usage; 145 /** @brief the description string of the program */ 146 extern const char *gengetopt_args_info_description; 147 /** @brief all the lines making the help output */ 148 extern const char *gengetopt_args_info_help[]; 149 /** @brief all the lines making the full help output (including hidden options) */ 150 extern const char *gengetopt_args_info_full_help[]; 151 152 /** 153 * The command line parser 154 * @param argc the number of command line options 155 * @param argv the command line options 156 * @param args_info the structure where option information will be stored 157 * @return 0 if everything went fine, NON 0 if an error took place 158 */ 159 int cmdline_parser (int argc, char **argv, 160 struct gengetopt_args_info *args_info); 161 162 /** 163 * The command line parser (version with additional parameters - deprecated) 164 * @param argc the number of command line options 165 * @param argv the command line options 166 * @param args_info the structure where option information will be stored 167 * @param override whether to override possibly already present options 168 * @param initialize whether to initialize the option structure my_args_info 169 * @param check_required whether to check that all required options were provided 170 * @return 0 if everything went fine, NON 0 if an error took place 171 * @deprecated use cmdline_parser_ext() instead 172 */ 173 int cmdline_parser2 (int argc, char **argv, 174 struct gengetopt_args_info *args_info, 175 int override, int initialize, int check_required); 176 177 /** 178 * The command line parser (version with additional parameters) 179 * @param argc the number of command line options 180 * @param argv the command line options 181 * @param args_info the structure where option information will be stored 182 * @param params additional parameters for the parser 183 * @return 0 if everything went fine, NON 0 if an error took place 184 */ 185 int cmdline_parser_ext (int argc, char **argv, 186 struct gengetopt_args_info *args_info, 187 struct cmdline_parser_params *params); 188 189 /** 190 * Save the contents of the option struct into an already open FILE stream. 191 * @param outfile the stream where to dump options 192 * @param args_info the option struct to dump 193 * @return 0 if everything went fine, NON 0 if an error took place 194 */ 195 int cmdline_parser_dump(FILE *outfile, 196 struct gengetopt_args_info *args_info); 197 198 /** 199 * Save the contents of the option struct into a (text) file. 200 * This file can be read by the config file parser (if generated by gengetopt) 201 * @param filename the file where to save 202 * @param args_info the option struct to save 203 * @return 0 if everything went fine, NON 0 if an error took place 204 */ 205 int cmdline_parser_file_save(const char *filename, 206 struct gengetopt_args_info *args_info); 207 208 /** 209 * Print the help 210 */ 211 void cmdline_parser_print_help(void); 212 /** 213 * Print the full help (including hidden options) 214 */ 215 void cmdline_parser_print_full_help(void); 216 /** 217 * Print the version 218 */ 219 void cmdline_parser_print_version(void); 220 221 /** 222 * Initializes all the fields a cmdline_parser_params structure 223 * to their default values 224 * @param params the structure to initialize 225 */ 226 void cmdline_parser_params_init(struct cmdline_parser_params *params); 227 228 /** 229 * Allocates dynamically a cmdline_parser_params structure and initializes 230 * all its fields to their default values 231 * @return the created and initialized cmdline_parser_params structure 232 */ 233 struct cmdline_parser_params *cmdline_parser_params_create(void); 234 235 /** 236 * Initializes the passed gengetopt_args_info structure's fields 237 * (also set default values for options that have a default) 238 * @param args_info the structure to initialize 239 */ 240 void cmdline_parser_init (struct gengetopt_args_info *args_info); 241 /** 242 * Deallocates the string fields of the gengetopt_args_info structure 243 * (but does not deallocate the structure itself) 244 * @param args_info the structure to deallocate 245 */ 246 void cmdline_parser_free (struct gengetopt_args_info *args_info); 247 248 /** 249 * Checks that all the required options were specified 250 * @param args_info the structure to check 251 * @param prog_name the name of the program that will be used to print 252 * possible errors 253 * @return 254 */ 255 int cmdline_parser_required (struct gengetopt_args_info *args_info, 256 const char *prog_name); 257 258 extern const char *cmdline_parser_dangle_values[]; /**< @brief Possible values for dangle. */ 259 260 261 #ifdef __cplusplus 262 } 263 #endif /* __cplusplus */ 264 #endif /* CMDLINE_H */ 265