| 1 |
gezelter |
1456 |
/** @file Dump2XYZCmd.h |
| 2 |
|
|
* @brief The header file for the command line option parser |
| 3 |
gezelter |
1630 |
* generated by GNU Gengetopt version 2.22.4 |
| 4 |
gezelter |
1456 |
* 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 |
tim |
12 |
|
| 8 |
tim |
302 |
#ifndef DUMP2XYZCMD_H |
| 9 |
|
|
#define DUMP2XYZCMD_H |
| 10 |
tim |
12 |
|
| 11 |
|
|
/* If we use autoconf. */ |
| 12 |
|
|
#ifdef HAVE_CONFIG_H |
| 13 |
|
|
#include "config.h" |
| 14 |
|
|
#endif |
| 15 |
|
|
|
| 16 |
gezelter |
1456 |
#include <stdio.h> /* for FILE */ |
| 17 |
|
|
|
| 18 |
tim |
12 |
#ifdef __cplusplus |
| 19 |
|
|
extern "C" { |
| 20 |
|
|
#endif /* __cplusplus */ |
| 21 |
|
|
|
| 22 |
|
|
#ifndef CMDLINE_PARSER_PACKAGE |
| 23 |
gezelter |
1630 |
/** @brief the program name (used for printing errors) */ |
| 24 |
tim |
12 |
#define CMDLINE_PARSER_PACKAGE "Dump2XYZ" |
| 25 |
|
|
#endif |
| 26 |
|
|
|
| 27 |
gezelter |
1630 |
#ifndef CMDLINE_PARSER_PACKAGE_NAME |
| 28 |
|
|
/** @brief the complete program name (used for help and version) */ |
| 29 |
|
|
#define CMDLINE_PARSER_PACKAGE_NAME "Dump2XYZ" |
| 30 |
|
|
#endif |
| 31 |
|
|
|
| 32 |
tim |
12 |
#ifndef CMDLINE_PARSER_VERSION |
| 33 |
gezelter |
1456 |
/** @brief the program version */ |
| 34 |
tim |
12 |
#define CMDLINE_PARSER_VERSION "0.99" |
| 35 |
|
|
#endif |
| 36 |
|
|
|
| 37 |
gezelter |
1456 |
/** @brief Where the command line options are stored */ |
| 38 |
tim |
543 |
struct gengetopt_args_info |
| 39 |
|
|
{ |
| 40 |
gezelter |
1456 |
const char *help_help; /**< @brief Print help and exit help description. */ |
| 41 |
|
|
const char *version_help; /**< @brief Print version and exit help description. */ |
| 42 |
|
|
char * input_arg; /**< @brief input dump file. */ |
| 43 |
|
|
char * input_orig; /**< @brief input dump file original value given at command line. */ |
| 44 |
|
|
const char *input_help; /**< @brief input dump file help description. */ |
| 45 |
|
|
char * output_arg; /**< @brief output file name. */ |
| 46 |
|
|
char * output_orig; /**< @brief output file name original value given at command line. */ |
| 47 |
|
|
const char *output_help; /**< @brief output file name help description. */ |
| 48 |
|
|
int frame_arg; /**< @brief print every n frame (default='1'). */ |
| 49 |
|
|
char * frame_orig; /**< @brief print every n frame original value given at command line. */ |
| 50 |
|
|
const char *frame_help; /**< @brief print every n frame help description. */ |
| 51 |
|
|
int water_flag; /**< @brief skip the the waters (default=off). */ |
| 52 |
|
|
const char *water_help; /**< @brief skip the the waters help description. */ |
| 53 |
|
|
int periodicBox_flag; /**< @brief map to the periodic box (default=off). */ |
| 54 |
|
|
const char *periodicBox_help; /**< @brief map to the periodic box help description. */ |
| 55 |
|
|
int zconstraint_flag; /**< @brief replace the atom types of zconstraint molecules (default=off). */ |
| 56 |
|
|
const char *zconstraint_help; /**< @brief replace the atom types of zconstraint molecules help description. */ |
| 57 |
|
|
int rigidbody_flag; /**< @brief add a pseudo COM atom to rigidbody (default=off). */ |
| 58 |
|
|
const char *rigidbody_help; /**< @brief add a pseudo COM atom to rigidbody help description. */ |
| 59 |
|
|
int watertype_flag; /**< @brief replace the atom type of water model (default=on). */ |
| 60 |
|
|
const char *watertype_help; /**< @brief replace the atom type of water model help description. */ |
| 61 |
|
|
char * selection_arg; /**< @brief general selection syntax. */ |
| 62 |
|
|
char * selection_orig; /**< @brief general selection syntax original value given at command line. */ |
| 63 |
|
|
const char *selection_help; /**< @brief general selection syntax help description. */ |
| 64 |
|
|
char * originsele_arg; /**< @brief select origin. */ |
| 65 |
|
|
char * originsele_orig; /**< @brief select origin original value given at command line. */ |
| 66 |
|
|
const char *originsele_help; /**< @brief select origin help description. */ |
| 67 |
|
|
char * refsele_arg; /**< @brief select reference. */ |
| 68 |
|
|
char * refsele_orig; /**< @brief select reference original value given at command line. */ |
| 69 |
|
|
const char *refsele_help; /**< @brief select reference help description. */ |
| 70 |
|
|
int repeatX_arg; /**< @brief The number of images to repeat in the x direction (default='0'). */ |
| 71 |
|
|
char * repeatX_orig; /**< @brief The number of images to repeat in the x direction original value given at command line. */ |
| 72 |
|
|
const char *repeatX_help; /**< @brief The number of images to repeat in the x direction help description. */ |
| 73 |
|
|
int repeatY_arg; /**< @brief The number of images to repeat in the y direction (default='0'). */ |
| 74 |
|
|
char * repeatY_orig; /**< @brief The number of images to repeat in the y direction original value given at command line. */ |
| 75 |
|
|
const char *repeatY_help; /**< @brief The number of images to repeat in the y direction help description. */ |
| 76 |
|
|
int repeatZ_arg; /**< @brief The number of images to repeat in the z direction (default='0'). */ |
| 77 |
|
|
char * repeatZ_orig; /**< @brief The number of images to repeat in the z direction original value given at command line. */ |
| 78 |
|
|
const char *repeatZ_help; /**< @brief The number of images to repeat in the z direction help description. */ |
| 79 |
|
|
int basetype_flag; /**< @brief Convert to base atom type (default=off). */ |
| 80 |
|
|
const char *basetype_help; /**< @brief Convert to base atom type help description. */ |
| 81 |
|
|
int velocities_flag; /**< @brief Print velocities in xyz file (default=off). */ |
| 82 |
|
|
const char *velocities_help; /**< @brief Print velocities in xyz file help description. */ |
| 83 |
|
|
int forces_flag; /**< @brief Print forces xyz file (default=off). */ |
| 84 |
|
|
const char *forces_help; /**< @brief Print forces xyz file help description. */ |
| 85 |
|
|
int vectors_flag; /**< @brief Print vectors (dipoles, etc) in xyz file (default=off). */ |
| 86 |
|
|
const char *vectors_help; /**< @brief Print vectors (dipoles, etc) in xyz file help description. */ |
| 87 |
|
|
int charges_flag; /**< @brief Print charges in xyz file (default=off). */ |
| 88 |
|
|
const char *charges_help; /**< @brief Print charges in xyz file help description. */ |
| 89 |
chuckv |
1117 |
|
| 90 |
gezelter |
1456 |
unsigned int help_given ; /**< @brief Whether help was given. */ |
| 91 |
|
|
unsigned int version_given ; /**< @brief Whether version was given. */ |
| 92 |
|
|
unsigned int input_given ; /**< @brief Whether input was given. */ |
| 93 |
|
|
unsigned int output_given ; /**< @brief Whether output was given. */ |
| 94 |
|
|
unsigned int frame_given ; /**< @brief Whether frame was given. */ |
| 95 |
|
|
unsigned int water_given ; /**< @brief Whether water was given. */ |
| 96 |
|
|
unsigned int periodicBox_given ; /**< @brief Whether periodicBox was given. */ |
| 97 |
|
|
unsigned int zconstraint_given ; /**< @brief Whether zconstraint was given. */ |
| 98 |
|
|
unsigned int rigidbody_given ; /**< @brief Whether rigidbody was given. */ |
| 99 |
|
|
unsigned int watertype_given ; /**< @brief Whether watertype was given. */ |
| 100 |
|
|
unsigned int selection_given ; /**< @brief Whether selection was given. */ |
| 101 |
|
|
unsigned int originsele_given ; /**< @brief Whether originsele was given. */ |
| 102 |
|
|
unsigned int refsele_given ; /**< @brief Whether refsele was given. */ |
| 103 |
|
|
unsigned int repeatX_given ; /**< @brief Whether repeatX was given. */ |
| 104 |
|
|
unsigned int repeatY_given ; /**< @brief Whether repeatY was given. */ |
| 105 |
|
|
unsigned int repeatZ_given ; /**< @brief Whether repeatZ was given. */ |
| 106 |
|
|
unsigned int basetype_given ; /**< @brief Whether basetype was given. */ |
| 107 |
|
|
unsigned int velocities_given ; /**< @brief Whether velocities was given. */ |
| 108 |
|
|
unsigned int forces_given ; /**< @brief Whether forces was given. */ |
| 109 |
|
|
unsigned int vectors_given ; /**< @brief Whether vectors was given. */ |
| 110 |
|
|
unsigned int charges_given ; /**< @brief Whether charges was given. */ |
| 111 |
tim |
12 |
|
| 112 |
gezelter |
1456 |
char **inputs ; /**< @brief unamed options (options without names) */ |
| 113 |
|
|
unsigned inputs_num ; /**< @brief unamed options number */ |
| 114 |
tim |
543 |
} ; |
| 115 |
tim |
12 |
|
| 116 |
gezelter |
1456 |
/** @brief The additional parameters to pass to parser functions */ |
| 117 |
|
|
struct cmdline_parser_params |
| 118 |
|
|
{ |
| 119 |
|
|
int override; /**< @brief whether to override possibly already present options (default 0) */ |
| 120 |
|
|
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ |
| 121 |
|
|
int check_required; /**< @brief whether to check that all required options were provided (default 1) */ |
| 122 |
|
|
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ |
| 123 |
|
|
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ |
| 124 |
|
|
} ; |
| 125 |
tim |
12 |
|
| 126 |
gezelter |
1456 |
/** @brief the purpose string of the program */ |
| 127 |
|
|
extern const char *gengetopt_args_info_purpose; |
| 128 |
|
|
/** @brief the usage string of the program */ |
| 129 |
|
|
extern const char *gengetopt_args_info_usage; |
| 130 |
|
|
/** @brief all the lines making the help output */ |
| 131 |
|
|
extern const char *gengetopt_args_info_help[]; |
| 132 |
|
|
|
| 133 |
|
|
/** |
| 134 |
|
|
* The command line parser |
| 135 |
|
|
* @param argc the number of command line options |
| 136 |
|
|
* @param argv the command line options |
| 137 |
|
|
* @param args_info the structure where option information will be stored |
| 138 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
| 139 |
|
|
*/ |
| 140 |
gezelter |
1630 |
int cmdline_parser (int argc, char **argv, |
| 141 |
gezelter |
1456 |
struct gengetopt_args_info *args_info); |
| 142 |
|
|
|
| 143 |
|
|
/** |
| 144 |
|
|
* The command line parser (version with additional parameters - deprecated) |
| 145 |
|
|
* @param argc the number of command line options |
| 146 |
|
|
* @param argv the command line options |
| 147 |
|
|
* @param args_info the structure where option information will be stored |
| 148 |
|
|
* @param override whether to override possibly already present options |
| 149 |
|
|
* @param initialize whether to initialize the option structure my_args_info |
| 150 |
|
|
* @param check_required whether to check that all required options were provided |
| 151 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
| 152 |
|
|
* @deprecated use cmdline_parser_ext() instead |
| 153 |
|
|
*/ |
| 154 |
gezelter |
1630 |
int cmdline_parser2 (int argc, char **argv, |
| 155 |
gezelter |
1456 |
struct gengetopt_args_info *args_info, |
| 156 |
|
|
int override, int initialize, int check_required); |
| 157 |
|
|
|
| 158 |
|
|
/** |
| 159 |
|
|
* The command line parser (version with additional parameters) |
| 160 |
|
|
* @param argc the number of command line options |
| 161 |
|
|
* @param argv the command line options |
| 162 |
|
|
* @param args_info the structure where option information will be stored |
| 163 |
|
|
* @param params additional parameters for the parser |
| 164 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
| 165 |
|
|
*/ |
| 166 |
gezelter |
1630 |
int cmdline_parser_ext (int argc, char **argv, |
| 167 |
gezelter |
1456 |
struct gengetopt_args_info *args_info, |
| 168 |
|
|
struct cmdline_parser_params *params); |
| 169 |
|
|
|
| 170 |
|
|
/** |
| 171 |
|
|
* Save the contents of the option struct into an already open FILE stream. |
| 172 |
|
|
* @param outfile the stream where to dump options |
| 173 |
|
|
* @param args_info the option struct to dump |
| 174 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
| 175 |
|
|
*/ |
| 176 |
|
|
int cmdline_parser_dump(FILE *outfile, |
| 177 |
|
|
struct gengetopt_args_info *args_info); |
| 178 |
|
|
|
| 179 |
|
|
/** |
| 180 |
|
|
* Save the contents of the option struct into a (text) file. |
| 181 |
|
|
* This file can be read by the config file parser (if generated by gengetopt) |
| 182 |
|
|
* @param filename the file where to save |
| 183 |
|
|
* @param args_info the option struct to save |
| 184 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
| 185 |
|
|
*/ |
| 186 |
|
|
int cmdline_parser_file_save(const char *filename, |
| 187 |
|
|
struct gengetopt_args_info *args_info); |
| 188 |
|
|
|
| 189 |
|
|
/** |
| 190 |
|
|
* Print the help |
| 191 |
|
|
*/ |
| 192 |
tim |
543 |
void cmdline_parser_print_help(void); |
| 193 |
gezelter |
1456 |
/** |
| 194 |
|
|
* Print the version |
| 195 |
|
|
*/ |
| 196 |
tim |
543 |
void cmdline_parser_print_version(void); |
| 197 |
tim |
12 |
|
| 198 |
gezelter |
1456 |
/** |
| 199 |
|
|
* Initializes all the fields a cmdline_parser_params structure |
| 200 |
|
|
* to their default values |
| 201 |
|
|
* @param params the structure to initialize |
| 202 |
|
|
*/ |
| 203 |
|
|
void cmdline_parser_params_init(struct cmdline_parser_params *params); |
| 204 |
|
|
|
| 205 |
|
|
/** |
| 206 |
|
|
* Allocates dynamically a cmdline_parser_params structure and initializes |
| 207 |
|
|
* all its fields to their default values |
| 208 |
|
|
* @return the created and initialized cmdline_parser_params structure |
| 209 |
|
|
*/ |
| 210 |
|
|
struct cmdline_parser_params *cmdline_parser_params_create(void); |
| 211 |
|
|
|
| 212 |
|
|
/** |
| 213 |
|
|
* Initializes the passed gengetopt_args_info structure's fields |
| 214 |
|
|
* (also set default values for options that have a default) |
| 215 |
|
|
* @param args_info the structure to initialize |
| 216 |
|
|
*/ |
| 217 |
chuckv |
1117 |
void cmdline_parser_init (struct gengetopt_args_info *args_info); |
| 218 |
gezelter |
1456 |
/** |
| 219 |
|
|
* Deallocates the string fields of the gengetopt_args_info structure |
| 220 |
|
|
* (but does not deallocate the structure itself) |
| 221 |
|
|
* @param args_info the structure to deallocate |
| 222 |
|
|
*/ |
| 223 |
chuckv |
1117 |
void cmdline_parser_free (struct gengetopt_args_info *args_info); |
| 224 |
|
|
|
| 225 |
gezelter |
1456 |
/** |
| 226 |
|
|
* Checks that all the required options were specified |
| 227 |
|
|
* @param args_info the structure to check |
| 228 |
|
|
* @param prog_name the name of the program that will be used to print |
| 229 |
|
|
* possible errors |
| 230 |
|
|
* @return |
| 231 |
|
|
*/ |
| 232 |
|
|
int cmdline_parser_required (struct gengetopt_args_info *args_info, |
| 233 |
|
|
const char *prog_name); |
| 234 |
chuckv |
1117 |
|
| 235 |
|
|
|
| 236 |
tim |
12 |
#ifdef __cplusplus |
| 237 |
|
|
} |
| 238 |
|
|
#endif /* __cplusplus */ |
| 239 |
tim |
302 |
#endif /* DUMP2XYZCMD_H */ |