| 1 |
/** @file randomBuilderCmd.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 */ |
| 7 |
|
| 8 |
#ifndef RANDOMBUILDERCMD_H |
| 9 |
#define RANDOMBUILDERCMD_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 "randomBuilder" |
| 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 "randomBuilder" |
| 30 |
#endif |
| 31 |
|
| 32 |
#ifndef CMDLINE_PARSER_VERSION |
| 33 |
/** @brief the program version */ |
| 34 |
#define CMDLINE_PARSER_VERSION "1.0" |
| 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 *version_help; /**< @brief Print version and exit help description. */ |
| 42 |
char * output_arg; /**< @brief Output file name. */ |
| 43 |
char * output_orig; /**< @brief Output file name original value given at command line. */ |
| 44 |
const char *output_help; /**< @brief Output file name help description. */ |
| 45 |
double density_arg; /**< @brief density (g/cm^3). */ |
| 46 |
char * density_orig; /**< @brief density (g/cm^3) original value given at command line. */ |
| 47 |
const char *density_help; /**< @brief density (g/cm^3) help description. */ |
| 48 |
int nx_arg; /**< @brief number of unit cells in x. */ |
| 49 |
char * nx_orig; /**< @brief number of unit cells in x original value given at command line. */ |
| 50 |
const char *nx_help; /**< @brief number of unit cells in x help description. */ |
| 51 |
int ny_arg; /**< @brief number of unit cells in y. */ |
| 52 |
char * ny_orig; /**< @brief number of unit cells in y original value given at command line. */ |
| 53 |
const char *ny_help; /**< @brief number of unit cells in y help description. */ |
| 54 |
int nz_arg; /**< @brief number of unit cells in z. */ |
| 55 |
char * nz_orig; /**< @brief number of unit cells in z original value given at command line. */ |
| 56 |
const char *nz_help; /**< @brief number of unit cells in z help description. */ |
| 57 |
double* molFraction_arg; /**< @brief (Default) Builds a multi-component random mixed nanoparticle. Mole Fraction must be specified for each componet > 1 in MD file.. */ |
| 58 |
char ** molFraction_orig; /**< @brief (Default) Builds a multi-component random mixed nanoparticle. Mole Fraction must be specified for each componet > 1 in MD file. original value given at command line. */ |
| 59 |
unsigned int molFraction_min; /**< @brief (Default) Builds a multi-component random mixed nanoparticle. Mole Fraction must be specified for each componet > 1 in MD file.'s minimum occurreces */ |
| 60 |
unsigned int molFraction_max; /**< @brief (Default) Builds a multi-component random mixed nanoparticle. Mole Fraction must be specified for each componet > 1 in MD file.'s maximum occurreces */ |
| 61 |
const char *molFraction_help; /**< @brief (Default) Builds a multi-component random mixed nanoparticle. Mole Fraction must be specified for each componet > 1 in MD file. help description. */ |
| 62 |
|
| 63 |
unsigned int help_given ; /**< @brief Whether help was given. */ |
| 64 |
unsigned int version_given ; /**< @brief Whether version was given. */ |
| 65 |
unsigned int output_given ; /**< @brief Whether output was given. */ |
| 66 |
unsigned int density_given ; /**< @brief Whether density was given. */ |
| 67 |
unsigned int nx_given ; /**< @brief Whether nx was given. */ |
| 68 |
unsigned int ny_given ; /**< @brief Whether ny was given. */ |
| 69 |
unsigned int nz_given ; /**< @brief Whether nz was given. */ |
| 70 |
unsigned int molFraction_given ; /**< @brief Whether molFraction was given. */ |
| 71 |
|
| 72 |
char **inputs ; /**< @brief unamed options (options without names) */ |
| 73 |
unsigned inputs_num ; /**< @brief unamed options number */ |
| 74 |
} ; |
| 75 |
|
| 76 |
/** @brief The additional parameters to pass to parser functions */ |
| 77 |
struct cmdline_parser_params |
| 78 |
{ |
| 79 |
int override; /**< @brief whether to override possibly already present options (default 0) */ |
| 80 |
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ |
| 81 |
int check_required; /**< @brief whether to check that all required options were provided (default 1) */ |
| 82 |
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ |
| 83 |
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ |
| 84 |
} ; |
| 85 |
|
| 86 |
/** @brief the purpose string of the program */ |
| 87 |
extern const char *gengetopt_args_info_purpose; |
| 88 |
/** @brief the usage string of the program */ |
| 89 |
extern const char *gengetopt_args_info_usage; |
| 90 |
/** @brief all the lines making the help output */ |
| 91 |
extern const char *gengetopt_args_info_help[]; |
| 92 |
|
| 93 |
/** |
| 94 |
* The command line parser |
| 95 |
* @param argc the number of command line options |
| 96 |
* @param argv the command line options |
| 97 |
* @param args_info the structure where option information will be stored |
| 98 |
* @return 0 if everything went fine, NON 0 if an error took place |
| 99 |
*/ |
| 100 |
int cmdline_parser (int argc, char **argv, |
| 101 |
struct gengetopt_args_info *args_info); |
| 102 |
|
| 103 |
/** |
| 104 |
* The command line parser (version with additional parameters - deprecated) |
| 105 |
* @param argc the number of command line options |
| 106 |
* @param argv the command line options |
| 107 |
* @param args_info the structure where option information will be stored |
| 108 |
* @param override whether to override possibly already present options |
| 109 |
* @param initialize whether to initialize the option structure my_args_info |
| 110 |
* @param check_required whether to check that all required options were provided |
| 111 |
* @return 0 if everything went fine, NON 0 if an error took place |
| 112 |
* @deprecated use cmdline_parser_ext() instead |
| 113 |
*/ |
| 114 |
int cmdline_parser2 (int argc, char **argv, |
| 115 |
struct gengetopt_args_info *args_info, |
| 116 |
int override, int initialize, int check_required); |
| 117 |
|
| 118 |
/** |
| 119 |
* The command line parser (version with additional parameters) |
| 120 |
* @param argc the number of command line options |
| 121 |
* @param argv the command line options |
| 122 |
* @param args_info the structure where option information will be stored |
| 123 |
* @param params additional parameters for the parser |
| 124 |
* @return 0 if everything went fine, NON 0 if an error took place |
| 125 |
*/ |
| 126 |
int cmdline_parser_ext (int argc, char **argv, |
| 127 |
struct gengetopt_args_info *args_info, |
| 128 |
struct cmdline_parser_params *params); |
| 129 |
|
| 130 |
/** |
| 131 |
* Save the contents of the option struct into an already open FILE stream. |
| 132 |
* @param outfile the stream where to dump options |
| 133 |
* @param args_info the option struct to dump |
| 134 |
* @return 0 if everything went fine, NON 0 if an error took place |
| 135 |
*/ |
| 136 |
int cmdline_parser_dump(FILE *outfile, |
| 137 |
struct gengetopt_args_info *args_info); |
| 138 |
|
| 139 |
/** |
| 140 |
* Save the contents of the option struct into a (text) file. |
| 141 |
* This file can be read by the config file parser (if generated by gengetopt) |
| 142 |
* @param filename the file where to save |
| 143 |
* @param args_info the option struct to save |
| 144 |
* @return 0 if everything went fine, NON 0 if an error took place |
| 145 |
*/ |
| 146 |
int cmdline_parser_file_save(const char *filename, |
| 147 |
struct gengetopt_args_info *args_info); |
| 148 |
|
| 149 |
/** |
| 150 |
* Print the help |
| 151 |
*/ |
| 152 |
void cmdline_parser_print_help(void); |
| 153 |
/** |
| 154 |
* Print the version |
| 155 |
*/ |
| 156 |
void cmdline_parser_print_version(void); |
| 157 |
|
| 158 |
/** |
| 159 |
* Initializes all the fields a cmdline_parser_params structure |
| 160 |
* to their default values |
| 161 |
* @param params the structure to initialize |
| 162 |
*/ |
| 163 |
void cmdline_parser_params_init(struct cmdline_parser_params *params); |
| 164 |
|
| 165 |
/** |
| 166 |
* Allocates dynamically a cmdline_parser_params structure and initializes |
| 167 |
* all its fields to their default values |
| 168 |
* @return the created and initialized cmdline_parser_params structure |
| 169 |
*/ |
| 170 |
struct cmdline_parser_params *cmdline_parser_params_create(void); |
| 171 |
|
| 172 |
/** |
| 173 |
* Initializes the passed gengetopt_args_info structure's fields |
| 174 |
* (also set default values for options that have a default) |
| 175 |
* @param args_info the structure to initialize |
| 176 |
*/ |
| 177 |
void cmdline_parser_init (struct gengetopt_args_info *args_info); |
| 178 |
/** |
| 179 |
* Deallocates the string fields of the gengetopt_args_info structure |
| 180 |
* (but does not deallocate the structure itself) |
| 181 |
* @param args_info the structure to deallocate |
| 182 |
*/ |
| 183 |
void cmdline_parser_free (struct gengetopt_args_info *args_info); |
| 184 |
|
| 185 |
/** |
| 186 |
* Checks that all the required options were specified |
| 187 |
* @param args_info the structure to check |
| 188 |
* @param prog_name the name of the program that will be used to print |
| 189 |
* possible errors |
| 190 |
* @return |
| 191 |
*/ |
| 192 |
int cmdline_parser_required (struct gengetopt_args_info *args_info, |
| 193 |
const char *prog_name); |
| 194 |
|
| 195 |
|
| 196 |
#ifdef __cplusplus |
| 197 |
} |
| 198 |
#endif /* __cplusplus */ |
| 199 |
#endif /* RANDOMBUILDERCMD_H */ |