1 |
gezelter |
2024 |
/** @file SequentialPropsCmd.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 SEQUENTIALPROPSCMD_H |
9 |
|
|
#define SEQUENTIALPROPSCMD_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 "SequentialProps" |
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 "SequentialProps" |
30 |
|
|
#endif |
31 |
|
|
|
32 |
|
|
#ifndef CMDLINE_PARSER_VERSION |
33 |
|
|
/** @brief the program version */ |
34 |
|
|
#define CMDLINE_PARSER_VERSION "1.00" |
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 * 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 |
|
|
char * sele1_arg; /**< @brief select first stuntdouble set. */ |
49 |
|
|
char * sele1_orig; /**< @brief select first stuntdouble set original value given at command line. */ |
50 |
|
|
const char *sele1_help; /**< @brief select first stuntdouble set help description. */ |
51 |
|
|
char * sele2_arg; /**< @brief select second stuntdouble set (if sele2 is not set, use script from sele1). */ |
52 |
|
|
char * sele2_orig; /**< @brief select second stuntdouble set (if sele2 is not set, use script from sele1) original value given at command line. */ |
53 |
|
|
const char *sele2_help; /**< @brief select second stuntdouble set (if sele2 is not set, use script from sele1) help description. */ |
54 |
gezelter |
2035 |
int nbins_arg; /**< @brief number of bins (general purpose) (default='100'). */ |
55 |
|
|
char * nbins_orig; /**< @brief number of bins (general purpose) original value given at command line. */ |
56 |
|
|
const char *nbins_help; /**< @brief number of bins (general purpose) help description. */ |
57 |
|
|
int nbins_z_arg; /**< @brief number of bins in z axis (default='100'). */ |
58 |
|
|
char * nbins_z_orig; /**< @brief number of bins in z axis original value given at command line. */ |
59 |
|
|
const char *nbins_z_help; /**< @brief number of bins in z axis help description. */ |
60 |
gezelter |
2029 |
double referenceZ_arg; /**< @brief Reference z-height of solid surface. */ |
61 |
|
|
char * referenceZ_orig; /**< @brief Reference z-height of solid surface original value given at command line. */ |
62 |
|
|
const char *referenceZ_help; /**< @brief Reference z-height of solid surface help description. */ |
63 |
|
|
double dropletR_arg; /**< @brief Droplet radius in angstroms. */ |
64 |
|
|
char * dropletR_orig; /**< @brief Droplet radius in angstroms original value given at command line. */ |
65 |
|
|
const char *dropletR_help; /**< @brief Droplet radius in angstroms help description. */ |
66 |
gezelter |
2035 |
double threshDens_arg; /**< @brief Threshold Density in g/cm^3. */ |
67 |
|
|
char * threshDens_orig; /**< @brief Threshold Density in g/cm^3 original value given at command line. */ |
68 |
|
|
const char *threshDens_help; /**< @brief Threshold Density in g/cm^3 help description. */ |
69 |
gezelter |
2039 |
double bufferLength_arg; /**< @brief Buffer length in angstroms. */ |
70 |
|
|
char * bufferLength_orig; /**< @brief Buffer length in angstroms original value given at command line. */ |
71 |
|
|
const char *bufferLength_help; /**< @brief Buffer length in angstroms help description. */ |
72 |
gezelter |
2029 |
const char *com_help; /**< @brief selection center of mass help description. */ |
73 |
|
|
const char *ca1_help; /**< @brief contact angle of selection (using center of mass) help description. */ |
74 |
|
|
const char *ca2_help; /**< @brief contact angle of selection (using density profile) help description. */ |
75 |
gezelter |
2024 |
|
76 |
|
|
unsigned int help_given ; /**< @brief Whether help was given. */ |
77 |
|
|
unsigned int version_given ; /**< @brief Whether version was given. */ |
78 |
|
|
unsigned int input_given ; /**< @brief Whether input was given. */ |
79 |
|
|
unsigned int output_given ; /**< @brief Whether output was given. */ |
80 |
|
|
unsigned int sele1_given ; /**< @brief Whether sele1 was given. */ |
81 |
|
|
unsigned int sele2_given ; /**< @brief Whether sele2 was given. */ |
82 |
|
|
unsigned int nbins_given ; /**< @brief Whether nbins was given. */ |
83 |
gezelter |
2035 |
unsigned int nbins_z_given ; /**< @brief Whether nbins_z was given. */ |
84 |
gezelter |
2029 |
unsigned int referenceZ_given ; /**< @brief Whether referenceZ was given. */ |
85 |
|
|
unsigned int dropletR_given ; /**< @brief Whether dropletR was given. */ |
86 |
gezelter |
2035 |
unsigned int threshDens_given ; /**< @brief Whether threshDens was given. */ |
87 |
gezelter |
2039 |
unsigned int bufferLength_given ; /**< @brief Whether bufferLength was given. */ |
88 |
gezelter |
2029 |
unsigned int com_given ; /**< @brief Whether com was given. */ |
89 |
|
|
unsigned int ca1_given ; /**< @brief Whether ca1 was given. */ |
90 |
|
|
unsigned int ca2_given ; /**< @brief Whether ca2 was given. */ |
91 |
gezelter |
2024 |
|
92 |
|
|
char **inputs ; /**< @brief unamed options (options without names) */ |
93 |
|
|
unsigned inputs_num ; /**< @brief unamed options number */ |
94 |
|
|
int sequentialProps_group_counter; /**< @brief Counter for group sequentialProps */ |
95 |
|
|
} ; |
96 |
|
|
|
97 |
|
|
/** @brief The additional parameters to pass to parser functions */ |
98 |
|
|
struct cmdline_parser_params |
99 |
|
|
{ |
100 |
|
|
int override; /**< @brief whether to override possibly already present options (default 0) */ |
101 |
|
|
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ |
102 |
|
|
int check_required; /**< @brief whether to check that all required options were provided (default 1) */ |
103 |
|
|
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ |
104 |
|
|
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ |
105 |
|
|
} ; |
106 |
|
|
|
107 |
|
|
/** @brief the purpose string of the program */ |
108 |
|
|
extern const char *gengetopt_args_info_purpose; |
109 |
|
|
/** @brief the usage string of the program */ |
110 |
|
|
extern const char *gengetopt_args_info_usage; |
111 |
|
|
/** @brief all the lines making the help output */ |
112 |
|
|
extern const char *gengetopt_args_info_help[]; |
113 |
|
|
|
114 |
|
|
/** |
115 |
|
|
* The command line parser |
116 |
|
|
* @param argc the number of command line options |
117 |
|
|
* @param argv the command line options |
118 |
|
|
* @param args_info the structure where option information will be stored |
119 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
120 |
|
|
*/ |
121 |
|
|
int cmdline_parser (int argc, char **argv, |
122 |
|
|
struct gengetopt_args_info *args_info); |
123 |
|
|
|
124 |
|
|
/** |
125 |
|
|
* The command line parser (version with additional parameters - deprecated) |
126 |
|
|
* @param argc the number of command line options |
127 |
|
|
* @param argv the command line options |
128 |
|
|
* @param args_info the structure where option information will be stored |
129 |
|
|
* @param override whether to override possibly already present options |
130 |
|
|
* @param initialize whether to initialize the option structure my_args_info |
131 |
|
|
* @param check_required whether to check that all required options were provided |
132 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
133 |
|
|
* @deprecated use cmdline_parser_ext() instead |
134 |
|
|
*/ |
135 |
|
|
int cmdline_parser2 (int argc, char **argv, |
136 |
|
|
struct gengetopt_args_info *args_info, |
137 |
|
|
int override, int initialize, int check_required); |
138 |
|
|
|
139 |
|
|
/** |
140 |
|
|
* The command line parser (version with additional parameters) |
141 |
|
|
* @param argc the number of command line options |
142 |
|
|
* @param argv the command line options |
143 |
|
|
* @param args_info the structure where option information will be stored |
144 |
|
|
* @param params additional parameters for the parser |
145 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
146 |
|
|
*/ |
147 |
|
|
int cmdline_parser_ext (int argc, char **argv, |
148 |
|
|
struct gengetopt_args_info *args_info, |
149 |
|
|
struct cmdline_parser_params *params); |
150 |
|
|
|
151 |
|
|
/** |
152 |
|
|
* Save the contents of the option struct into an already open FILE stream. |
153 |
|
|
* @param outfile the stream where to dump options |
154 |
|
|
* @param args_info the option struct to dump |
155 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
156 |
|
|
*/ |
157 |
|
|
int cmdline_parser_dump(FILE *outfile, |
158 |
|
|
struct gengetopt_args_info *args_info); |
159 |
|
|
|
160 |
|
|
/** |
161 |
|
|
* Save the contents of the option struct into a (text) file. |
162 |
|
|
* This file can be read by the config file parser (if generated by gengetopt) |
163 |
|
|
* @param filename the file where to save |
164 |
|
|
* @param args_info the option struct to save |
165 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
166 |
|
|
*/ |
167 |
|
|
int cmdline_parser_file_save(const char *filename, |
168 |
|
|
struct gengetopt_args_info *args_info); |
169 |
|
|
|
170 |
|
|
/** |
171 |
|
|
* Print the help |
172 |
|
|
*/ |
173 |
|
|
void cmdline_parser_print_help(void); |
174 |
|
|
/** |
175 |
|
|
* Print the version |
176 |
|
|
*/ |
177 |
|
|
void cmdline_parser_print_version(void); |
178 |
|
|
|
179 |
|
|
/** |
180 |
|
|
* Initializes all the fields a cmdline_parser_params structure |
181 |
|
|
* to their default values |
182 |
|
|
* @param params the structure to initialize |
183 |
|
|
*/ |
184 |
|
|
void cmdline_parser_params_init(struct cmdline_parser_params *params); |
185 |
|
|
|
186 |
|
|
/** |
187 |
|
|
* Allocates dynamically a cmdline_parser_params structure and initializes |
188 |
|
|
* all its fields to their default values |
189 |
|
|
* @return the created and initialized cmdline_parser_params structure |
190 |
|
|
*/ |
191 |
|
|
struct cmdline_parser_params *cmdline_parser_params_create(void); |
192 |
|
|
|
193 |
|
|
/** |
194 |
|
|
* Initializes the passed gengetopt_args_info structure's fields |
195 |
|
|
* (also set default values for options that have a default) |
196 |
|
|
* @param args_info the structure to initialize |
197 |
|
|
*/ |
198 |
|
|
void cmdline_parser_init (struct gengetopt_args_info *args_info); |
199 |
|
|
/** |
200 |
|
|
* Deallocates the string fields of the gengetopt_args_info structure |
201 |
|
|
* (but does not deallocate the structure itself) |
202 |
|
|
* @param args_info the structure to deallocate |
203 |
|
|
*/ |
204 |
|
|
void cmdline_parser_free (struct gengetopt_args_info *args_info); |
205 |
|
|
|
206 |
|
|
/** |
207 |
|
|
* Checks that all the required options were specified |
208 |
|
|
* @param args_info the structure to check |
209 |
|
|
* @param prog_name the name of the program that will be used to print |
210 |
|
|
* possible errors |
211 |
|
|
* @return |
212 |
|
|
*/ |
213 |
|
|
int cmdline_parser_required (struct gengetopt_args_info *args_info, |
214 |
|
|
const char *prog_name); |
215 |
|
|
|
216 |
|
|
|
217 |
|
|
#ifdef __cplusplus |
218 |
|
|
} |
219 |
|
|
#endif /* __cplusplus */ |
220 |
|
|
#endif /* SEQUENTIALPROPSCMD_H */ |