1 |
|
/* |
2 |
< |
File autogenerated by gengetopt version 2.19.1 |
2 |
> |
File autogenerated by gengetopt version 2.22.4 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt --file-name=StaticPropsCmd -u |
4 |
> |
gengetopt --file-name=StaticPropsCmd --unamed-opts |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
17 |
|
#include <stdlib.h> |
18 |
|
#include <string.h> |
19 |
|
|
20 |
< |
#include "getopt.h" |
20 |
> |
#ifndef FIX_UNUSED |
21 |
> |
#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ |
22 |
> |
#endif |
23 |
|
|
24 |
+ |
#include <getopt.h> |
25 |
+ |
|
26 |
|
#include "StaticPropsCmd.h" |
27 |
|
|
28 |
|
const char *gengetopt_args_info_purpose = ""; |
40 |
|
" -b, --nbins=INT number of bins (general purpose) \n (default=`100')", |
41 |
|
" -x, --nbins_x=INT number of bins in x axis (default=`100')", |
42 |
|
" -y, --nbins_y=INT number of bins in y axis (default=`100')", |
43 |
+ |
" --nbins_z=INT number of bins in z axis (default=`100')", |
44 |
|
" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')", |
40 |
– |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
45 |
|
" -c, --rcut=DOUBLE cutoff radius (rcut)", |
46 |
+ |
" --dz=DOUBLE slab width (dz)", |
47 |
+ |
" --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
48 |
+ |
" --zlength=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)", |
49 |
|
" -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')", |
50 |
|
" --sele1=selection script select the first stuntdouble set", |
51 |
|
" --sele2=selection script select the second stuntdouble set", |
52 |
|
" --sele3=selection script select the third stuntdouble set", |
53 |
|
" --refsele=selection script\n select reference (use and only use with --gxyz)", |
54 |
+ |
" --comsele=selection script\n select stunt doubles for center-of-mass \n reference point", |
55 |
+ |
" --seleoffset=INT global index offset for a second object (used \n to define a vector between sites in molecule)", |
56 |
|
" --molname=STRING molecule name", |
57 |
|
" --begin=INT begin internal index", |
58 |
|
" --end=INT end internal index", |
61 |
|
" --bo bond order parameter (--rcut must be specified)", |
62 |
|
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
63 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
64 |
+ |
" --count count of molecules matching selection criteria \n (and associated statistics)", |
65 |
|
" -g, --gofr g(r)", |
66 |
|
" --gofz g(z)", |
67 |
|
" --r_theta g(r, cos(theta))", |
68 |
|
" --r_omega g(r, cos(omega))", |
69 |
+ |
" --r_z g(r, z)", |
70 |
|
" --theta_omega g(cos(theta), cos(omega))", |
71 |
|
" --gxyz g(x, y, z)", |
72 |
< |
" -p, --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)", |
72 |
> |
" --twodgofr 2D g(r) (Slab width --dz must be specified)", |
73 |
> |
" -p, --p2 p2 order parameter (--sele1 must be specified, \n --sele2 is optional)", |
74 |
|
" --rp2 rp2 order parameter (--sele1 and --sele2 must \n be specified)", |
75 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
76 |
|
" -d, --density density plot", |
77 |
|
" --slab_density slab density", |
78 |
+ |
" --p_angle p(cos(theta))", |
79 |
|
" --hxy hxy", |
80 |
|
" --rho_r rho of R", |
81 |
+ |
" --angle_r angle of R", |
82 |
|
" --hullvol hull volume of nanoparticle", |
83 |
+ |
" --rodlength length of nanorod", |
84 |
+ |
" -Q, --tet_param tetrahedrality order parameter", |
85 |
+ |
" --tet_param_z tetrahedrality order parameter by zbin(--sele1 \n must be specified)", |
86 |
|
0 |
87 |
|
}; |
88 |
|
|
89 |
+ |
typedef enum {ARG_NO |
90 |
+ |
, ARG_STRING |
91 |
+ |
, ARG_INT |
92 |
+ |
, ARG_DOUBLE |
93 |
+ |
} cmdline_parser_arg_type; |
94 |
+ |
|
95 |
|
static |
96 |
|
void clear_given (struct gengetopt_args_info *args_info); |
97 |
|
static |
98 |
|
void clear_args (struct gengetopt_args_info *args_info); |
99 |
|
|
100 |
|
static int |
101 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error); |
101 |
> |
cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, |
102 |
> |
struct cmdline_parser_params *params, const char *additional_error); |
103 |
|
|
104 |
|
static int |
105 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); |
118 |
|
args_info->nbins_given = 0 ; |
119 |
|
args_info->nbins_x_given = 0 ; |
120 |
|
args_info->nbins_y_given = 0 ; |
121 |
+ |
args_info->nbins_z_given = 0 ; |
122 |
|
args_info->nanglebins_given = 0 ; |
98 |
– |
args_info->length_given = 0 ; |
123 |
|
args_info->rcut_given = 0 ; |
124 |
+ |
args_info->dz_given = 0 ; |
125 |
+ |
args_info->length_given = 0 ; |
126 |
+ |
args_info->zlength_given = 0 ; |
127 |
|
args_info->zoffset_given = 0 ; |
128 |
|
args_info->sele1_given = 0 ; |
129 |
|
args_info->sele2_given = 0 ; |
130 |
|
args_info->sele3_given = 0 ; |
131 |
|
args_info->refsele_given = 0 ; |
132 |
+ |
args_info->comsele_given = 0 ; |
133 |
+ |
args_info->seleoffset_given = 0 ; |
134 |
|
args_info->molname_given = 0 ; |
135 |
|
args_info->begin_given = 0 ; |
136 |
|
args_info->end_given = 0 ; |
138 |
|
args_info->bo_given = 0 ; |
139 |
|
args_info->bor_given = 0 ; |
140 |
|
args_info->bad_given = 0 ; |
141 |
+ |
args_info->count_given = 0 ; |
142 |
|
args_info->gofr_given = 0 ; |
143 |
|
args_info->gofz_given = 0 ; |
144 |
|
args_info->r_theta_given = 0 ; |
145 |
|
args_info->r_omega_given = 0 ; |
146 |
+ |
args_info->r_z_given = 0 ; |
147 |
|
args_info->theta_omega_given = 0 ; |
148 |
|
args_info->gxyz_given = 0 ; |
149 |
+ |
args_info->twodgofr_given = 0 ; |
150 |
|
args_info->p2_given = 0 ; |
151 |
|
args_info->rp2_given = 0 ; |
152 |
|
args_info->scd_given = 0 ; |
153 |
|
args_info->density_given = 0 ; |
154 |
|
args_info->slab_density_given = 0 ; |
155 |
+ |
args_info->p_angle_given = 0 ; |
156 |
|
args_info->hxy_given = 0 ; |
157 |
|
args_info->rho_r_given = 0 ; |
158 |
+ |
args_info->angle_r_given = 0 ; |
159 |
|
args_info->hullvol_given = 0 ; |
160 |
+ |
args_info->rodlength_given = 0 ; |
161 |
+ |
args_info->tet_param_given = 0 ; |
162 |
+ |
args_info->tet_param_z_given = 0 ; |
163 |
|
args_info->staticProps_group_counter = 0 ; |
164 |
|
} |
165 |
|
|
166 |
|
static |
167 |
|
void clear_args (struct gengetopt_args_info *args_info) |
168 |
|
{ |
169 |
+ |
FIX_UNUSED (args_info); |
170 |
|
args_info->input_arg = NULL; |
171 |
|
args_info->input_orig = NULL; |
172 |
|
args_info->output_arg = NULL; |
179 |
|
args_info->nbins_x_orig = NULL; |
180 |
|
args_info->nbins_y_arg = 100; |
181 |
|
args_info->nbins_y_orig = NULL; |
182 |
+ |
args_info->nbins_z_arg = 100; |
183 |
+ |
args_info->nbins_z_orig = NULL; |
184 |
|
args_info->nanglebins_arg = 50; |
185 |
|
args_info->nanglebins_orig = NULL; |
146 |
– |
args_info->length_orig = NULL; |
186 |
|
args_info->rcut_orig = NULL; |
187 |
+ |
args_info->dz_orig = NULL; |
188 |
+ |
args_info->length_orig = NULL; |
189 |
+ |
args_info->zlength_orig = NULL; |
190 |
|
args_info->zoffset_arg = 0; |
191 |
|
args_info->zoffset_orig = NULL; |
192 |
|
args_info->sele1_arg = NULL; |
197 |
|
args_info->sele3_orig = NULL; |
198 |
|
args_info->refsele_arg = NULL; |
199 |
|
args_info->refsele_orig = NULL; |
200 |
+ |
args_info->comsele_arg = NULL; |
201 |
+ |
args_info->comsele_orig = NULL; |
202 |
+ |
args_info->seleoffset_orig = NULL; |
203 |
|
args_info->molname_arg = NULL; |
204 |
|
args_info->molname_orig = NULL; |
205 |
|
args_info->begin_orig = NULL; |
211 |
|
static |
212 |
|
void init_args_info(struct gengetopt_args_info *args_info) |
213 |
|
{ |
214 |
+ |
|
215 |
+ |
|
216 |
|
args_info->help_help = gengetopt_args_info_help[0] ; |
217 |
|
args_info->version_help = gengetopt_args_info_help[1] ; |
218 |
|
args_info->input_help = gengetopt_args_info_help[2] ; |
221 |
|
args_info->nbins_help = gengetopt_args_info_help[5] ; |
222 |
|
args_info->nbins_x_help = gengetopt_args_info_help[6] ; |
223 |
|
args_info->nbins_y_help = gengetopt_args_info_help[7] ; |
224 |
< |
args_info->nanglebins_help = gengetopt_args_info_help[8] ; |
225 |
< |
args_info->length_help = gengetopt_args_info_help[9] ; |
224 |
> |
args_info->nbins_z_help = gengetopt_args_info_help[8] ; |
225 |
> |
args_info->nanglebins_help = gengetopt_args_info_help[9] ; |
226 |
|
args_info->rcut_help = gengetopt_args_info_help[10] ; |
227 |
< |
args_info->zoffset_help = gengetopt_args_info_help[11] ; |
228 |
< |
args_info->sele1_help = gengetopt_args_info_help[12] ; |
229 |
< |
args_info->sele2_help = gengetopt_args_info_help[13] ; |
230 |
< |
args_info->sele3_help = gengetopt_args_info_help[14] ; |
231 |
< |
args_info->refsele_help = gengetopt_args_info_help[15] ; |
232 |
< |
args_info->molname_help = gengetopt_args_info_help[16] ; |
233 |
< |
args_info->begin_help = gengetopt_args_info_help[17] ; |
234 |
< |
args_info->end_help = gengetopt_args_info_help[18] ; |
235 |
< |
args_info->radius_help = gengetopt_args_info_help[19] ; |
236 |
< |
args_info->bo_help = gengetopt_args_info_help[20] ; |
237 |
< |
args_info->bor_help = gengetopt_args_info_help[21] ; |
238 |
< |
args_info->bad_help = gengetopt_args_info_help[22] ; |
239 |
< |
args_info->gofr_help = gengetopt_args_info_help[23] ; |
240 |
< |
args_info->gofz_help = gengetopt_args_info_help[24] ; |
241 |
< |
args_info->r_theta_help = gengetopt_args_info_help[25] ; |
242 |
< |
args_info->r_omega_help = gengetopt_args_info_help[26] ; |
243 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[27] ; |
244 |
< |
args_info->gxyz_help = gengetopt_args_info_help[28] ; |
245 |
< |
args_info->p2_help = gengetopt_args_info_help[29] ; |
246 |
< |
args_info->rp2_help = gengetopt_args_info_help[30] ; |
247 |
< |
args_info->scd_help = gengetopt_args_info_help[31] ; |
248 |
< |
args_info->density_help = gengetopt_args_info_help[32] ; |
249 |
< |
args_info->slab_density_help = gengetopt_args_info_help[33] ; |
250 |
< |
args_info->hxy_help = gengetopt_args_info_help[34] ; |
251 |
< |
args_info->rho_r_help = gengetopt_args_info_help[35] ; |
252 |
< |
args_info->hullvol_help = gengetopt_args_info_help[36] ; |
227 |
> |
args_info->dz_help = gengetopt_args_info_help[11] ; |
228 |
> |
args_info->length_help = gengetopt_args_info_help[12] ; |
229 |
> |
args_info->zlength_help = gengetopt_args_info_help[13] ; |
230 |
> |
args_info->zoffset_help = gengetopt_args_info_help[14] ; |
231 |
> |
args_info->sele1_help = gengetopt_args_info_help[15] ; |
232 |
> |
args_info->sele2_help = gengetopt_args_info_help[16] ; |
233 |
> |
args_info->sele3_help = gengetopt_args_info_help[17] ; |
234 |
> |
args_info->refsele_help = gengetopt_args_info_help[18] ; |
235 |
> |
args_info->comsele_help = gengetopt_args_info_help[19] ; |
236 |
> |
args_info->seleoffset_help = gengetopt_args_info_help[20] ; |
237 |
> |
args_info->molname_help = gengetopt_args_info_help[21] ; |
238 |
> |
args_info->begin_help = gengetopt_args_info_help[22] ; |
239 |
> |
args_info->end_help = gengetopt_args_info_help[23] ; |
240 |
> |
args_info->radius_help = gengetopt_args_info_help[24] ; |
241 |
> |
args_info->bo_help = gengetopt_args_info_help[26] ; |
242 |
> |
args_info->bor_help = gengetopt_args_info_help[27] ; |
243 |
> |
args_info->bad_help = gengetopt_args_info_help[28] ; |
244 |
> |
args_info->count_help = gengetopt_args_info_help[29] ; |
245 |
> |
args_info->gofr_help = gengetopt_args_info_help[30] ; |
246 |
> |
args_info->gofz_help = gengetopt_args_info_help[31] ; |
247 |
> |
args_info->r_theta_help = gengetopt_args_info_help[32] ; |
248 |
> |
args_info->r_omega_help = gengetopt_args_info_help[33] ; |
249 |
> |
args_info->r_z_help = gengetopt_args_info_help[34] ; |
250 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[35] ; |
251 |
> |
args_info->gxyz_help = gengetopt_args_info_help[36] ; |
252 |
> |
args_info->twodgofr_help = gengetopt_args_info_help[37] ; |
253 |
> |
args_info->p2_help = gengetopt_args_info_help[38] ; |
254 |
> |
args_info->rp2_help = gengetopt_args_info_help[39] ; |
255 |
> |
args_info->scd_help = gengetopt_args_info_help[40] ; |
256 |
> |
args_info->density_help = gengetopt_args_info_help[41] ; |
257 |
> |
args_info->slab_density_help = gengetopt_args_info_help[42] ; |
258 |
> |
args_info->p_angle_help = gengetopt_args_info_help[43] ; |
259 |
> |
args_info->hxy_help = gengetopt_args_info_help[44] ; |
260 |
> |
args_info->rho_r_help = gengetopt_args_info_help[45] ; |
261 |
> |
args_info->angle_r_help = gengetopt_args_info_help[46] ; |
262 |
> |
args_info->hullvol_help = gengetopt_args_info_help[47] ; |
263 |
> |
args_info->rodlength_help = gengetopt_args_info_help[48] ; |
264 |
> |
args_info->tet_param_help = gengetopt_args_info_help[49] ; |
265 |
> |
args_info->tet_param_z_help = gengetopt_args_info_help[50] ; |
266 |
|
|
267 |
|
} |
268 |
|
|
269 |
|
void |
270 |
|
cmdline_parser_print_version (void) |
271 |
|
{ |
272 |
< |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
272 |
> |
printf ("%s %s\n", |
273 |
> |
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), |
274 |
> |
CMDLINE_PARSER_VERSION); |
275 |
|
} |
276 |
|
|
277 |
< |
void |
216 |
< |
cmdline_parser_print_help (void) |
217 |
< |
{ |
218 |
< |
int i = 0; |
277 |
> |
static void print_help_common(void) { |
278 |
|
cmdline_parser_print_version (); |
279 |
|
|
280 |
|
if (strlen(gengetopt_args_info_purpose) > 0) |
281 |
|
printf("\n%s\n", gengetopt_args_info_purpose); |
282 |
|
|
283 |
< |
printf("\n%s\n\n", gengetopt_args_info_usage); |
283 |
> |
if (strlen(gengetopt_args_info_usage) > 0) |
284 |
> |
printf("\n%s\n", gengetopt_args_info_usage); |
285 |
|
|
286 |
+ |
printf("\n"); |
287 |
+ |
|
288 |
|
if (strlen(gengetopt_args_info_description) > 0) |
289 |
< |
printf("%s\n", gengetopt_args_info_description); |
289 |
> |
printf("%s\n\n", gengetopt_args_info_description); |
290 |
> |
} |
291 |
|
|
292 |
+ |
void |
293 |
+ |
cmdline_parser_print_help (void) |
294 |
+ |
{ |
295 |
+ |
int i = 0; |
296 |
+ |
print_help_common(); |
297 |
|
while (gengetopt_args_info_help[i]) |
298 |
|
printf("%s\n", gengetopt_args_info_help[i++]); |
299 |
|
} |
305 |
|
clear_args (args_info); |
306 |
|
init_args_info (args_info); |
307 |
|
|
308 |
< |
args_info->inputs = NULL; |
308 |
> |
args_info->inputs = 0; |
309 |
|
args_info->inputs_num = 0; |
310 |
|
} |
311 |
|
|
312 |
+ |
void |
313 |
+ |
cmdline_parser_params_init(struct cmdline_parser_params *params) |
314 |
+ |
{ |
315 |
+ |
if (params) |
316 |
+ |
{ |
317 |
+ |
params->override = 0; |
318 |
+ |
params->initialize = 1; |
319 |
+ |
params->check_required = 1; |
320 |
+ |
params->check_ambiguity = 0; |
321 |
+ |
params->print_errors = 1; |
322 |
+ |
} |
323 |
+ |
} |
324 |
+ |
|
325 |
+ |
struct cmdline_parser_params * |
326 |
+ |
cmdline_parser_params_create(void) |
327 |
+ |
{ |
328 |
+ |
struct cmdline_parser_params *params = |
329 |
+ |
(struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); |
330 |
+ |
cmdline_parser_params_init(params); |
331 |
+ |
return params; |
332 |
+ |
} |
333 |
+ |
|
334 |
|
static void |
335 |
< |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
335 |
> |
free_string_field (char **s) |
336 |
|
{ |
337 |
< |
|
248 |
< |
unsigned int i; |
249 |
< |
if (args_info->input_arg) |
337 |
> |
if (*s) |
338 |
|
{ |
339 |
< |
free (args_info->input_arg); /* free previous argument */ |
340 |
< |
args_info->input_arg = 0; |
253 |
< |
} |
254 |
< |
if (args_info->input_orig) |
255 |
< |
{ |
256 |
< |
free (args_info->input_orig); /* free previous argument */ |
257 |
< |
args_info->input_orig = 0; |
258 |
< |
} |
259 |
< |
if (args_info->output_arg) |
260 |
< |
{ |
261 |
< |
free (args_info->output_arg); /* free previous argument */ |
262 |
< |
args_info->output_arg = 0; |
263 |
< |
} |
264 |
< |
if (args_info->output_orig) |
265 |
< |
{ |
266 |
< |
free (args_info->output_orig); /* free previous argument */ |
267 |
< |
args_info->output_orig = 0; |
268 |
< |
} |
269 |
< |
if (args_info->step_orig) |
270 |
< |
{ |
271 |
< |
free (args_info->step_orig); /* free previous argument */ |
272 |
< |
args_info->step_orig = 0; |
273 |
< |
} |
274 |
< |
if (args_info->nbins_orig) |
275 |
< |
{ |
276 |
< |
free (args_info->nbins_orig); /* free previous argument */ |
277 |
< |
args_info->nbins_orig = 0; |
278 |
< |
} |
279 |
< |
if (args_info->nbins_x_orig) |
280 |
< |
{ |
281 |
< |
free (args_info->nbins_x_orig); /* free previous argument */ |
282 |
< |
args_info->nbins_x_orig = 0; |
283 |
< |
} |
284 |
< |
if (args_info->nbins_y_orig) |
285 |
< |
{ |
286 |
< |
free (args_info->nbins_y_orig); /* free previous argument */ |
287 |
< |
args_info->nbins_y_orig = 0; |
288 |
< |
} |
289 |
< |
if (args_info->nanglebins_orig) |
290 |
< |
{ |
291 |
< |
free (args_info->nanglebins_orig); /* free previous argument */ |
292 |
< |
args_info->nanglebins_orig = 0; |
293 |
< |
} |
294 |
< |
if (args_info->length_orig) |
295 |
< |
{ |
296 |
< |
free (args_info->length_orig); /* free previous argument */ |
297 |
< |
args_info->length_orig = 0; |
298 |
< |
} |
299 |
< |
if (args_info->rcut_orig) |
300 |
< |
{ |
301 |
< |
free (args_info->rcut_orig); /* free previous argument */ |
302 |
< |
args_info->rcut_orig = 0; |
303 |
< |
} |
304 |
< |
if (args_info->zoffset_orig) |
305 |
< |
{ |
306 |
< |
free (args_info->zoffset_orig); /* free previous argument */ |
307 |
< |
args_info->zoffset_orig = 0; |
308 |
< |
} |
309 |
< |
if (args_info->sele1_arg) |
310 |
< |
{ |
311 |
< |
free (args_info->sele1_arg); /* free previous argument */ |
312 |
< |
args_info->sele1_arg = 0; |
339 |
> |
free (*s); |
340 |
> |
*s = 0; |
341 |
|
} |
342 |
< |
if (args_info->sele1_orig) |
343 |
< |
{ |
344 |
< |
free (args_info->sele1_orig); /* free previous argument */ |
345 |
< |
args_info->sele1_orig = 0; |
346 |
< |
} |
347 |
< |
if (args_info->sele2_arg) |
348 |
< |
{ |
349 |
< |
free (args_info->sele2_arg); /* free previous argument */ |
350 |
< |
args_info->sele2_arg = 0; |
351 |
< |
} |
352 |
< |
if (args_info->sele2_orig) |
353 |
< |
{ |
354 |
< |
free (args_info->sele2_orig); /* free previous argument */ |
355 |
< |
args_info->sele2_orig = 0; |
356 |
< |
} |
357 |
< |
if (args_info->sele3_arg) |
358 |
< |
{ |
359 |
< |
free (args_info->sele3_arg); /* free previous argument */ |
360 |
< |
args_info->sele3_arg = 0; |
361 |
< |
} |
362 |
< |
if (args_info->sele3_orig) |
363 |
< |
{ |
364 |
< |
free (args_info->sele3_orig); /* free previous argument */ |
365 |
< |
args_info->sele3_orig = 0; |
366 |
< |
} |
367 |
< |
if (args_info->refsele_arg) |
368 |
< |
{ |
369 |
< |
free (args_info->refsele_arg); /* free previous argument */ |
370 |
< |
args_info->refsele_arg = 0; |
371 |
< |
} |
372 |
< |
if (args_info->refsele_orig) |
373 |
< |
{ |
374 |
< |
free (args_info->refsele_orig); /* free previous argument */ |
375 |
< |
args_info->refsele_orig = 0; |
376 |
< |
} |
377 |
< |
if (args_info->molname_arg) |
378 |
< |
{ |
379 |
< |
free (args_info->molname_arg); /* free previous argument */ |
352 |
< |
args_info->molname_arg = 0; |
353 |
< |
} |
354 |
< |
if (args_info->molname_orig) |
355 |
< |
{ |
356 |
< |
free (args_info->molname_orig); /* free previous argument */ |
357 |
< |
args_info->molname_orig = 0; |
358 |
< |
} |
359 |
< |
if (args_info->begin_orig) |
360 |
< |
{ |
361 |
< |
free (args_info->begin_orig); /* free previous argument */ |
362 |
< |
args_info->begin_orig = 0; |
363 |
< |
} |
364 |
< |
if (args_info->end_orig) |
365 |
< |
{ |
366 |
< |
free (args_info->end_orig); /* free previous argument */ |
367 |
< |
args_info->end_orig = 0; |
368 |
< |
} |
369 |
< |
if (args_info->radius_orig) |
370 |
< |
{ |
371 |
< |
free (args_info->radius_orig); /* free previous argument */ |
372 |
< |
args_info->radius_orig = 0; |
373 |
< |
} |
342 |
> |
} |
343 |
> |
|
344 |
> |
|
345 |
> |
static void |
346 |
> |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
347 |
> |
{ |
348 |
> |
unsigned int i; |
349 |
> |
free_string_field (&(args_info->input_arg)); |
350 |
> |
free_string_field (&(args_info->input_orig)); |
351 |
> |
free_string_field (&(args_info->output_arg)); |
352 |
> |
free_string_field (&(args_info->output_orig)); |
353 |
> |
free_string_field (&(args_info->step_orig)); |
354 |
> |
free_string_field (&(args_info->nbins_orig)); |
355 |
> |
free_string_field (&(args_info->nbins_x_orig)); |
356 |
> |
free_string_field (&(args_info->nbins_y_orig)); |
357 |
> |
free_string_field (&(args_info->nbins_z_orig)); |
358 |
> |
free_string_field (&(args_info->nanglebins_orig)); |
359 |
> |
free_string_field (&(args_info->rcut_orig)); |
360 |
> |
free_string_field (&(args_info->dz_orig)); |
361 |
> |
free_string_field (&(args_info->length_orig)); |
362 |
> |
free_string_field (&(args_info->zlength_orig)); |
363 |
> |
free_string_field (&(args_info->zoffset_orig)); |
364 |
> |
free_string_field (&(args_info->sele1_arg)); |
365 |
> |
free_string_field (&(args_info->sele1_orig)); |
366 |
> |
free_string_field (&(args_info->sele2_arg)); |
367 |
> |
free_string_field (&(args_info->sele2_orig)); |
368 |
> |
free_string_field (&(args_info->sele3_arg)); |
369 |
> |
free_string_field (&(args_info->sele3_orig)); |
370 |
> |
free_string_field (&(args_info->refsele_arg)); |
371 |
> |
free_string_field (&(args_info->refsele_orig)); |
372 |
> |
free_string_field (&(args_info->comsele_arg)); |
373 |
> |
free_string_field (&(args_info->comsele_orig)); |
374 |
> |
free_string_field (&(args_info->seleoffset_orig)); |
375 |
> |
free_string_field (&(args_info->molname_arg)); |
376 |
> |
free_string_field (&(args_info->molname_orig)); |
377 |
> |
free_string_field (&(args_info->begin_orig)); |
378 |
> |
free_string_field (&(args_info->end_orig)); |
379 |
> |
free_string_field (&(args_info->radius_orig)); |
380 |
|
|
381 |
+ |
|
382 |
|
for (i = 0; i < args_info->inputs_num; ++i) |
383 |
|
free (args_info->inputs [i]); |
384 |
< |
|
384 |
> |
|
385 |
|
if (args_info->inputs_num) |
386 |
|
free (args_info->inputs); |
387 |
< |
|
387 |
> |
|
388 |
|
clear_given (args_info); |
389 |
|
} |
390 |
|
|
391 |
+ |
|
392 |
+ |
static void |
393 |
+ |
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) |
394 |
+ |
{ |
395 |
+ |
FIX_UNUSED (values); |
396 |
+ |
if (arg) { |
397 |
+ |
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
398 |
+ |
} else { |
399 |
+ |
fprintf(outfile, "%s\n", opt); |
400 |
+ |
} |
401 |
+ |
} |
402 |
+ |
|
403 |
+ |
|
404 |
|
int |
405 |
+ |
cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) |
406 |
+ |
{ |
407 |
+ |
int i = 0; |
408 |
+ |
|
409 |
+ |
if (!outfile) |
410 |
+ |
{ |
411 |
+ |
fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); |
412 |
+ |
return EXIT_FAILURE; |
413 |
+ |
} |
414 |
+ |
|
415 |
+ |
if (args_info->help_given) |
416 |
+ |
write_into_file(outfile, "help", 0, 0 ); |
417 |
+ |
if (args_info->version_given) |
418 |
+ |
write_into_file(outfile, "version", 0, 0 ); |
419 |
+ |
if (args_info->input_given) |
420 |
+ |
write_into_file(outfile, "input", args_info->input_orig, 0); |
421 |
+ |
if (args_info->output_given) |
422 |
+ |
write_into_file(outfile, "output", args_info->output_orig, 0); |
423 |
+ |
if (args_info->step_given) |
424 |
+ |
write_into_file(outfile, "step", args_info->step_orig, 0); |
425 |
+ |
if (args_info->nbins_given) |
426 |
+ |
write_into_file(outfile, "nbins", args_info->nbins_orig, 0); |
427 |
+ |
if (args_info->nbins_x_given) |
428 |
+ |
write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); |
429 |
+ |
if (args_info->nbins_y_given) |
430 |
+ |
write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); |
431 |
+ |
if (args_info->nbins_z_given) |
432 |
+ |
write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0); |
433 |
+ |
if (args_info->nanglebins_given) |
434 |
+ |
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
435 |
+ |
if (args_info->rcut_given) |
436 |
+ |
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
437 |
+ |
if (args_info->dz_given) |
438 |
+ |
write_into_file(outfile, "dz", args_info->dz_orig, 0); |
439 |
+ |
if (args_info->length_given) |
440 |
+ |
write_into_file(outfile, "length", args_info->length_orig, 0); |
441 |
+ |
if (args_info->zlength_given) |
442 |
+ |
write_into_file(outfile, "zlength", args_info->zlength_orig, 0); |
443 |
+ |
if (args_info->zoffset_given) |
444 |
+ |
write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); |
445 |
+ |
if (args_info->sele1_given) |
446 |
+ |
write_into_file(outfile, "sele1", args_info->sele1_orig, 0); |
447 |
+ |
if (args_info->sele2_given) |
448 |
+ |
write_into_file(outfile, "sele2", args_info->sele2_orig, 0); |
449 |
+ |
if (args_info->sele3_given) |
450 |
+ |
write_into_file(outfile, "sele3", args_info->sele3_orig, 0); |
451 |
+ |
if (args_info->refsele_given) |
452 |
+ |
write_into_file(outfile, "refsele", args_info->refsele_orig, 0); |
453 |
+ |
if (args_info->comsele_given) |
454 |
+ |
write_into_file(outfile, "comsele", args_info->comsele_orig, 0); |
455 |
+ |
if (args_info->seleoffset_given) |
456 |
+ |
write_into_file(outfile, "seleoffset", args_info->seleoffset_orig, 0); |
457 |
+ |
if (args_info->molname_given) |
458 |
+ |
write_into_file(outfile, "molname", args_info->molname_orig, 0); |
459 |
+ |
if (args_info->begin_given) |
460 |
+ |
write_into_file(outfile, "begin", args_info->begin_orig, 0); |
461 |
+ |
if (args_info->end_given) |
462 |
+ |
write_into_file(outfile, "end", args_info->end_orig, 0); |
463 |
+ |
if (args_info->radius_given) |
464 |
+ |
write_into_file(outfile, "radius", args_info->radius_orig, 0); |
465 |
+ |
if (args_info->bo_given) |
466 |
+ |
write_into_file(outfile, "bo", 0, 0 ); |
467 |
+ |
if (args_info->bor_given) |
468 |
+ |
write_into_file(outfile, "bor", 0, 0 ); |
469 |
+ |
if (args_info->bad_given) |
470 |
+ |
write_into_file(outfile, "bad", 0, 0 ); |
471 |
+ |
if (args_info->count_given) |
472 |
+ |
write_into_file(outfile, "count", 0, 0 ); |
473 |
+ |
if (args_info->gofr_given) |
474 |
+ |
write_into_file(outfile, "gofr", 0, 0 ); |
475 |
+ |
if (args_info->gofz_given) |
476 |
+ |
write_into_file(outfile, "gofz", 0, 0 ); |
477 |
+ |
if (args_info->r_theta_given) |
478 |
+ |
write_into_file(outfile, "r_theta", 0, 0 ); |
479 |
+ |
if (args_info->r_omega_given) |
480 |
+ |
write_into_file(outfile, "r_omega", 0, 0 ); |
481 |
+ |
if (args_info->r_z_given) |
482 |
+ |
write_into_file(outfile, "r_z", 0, 0 ); |
483 |
+ |
if (args_info->theta_omega_given) |
484 |
+ |
write_into_file(outfile, "theta_omega", 0, 0 ); |
485 |
+ |
if (args_info->gxyz_given) |
486 |
+ |
write_into_file(outfile, "gxyz", 0, 0 ); |
487 |
+ |
if (args_info->twodgofr_given) |
488 |
+ |
write_into_file(outfile, "twodgofr", 0, 0 ); |
489 |
+ |
if (args_info->p2_given) |
490 |
+ |
write_into_file(outfile, "p2", 0, 0 ); |
491 |
+ |
if (args_info->rp2_given) |
492 |
+ |
write_into_file(outfile, "rp2", 0, 0 ); |
493 |
+ |
if (args_info->scd_given) |
494 |
+ |
write_into_file(outfile, "scd", 0, 0 ); |
495 |
+ |
if (args_info->density_given) |
496 |
+ |
write_into_file(outfile, "density", 0, 0 ); |
497 |
+ |
if (args_info->slab_density_given) |
498 |
+ |
write_into_file(outfile, "slab_density", 0, 0 ); |
499 |
+ |
if (args_info->p_angle_given) |
500 |
+ |
write_into_file(outfile, "p_angle", 0, 0 ); |
501 |
+ |
if (args_info->hxy_given) |
502 |
+ |
write_into_file(outfile, "hxy", 0, 0 ); |
503 |
+ |
if (args_info->rho_r_given) |
504 |
+ |
write_into_file(outfile, "rho_r", 0, 0 ); |
505 |
+ |
if (args_info->angle_r_given) |
506 |
+ |
write_into_file(outfile, "angle_r", 0, 0 ); |
507 |
+ |
if (args_info->hullvol_given) |
508 |
+ |
write_into_file(outfile, "hullvol", 0, 0 ); |
509 |
+ |
if (args_info->rodlength_given) |
510 |
+ |
write_into_file(outfile, "rodlength", 0, 0 ); |
511 |
+ |
if (args_info->tet_param_given) |
512 |
+ |
write_into_file(outfile, "tet_param", 0, 0 ); |
513 |
+ |
if (args_info->tet_param_z_given) |
514 |
+ |
write_into_file(outfile, "tet_param_z", 0, 0 ); |
515 |
+ |
|
516 |
+ |
|
517 |
+ |
i = EXIT_SUCCESS; |
518 |
+ |
return i; |
519 |
+ |
} |
520 |
+ |
|
521 |
+ |
int |
522 |
|
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) |
523 |
|
{ |
524 |
|
FILE *outfile; |
532 |
|
return EXIT_FAILURE; |
533 |
|
} |
534 |
|
|
535 |
< |
if (args_info->help_given) { |
399 |
< |
fprintf(outfile, "%s\n", "help"); |
400 |
< |
} |
401 |
< |
if (args_info->version_given) { |
402 |
< |
fprintf(outfile, "%s\n", "version"); |
403 |
< |
} |
404 |
< |
if (args_info->input_given) { |
405 |
< |
if (args_info->input_orig) { |
406 |
< |
fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig); |
407 |
< |
} else { |
408 |
< |
fprintf(outfile, "%s\n", "input"); |
409 |
< |
} |
410 |
< |
} |
411 |
< |
if (args_info->output_given) { |
412 |
< |
if (args_info->output_orig) { |
413 |
< |
fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig); |
414 |
< |
} else { |
415 |
< |
fprintf(outfile, "%s\n", "output"); |
416 |
< |
} |
417 |
< |
} |
418 |
< |
if (args_info->step_given) { |
419 |
< |
if (args_info->step_orig) { |
420 |
< |
fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig); |
421 |
< |
} else { |
422 |
< |
fprintf(outfile, "%s\n", "step"); |
423 |
< |
} |
424 |
< |
} |
425 |
< |
if (args_info->nbins_given) { |
426 |
< |
if (args_info->nbins_orig) { |
427 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
428 |
< |
} else { |
429 |
< |
fprintf(outfile, "%s\n", "nbins"); |
430 |
< |
} |
431 |
< |
} |
432 |
< |
if (args_info->nbins_x_given) { |
433 |
< |
if (args_info->nbins_x_orig) { |
434 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); |
435 |
< |
} else { |
436 |
< |
fprintf(outfile, "%s\n", "nbins_x"); |
437 |
< |
} |
438 |
< |
} |
439 |
< |
if (args_info->nbins_y_given) { |
440 |
< |
if (args_info->nbins_y_orig) { |
441 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); |
442 |
< |
} else { |
443 |
< |
fprintf(outfile, "%s\n", "nbins_y"); |
444 |
< |
} |
445 |
< |
} |
446 |
< |
if (args_info->nanglebins_given) { |
447 |
< |
if (args_info->nanglebins_orig) { |
448 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); |
449 |
< |
} else { |
450 |
< |
fprintf(outfile, "%s\n", "nanglebins"); |
451 |
< |
} |
452 |
< |
} |
453 |
< |
if (args_info->length_given) { |
454 |
< |
if (args_info->length_orig) { |
455 |
< |
fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); |
456 |
< |
} else { |
457 |
< |
fprintf(outfile, "%s\n", "length"); |
458 |
< |
} |
459 |
< |
} |
460 |
< |
if (args_info->rcut_given) { |
461 |
< |
if (args_info->rcut_orig) { |
462 |
< |
fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
463 |
< |
} else { |
464 |
< |
fprintf(outfile, "%s\n", "rcut"); |
465 |
< |
} |
466 |
< |
} |
467 |
< |
if (args_info->zoffset_given) { |
468 |
< |
if (args_info->zoffset_orig) { |
469 |
< |
fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); |
470 |
< |
} else { |
471 |
< |
fprintf(outfile, "%s\n", "zoffset"); |
472 |
< |
} |
473 |
< |
} |
474 |
< |
if (args_info->sele1_given) { |
475 |
< |
if (args_info->sele1_orig) { |
476 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig); |
477 |
< |
} else { |
478 |
< |
fprintf(outfile, "%s\n", "sele1"); |
479 |
< |
} |
480 |
< |
} |
481 |
< |
if (args_info->sele2_given) { |
482 |
< |
if (args_info->sele2_orig) { |
483 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig); |
484 |
< |
} else { |
485 |
< |
fprintf(outfile, "%s\n", "sele2"); |
486 |
< |
} |
487 |
< |
} |
488 |
< |
if (args_info->sele3_given) { |
489 |
< |
if (args_info->sele3_orig) { |
490 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig); |
491 |
< |
} else { |
492 |
< |
fprintf(outfile, "%s\n", "sele3"); |
493 |
< |
} |
494 |
< |
} |
495 |
< |
if (args_info->refsele_given) { |
496 |
< |
if (args_info->refsele_orig) { |
497 |
< |
fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig); |
498 |
< |
} else { |
499 |
< |
fprintf(outfile, "%s\n", "refsele"); |
500 |
< |
} |
501 |
< |
} |
502 |
< |
if (args_info->molname_given) { |
503 |
< |
if (args_info->molname_orig) { |
504 |
< |
fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig); |
505 |
< |
} else { |
506 |
< |
fprintf(outfile, "%s\n", "molname"); |
507 |
< |
} |
508 |
< |
} |
509 |
< |
if (args_info->begin_given) { |
510 |
< |
if (args_info->begin_orig) { |
511 |
< |
fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig); |
512 |
< |
} else { |
513 |
< |
fprintf(outfile, "%s\n", "begin"); |
514 |
< |
} |
515 |
< |
} |
516 |
< |
if (args_info->end_given) { |
517 |
< |
if (args_info->end_orig) { |
518 |
< |
fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig); |
519 |
< |
} else { |
520 |
< |
fprintf(outfile, "%s\n", "end"); |
521 |
< |
} |
522 |
< |
} |
523 |
< |
if (args_info->radius_given) { |
524 |
< |
if (args_info->radius_orig) { |
525 |
< |
fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); |
526 |
< |
} else { |
527 |
< |
fprintf(outfile, "%s\n", "radius"); |
528 |
< |
} |
529 |
< |
} |
530 |
< |
if (args_info->bo_given) { |
531 |
< |
fprintf(outfile, "%s\n", "bo"); |
532 |
< |
} |
533 |
< |
if (args_info->bor_given) { |
534 |
< |
fprintf(outfile, "%s\n", "bor"); |
535 |
< |
} |
536 |
< |
if (args_info->bad_given) { |
537 |
< |
fprintf(outfile, "%s\n", "bad"); |
538 |
< |
} |
539 |
< |
if (args_info->gofr_given) { |
540 |
< |
fprintf(outfile, "%s\n", "gofr"); |
541 |
< |
} |
542 |
< |
if (args_info->gofz_given) { |
543 |
< |
fprintf(outfile, "%s\n", "gofz"); |
544 |
< |
} |
545 |
< |
if (args_info->r_theta_given) { |
546 |
< |
fprintf(outfile, "%s\n", "r_theta"); |
547 |
< |
} |
548 |
< |
if (args_info->r_omega_given) { |
549 |
< |
fprintf(outfile, "%s\n", "r_omega"); |
550 |
< |
} |
551 |
< |
if (args_info->theta_omega_given) { |
552 |
< |
fprintf(outfile, "%s\n", "theta_omega"); |
553 |
< |
} |
554 |
< |
if (args_info->gxyz_given) { |
555 |
< |
fprintf(outfile, "%s\n", "gxyz"); |
556 |
< |
} |
557 |
< |
if (args_info->p2_given) { |
558 |
< |
fprintf(outfile, "%s\n", "p2"); |
559 |
< |
} |
560 |
< |
if (args_info->rp2_given) { |
561 |
< |
fprintf(outfile, "%s\n", "rp2"); |
562 |
< |
} |
563 |
< |
if (args_info->scd_given) { |
564 |
< |
fprintf(outfile, "%s\n", "scd"); |
565 |
< |
} |
566 |
< |
if (args_info->density_given) { |
567 |
< |
fprintf(outfile, "%s\n", "density"); |
568 |
< |
} |
569 |
< |
if (args_info->slab_density_given) { |
570 |
< |
fprintf(outfile, "%s\n", "slab_density"); |
571 |
< |
} |
572 |
< |
if (args_info->hxy_given) { |
573 |
< |
fprintf(outfile, "%s\n", "hxy"); |
574 |
< |
} |
575 |
< |
if (args_info->rho_r_given) { |
576 |
< |
fprintf(outfile, "%s\n", "rho_r"); |
577 |
< |
} |
578 |
< |
if (args_info->hullvol_given) { |
579 |
< |
fprintf(outfile, "%s\n", "hullvol"); |
580 |
< |
} |
581 |
< |
|
535 |
> |
i = cmdline_parser_dump(outfile, args_info); |
536 |
|
fclose (outfile); |
537 |
|
|
584 |
– |
i = EXIT_SUCCESS; |
538 |
|
return i; |
539 |
|
} |
540 |
|
|
544 |
|
cmdline_parser_release (args_info); |
545 |
|
} |
546 |
|
|
547 |
< |
|
595 |
< |
/* gengetopt_strdup() */ |
596 |
< |
/* strdup.c replacement of strdup, which is not standard */ |
547 |
> |
/** @brief replacement of strdup, which is not standard */ |
548 |
|
char * |
549 |
|
gengetopt_strdup (const char *s) |
550 |
|
{ |
551 |
< |
char *result = NULL; |
551 |
> |
char *result = 0; |
552 |
|
if (!s) |
553 |
|
return result; |
554 |
|
|
560 |
|
} |
561 |
|
|
562 |
|
static void |
612 |
– |
reset_group_staticProps(struct gengetopt_args_info *args_info); |
613 |
– |
|
614 |
– |
static void |
563 |
|
reset_group_staticProps(struct gengetopt_args_info *args_info) |
564 |
|
{ |
565 |
|
if (! args_info->staticProps_group_counter) |
568 |
|
args_info->bo_given = 0 ; |
569 |
|
args_info->bor_given = 0 ; |
570 |
|
args_info->bad_given = 0 ; |
571 |
+ |
args_info->count_given = 0 ; |
572 |
|
args_info->gofr_given = 0 ; |
573 |
|
args_info->gofz_given = 0 ; |
574 |
|
args_info->r_theta_given = 0 ; |
575 |
|
args_info->r_omega_given = 0 ; |
576 |
+ |
args_info->r_z_given = 0 ; |
577 |
|
args_info->theta_omega_given = 0 ; |
578 |
|
args_info->gxyz_given = 0 ; |
579 |
+ |
args_info->twodgofr_given = 0 ; |
580 |
|
args_info->p2_given = 0 ; |
581 |
|
args_info->rp2_given = 0 ; |
582 |
|
args_info->scd_given = 0 ; |
583 |
|
args_info->density_given = 0 ; |
584 |
|
args_info->slab_density_given = 0 ; |
585 |
+ |
args_info->p_angle_given = 0 ; |
586 |
|
args_info->hxy_given = 0 ; |
587 |
|
args_info->rho_r_given = 0 ; |
588 |
+ |
args_info->angle_r_given = 0 ; |
589 |
|
args_info->hullvol_given = 0 ; |
590 |
+ |
args_info->rodlength_given = 0 ; |
591 |
+ |
args_info->tet_param_given = 0 ; |
592 |
+ |
args_info->tet_param_z_given = 0 ; |
593 |
|
|
594 |
|
args_info->staticProps_group_counter = 0; |
595 |
|
} |
596 |
|
|
597 |
|
int |
598 |
< |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
598 |
> |
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) |
599 |
|
{ |
600 |
|
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
601 |
|
} |
602 |
|
|
603 |
|
int |
604 |
< |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
604 |
> |
cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, |
605 |
> |
struct cmdline_parser_params *params) |
606 |
|
{ |
607 |
|
int result; |
608 |
+ |
result = cmdline_parser_internal (argc, argv, args_info, params, 0); |
609 |
|
|
610 |
< |
result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL); |
610 |
> |
if (result == EXIT_FAILURE) |
611 |
> |
{ |
612 |
> |
cmdline_parser_free (args_info); |
613 |
> |
exit (EXIT_FAILURE); |
614 |
> |
} |
615 |
> |
|
616 |
> |
return result; |
617 |
> |
} |
618 |
|
|
619 |
+ |
int |
620 |
+ |
cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
621 |
+ |
{ |
622 |
+ |
int result; |
623 |
+ |
struct cmdline_parser_params params; |
624 |
+ |
|
625 |
+ |
params.override = override; |
626 |
+ |
params.initialize = initialize; |
627 |
+ |
params.check_required = check_required; |
628 |
+ |
params.check_ambiguity = 0; |
629 |
+ |
params.print_errors = 1; |
630 |
+ |
|
631 |
+ |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); |
632 |
+ |
|
633 |
|
if (result == EXIT_FAILURE) |
634 |
|
{ |
635 |
|
cmdline_parser_free (args_info); |
644 |
|
{ |
645 |
|
int result = EXIT_SUCCESS; |
646 |
|
|
647 |
< |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
647 |
> |
if (cmdline_parser_required2(args_info, prog_name, 0) > 0) |
648 |
|
result = EXIT_FAILURE; |
649 |
|
|
650 |
|
if (result == EXIT_FAILURE) |
660 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
661 |
|
{ |
662 |
|
int error = 0; |
663 |
+ |
FIX_UNUSED (additional_error); |
664 |
|
|
665 |
|
/* checks for required options */ |
666 |
|
if (! args_info->input_given) |
671 |
|
|
672 |
|
if (args_info->staticProps_group_counter == 0) |
673 |
|
{ |
674 |
< |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
674 |
> |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
675 |
|
error = 1; |
676 |
|
} |
677 |
|
|
681 |
|
return error; |
682 |
|
} |
683 |
|
|
684 |
+ |
|
685 |
+ |
static char *package_name = 0; |
686 |
+ |
|
687 |
+ |
/** |
688 |
+ |
* @brief updates an option |
689 |
+ |
* @param field the generic pointer to the field to update |
690 |
+ |
* @param orig_field the pointer to the orig field |
691 |
+ |
* @param field_given the pointer to the number of occurrence of this option |
692 |
+ |
* @param prev_given the pointer to the number of occurrence already seen |
693 |
+ |
* @param value the argument for this option (if null no arg was specified) |
694 |
+ |
* @param possible_values the possible values for this option (if specified) |
695 |
+ |
* @param default_value the default value (in case the option only accepts fixed values) |
696 |
+ |
* @param arg_type the type of this option |
697 |
+ |
* @param check_ambiguity @see cmdline_parser_params.check_ambiguity |
698 |
+ |
* @param override @see cmdline_parser_params.override |
699 |
+ |
* @param no_free whether to free a possible previous value |
700 |
+ |
* @param multiple_option whether this is a multiple option |
701 |
+ |
* @param long_opt the corresponding long option |
702 |
+ |
* @param short_opt the corresponding short option (or '-' if none) |
703 |
+ |
* @param additional_error possible further error specification |
704 |
+ |
*/ |
705 |
+ |
static |
706 |
+ |
int update_arg(void *field, char **orig_field, |
707 |
+ |
unsigned int *field_given, unsigned int *prev_given, |
708 |
+ |
char *value, const char *possible_values[], |
709 |
+ |
const char *default_value, |
710 |
+ |
cmdline_parser_arg_type arg_type, |
711 |
+ |
int check_ambiguity, int override, |
712 |
+ |
int no_free, int multiple_option, |
713 |
+ |
const char *long_opt, char short_opt, |
714 |
+ |
const char *additional_error) |
715 |
+ |
{ |
716 |
+ |
char *stop_char = 0; |
717 |
+ |
const char *val = value; |
718 |
+ |
int found; |
719 |
+ |
char **string_field; |
720 |
+ |
FIX_UNUSED (field); |
721 |
+ |
|
722 |
+ |
stop_char = 0; |
723 |
+ |
found = 0; |
724 |
+ |
|
725 |
+ |
if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) |
726 |
+ |
{ |
727 |
+ |
if (short_opt != '-') |
728 |
+ |
fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", |
729 |
+ |
package_name, long_opt, short_opt, |
730 |
+ |
(additional_error ? additional_error : "")); |
731 |
+ |
else |
732 |
+ |
fprintf (stderr, "%s: `--%s' option given more than once%s\n", |
733 |
+ |
package_name, long_opt, |
734 |
+ |
(additional_error ? additional_error : "")); |
735 |
+ |
return 1; /* failure */ |
736 |
+ |
} |
737 |
+ |
|
738 |
+ |
FIX_UNUSED (default_value); |
739 |
+ |
|
740 |
+ |
if (field_given && *field_given && ! override) |
741 |
+ |
return 0; |
742 |
+ |
if (prev_given) |
743 |
+ |
(*prev_given)++; |
744 |
+ |
if (field_given) |
745 |
+ |
(*field_given)++; |
746 |
+ |
if (possible_values) |
747 |
+ |
val = possible_values[found]; |
748 |
+ |
|
749 |
+ |
switch(arg_type) { |
750 |
+ |
case ARG_INT: |
751 |
+ |
if (val) *((int *)field) = strtol (val, &stop_char, 0); |
752 |
+ |
break; |
753 |
+ |
case ARG_DOUBLE: |
754 |
+ |
if (val) *((double *)field) = strtod (val, &stop_char); |
755 |
+ |
break; |
756 |
+ |
case ARG_STRING: |
757 |
+ |
if (val) { |
758 |
+ |
string_field = (char **)field; |
759 |
+ |
if (!no_free && *string_field) |
760 |
+ |
free (*string_field); /* free previous string */ |
761 |
+ |
*string_field = gengetopt_strdup (val); |
762 |
+ |
} |
763 |
+ |
break; |
764 |
+ |
default: |
765 |
+ |
break; |
766 |
+ |
}; |
767 |
+ |
|
768 |
+ |
/* check numeric conversion */ |
769 |
+ |
switch(arg_type) { |
770 |
+ |
case ARG_INT: |
771 |
+ |
case ARG_DOUBLE: |
772 |
+ |
if (val && !(stop_char && *stop_char == '\0')) { |
773 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); |
774 |
+ |
return 1; /* failure */ |
775 |
+ |
} |
776 |
+ |
break; |
777 |
+ |
default: |
778 |
+ |
; |
779 |
+ |
}; |
780 |
+ |
|
781 |
+ |
/* store the original value */ |
782 |
+ |
switch(arg_type) { |
783 |
+ |
case ARG_NO: |
784 |
+ |
break; |
785 |
+ |
default: |
786 |
+ |
if (value && orig_field) { |
787 |
+ |
if (no_free) { |
788 |
+ |
*orig_field = value; |
789 |
+ |
} else { |
790 |
+ |
if (*orig_field) |
791 |
+ |
free (*orig_field); /* free previous string */ |
792 |
+ |
*orig_field = gengetopt_strdup (value); |
793 |
+ |
} |
794 |
+ |
} |
795 |
+ |
}; |
796 |
+ |
|
797 |
+ |
return 0; /* OK */ |
798 |
+ |
} |
799 |
+ |
|
800 |
+ |
|
801 |
|
int |
802 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required, const char *additional_error) |
802 |
> |
cmdline_parser_internal ( |
803 |
> |
int argc, char **argv, struct gengetopt_args_info *args_info, |
804 |
> |
struct cmdline_parser_params *params, const char *additional_error) |
805 |
|
{ |
806 |
|
int c; /* Character of the parsed option. */ |
807 |
|
|
808 |
|
int error = 0; |
809 |
|
struct gengetopt_args_info local_args_info; |
810 |
+ |
|
811 |
+ |
int override; |
812 |
+ |
int initialize; |
813 |
+ |
int check_required; |
814 |
+ |
int check_ambiguity; |
815 |
+ |
|
816 |
+ |
package_name = argv[0]; |
817 |
+ |
|
818 |
+ |
override = params->override; |
819 |
+ |
initialize = params->initialize; |
820 |
+ |
check_required = params->check_required; |
821 |
+ |
check_ambiguity = params->check_ambiguity; |
822 |
|
|
823 |
|
if (initialize) |
824 |
|
cmdline_parser_init (args_info); |
827 |
|
|
828 |
|
optarg = 0; |
829 |
|
optind = 0; |
830 |
< |
opterr = 1; |
830 |
> |
opterr = params->print_errors; |
831 |
|
optopt = '?'; |
832 |
|
|
833 |
|
while (1) |
834 |
|
{ |
835 |
|
int option_index = 0; |
725 |
– |
char *stop_char; |
836 |
|
|
837 |
|
static struct option long_options[] = { |
838 |
|
{ "help", 0, NULL, 'h' }, |
843 |
|
{ "nbins", 1, NULL, 'b' }, |
844 |
|
{ "nbins_x", 1, NULL, 'x' }, |
845 |
|
{ "nbins_y", 1, NULL, 'y' }, |
846 |
+ |
{ "nbins_z", 1, NULL, 0 }, |
847 |
|
{ "nanglebins", 1, NULL, 'a' }, |
737 |
– |
{ "length", 1, NULL, 0 }, |
848 |
|
{ "rcut", 1, NULL, 'c' }, |
849 |
+ |
{ "dz", 1, NULL, 0 }, |
850 |
+ |
{ "length", 1, NULL, 0 }, |
851 |
+ |
{ "zlength", 1, NULL, 0 }, |
852 |
|
{ "zoffset", 1, NULL, 'z' }, |
853 |
|
{ "sele1", 1, NULL, 0 }, |
854 |
|
{ "sele2", 1, NULL, 0 }, |
855 |
|
{ "sele3", 1, NULL, 0 }, |
856 |
|
{ "refsele", 1, NULL, 0 }, |
857 |
+ |
{ "comsele", 1, NULL, 0 }, |
858 |
+ |
{ "seleoffset", 1, NULL, 0 }, |
859 |
|
{ "molname", 1, NULL, 0 }, |
860 |
|
{ "begin", 1, NULL, 0 }, |
861 |
|
{ "end", 1, NULL, 0 }, |
863 |
|
{ "bo", 0, NULL, 0 }, |
864 |
|
{ "bor", 0, NULL, 0 }, |
865 |
|
{ "bad", 0, NULL, 0 }, |
866 |
+ |
{ "count", 0, NULL, 0 }, |
867 |
|
{ "gofr", 0, NULL, 'g' }, |
868 |
|
{ "gofz", 0, NULL, 0 }, |
869 |
|
{ "r_theta", 0, NULL, 0 }, |
870 |
|
{ "r_omega", 0, NULL, 0 }, |
871 |
+ |
{ "r_z", 0, NULL, 0 }, |
872 |
|
{ "theta_omega", 0, NULL, 0 }, |
873 |
|
{ "gxyz", 0, NULL, 0 }, |
874 |
+ |
{ "twodgofr", 0, NULL, 0 }, |
875 |
|
{ "p2", 0, NULL, 'p' }, |
876 |
|
{ "rp2", 0, NULL, 0 }, |
877 |
|
{ "scd", 0, NULL, 's' }, |
878 |
|
{ "density", 0, NULL, 'd' }, |
879 |
|
{ "slab_density", 0, NULL, 0 }, |
880 |
+ |
{ "p_angle", 0, NULL, 0 }, |
881 |
|
{ "hxy", 0, NULL, 0 }, |
882 |
|
{ "rho_r", 0, NULL, 0 }, |
883 |
+ |
{ "angle_r", 0, NULL, 0 }, |
884 |
|
{ "hullvol", 0, NULL, 0 }, |
885 |
< |
{ NULL, 0, NULL, 0 } |
885 |
> |
{ "rodlength", 0, NULL, 0 }, |
886 |
> |
{ "tet_param", 0, NULL, 'Q' }, |
887 |
> |
{ "tet_param_z", 0, NULL, 0 }, |
888 |
> |
{ 0, 0, 0, 0 } |
889 |
|
}; |
890 |
|
|
891 |
< |
stop_char = 0; |
769 |
< |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
891 |
> |
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsdQ", long_options, &option_index); |
892 |
|
|
893 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
894 |
|
|
905 |
|
exit (EXIT_SUCCESS); |
906 |
|
|
907 |
|
case 'i': /* input dump file. */ |
908 |
< |
if (local_args_info.input_given) |
909 |
< |
{ |
910 |
< |
fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
911 |
< |
goto failure; |
912 |
< |
} |
913 |
< |
if (args_info->input_given && ! override) |
914 |
< |
continue; |
915 |
< |
local_args_info.input_given = 1; |
916 |
< |
args_info->input_given = 1; |
917 |
< |
if (args_info->input_arg) |
796 |
< |
free (args_info->input_arg); /* free previous string */ |
797 |
< |
args_info->input_arg = gengetopt_strdup (optarg); |
798 |
< |
if (args_info->input_orig) |
799 |
< |
free (args_info->input_orig); /* free previous string */ |
800 |
< |
args_info->input_orig = gengetopt_strdup (optarg); |
908 |
> |
|
909 |
> |
|
910 |
> |
if (update_arg( (void *)&(args_info->input_arg), |
911 |
> |
&(args_info->input_orig), &(args_info->input_given), |
912 |
> |
&(local_args_info.input_given), optarg, 0, 0, ARG_STRING, |
913 |
> |
check_ambiguity, override, 0, 0, |
914 |
> |
"input", 'i', |
915 |
> |
additional_error)) |
916 |
> |
goto failure; |
917 |
> |
|
918 |
|
break; |
802 |
– |
|
919 |
|
case 'o': /* output file name. */ |
920 |
< |
if (local_args_info.output_given) |
921 |
< |
{ |
922 |
< |
fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
923 |
< |
goto failure; |
924 |
< |
} |
925 |
< |
if (args_info->output_given && ! override) |
926 |
< |
continue; |
927 |
< |
local_args_info.output_given = 1; |
928 |
< |
args_info->output_given = 1; |
929 |
< |
if (args_info->output_arg) |
814 |
< |
free (args_info->output_arg); /* free previous string */ |
815 |
< |
args_info->output_arg = gengetopt_strdup (optarg); |
816 |
< |
if (args_info->output_orig) |
817 |
< |
free (args_info->output_orig); /* free previous string */ |
818 |
< |
args_info->output_orig = gengetopt_strdup (optarg); |
920 |
> |
|
921 |
> |
|
922 |
> |
if (update_arg( (void *)&(args_info->output_arg), |
923 |
> |
&(args_info->output_orig), &(args_info->output_given), |
924 |
> |
&(local_args_info.output_given), optarg, 0, 0, ARG_STRING, |
925 |
> |
check_ambiguity, override, 0, 0, |
926 |
> |
"output", 'o', |
927 |
> |
additional_error)) |
928 |
> |
goto failure; |
929 |
> |
|
930 |
|
break; |
820 |
– |
|
931 |
|
case 'n': /* process every n frame. */ |
932 |
< |
if (local_args_info.step_given) |
933 |
< |
{ |
934 |
< |
fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
935 |
< |
goto failure; |
936 |
< |
} |
937 |
< |
if (args_info->step_given && ! override) |
938 |
< |
continue; |
939 |
< |
local_args_info.step_given = 1; |
830 |
< |
args_info->step_given = 1; |
831 |
< |
args_info->step_arg = strtol (optarg, &stop_char, 0); |
832 |
< |
if (!(stop_char && *stop_char == '\0')) { |
833 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
932 |
> |
|
933 |
> |
|
934 |
> |
if (update_arg( (void *)&(args_info->step_arg), |
935 |
> |
&(args_info->step_orig), &(args_info->step_given), |
936 |
> |
&(local_args_info.step_given), optarg, 0, "1", ARG_INT, |
937 |
> |
check_ambiguity, override, 0, 0, |
938 |
> |
"step", 'n', |
939 |
> |
additional_error)) |
940 |
|
goto failure; |
941 |
< |
} |
836 |
< |
if (args_info->step_orig) |
837 |
< |
free (args_info->step_orig); /* free previous string */ |
838 |
< |
args_info->step_orig = gengetopt_strdup (optarg); |
941 |
> |
|
942 |
|
break; |
840 |
– |
|
943 |
|
case 'b': /* number of bins (general purpose). */ |
944 |
< |
if (local_args_info.nbins_given) |
945 |
< |
{ |
946 |
< |
fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
947 |
< |
goto failure; |
948 |
< |
} |
949 |
< |
if (args_info->nbins_given && ! override) |
950 |
< |
continue; |
951 |
< |
local_args_info.nbins_given = 1; |
850 |
< |
args_info->nbins_given = 1; |
851 |
< |
args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
852 |
< |
if (!(stop_char && *stop_char == '\0')) { |
853 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
944 |
> |
|
945 |
> |
|
946 |
> |
if (update_arg( (void *)&(args_info->nbins_arg), |
947 |
> |
&(args_info->nbins_orig), &(args_info->nbins_given), |
948 |
> |
&(local_args_info.nbins_given), optarg, 0, "100", ARG_INT, |
949 |
> |
check_ambiguity, override, 0, 0, |
950 |
> |
"nbins", 'b', |
951 |
> |
additional_error)) |
952 |
|
goto failure; |
953 |
< |
} |
856 |
< |
if (args_info->nbins_orig) |
857 |
< |
free (args_info->nbins_orig); /* free previous string */ |
858 |
< |
args_info->nbins_orig = gengetopt_strdup (optarg); |
953 |
> |
|
954 |
|
break; |
860 |
– |
|
955 |
|
case 'x': /* number of bins in x axis. */ |
956 |
< |
if (local_args_info.nbins_x_given) |
957 |
< |
{ |
958 |
< |
fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
959 |
< |
goto failure; |
960 |
< |
} |
961 |
< |
if (args_info->nbins_x_given && ! override) |
962 |
< |
continue; |
963 |
< |
local_args_info.nbins_x_given = 1; |
870 |
< |
args_info->nbins_x_given = 1; |
871 |
< |
args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); |
872 |
< |
if (!(stop_char && *stop_char == '\0')) { |
873 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
956 |
> |
|
957 |
> |
|
958 |
> |
if (update_arg( (void *)&(args_info->nbins_x_arg), |
959 |
> |
&(args_info->nbins_x_orig), &(args_info->nbins_x_given), |
960 |
> |
&(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT, |
961 |
> |
check_ambiguity, override, 0, 0, |
962 |
> |
"nbins_x", 'x', |
963 |
> |
additional_error)) |
964 |
|
goto failure; |
965 |
< |
} |
876 |
< |
if (args_info->nbins_x_orig) |
877 |
< |
free (args_info->nbins_x_orig); /* free previous string */ |
878 |
< |
args_info->nbins_x_orig = gengetopt_strdup (optarg); |
965 |
> |
|
966 |
|
break; |
880 |
– |
|
967 |
|
case 'y': /* number of bins in y axis. */ |
968 |
< |
if (local_args_info.nbins_y_given) |
969 |
< |
{ |
970 |
< |
fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
971 |
< |
goto failure; |
972 |
< |
} |
973 |
< |
if (args_info->nbins_y_given && ! override) |
974 |
< |
continue; |
975 |
< |
local_args_info.nbins_y_given = 1; |
890 |
< |
args_info->nbins_y_given = 1; |
891 |
< |
args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); |
892 |
< |
if (!(stop_char && *stop_char == '\0')) { |
893 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
968 |
> |
|
969 |
> |
|
970 |
> |
if (update_arg( (void *)&(args_info->nbins_y_arg), |
971 |
> |
&(args_info->nbins_y_orig), &(args_info->nbins_y_given), |
972 |
> |
&(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT, |
973 |
> |
check_ambiguity, override, 0, 0, |
974 |
> |
"nbins_y", 'y', |
975 |
> |
additional_error)) |
976 |
|
goto failure; |
977 |
< |
} |
896 |
< |
if (args_info->nbins_y_orig) |
897 |
< |
free (args_info->nbins_y_orig); /* free previous string */ |
898 |
< |
args_info->nbins_y_orig = gengetopt_strdup (optarg); |
977 |
> |
|
978 |
|
break; |
900 |
– |
|
979 |
|
case 'a': /* number of bins for cos(angle). */ |
980 |
< |
if (local_args_info.nanglebins_given) |
981 |
< |
{ |
982 |
< |
fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
983 |
< |
goto failure; |
984 |
< |
} |
985 |
< |
if (args_info->nanglebins_given && ! override) |
986 |
< |
continue; |
987 |
< |
local_args_info.nanglebins_given = 1; |
910 |
< |
args_info->nanglebins_given = 1; |
911 |
< |
args_info->nanglebins_arg = strtol (optarg, &stop_char, 0); |
912 |
< |
if (!(stop_char && *stop_char == '\0')) { |
913 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
980 |
> |
|
981 |
> |
|
982 |
> |
if (update_arg( (void *)&(args_info->nanglebins_arg), |
983 |
> |
&(args_info->nanglebins_orig), &(args_info->nanglebins_given), |
984 |
> |
&(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT, |
985 |
> |
check_ambiguity, override, 0, 0, |
986 |
> |
"nanglebins", 'a', |
987 |
> |
additional_error)) |
988 |
|
goto failure; |
989 |
< |
} |
916 |
< |
if (args_info->nanglebins_orig) |
917 |
< |
free (args_info->nanglebins_orig); /* free previous string */ |
918 |
< |
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
989 |
> |
|
990 |
|
break; |
920 |
– |
|
991 |
|
case 'c': /* cutoff radius (rcut). */ |
992 |
< |
if (local_args_info.rcut_given) |
993 |
< |
{ |
994 |
< |
fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
995 |
< |
goto failure; |
996 |
< |
} |
997 |
< |
if (args_info->rcut_given && ! override) |
998 |
< |
continue; |
999 |
< |
local_args_info.rcut_given = 1; |
930 |
< |
args_info->rcut_given = 1; |
931 |
< |
args_info->rcut_arg = strtod (optarg, &stop_char); |
932 |
< |
if (!(stop_char && *stop_char == '\0')) { |
933 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
992 |
> |
|
993 |
> |
|
994 |
> |
if (update_arg( (void *)&(args_info->rcut_arg), |
995 |
> |
&(args_info->rcut_orig), &(args_info->rcut_given), |
996 |
> |
&(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE, |
997 |
> |
check_ambiguity, override, 0, 0, |
998 |
> |
"rcut", 'c', |
999 |
> |
additional_error)) |
1000 |
|
goto failure; |
1001 |
< |
} |
936 |
< |
if (args_info->rcut_orig) |
937 |
< |
free (args_info->rcut_orig); /* free previous string */ |
938 |
< |
args_info->rcut_orig = gengetopt_strdup (optarg); |
1001 |
> |
|
1002 |
|
break; |
940 |
– |
|
1003 |
|
case 'z': /* Where to set the zero for the slab_density calculation. */ |
1004 |
< |
if (local_args_info.zoffset_given) |
1005 |
< |
{ |
1006 |
< |
fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1007 |
< |
goto failure; |
1008 |
< |
} |
1009 |
< |
if (args_info->zoffset_given && ! override) |
1010 |
< |
continue; |
1011 |
< |
local_args_info.zoffset_given = 1; |
950 |
< |
args_info->zoffset_given = 1; |
951 |
< |
args_info->zoffset_arg = strtod (optarg, &stop_char); |
952 |
< |
if (!(stop_char && *stop_char == '\0')) { |
953 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1004 |
> |
|
1005 |
> |
|
1006 |
> |
if (update_arg( (void *)&(args_info->zoffset_arg), |
1007 |
> |
&(args_info->zoffset_orig), &(args_info->zoffset_given), |
1008 |
> |
&(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE, |
1009 |
> |
check_ambiguity, override, 0, 0, |
1010 |
> |
"zoffset", 'z', |
1011 |
> |
additional_error)) |
1012 |
|
goto failure; |
1013 |
< |
} |
956 |
< |
if (args_info->zoffset_orig) |
957 |
< |
free (args_info->zoffset_orig); /* free previous string */ |
958 |
< |
args_info->zoffset_orig = gengetopt_strdup (optarg); |
1013 |
> |
|
1014 |
|
break; |
960 |
– |
|
1015 |
|
case 'g': /* g(r). */ |
1016 |
< |
if (local_args_info.gofr_given) |
963 |
< |
{ |
964 |
< |
fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
965 |
< |
goto failure; |
966 |
< |
} |
967 |
< |
if (args_info->gofr_given && ! override) |
968 |
< |
continue; |
969 |
< |
local_args_info.gofr_given = 1; |
970 |
< |
args_info->gofr_given = 1; |
1016 |
> |
|
1017 |
|
if (args_info->staticProps_group_counter && override) |
1018 |
|
reset_group_staticProps (args_info); |
1019 |
|
args_info->staticProps_group_counter += 1; |
1020 |
+ |
|
1021 |
+ |
if (update_arg( 0 , |
1022 |
+ |
0 , &(args_info->gofr_given), |
1023 |
+ |
&(local_args_info.gofr_given), optarg, 0, 0, ARG_NO, |
1024 |
+ |
check_ambiguity, override, 0, 0, |
1025 |
+ |
"gofr", 'g', |
1026 |
+ |
additional_error)) |
1027 |
+ |
goto failure; |
1028 |
+ |
|
1029 |
|
break; |
1030 |
< |
|
1031 |
< |
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
977 |
< |
if (local_args_info.p2_given) |
978 |
< |
{ |
979 |
< |
fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
980 |
< |
goto failure; |
981 |
< |
} |
982 |
< |
if (args_info->p2_given && ! override) |
983 |
< |
continue; |
984 |
< |
local_args_info.p2_given = 1; |
985 |
< |
args_info->p2_given = 1; |
1030 |
> |
case 'p': /* p2 order parameter (--sele1 must be specified, --sele2 is optional). */ |
1031 |
> |
|
1032 |
|
if (args_info->staticProps_group_counter && override) |
1033 |
|
reset_group_staticProps (args_info); |
1034 |
|
args_info->staticProps_group_counter += 1; |
1035 |
+ |
|
1036 |
+ |
if (update_arg( 0 , |
1037 |
+ |
0 , &(args_info->p2_given), |
1038 |
+ |
&(local_args_info.p2_given), optarg, 0, 0, ARG_NO, |
1039 |
+ |
check_ambiguity, override, 0, 0, |
1040 |
+ |
"p2", 'p', |
1041 |
+ |
additional_error)) |
1042 |
+ |
goto failure; |
1043 |
+ |
|
1044 |
|
break; |
990 |
– |
|
1045 |
|
case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
1046 |
< |
if (local_args_info.scd_given) |
993 |
< |
{ |
994 |
< |
fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
995 |
< |
goto failure; |
996 |
< |
} |
997 |
< |
if (args_info->scd_given && ! override) |
998 |
< |
continue; |
999 |
< |
local_args_info.scd_given = 1; |
1000 |
< |
args_info->scd_given = 1; |
1046 |
> |
|
1047 |
|
if (args_info->staticProps_group_counter && override) |
1048 |
|
reset_group_staticProps (args_info); |
1049 |
|
args_info->staticProps_group_counter += 1; |
1050 |
+ |
|
1051 |
+ |
if (update_arg( 0 , |
1052 |
+ |
0 , &(args_info->scd_given), |
1053 |
+ |
&(local_args_info.scd_given), optarg, 0, 0, ARG_NO, |
1054 |
+ |
check_ambiguity, override, 0, 0, |
1055 |
+ |
"scd", 's', |
1056 |
+ |
additional_error)) |
1057 |
+ |
goto failure; |
1058 |
+ |
|
1059 |
|
break; |
1005 |
– |
|
1060 |
|
case 'd': /* density plot. */ |
1061 |
< |
if (local_args_info.density_given) |
1008 |
< |
{ |
1009 |
< |
fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1010 |
< |
goto failure; |
1011 |
< |
} |
1012 |
< |
if (args_info->density_given && ! override) |
1013 |
< |
continue; |
1014 |
< |
local_args_info.density_given = 1; |
1015 |
< |
args_info->density_given = 1; |
1061 |
> |
|
1062 |
|
if (args_info->staticProps_group_counter && override) |
1063 |
|
reset_group_staticProps (args_info); |
1064 |
|
args_info->staticProps_group_counter += 1; |
1065 |
+ |
|
1066 |
+ |
if (update_arg( 0 , |
1067 |
+ |
0 , &(args_info->density_given), |
1068 |
+ |
&(local_args_info.density_given), optarg, 0, 0, ARG_NO, |
1069 |
+ |
check_ambiguity, override, 0, 0, |
1070 |
+ |
"density", 'd', |
1071 |
+ |
additional_error)) |
1072 |
+ |
goto failure; |
1073 |
+ |
|
1074 |
|
break; |
1075 |
< |
|
1075 |
> |
case 'Q': /* tetrahedrality order parameter. */ |
1076 |
> |
|
1077 |
> |
if (args_info->staticProps_group_counter && override) |
1078 |
> |
reset_group_staticProps (args_info); |
1079 |
> |
args_info->staticProps_group_counter += 1; |
1080 |
> |
|
1081 |
> |
if (update_arg( 0 , |
1082 |
> |
0 , &(args_info->tet_param_given), |
1083 |
> |
&(local_args_info.tet_param_given), optarg, 0, 0, ARG_NO, |
1084 |
> |
check_ambiguity, override, 0, 0, |
1085 |
> |
"tet_param", 'Q', |
1086 |
> |
additional_error)) |
1087 |
> |
goto failure; |
1088 |
> |
|
1089 |
> |
break; |
1090 |
|
|
1091 |
|
case 0: /* Long option with no short option */ |
1092 |
+ |
/* number of bins in z axis. */ |
1093 |
+ |
if (strcmp (long_options[option_index].name, "nbins_z") == 0) |
1094 |
+ |
{ |
1095 |
+ |
|
1096 |
+ |
|
1097 |
+ |
if (update_arg( (void *)&(args_info->nbins_z_arg), |
1098 |
+ |
&(args_info->nbins_z_orig), &(args_info->nbins_z_given), |
1099 |
+ |
&(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT, |
1100 |
+ |
check_ambiguity, override, 0, 0, |
1101 |
+ |
"nbins_z", '-', |
1102 |
+ |
additional_error)) |
1103 |
+ |
goto failure; |
1104 |
+ |
|
1105 |
+ |
} |
1106 |
+ |
/* slab width (dz). */ |
1107 |
+ |
else if (strcmp (long_options[option_index].name, "dz") == 0) |
1108 |
+ |
{ |
1109 |
+ |
|
1110 |
+ |
|
1111 |
+ |
if (update_arg( (void *)&(args_info->dz_arg), |
1112 |
+ |
&(args_info->dz_orig), &(args_info->dz_given), |
1113 |
+ |
&(local_args_info.dz_given), optarg, 0, 0, ARG_DOUBLE, |
1114 |
+ |
check_ambiguity, override, 0, 0, |
1115 |
+ |
"dz", '-', |
1116 |
+ |
additional_error)) |
1117 |
+ |
goto failure; |
1118 |
+ |
|
1119 |
+ |
} |
1120 |
|
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1121 |
< |
if (strcmp (long_options[option_index].name, "length") == 0) |
1121 |
> |
else if (strcmp (long_options[option_index].name, "length") == 0) |
1122 |
|
{ |
1123 |
< |
if (local_args_info.length_given) |
1124 |
< |
{ |
1125 |
< |
fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1126 |
< |
goto failure; |
1127 |
< |
} |
1128 |
< |
if (args_info->length_given && ! override) |
1129 |
< |
continue; |
1130 |
< |
local_args_info.length_given = 1; |
1034 |
< |
args_info->length_given = 1; |
1035 |
< |
args_info->length_arg = strtod (optarg, &stop_char); |
1036 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1037 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1123 |
> |
|
1124 |
> |
|
1125 |
> |
if (update_arg( (void *)&(args_info->length_arg), |
1126 |
> |
&(args_info->length_orig), &(args_info->length_given), |
1127 |
> |
&(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE, |
1128 |
> |
check_ambiguity, override, 0, 0, |
1129 |
> |
"length", '-', |
1130 |
> |
additional_error)) |
1131 |
|
goto failure; |
1132 |
< |
} |
1040 |
< |
if (args_info->length_orig) |
1041 |
< |
free (args_info->length_orig); /* free previous string */ |
1042 |
< |
args_info->length_orig = gengetopt_strdup (optarg); |
1132 |
> |
|
1133 |
|
} |
1134 |
+ |
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
1135 |
+ |
else if (strcmp (long_options[option_index].name, "zlength") == 0) |
1136 |
+ |
{ |
1137 |
+ |
|
1138 |
+ |
|
1139 |
+ |
if (update_arg( (void *)&(args_info->zlength_arg), |
1140 |
+ |
&(args_info->zlength_orig), &(args_info->zlength_given), |
1141 |
+ |
&(local_args_info.zlength_given), optarg, 0, 0, ARG_DOUBLE, |
1142 |
+ |
check_ambiguity, override, 0, 0, |
1143 |
+ |
"zlength", '-', |
1144 |
+ |
additional_error)) |
1145 |
+ |
goto failure; |
1146 |
+ |
|
1147 |
+ |
} |
1148 |
|
/* select the first stuntdouble set. */ |
1149 |
|
else if (strcmp (long_options[option_index].name, "sele1") == 0) |
1150 |
|
{ |
1151 |
< |
if (local_args_info.sele1_given) |
1152 |
< |
{ |
1153 |
< |
fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1154 |
< |
goto failure; |
1155 |
< |
} |
1156 |
< |
if (args_info->sele1_given && ! override) |
1157 |
< |
continue; |
1158 |
< |
local_args_info.sele1_given = 1; |
1159 |
< |
args_info->sele1_given = 1; |
1160 |
< |
if (args_info->sele1_arg) |
1057 |
< |
free (args_info->sele1_arg); /* free previous string */ |
1058 |
< |
args_info->sele1_arg = gengetopt_strdup (optarg); |
1059 |
< |
if (args_info->sele1_orig) |
1060 |
< |
free (args_info->sele1_orig); /* free previous string */ |
1061 |
< |
args_info->sele1_orig = gengetopt_strdup (optarg); |
1151 |
> |
|
1152 |
> |
|
1153 |
> |
if (update_arg( (void *)&(args_info->sele1_arg), |
1154 |
> |
&(args_info->sele1_orig), &(args_info->sele1_given), |
1155 |
> |
&(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING, |
1156 |
> |
check_ambiguity, override, 0, 0, |
1157 |
> |
"sele1", '-', |
1158 |
> |
additional_error)) |
1159 |
> |
goto failure; |
1160 |
> |
|
1161 |
|
} |
1162 |
|
/* select the second stuntdouble set. */ |
1163 |
|
else if (strcmp (long_options[option_index].name, "sele2") == 0) |
1164 |
|
{ |
1165 |
< |
if (local_args_info.sele2_given) |
1166 |
< |
{ |
1167 |
< |
fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1168 |
< |
goto failure; |
1169 |
< |
} |
1170 |
< |
if (args_info->sele2_given && ! override) |
1171 |
< |
continue; |
1172 |
< |
local_args_info.sele2_given = 1; |
1173 |
< |
args_info->sele2_given = 1; |
1174 |
< |
if (args_info->sele2_arg) |
1076 |
< |
free (args_info->sele2_arg); /* free previous string */ |
1077 |
< |
args_info->sele2_arg = gengetopt_strdup (optarg); |
1078 |
< |
if (args_info->sele2_orig) |
1079 |
< |
free (args_info->sele2_orig); /* free previous string */ |
1080 |
< |
args_info->sele2_orig = gengetopt_strdup (optarg); |
1165 |
> |
|
1166 |
> |
|
1167 |
> |
if (update_arg( (void *)&(args_info->sele2_arg), |
1168 |
> |
&(args_info->sele2_orig), &(args_info->sele2_given), |
1169 |
> |
&(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING, |
1170 |
> |
check_ambiguity, override, 0, 0, |
1171 |
> |
"sele2", '-', |
1172 |
> |
additional_error)) |
1173 |
> |
goto failure; |
1174 |
> |
|
1175 |
|
} |
1176 |
|
/* select the third stuntdouble set. */ |
1177 |
|
else if (strcmp (long_options[option_index].name, "sele3") == 0) |
1178 |
|
{ |
1179 |
< |
if (local_args_info.sele3_given) |
1180 |
< |
{ |
1181 |
< |
fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1182 |
< |
goto failure; |
1183 |
< |
} |
1184 |
< |
if (args_info->sele3_given && ! override) |
1185 |
< |
continue; |
1186 |
< |
local_args_info.sele3_given = 1; |
1187 |
< |
args_info->sele3_given = 1; |
1188 |
< |
if (args_info->sele3_arg) |
1095 |
< |
free (args_info->sele3_arg); /* free previous string */ |
1096 |
< |
args_info->sele3_arg = gengetopt_strdup (optarg); |
1097 |
< |
if (args_info->sele3_orig) |
1098 |
< |
free (args_info->sele3_orig); /* free previous string */ |
1099 |
< |
args_info->sele3_orig = gengetopt_strdup (optarg); |
1179 |
> |
|
1180 |
> |
|
1181 |
> |
if (update_arg( (void *)&(args_info->sele3_arg), |
1182 |
> |
&(args_info->sele3_orig), &(args_info->sele3_given), |
1183 |
> |
&(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING, |
1184 |
> |
check_ambiguity, override, 0, 0, |
1185 |
> |
"sele3", '-', |
1186 |
> |
additional_error)) |
1187 |
> |
goto failure; |
1188 |
> |
|
1189 |
|
} |
1190 |
|
/* select reference (use and only use with --gxyz). */ |
1191 |
|
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
1192 |
|
{ |
1193 |
< |
if (local_args_info.refsele_given) |
1194 |
< |
{ |
1195 |
< |
fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1196 |
< |
goto failure; |
1197 |
< |
} |
1198 |
< |
if (args_info->refsele_given && ! override) |
1199 |
< |
continue; |
1200 |
< |
local_args_info.refsele_given = 1; |
1201 |
< |
args_info->refsele_given = 1; |
1202 |
< |
if (args_info->refsele_arg) |
1114 |
< |
free (args_info->refsele_arg); /* free previous string */ |
1115 |
< |
args_info->refsele_arg = gengetopt_strdup (optarg); |
1116 |
< |
if (args_info->refsele_orig) |
1117 |
< |
free (args_info->refsele_orig); /* free previous string */ |
1118 |
< |
args_info->refsele_orig = gengetopt_strdup (optarg); |
1193 |
> |
|
1194 |
> |
|
1195 |
> |
if (update_arg( (void *)&(args_info->refsele_arg), |
1196 |
> |
&(args_info->refsele_orig), &(args_info->refsele_given), |
1197 |
> |
&(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING, |
1198 |
> |
check_ambiguity, override, 0, 0, |
1199 |
> |
"refsele", '-', |
1200 |
> |
additional_error)) |
1201 |
> |
goto failure; |
1202 |
> |
|
1203 |
|
} |
1204 |
+ |
/* select stunt doubles for center-of-mass reference point. */ |
1205 |
+ |
else if (strcmp (long_options[option_index].name, "comsele") == 0) |
1206 |
+ |
{ |
1207 |
+ |
|
1208 |
+ |
|
1209 |
+ |
if (update_arg( (void *)&(args_info->comsele_arg), |
1210 |
+ |
&(args_info->comsele_orig), &(args_info->comsele_given), |
1211 |
+ |
&(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING, |
1212 |
+ |
check_ambiguity, override, 0, 0, |
1213 |
+ |
"comsele", '-', |
1214 |
+ |
additional_error)) |
1215 |
+ |
goto failure; |
1216 |
+ |
|
1217 |
+ |
} |
1218 |
+ |
/* global index offset for a second object (used to define a vector between sites in molecule). */ |
1219 |
+ |
else if (strcmp (long_options[option_index].name, "seleoffset") == 0) |
1220 |
+ |
{ |
1221 |
+ |
|
1222 |
+ |
|
1223 |
+ |
if (update_arg( (void *)&(args_info->seleoffset_arg), |
1224 |
+ |
&(args_info->seleoffset_orig), &(args_info->seleoffset_given), |
1225 |
+ |
&(local_args_info.seleoffset_given), optarg, 0, 0, ARG_INT, |
1226 |
+ |
check_ambiguity, override, 0, 0, |
1227 |
+ |
"seleoffset", '-', |
1228 |
+ |
additional_error)) |
1229 |
+ |
goto failure; |
1230 |
+ |
|
1231 |
+ |
} |
1232 |
|
/* molecule name. */ |
1233 |
|
else if (strcmp (long_options[option_index].name, "molname") == 0) |
1234 |
|
{ |
1235 |
< |
if (local_args_info.molname_given) |
1236 |
< |
{ |
1237 |
< |
fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1238 |
< |
goto failure; |
1239 |
< |
} |
1240 |
< |
if (args_info->molname_given && ! override) |
1241 |
< |
continue; |
1242 |
< |
local_args_info.molname_given = 1; |
1243 |
< |
args_info->molname_given = 1; |
1244 |
< |
if (args_info->molname_arg) |
1133 |
< |
free (args_info->molname_arg); /* free previous string */ |
1134 |
< |
args_info->molname_arg = gengetopt_strdup (optarg); |
1135 |
< |
if (args_info->molname_orig) |
1136 |
< |
free (args_info->molname_orig); /* free previous string */ |
1137 |
< |
args_info->molname_orig = gengetopt_strdup (optarg); |
1235 |
> |
|
1236 |
> |
|
1237 |
> |
if (update_arg( (void *)&(args_info->molname_arg), |
1238 |
> |
&(args_info->molname_orig), &(args_info->molname_given), |
1239 |
> |
&(local_args_info.molname_given), optarg, 0, 0, ARG_STRING, |
1240 |
> |
check_ambiguity, override, 0, 0, |
1241 |
> |
"molname", '-', |
1242 |
> |
additional_error)) |
1243 |
> |
goto failure; |
1244 |
> |
|
1245 |
|
} |
1246 |
|
/* begin internal index. */ |
1247 |
|
else if (strcmp (long_options[option_index].name, "begin") == 0) |
1248 |
|
{ |
1249 |
< |
if (local_args_info.begin_given) |
1250 |
< |
{ |
1251 |
< |
fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1252 |
< |
goto failure; |
1253 |
< |
} |
1254 |
< |
if (args_info->begin_given && ! override) |
1255 |
< |
continue; |
1256 |
< |
local_args_info.begin_given = 1; |
1150 |
< |
args_info->begin_given = 1; |
1151 |
< |
args_info->begin_arg = strtol (optarg, &stop_char, 0); |
1152 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1153 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1249 |
> |
|
1250 |
> |
|
1251 |
> |
if (update_arg( (void *)&(args_info->begin_arg), |
1252 |
> |
&(args_info->begin_orig), &(args_info->begin_given), |
1253 |
> |
&(local_args_info.begin_given), optarg, 0, 0, ARG_INT, |
1254 |
> |
check_ambiguity, override, 0, 0, |
1255 |
> |
"begin", '-', |
1256 |
> |
additional_error)) |
1257 |
|
goto failure; |
1258 |
< |
} |
1156 |
< |
if (args_info->begin_orig) |
1157 |
< |
free (args_info->begin_orig); /* free previous string */ |
1158 |
< |
args_info->begin_orig = gengetopt_strdup (optarg); |
1258 |
> |
|
1259 |
|
} |
1260 |
|
/* end internal index. */ |
1261 |
|
else if (strcmp (long_options[option_index].name, "end") == 0) |
1262 |
|
{ |
1263 |
< |
if (local_args_info.end_given) |
1264 |
< |
{ |
1265 |
< |
fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1266 |
< |
goto failure; |
1267 |
< |
} |
1268 |
< |
if (args_info->end_given && ! override) |
1269 |
< |
continue; |
1270 |
< |
local_args_info.end_given = 1; |
1171 |
< |
args_info->end_given = 1; |
1172 |
< |
args_info->end_arg = strtol (optarg, &stop_char, 0); |
1173 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1174 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1263 |
> |
|
1264 |
> |
|
1265 |
> |
if (update_arg( (void *)&(args_info->end_arg), |
1266 |
> |
&(args_info->end_orig), &(args_info->end_given), |
1267 |
> |
&(local_args_info.end_given), optarg, 0, 0, ARG_INT, |
1268 |
> |
check_ambiguity, override, 0, 0, |
1269 |
> |
"end", '-', |
1270 |
> |
additional_error)) |
1271 |
|
goto failure; |
1272 |
< |
} |
1177 |
< |
if (args_info->end_orig) |
1178 |
< |
free (args_info->end_orig); /* free previous string */ |
1179 |
< |
args_info->end_orig = gengetopt_strdup (optarg); |
1272 |
> |
|
1273 |
|
} |
1274 |
|
/* nanoparticle radius. */ |
1275 |
|
else if (strcmp (long_options[option_index].name, "radius") == 0) |
1276 |
|
{ |
1277 |
< |
if (local_args_info.radius_given) |
1278 |
< |
{ |
1279 |
< |
fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1280 |
< |
goto failure; |
1281 |
< |
} |
1282 |
< |
if (args_info->radius_given && ! override) |
1283 |
< |
continue; |
1284 |
< |
local_args_info.radius_given = 1; |
1192 |
< |
args_info->radius_given = 1; |
1193 |
< |
args_info->radius_arg = strtod (optarg, &stop_char); |
1194 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1195 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1277 |
> |
|
1278 |
> |
|
1279 |
> |
if (update_arg( (void *)&(args_info->radius_arg), |
1280 |
> |
&(args_info->radius_orig), &(args_info->radius_given), |
1281 |
> |
&(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE, |
1282 |
> |
check_ambiguity, override, 0, 0, |
1283 |
> |
"radius", '-', |
1284 |
> |
additional_error)) |
1285 |
|
goto failure; |
1286 |
< |
} |
1198 |
< |
if (args_info->radius_orig) |
1199 |
< |
free (args_info->radius_orig); /* free previous string */ |
1200 |
< |
args_info->radius_orig = gengetopt_strdup (optarg); |
1286 |
> |
|
1287 |
|
} |
1288 |
|
/* bond order parameter (--rcut must be specified). */ |
1289 |
|
else if (strcmp (long_options[option_index].name, "bo") == 0) |
1290 |
|
{ |
1291 |
< |
if (local_args_info.bo_given) |
1206 |
< |
{ |
1207 |
< |
fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1208 |
< |
goto failure; |
1209 |
< |
} |
1210 |
< |
if (args_info->bo_given && ! override) |
1211 |
< |
continue; |
1212 |
< |
local_args_info.bo_given = 1; |
1213 |
< |
args_info->bo_given = 1; |
1291 |
> |
|
1292 |
|
if (args_info->staticProps_group_counter && override) |
1293 |
|
reset_group_staticProps (args_info); |
1294 |
|
args_info->staticProps_group_counter += 1; |
1295 |
< |
break; |
1295 |
> |
|
1296 |
> |
if (update_arg( 0 , |
1297 |
> |
0 , &(args_info->bo_given), |
1298 |
> |
&(local_args_info.bo_given), optarg, 0, 0, ARG_NO, |
1299 |
> |
check_ambiguity, override, 0, 0, |
1300 |
> |
"bo", '-', |
1301 |
> |
additional_error)) |
1302 |
> |
goto failure; |
1303 |
> |
|
1304 |
|
} |
1305 |
|
/* bond order parameter as a function of radius (--rcut must be specified). */ |
1306 |
|
else if (strcmp (long_options[option_index].name, "bor") == 0) |
1307 |
|
{ |
1308 |
< |
if (local_args_info.bor_given) |
1223 |
< |
{ |
1224 |
< |
fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1225 |
< |
goto failure; |
1226 |
< |
} |
1227 |
< |
if (args_info->bor_given && ! override) |
1228 |
< |
continue; |
1229 |
< |
local_args_info.bor_given = 1; |
1230 |
< |
args_info->bor_given = 1; |
1308 |
> |
|
1309 |
|
if (args_info->staticProps_group_counter && override) |
1310 |
|
reset_group_staticProps (args_info); |
1311 |
|
args_info->staticProps_group_counter += 1; |
1312 |
< |
break; |
1312 |
> |
|
1313 |
> |
if (update_arg( 0 , |
1314 |
> |
0 , &(args_info->bor_given), |
1315 |
> |
&(local_args_info.bor_given), optarg, 0, 0, ARG_NO, |
1316 |
> |
check_ambiguity, override, 0, 0, |
1317 |
> |
"bor", '-', |
1318 |
> |
additional_error)) |
1319 |
> |
goto failure; |
1320 |
> |
|
1321 |
|
} |
1322 |
|
/* N(theta) bond angle density within (--rcut must be specified). */ |
1323 |
|
else if (strcmp (long_options[option_index].name, "bad") == 0) |
1324 |
|
{ |
1325 |
< |
if (local_args_info.bad_given) |
1240 |
< |
{ |
1241 |
< |
fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1242 |
< |
goto failure; |
1243 |
< |
} |
1244 |
< |
if (args_info->bad_given && ! override) |
1245 |
< |
continue; |
1246 |
< |
local_args_info.bad_given = 1; |
1247 |
< |
args_info->bad_given = 1; |
1325 |
> |
|
1326 |
|
if (args_info->staticProps_group_counter && override) |
1327 |
|
reset_group_staticProps (args_info); |
1328 |
|
args_info->staticProps_group_counter += 1; |
1329 |
< |
break; |
1329 |
> |
|
1330 |
> |
if (update_arg( 0 , |
1331 |
> |
0 , &(args_info->bad_given), |
1332 |
> |
&(local_args_info.bad_given), optarg, 0, 0, ARG_NO, |
1333 |
> |
check_ambiguity, override, 0, 0, |
1334 |
> |
"bad", '-', |
1335 |
> |
additional_error)) |
1336 |
> |
goto failure; |
1337 |
> |
|
1338 |
|
} |
1339 |
+ |
/* count of molecules matching selection criteria (and associated statistics). */ |
1340 |
+ |
else if (strcmp (long_options[option_index].name, "count") == 0) |
1341 |
+ |
{ |
1342 |
+ |
|
1343 |
+ |
if (args_info->staticProps_group_counter && override) |
1344 |
+ |
reset_group_staticProps (args_info); |
1345 |
+ |
args_info->staticProps_group_counter += 1; |
1346 |
+ |
|
1347 |
+ |
if (update_arg( 0 , |
1348 |
+ |
0 , &(args_info->count_given), |
1349 |
+ |
&(local_args_info.count_given), optarg, 0, 0, ARG_NO, |
1350 |
+ |
check_ambiguity, override, 0, 0, |
1351 |
+ |
"count", '-', |
1352 |
+ |
additional_error)) |
1353 |
+ |
goto failure; |
1354 |
+ |
|
1355 |
+ |
} |
1356 |
|
/* g(z). */ |
1357 |
|
else if (strcmp (long_options[option_index].name, "gofz") == 0) |
1358 |
|
{ |
1359 |
< |
if (local_args_info.gofz_given) |
1257 |
< |
{ |
1258 |
< |
fprintf (stderr, "%s: `--gofz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1259 |
< |
goto failure; |
1260 |
< |
} |
1261 |
< |
if (args_info->gofz_given && ! override) |
1262 |
< |
continue; |
1263 |
< |
local_args_info.gofz_given = 1; |
1264 |
< |
args_info->gofz_given = 1; |
1359 |
> |
|
1360 |
|
if (args_info->staticProps_group_counter && override) |
1361 |
|
reset_group_staticProps (args_info); |
1362 |
|
args_info->staticProps_group_counter += 1; |
1363 |
< |
break; |
1363 |
> |
|
1364 |
> |
if (update_arg( 0 , |
1365 |
> |
0 , &(args_info->gofz_given), |
1366 |
> |
&(local_args_info.gofz_given), optarg, 0, 0, ARG_NO, |
1367 |
> |
check_ambiguity, override, 0, 0, |
1368 |
> |
"gofz", '-', |
1369 |
> |
additional_error)) |
1370 |
> |
goto failure; |
1371 |
> |
|
1372 |
|
} |
1373 |
|
/* g(r, cos(theta)). */ |
1374 |
|
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |
1375 |
|
{ |
1376 |
< |
if (local_args_info.r_theta_given) |
1274 |
< |
{ |
1275 |
< |
fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1276 |
< |
goto failure; |
1277 |
< |
} |
1278 |
< |
if (args_info->r_theta_given && ! override) |
1279 |
< |
continue; |
1280 |
< |
local_args_info.r_theta_given = 1; |
1281 |
< |
args_info->r_theta_given = 1; |
1376 |
> |
|
1377 |
|
if (args_info->staticProps_group_counter && override) |
1378 |
|
reset_group_staticProps (args_info); |
1379 |
|
args_info->staticProps_group_counter += 1; |
1380 |
< |
break; |
1380 |
> |
|
1381 |
> |
if (update_arg( 0 , |
1382 |
> |
0 , &(args_info->r_theta_given), |
1383 |
> |
&(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO, |
1384 |
> |
check_ambiguity, override, 0, 0, |
1385 |
> |
"r_theta", '-', |
1386 |
> |
additional_error)) |
1387 |
> |
goto failure; |
1388 |
> |
|
1389 |
|
} |
1390 |
|
/* g(r, cos(omega)). */ |
1391 |
|
else if (strcmp (long_options[option_index].name, "r_omega") == 0) |
1392 |
|
{ |
1393 |
< |
if (local_args_info.r_omega_given) |
1291 |
< |
{ |
1292 |
< |
fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1293 |
< |
goto failure; |
1294 |
< |
} |
1295 |
< |
if (args_info->r_omega_given && ! override) |
1296 |
< |
continue; |
1297 |
< |
local_args_info.r_omega_given = 1; |
1298 |
< |
args_info->r_omega_given = 1; |
1393 |
> |
|
1394 |
|
if (args_info->staticProps_group_counter && override) |
1395 |
|
reset_group_staticProps (args_info); |
1396 |
|
args_info->staticProps_group_counter += 1; |
1397 |
< |
break; |
1397 |
> |
|
1398 |
> |
if (update_arg( 0 , |
1399 |
> |
0 , &(args_info->r_omega_given), |
1400 |
> |
&(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO, |
1401 |
> |
check_ambiguity, override, 0, 0, |
1402 |
> |
"r_omega", '-', |
1403 |
> |
additional_error)) |
1404 |
> |
goto failure; |
1405 |
> |
|
1406 |
|
} |
1407 |
+ |
/* g(r, z). */ |
1408 |
+ |
else if (strcmp (long_options[option_index].name, "r_z") == 0) |
1409 |
+ |
{ |
1410 |
+ |
|
1411 |
+ |
if (args_info->staticProps_group_counter && override) |
1412 |
+ |
reset_group_staticProps (args_info); |
1413 |
+ |
args_info->staticProps_group_counter += 1; |
1414 |
+ |
|
1415 |
+ |
if (update_arg( 0 , |
1416 |
+ |
0 , &(args_info->r_z_given), |
1417 |
+ |
&(local_args_info.r_z_given), optarg, 0, 0, ARG_NO, |
1418 |
+ |
check_ambiguity, override, 0, 0, |
1419 |
+ |
"r_z", '-', |
1420 |
+ |
additional_error)) |
1421 |
+ |
goto failure; |
1422 |
+ |
|
1423 |
+ |
} |
1424 |
|
/* g(cos(theta), cos(omega)). */ |
1425 |
|
else if (strcmp (long_options[option_index].name, "theta_omega") == 0) |
1426 |
|
{ |
1427 |
< |
if (local_args_info.theta_omega_given) |
1308 |
< |
{ |
1309 |
< |
fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1310 |
< |
goto failure; |
1311 |
< |
} |
1312 |
< |
if (args_info->theta_omega_given && ! override) |
1313 |
< |
continue; |
1314 |
< |
local_args_info.theta_omega_given = 1; |
1315 |
< |
args_info->theta_omega_given = 1; |
1427 |
> |
|
1428 |
|
if (args_info->staticProps_group_counter && override) |
1429 |
|
reset_group_staticProps (args_info); |
1430 |
|
args_info->staticProps_group_counter += 1; |
1431 |
< |
break; |
1431 |
> |
|
1432 |
> |
if (update_arg( 0 , |
1433 |
> |
0 , &(args_info->theta_omega_given), |
1434 |
> |
&(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO, |
1435 |
> |
check_ambiguity, override, 0, 0, |
1436 |
> |
"theta_omega", '-', |
1437 |
> |
additional_error)) |
1438 |
> |
goto failure; |
1439 |
> |
|
1440 |
|
} |
1441 |
|
/* g(x, y, z). */ |
1442 |
|
else if (strcmp (long_options[option_index].name, "gxyz") == 0) |
1443 |
|
{ |
1444 |
< |
if (local_args_info.gxyz_given) |
1325 |
< |
{ |
1326 |
< |
fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1327 |
< |
goto failure; |
1328 |
< |
} |
1329 |
< |
if (args_info->gxyz_given && ! override) |
1330 |
< |
continue; |
1331 |
< |
local_args_info.gxyz_given = 1; |
1332 |
< |
args_info->gxyz_given = 1; |
1444 |
> |
|
1445 |
|
if (args_info->staticProps_group_counter && override) |
1446 |
|
reset_group_staticProps (args_info); |
1447 |
|
args_info->staticProps_group_counter += 1; |
1448 |
< |
break; |
1448 |
> |
|
1449 |
> |
if (update_arg( 0 , |
1450 |
> |
0 , &(args_info->gxyz_given), |
1451 |
> |
&(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO, |
1452 |
> |
check_ambiguity, override, 0, 0, |
1453 |
> |
"gxyz", '-', |
1454 |
> |
additional_error)) |
1455 |
> |
goto failure; |
1456 |
> |
|
1457 |
|
} |
1458 |
+ |
/* 2D g(r) (Slab width --dz must be specified). */ |
1459 |
+ |
else if (strcmp (long_options[option_index].name, "twodgofr") == 0) |
1460 |
+ |
{ |
1461 |
+ |
|
1462 |
+ |
if (args_info->staticProps_group_counter && override) |
1463 |
+ |
reset_group_staticProps (args_info); |
1464 |
+ |
args_info->staticProps_group_counter += 1; |
1465 |
+ |
|
1466 |
+ |
if (update_arg( 0 , |
1467 |
+ |
0 , &(args_info->twodgofr_given), |
1468 |
+ |
&(local_args_info.twodgofr_given), optarg, 0, 0, ARG_NO, |
1469 |
+ |
check_ambiguity, override, 0, 0, |
1470 |
+ |
"twodgofr", '-', |
1471 |
+ |
additional_error)) |
1472 |
+ |
goto failure; |
1473 |
+ |
|
1474 |
+ |
} |
1475 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1476 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1477 |
|
{ |
1478 |
< |
if (local_args_info.rp2_given) |
1342 |
< |
{ |
1343 |
< |
fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1344 |
< |
goto failure; |
1345 |
< |
} |
1346 |
< |
if (args_info->rp2_given && ! override) |
1347 |
< |
continue; |
1348 |
< |
local_args_info.rp2_given = 1; |
1349 |
< |
args_info->rp2_given = 1; |
1478 |
> |
|
1479 |
|
if (args_info->staticProps_group_counter && override) |
1480 |
|
reset_group_staticProps (args_info); |
1481 |
|
args_info->staticProps_group_counter += 1; |
1482 |
< |
break; |
1482 |
> |
|
1483 |
> |
if (update_arg( 0 , |
1484 |
> |
0 , &(args_info->rp2_given), |
1485 |
> |
&(local_args_info.rp2_given), optarg, 0, 0, ARG_NO, |
1486 |
> |
check_ambiguity, override, 0, 0, |
1487 |
> |
"rp2", '-', |
1488 |
> |
additional_error)) |
1489 |
> |
goto failure; |
1490 |
> |
|
1491 |
|
} |
1492 |
|
/* slab density. */ |
1493 |
|
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1494 |
|
{ |
1495 |
< |
if (local_args_info.slab_density_given) |
1359 |
< |
{ |
1360 |
< |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1361 |
< |
goto failure; |
1362 |
< |
} |
1363 |
< |
if (args_info->slab_density_given && ! override) |
1364 |
< |
continue; |
1365 |
< |
local_args_info.slab_density_given = 1; |
1366 |
< |
args_info->slab_density_given = 1; |
1495 |
> |
|
1496 |
|
if (args_info->staticProps_group_counter && override) |
1497 |
|
reset_group_staticProps (args_info); |
1498 |
|
args_info->staticProps_group_counter += 1; |
1499 |
< |
break; |
1499 |
> |
|
1500 |
> |
if (update_arg( 0 , |
1501 |
> |
0 , &(args_info->slab_density_given), |
1502 |
> |
&(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO, |
1503 |
> |
check_ambiguity, override, 0, 0, |
1504 |
> |
"slab_density", '-', |
1505 |
> |
additional_error)) |
1506 |
> |
goto failure; |
1507 |
> |
|
1508 |
|
} |
1509 |
+ |
/* p(cos(theta)). */ |
1510 |
+ |
else if (strcmp (long_options[option_index].name, "p_angle") == 0) |
1511 |
+ |
{ |
1512 |
+ |
|
1513 |
+ |
if (args_info->staticProps_group_counter && override) |
1514 |
+ |
reset_group_staticProps (args_info); |
1515 |
+ |
args_info->staticProps_group_counter += 1; |
1516 |
+ |
|
1517 |
+ |
if (update_arg( 0 , |
1518 |
+ |
0 , &(args_info->p_angle_given), |
1519 |
+ |
&(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO, |
1520 |
+ |
check_ambiguity, override, 0, 0, |
1521 |
+ |
"p_angle", '-', |
1522 |
+ |
additional_error)) |
1523 |
+ |
goto failure; |
1524 |
+ |
|
1525 |
+ |
} |
1526 |
|
/* hxy. */ |
1527 |
|
else if (strcmp (long_options[option_index].name, "hxy") == 0) |
1528 |
|
{ |
1529 |
< |
if (local_args_info.hxy_given) |
1376 |
< |
{ |
1377 |
< |
fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1378 |
< |
goto failure; |
1379 |
< |
} |
1380 |
< |
if (args_info->hxy_given && ! override) |
1381 |
< |
continue; |
1382 |
< |
local_args_info.hxy_given = 1; |
1383 |
< |
args_info->hxy_given = 1; |
1529 |
> |
|
1530 |
|
if (args_info->staticProps_group_counter && override) |
1531 |
|
reset_group_staticProps (args_info); |
1532 |
|
args_info->staticProps_group_counter += 1; |
1533 |
< |
break; |
1533 |
> |
|
1534 |
> |
if (update_arg( 0 , |
1535 |
> |
0 , &(args_info->hxy_given), |
1536 |
> |
&(local_args_info.hxy_given), optarg, 0, 0, ARG_NO, |
1537 |
> |
check_ambiguity, override, 0, 0, |
1538 |
> |
"hxy", '-', |
1539 |
> |
additional_error)) |
1540 |
> |
goto failure; |
1541 |
> |
|
1542 |
|
} |
1543 |
|
/* rho of R. */ |
1544 |
|
else if (strcmp (long_options[option_index].name, "rho_r") == 0) |
1545 |
|
{ |
1546 |
< |
if (local_args_info.rho_r_given) |
1393 |
< |
{ |
1394 |
< |
fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1395 |
< |
goto failure; |
1396 |
< |
} |
1397 |
< |
if (args_info->rho_r_given && ! override) |
1398 |
< |
continue; |
1399 |
< |
local_args_info.rho_r_given = 1; |
1400 |
< |
args_info->rho_r_given = 1; |
1546 |
> |
|
1547 |
|
if (args_info->staticProps_group_counter && override) |
1548 |
|
reset_group_staticProps (args_info); |
1549 |
|
args_info->staticProps_group_counter += 1; |
1550 |
< |
break; |
1550 |
> |
|
1551 |
> |
if (update_arg( 0 , |
1552 |
> |
0 , &(args_info->rho_r_given), |
1553 |
> |
&(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO, |
1554 |
> |
check_ambiguity, override, 0, 0, |
1555 |
> |
"rho_r", '-', |
1556 |
> |
additional_error)) |
1557 |
> |
goto failure; |
1558 |
> |
|
1559 |
|
} |
1560 |
+ |
/* angle of R. */ |
1561 |
+ |
else if (strcmp (long_options[option_index].name, "angle_r") == 0) |
1562 |
+ |
{ |
1563 |
+ |
|
1564 |
+ |
if (args_info->staticProps_group_counter && override) |
1565 |
+ |
reset_group_staticProps (args_info); |
1566 |
+ |
args_info->staticProps_group_counter += 1; |
1567 |
+ |
|
1568 |
+ |
if (update_arg( 0 , |
1569 |
+ |
0 , &(args_info->angle_r_given), |
1570 |
+ |
&(local_args_info.angle_r_given), optarg, 0, 0, ARG_NO, |
1571 |
+ |
check_ambiguity, override, 0, 0, |
1572 |
+ |
"angle_r", '-', |
1573 |
+ |
additional_error)) |
1574 |
+ |
goto failure; |
1575 |
+ |
|
1576 |
+ |
} |
1577 |
|
/* hull volume of nanoparticle. */ |
1578 |
|
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1579 |
|
{ |
1580 |
< |
if (local_args_info.hullvol_given) |
1410 |
< |
{ |
1411 |
< |
fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1412 |
< |
goto failure; |
1413 |
< |
} |
1414 |
< |
if (args_info->hullvol_given && ! override) |
1415 |
< |
continue; |
1416 |
< |
local_args_info.hullvol_given = 1; |
1417 |
< |
args_info->hullvol_given = 1; |
1580 |
> |
|
1581 |
|
if (args_info->staticProps_group_counter && override) |
1582 |
|
reset_group_staticProps (args_info); |
1583 |
|
args_info->staticProps_group_counter += 1; |
1584 |
< |
break; |
1584 |
> |
|
1585 |
> |
if (update_arg( 0 , |
1586 |
> |
0 , &(args_info->hullvol_given), |
1587 |
> |
&(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO, |
1588 |
> |
check_ambiguity, override, 0, 0, |
1589 |
> |
"hullvol", '-', |
1590 |
> |
additional_error)) |
1591 |
> |
goto failure; |
1592 |
> |
|
1593 |
|
} |
1594 |
+ |
/* length of nanorod. */ |
1595 |
+ |
else if (strcmp (long_options[option_index].name, "rodlength") == 0) |
1596 |
+ |
{ |
1597 |
|
|
1598 |
+ |
if (args_info->staticProps_group_counter && override) |
1599 |
+ |
reset_group_staticProps (args_info); |
1600 |
+ |
args_info->staticProps_group_counter += 1; |
1601 |
+ |
|
1602 |
+ |
if (update_arg( 0 , |
1603 |
+ |
0 , &(args_info->rodlength_given), |
1604 |
+ |
&(local_args_info.rodlength_given), optarg, 0, 0, ARG_NO, |
1605 |
+ |
check_ambiguity, override, 0, 0, |
1606 |
+ |
"rodlength", '-', |
1607 |
+ |
additional_error)) |
1608 |
+ |
goto failure; |
1609 |
+ |
|
1610 |
+ |
} |
1611 |
+ |
/* tetrahedrality order parameter by zbin(--sele1 must be specified). */ |
1612 |
+ |
else if (strcmp (long_options[option_index].name, "tet_param_z") == 0) |
1613 |
+ |
{ |
1614 |
+ |
|
1615 |
+ |
if (args_info->staticProps_group_counter && override) |
1616 |
+ |
reset_group_staticProps (args_info); |
1617 |
+ |
args_info->staticProps_group_counter += 1; |
1618 |
+ |
|
1619 |
+ |
if (update_arg( 0 , |
1620 |
+ |
0 , &(args_info->tet_param_z_given), |
1621 |
+ |
&(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO, |
1622 |
+ |
check_ambiguity, override, 0, 0, |
1623 |
+ |
"tet_param_z", '-', |
1624 |
+ |
additional_error)) |
1625 |
+ |
goto failure; |
1626 |
+ |
|
1627 |
+ |
} |
1628 |
+ |
|
1629 |
|
break; |
1630 |
|
case '?': /* Invalid option. */ |
1631 |
|
/* `getopt_long' already printed an error message. */ |
1639 |
|
|
1640 |
|
if (args_info->staticProps_group_counter > 1) |
1641 |
|
{ |
1642 |
< |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
1642 |
> |
fprintf (stderr, "%s: %d options of group staticProps were given. One is required%s.\n", argv[0], args_info->staticProps_group_counter, (additional_error ? additional_error : "")); |
1643 |
|
error = 1; |
1644 |
|
} |
1645 |
|
|