1 |
kstocke1 |
1701 |
/** @file nanorod_pentBuilderCmd.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 NANOROD_PENTBUILDERCMD_H |
9 |
|
|
#define NANOROD_PENTBUILDERCMD_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 "nanorod_pentBuilder" |
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 "nanorod_pentBuilder" |
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 latticeConstant_arg; /**< @brief Lattice spacing in Angstroms for cubic lattice.. */ |
46 |
|
|
char * latticeConstant_orig; /**< @brief Lattice spacing in Angstroms for cubic lattice. original value given at command line. */ |
47 |
|
|
const char *latticeConstant_help; /**< @brief Lattice spacing in Angstroms for cubic lattice. help description. */ |
48 |
|
|
double radius_arg; /**< @brief Nanorod radius in Angstroms. */ |
49 |
|
|
char * radius_orig; /**< @brief Nanorod radius in Angstroms original value given at command line. */ |
50 |
|
|
const char *radius_help; /**< @brief Nanorod radius in Angstroms help description. */ |
51 |
|
|
double length_arg; /**< @brief Nanorod length in Angstroms. */ |
52 |
|
|
char * length_orig; /**< @brief Nanorod length in Angstroms original value given at command line. */ |
53 |
|
|
const char *length_help; /**< @brief Nanorod length in Angstroms help description. */ |
54 |
|
|
double* shellRadius_arg; /**< @brief Radius containing within it only molecules of a specific component. Specified for each component > 1 in the template file.. */ |
55 |
|
|
char ** shellRadius_orig; /**< @brief Radius containing within it only molecules of a specific component. Specified for each component > 1 in the template file. original value given at command line. */ |
56 |
|
|
unsigned int shellRadius_min; /**< @brief Radius containing within it only molecules of a specific component. Specified for each component > 1 in the template file.'s minimum occurreces */ |
57 |
|
|
unsigned int shellRadius_max; /**< @brief Radius containing within it only molecules of a specific component. Specified for each component > 1 in the template file.'s maximum occurreces */ |
58 |
|
|
const char *shellRadius_help; /**< @brief Radius containing within it only molecules of a specific component. Specified for each component > 1 in the template file. help description. */ |
59 |
|
|
double* molFraction_arg; /**< @brief Builds a multi-component random alloy nanoparticle. A mole Fraction must be specified for each component > 1 in the template file.. */ |
60 |
|
|
char ** molFraction_orig; /**< @brief Builds a multi-component random alloy nanoparticle. A mole Fraction must be specified for each component > 1 in the template file. original value given at command line. */ |
61 |
|
|
unsigned int molFraction_min; /**< @brief Builds a multi-component random alloy nanoparticle. A mole Fraction must be specified for each component > 1 in the template file.'s minimum occurreces */ |
62 |
|
|
unsigned int molFraction_max; /**< @brief Builds a multi-component random alloy nanoparticle. A mole Fraction must be specified for each component > 1 in the template file.'s maximum occurreces */ |
63 |
|
|
const char *molFraction_help; /**< @brief Builds a multi-component random alloy nanoparticle. A mole Fraction must be specified for each component > 1 in the template file. help description. */ |
64 |
|
|
double vacancyPercent_arg; /**< @brief Percentage of atoms to remove from within vacancy range. */ |
65 |
|
|
char * vacancyPercent_orig; /**< @brief Percentage of atoms to remove from within vacancy range original value given at command line. */ |
66 |
|
|
const char *vacancyPercent_help; /**< @brief Percentage of atoms to remove from within vacancy range help description. */ |
67 |
|
|
double vacancyInnerRadius_arg; /**< @brief Radius arround core-shell where vacancies should be located.. */ |
68 |
|
|
char * vacancyInnerRadius_orig; /**< @brief Radius arround core-shell where vacancies should be located. original value given at command line. */ |
69 |
|
|
const char *vacancyInnerRadius_help; /**< @brief Radius arround core-shell where vacancies should be located. help description. */ |
70 |
|
|
double vacancyOuterRadius_arg; /**< @brief Radius arround core-shell where vacancies should be located.. */ |
71 |
|
|
char * vacancyOuterRadius_orig; /**< @brief Radius arround core-shell where vacancies should be located. original value given at command line. */ |
72 |
|
|
const char *vacancyOuterRadius_help; /**< @brief Radius arround core-shell where vacancies should be located. help description. */ |
73 |
|
|
|
74 |
|
|
unsigned int help_given ; /**< @brief Whether help was given. */ |
75 |
|
|
unsigned int version_given ; /**< @brief Whether version was given. */ |
76 |
|
|
unsigned int output_given ; /**< @brief Whether output was given. */ |
77 |
|
|
unsigned int latticeConstant_given ; /**< @brief Whether latticeConstant was given. */ |
78 |
|
|
unsigned int radius_given ; /**< @brief Whether radius was given. */ |
79 |
|
|
unsigned int length_given ; /**< @brief Whether length was given. */ |
80 |
|
|
unsigned int shellRadius_given ; /**< @brief Whether shellRadius was given. */ |
81 |
|
|
unsigned int molFraction_given ; /**< @brief Whether molFraction was given. */ |
82 |
|
|
unsigned int vacancyPercent_given ; /**< @brief Whether vacancyPercent was given. */ |
83 |
|
|
unsigned int vacancyInnerRadius_given ; /**< @brief Whether vacancyInnerRadius was given. */ |
84 |
|
|
unsigned int vacancyOuterRadius_given ; /**< @brief Whether vacancyOuterRadius was given. */ |
85 |
|
|
|
86 |
|
|
char **inputs ; /**< @brief unamed options (options without names) */ |
87 |
|
|
unsigned inputs_num ; /**< @brief unamed options number */ |
88 |
|
|
} ; |
89 |
|
|
|
90 |
|
|
/** @brief The additional parameters to pass to parser functions */ |
91 |
|
|
struct cmdline_parser_params |
92 |
|
|
{ |
93 |
|
|
int override; /**< @brief whether to override possibly already present options (default 0) */ |
94 |
|
|
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ |
95 |
|
|
int check_required; /**< @brief whether to check that all required options were provided (default 1) */ |
96 |
|
|
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ |
97 |
|
|
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ |
98 |
|
|
} ; |
99 |
|
|
|
100 |
|
|
/** @brief the purpose string of the program */ |
101 |
|
|
extern const char *gengetopt_args_info_purpose; |
102 |
|
|
/** @brief the usage string of the program */ |
103 |
|
|
extern const char *gengetopt_args_info_usage; |
104 |
|
|
/** @brief all the lines making the help output */ |
105 |
|
|
extern const char *gengetopt_args_info_help[]; |
106 |
|
|
|
107 |
|
|
/** |
108 |
|
|
* The command line parser |
109 |
|
|
* @param argc the number of command line options |
110 |
|
|
* @param argv the command line options |
111 |
|
|
* @param args_info the structure where option information will be stored |
112 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
113 |
|
|
*/ |
114 |
|
|
int cmdline_parser (int argc, char **argv, |
115 |
|
|
struct gengetopt_args_info *args_info); |
116 |
|
|
|
117 |
|
|
/** |
118 |
|
|
* The command line parser (version with additional parameters - deprecated) |
119 |
|
|
* @param argc the number of command line options |
120 |
|
|
* @param argv the command line options |
121 |
|
|
* @param args_info the structure where option information will be stored |
122 |
|
|
* @param override whether to override possibly already present options |
123 |
|
|
* @param initialize whether to initialize the option structure my_args_info |
124 |
|
|
* @param check_required whether to check that all required options were provided |
125 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
126 |
|
|
* @deprecated use cmdline_parser_ext() instead |
127 |
|
|
*/ |
128 |
|
|
int cmdline_parser2 (int argc, char **argv, |
129 |
|
|
struct gengetopt_args_info *args_info, |
130 |
|
|
int override, int initialize, int check_required); |
131 |
|
|
|
132 |
|
|
/** |
133 |
|
|
* The command line parser (version with additional parameters) |
134 |
|
|
* @param argc the number of command line options |
135 |
|
|
* @param argv the command line options |
136 |
|
|
* @param args_info the structure where option information will be stored |
137 |
|
|
* @param params additional parameters for the parser |
138 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
139 |
|
|
*/ |
140 |
|
|
int cmdline_parser_ext (int argc, char **argv, |
141 |
|
|
struct gengetopt_args_info *args_info, |
142 |
|
|
struct cmdline_parser_params *params); |
143 |
|
|
|
144 |
|
|
/** |
145 |
|
|
* Save the contents of the option struct into an already open FILE stream. |
146 |
|
|
* @param outfile the stream where to dump options |
147 |
|
|
* @param args_info the option struct to dump |
148 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
149 |
|
|
*/ |
150 |
|
|
int cmdline_parser_dump(FILE *outfile, |
151 |
|
|
struct gengetopt_args_info *args_info); |
152 |
|
|
|
153 |
|
|
/** |
154 |
|
|
* Save the contents of the option struct into a (text) file. |
155 |
|
|
* This file can be read by the config file parser (if generated by gengetopt) |
156 |
|
|
* @param filename the file where to save |
157 |
|
|
* @param args_info the option struct to save |
158 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
159 |
|
|
*/ |
160 |
|
|
int cmdline_parser_file_save(const char *filename, |
161 |
|
|
struct gengetopt_args_info *args_info); |
162 |
|
|
|
163 |
|
|
/** |
164 |
|
|
* Print the help |
165 |
|
|
*/ |
166 |
|
|
void cmdline_parser_print_help(void); |
167 |
|
|
/** |
168 |
|
|
* Print the version |
169 |
|
|
*/ |
170 |
|
|
void cmdline_parser_print_version(void); |
171 |
|
|
|
172 |
|
|
/** |
173 |
|
|
* Initializes all the fields a cmdline_parser_params structure |
174 |
|
|
* to their default values |
175 |
|
|
* @param params the structure to initialize |
176 |
|
|
*/ |
177 |
|
|
void cmdline_parser_params_init(struct cmdline_parser_params *params); |
178 |
|
|
|
179 |
|
|
/** |
180 |
|
|
* Allocates dynamically a cmdline_parser_params structure and initializes |
181 |
|
|
* all its fields to their default values |
182 |
|
|
* @return the created and initialized cmdline_parser_params structure |
183 |
|
|
*/ |
184 |
|
|
struct cmdline_parser_params *cmdline_parser_params_create(void); |
185 |
|
|
|
186 |
|
|
/** |
187 |
|
|
* Initializes the passed gengetopt_args_info structure's fields |
188 |
|
|
* (also set default values for options that have a default) |
189 |
|
|
* @param args_info the structure to initialize |
190 |
|
|
*/ |
191 |
|
|
void cmdline_parser_init (struct gengetopt_args_info *args_info); |
192 |
|
|
/** |
193 |
|
|
* Deallocates the string fields of the gengetopt_args_info structure |
194 |
|
|
* (but does not deallocate the structure itself) |
195 |
|
|
* @param args_info the structure to deallocate |
196 |
|
|
*/ |
197 |
|
|
void cmdline_parser_free (struct gengetopt_args_info *args_info); |
198 |
|
|
|
199 |
|
|
/** |
200 |
|
|
* Checks that all the required options were specified |
201 |
|
|
* @param args_info the structure to check |
202 |
|
|
* @param prog_name the name of the program that will be used to print |
203 |
|
|
* possible errors |
204 |
|
|
* @return |
205 |
|
|
*/ |
206 |
|
|
int cmdline_parser_required (struct gengetopt_args_info *args_info, |
207 |
|
|
const char *prog_name); |
208 |
|
|
|
209 |
|
|
|
210 |
|
|
#ifdef __cplusplus |
211 |
|
|
} |
212 |
|
|
#endif /* __cplusplus */ |
213 |
|
|
#endif /* NANOROD_PENTBUILDERCMD_H */ |