1 |
|
/* |
2 |
< |
File autogenerated by gengetopt version 2.19.1 |
2 |
> |
File autogenerated by gengetopt version 2.22 |
3 |
|
generated with the following command: |
4 |
< |
gengetopt --file-name=StaticPropsCmd -u |
4 |
> |
gengetopt -F StaticPropsCmd -u |
5 |
|
|
6 |
|
The developers of gengetopt consider the fixed text that goes in all |
7 |
|
gengetopt output files to be in the public domain: |
44 |
|
" --sele2=selection script select the second stuntdouble set", |
45 |
|
" --sele3=selection script select the third stuntdouble set", |
46 |
|
" --refsele=selection script\n select reference (use and only use with --gxyz)", |
47 |
+ |
" --comsele=selection script\n select stunt doubles for center-of-mass \n reference point", |
48 |
|
" --molname=STRING molecule name", |
49 |
|
" --begin=INT begin internal index", |
50 |
|
" --end=INT end internal index", |
54 |
|
" --bor bond order parameter as a function of radius \n (--rcut must be specified)", |
55 |
|
" --bad N(theta) bond angle density within (--rcut must \n be specified)", |
56 |
|
" -g, --gofr g(r)", |
57 |
+ |
" --gofz g(z)", |
58 |
|
" --r_theta g(r, cos(theta))", |
59 |
|
" --r_omega g(r, cos(omega))", |
60 |
|
" --theta_omega g(cos(theta), cos(omega))", |
64 |
|
" -s, --scd scd order parameter (either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)", |
65 |
|
" -d, --density density plot", |
66 |
|
" --slab_density slab density", |
67 |
+ |
" --p_angle p(cos(theta))", |
68 |
|
" --hxy hxy", |
69 |
|
" --rho_r rho of R", |
70 |
|
" --hullvol hull volume of nanoparticle", |
71 |
|
0 |
72 |
|
}; |
73 |
|
|
74 |
+ |
typedef enum {ARG_NO |
75 |
+ |
, ARG_STRING |
76 |
+ |
, ARG_INT |
77 |
+ |
, ARG_DOUBLE |
78 |
+ |
} cmdline_parser_arg_type; |
79 |
+ |
|
80 |
|
static |
81 |
|
void clear_given (struct gengetopt_args_info *args_info); |
82 |
|
static |
83 |
|
void clear_args (struct gengetopt_args_info *args_info); |
84 |
|
|
85 |
|
static int |
86 |
< |
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); |
86 |
> |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
87 |
> |
struct cmdline_parser_params *params, const char *additional_error); |
88 |
|
|
89 |
|
static int |
90 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); |
111 |
|
args_info->sele2_given = 0 ; |
112 |
|
args_info->sele3_given = 0 ; |
113 |
|
args_info->refsele_given = 0 ; |
114 |
+ |
args_info->comsele_given = 0 ; |
115 |
|
args_info->molname_given = 0 ; |
116 |
|
args_info->begin_given = 0 ; |
117 |
|
args_info->end_given = 0 ; |
120 |
|
args_info->bor_given = 0 ; |
121 |
|
args_info->bad_given = 0 ; |
122 |
|
args_info->gofr_given = 0 ; |
123 |
+ |
args_info->gofz_given = 0 ; |
124 |
|
args_info->r_theta_given = 0 ; |
125 |
|
args_info->r_omega_given = 0 ; |
126 |
|
args_info->theta_omega_given = 0 ; |
130 |
|
args_info->scd_given = 0 ; |
131 |
|
args_info->density_given = 0 ; |
132 |
|
args_info->slab_density_given = 0 ; |
133 |
+ |
args_info->p_angle_given = 0 ; |
134 |
|
args_info->hxy_given = 0 ; |
135 |
|
args_info->rho_r_given = 0 ; |
136 |
|
args_info->hullvol_given = 0 ; |
166 |
|
args_info->sele3_orig = NULL; |
167 |
|
args_info->refsele_arg = NULL; |
168 |
|
args_info->refsele_orig = NULL; |
169 |
+ |
args_info->comsele_arg = NULL; |
170 |
+ |
args_info->comsele_orig = NULL; |
171 |
|
args_info->molname_arg = NULL; |
172 |
|
args_info->molname_orig = NULL; |
173 |
|
args_info->begin_orig = NULL; |
179 |
|
static |
180 |
|
void init_args_info(struct gengetopt_args_info *args_info) |
181 |
|
{ |
182 |
+ |
|
183 |
+ |
|
184 |
|
args_info->help_help = gengetopt_args_info_help[0] ; |
185 |
|
args_info->version_help = gengetopt_args_info_help[1] ; |
186 |
|
args_info->input_help = gengetopt_args_info_help[2] ; |
197 |
|
args_info->sele2_help = gengetopt_args_info_help[13] ; |
198 |
|
args_info->sele3_help = gengetopt_args_info_help[14] ; |
199 |
|
args_info->refsele_help = gengetopt_args_info_help[15] ; |
200 |
< |
args_info->molname_help = gengetopt_args_info_help[16] ; |
201 |
< |
args_info->begin_help = gengetopt_args_info_help[17] ; |
202 |
< |
args_info->end_help = gengetopt_args_info_help[18] ; |
203 |
< |
args_info->radius_help = gengetopt_args_info_help[19] ; |
204 |
< |
args_info->bo_help = gengetopt_args_info_help[20] ; |
205 |
< |
args_info->bor_help = gengetopt_args_info_help[21] ; |
206 |
< |
args_info->bad_help = gengetopt_args_info_help[22] ; |
207 |
< |
args_info->gofr_help = gengetopt_args_info_help[23] ; |
208 |
< |
args_info->r_theta_help = gengetopt_args_info_help[24] ; |
209 |
< |
args_info->r_omega_help = gengetopt_args_info_help[25] ; |
210 |
< |
args_info->theta_omega_help = gengetopt_args_info_help[26] ; |
211 |
< |
args_info->gxyz_help = gengetopt_args_info_help[27] ; |
212 |
< |
args_info->p2_help = gengetopt_args_info_help[28] ; |
213 |
< |
args_info->rp2_help = gengetopt_args_info_help[29] ; |
214 |
< |
args_info->scd_help = gengetopt_args_info_help[30] ; |
215 |
< |
args_info->density_help = gengetopt_args_info_help[31] ; |
216 |
< |
args_info->slab_density_help = gengetopt_args_info_help[32] ; |
217 |
< |
args_info->hxy_help = gengetopt_args_info_help[33] ; |
218 |
< |
args_info->rho_r_help = gengetopt_args_info_help[34] ; |
219 |
< |
args_info->hullvol_help = gengetopt_args_info_help[35] ; |
200 |
> |
args_info->comsele_help = gengetopt_args_info_help[16] ; |
201 |
> |
args_info->molname_help = gengetopt_args_info_help[17] ; |
202 |
> |
args_info->begin_help = gengetopt_args_info_help[18] ; |
203 |
> |
args_info->end_help = gengetopt_args_info_help[19] ; |
204 |
> |
args_info->radius_help = gengetopt_args_info_help[20] ; |
205 |
> |
args_info->bo_help = gengetopt_args_info_help[22] ; |
206 |
> |
args_info->bor_help = gengetopt_args_info_help[23] ; |
207 |
> |
args_info->bad_help = gengetopt_args_info_help[24] ; |
208 |
> |
args_info->gofr_help = gengetopt_args_info_help[25] ; |
209 |
> |
args_info->gofz_help = gengetopt_args_info_help[26] ; |
210 |
> |
args_info->r_theta_help = gengetopt_args_info_help[27] ; |
211 |
> |
args_info->r_omega_help = gengetopt_args_info_help[28] ; |
212 |
> |
args_info->theta_omega_help = gengetopt_args_info_help[29] ; |
213 |
> |
args_info->gxyz_help = gengetopt_args_info_help[30] ; |
214 |
> |
args_info->p2_help = gengetopt_args_info_help[31] ; |
215 |
> |
args_info->rp2_help = gengetopt_args_info_help[32] ; |
216 |
> |
args_info->scd_help = gengetopt_args_info_help[33] ; |
217 |
> |
args_info->density_help = gengetopt_args_info_help[34] ; |
218 |
> |
args_info->slab_density_help = gengetopt_args_info_help[35] ; |
219 |
> |
args_info->p_angle_help = gengetopt_args_info_help[36] ; |
220 |
> |
args_info->hxy_help = gengetopt_args_info_help[37] ; |
221 |
> |
args_info->rho_r_help = gengetopt_args_info_help[38] ; |
222 |
> |
args_info->hullvol_help = gengetopt_args_info_help[39] ; |
223 |
|
|
224 |
|
} |
225 |
|
|
229 |
|
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
230 |
|
} |
231 |
|
|
232 |
< |
void |
213 |
< |
cmdline_parser_print_help (void) |
214 |
< |
{ |
215 |
< |
int i = 0; |
232 |
> |
static void print_help_common(void) { |
233 |
|
cmdline_parser_print_version (); |
234 |
|
|
235 |
|
if (strlen(gengetopt_args_info_purpose) > 0) |
236 |
|
printf("\n%s\n", gengetopt_args_info_purpose); |
237 |
|
|
238 |
< |
printf("\n%s\n\n", gengetopt_args_info_usage); |
238 |
> |
if (strlen(gengetopt_args_info_usage) > 0) |
239 |
> |
printf("\n%s\n", gengetopt_args_info_usage); |
240 |
|
|
241 |
+ |
printf("\n"); |
242 |
+ |
|
243 |
|
if (strlen(gengetopt_args_info_description) > 0) |
244 |
|
printf("%s\n", gengetopt_args_info_description); |
245 |
+ |
} |
246 |
|
|
247 |
+ |
void |
248 |
+ |
cmdline_parser_print_help (void) |
249 |
+ |
{ |
250 |
+ |
int i = 0; |
251 |
+ |
print_help_common(); |
252 |
|
while (gengetopt_args_info_help[i]) |
253 |
|
printf("%s\n", gengetopt_args_info_help[i++]); |
254 |
|
} |
264 |
|
args_info->inputs_num = 0; |
265 |
|
} |
266 |
|
|
267 |
< |
static void |
268 |
< |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
267 |
> |
void |
268 |
> |
cmdline_parser_params_init(struct cmdline_parser_params *params) |
269 |
|
{ |
270 |
< |
|
271 |
< |
unsigned int i; |
272 |
< |
if (args_info->input_arg) |
273 |
< |
{ |
274 |
< |
free (args_info->input_arg); /* free previous argument */ |
275 |
< |
args_info->input_arg = 0; |
270 |
> |
if (params) |
271 |
> |
{ |
272 |
> |
params->override = 0; |
273 |
> |
params->initialize = 1; |
274 |
> |
params->check_required = 1; |
275 |
> |
params->check_ambiguity = 0; |
276 |
> |
params->print_errors = 1; |
277 |
|
} |
278 |
< |
if (args_info->input_orig) |
278 |
> |
} |
279 |
> |
|
280 |
> |
struct cmdline_parser_params * |
281 |
> |
cmdline_parser_params_create(void) |
282 |
> |
{ |
283 |
> |
struct cmdline_parser_params *params = |
284 |
> |
(struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); |
285 |
> |
cmdline_parser_params_init(params); |
286 |
> |
return params; |
287 |
> |
} |
288 |
> |
|
289 |
> |
static void |
290 |
> |
free_string_field (char **s) |
291 |
> |
{ |
292 |
> |
if (*s) |
293 |
|
{ |
294 |
< |
free (args_info->input_orig); /* free previous argument */ |
295 |
< |
args_info->input_orig = 0; |
294 |
> |
free (*s); |
295 |
> |
*s = 0; |
296 |
|
} |
297 |
< |
if (args_info->output_arg) |
298 |
< |
{ |
299 |
< |
free (args_info->output_arg); /* free previous argument */ |
300 |
< |
args_info->output_arg = 0; |
301 |
< |
} |
302 |
< |
if (args_info->output_orig) |
303 |
< |
{ |
304 |
< |
free (args_info->output_orig); /* free previous argument */ |
305 |
< |
args_info->output_orig = 0; |
306 |
< |
} |
307 |
< |
if (args_info->step_orig) |
308 |
< |
{ |
309 |
< |
free (args_info->step_orig); /* free previous argument */ |
310 |
< |
args_info->step_orig = 0; |
311 |
< |
} |
312 |
< |
if (args_info->nbins_orig) |
313 |
< |
{ |
314 |
< |
free (args_info->nbins_orig); /* free previous argument */ |
315 |
< |
args_info->nbins_orig = 0; |
316 |
< |
} |
317 |
< |
if (args_info->nbins_x_orig) |
318 |
< |
{ |
319 |
< |
free (args_info->nbins_x_orig); /* free previous argument */ |
320 |
< |
args_info->nbins_x_orig = 0; |
321 |
< |
} |
322 |
< |
if (args_info->nbins_y_orig) |
323 |
< |
{ |
324 |
< |
free (args_info->nbins_y_orig); /* free previous argument */ |
325 |
< |
args_info->nbins_y_orig = 0; |
326 |
< |
} |
327 |
< |
if (args_info->nanglebins_orig) |
328 |
< |
{ |
329 |
< |
free (args_info->nanglebins_orig); /* free previous argument */ |
330 |
< |
args_info->nanglebins_orig = 0; |
290 |
< |
} |
291 |
< |
if (args_info->length_orig) |
292 |
< |
{ |
293 |
< |
free (args_info->length_orig); /* free previous argument */ |
294 |
< |
args_info->length_orig = 0; |
295 |
< |
} |
296 |
< |
if (args_info->rcut_orig) |
297 |
< |
{ |
298 |
< |
free (args_info->rcut_orig); /* free previous argument */ |
299 |
< |
args_info->rcut_orig = 0; |
300 |
< |
} |
301 |
< |
if (args_info->zoffset_orig) |
302 |
< |
{ |
303 |
< |
free (args_info->zoffset_orig); /* free previous argument */ |
304 |
< |
args_info->zoffset_orig = 0; |
305 |
< |
} |
306 |
< |
if (args_info->sele1_arg) |
307 |
< |
{ |
308 |
< |
free (args_info->sele1_arg); /* free previous argument */ |
309 |
< |
args_info->sele1_arg = 0; |
310 |
< |
} |
311 |
< |
if (args_info->sele1_orig) |
312 |
< |
{ |
313 |
< |
free (args_info->sele1_orig); /* free previous argument */ |
314 |
< |
args_info->sele1_orig = 0; |
315 |
< |
} |
316 |
< |
if (args_info->sele2_arg) |
317 |
< |
{ |
318 |
< |
free (args_info->sele2_arg); /* free previous argument */ |
319 |
< |
args_info->sele2_arg = 0; |
320 |
< |
} |
321 |
< |
if (args_info->sele2_orig) |
322 |
< |
{ |
323 |
< |
free (args_info->sele2_orig); /* free previous argument */ |
324 |
< |
args_info->sele2_orig = 0; |
325 |
< |
} |
326 |
< |
if (args_info->sele3_arg) |
327 |
< |
{ |
328 |
< |
free (args_info->sele3_arg); /* free previous argument */ |
329 |
< |
args_info->sele3_arg = 0; |
330 |
< |
} |
331 |
< |
if (args_info->sele3_orig) |
332 |
< |
{ |
333 |
< |
free (args_info->sele3_orig); /* free previous argument */ |
334 |
< |
args_info->sele3_orig = 0; |
335 |
< |
} |
336 |
< |
if (args_info->refsele_arg) |
337 |
< |
{ |
338 |
< |
free (args_info->refsele_arg); /* free previous argument */ |
339 |
< |
args_info->refsele_arg = 0; |
340 |
< |
} |
341 |
< |
if (args_info->refsele_orig) |
342 |
< |
{ |
343 |
< |
free (args_info->refsele_orig); /* free previous argument */ |
344 |
< |
args_info->refsele_orig = 0; |
345 |
< |
} |
346 |
< |
if (args_info->molname_arg) |
347 |
< |
{ |
348 |
< |
free (args_info->molname_arg); /* free previous argument */ |
349 |
< |
args_info->molname_arg = 0; |
350 |
< |
} |
351 |
< |
if (args_info->molname_orig) |
352 |
< |
{ |
353 |
< |
free (args_info->molname_orig); /* free previous argument */ |
354 |
< |
args_info->molname_orig = 0; |
355 |
< |
} |
356 |
< |
if (args_info->begin_orig) |
357 |
< |
{ |
358 |
< |
free (args_info->begin_orig); /* free previous argument */ |
359 |
< |
args_info->begin_orig = 0; |
360 |
< |
} |
361 |
< |
if (args_info->end_orig) |
362 |
< |
{ |
363 |
< |
free (args_info->end_orig); /* free previous argument */ |
364 |
< |
args_info->end_orig = 0; |
365 |
< |
} |
366 |
< |
if (args_info->radius_orig) |
367 |
< |
{ |
368 |
< |
free (args_info->radius_orig); /* free previous argument */ |
369 |
< |
args_info->radius_orig = 0; |
370 |
< |
} |
297 |
> |
} |
298 |
> |
|
299 |
> |
|
300 |
> |
static void |
301 |
> |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
302 |
> |
{ |
303 |
> |
unsigned int i; |
304 |
> |
free_string_field (&(args_info->input_arg)); |
305 |
> |
free_string_field (&(args_info->input_orig)); |
306 |
> |
free_string_field (&(args_info->output_arg)); |
307 |
> |
free_string_field (&(args_info->output_orig)); |
308 |
> |
free_string_field (&(args_info->step_orig)); |
309 |
> |
free_string_field (&(args_info->nbins_orig)); |
310 |
> |
free_string_field (&(args_info->nbins_x_orig)); |
311 |
> |
free_string_field (&(args_info->nbins_y_orig)); |
312 |
> |
free_string_field (&(args_info->nanglebins_orig)); |
313 |
> |
free_string_field (&(args_info->length_orig)); |
314 |
> |
free_string_field (&(args_info->rcut_orig)); |
315 |
> |
free_string_field (&(args_info->zoffset_orig)); |
316 |
> |
free_string_field (&(args_info->sele1_arg)); |
317 |
> |
free_string_field (&(args_info->sele1_orig)); |
318 |
> |
free_string_field (&(args_info->sele2_arg)); |
319 |
> |
free_string_field (&(args_info->sele2_orig)); |
320 |
> |
free_string_field (&(args_info->sele3_arg)); |
321 |
> |
free_string_field (&(args_info->sele3_orig)); |
322 |
> |
free_string_field (&(args_info->refsele_arg)); |
323 |
> |
free_string_field (&(args_info->refsele_orig)); |
324 |
> |
free_string_field (&(args_info->comsele_arg)); |
325 |
> |
free_string_field (&(args_info->comsele_orig)); |
326 |
> |
free_string_field (&(args_info->molname_arg)); |
327 |
> |
free_string_field (&(args_info->molname_orig)); |
328 |
> |
free_string_field (&(args_info->begin_orig)); |
329 |
> |
free_string_field (&(args_info->end_orig)); |
330 |
> |
free_string_field (&(args_info->radius_orig)); |
331 |
|
|
332 |
+ |
|
333 |
|
for (i = 0; i < args_info->inputs_num; ++i) |
334 |
|
free (args_info->inputs [i]); |
335 |
< |
|
335 |
> |
|
336 |
|
if (args_info->inputs_num) |
337 |
|
free (args_info->inputs); |
338 |
< |
|
338 |
> |
|
339 |
|
clear_given (args_info); |
340 |
|
} |
341 |
|
|
342 |
+ |
|
343 |
+ |
static void |
344 |
+ |
write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[]) |
345 |
+ |
{ |
346 |
+ |
if (arg) { |
347 |
+ |
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
348 |
+ |
} else { |
349 |
+ |
fprintf(outfile, "%s\n", opt); |
350 |
+ |
} |
351 |
+ |
} |
352 |
+ |
|
353 |
+ |
|
354 |
|
int |
355 |
+ |
cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) |
356 |
+ |
{ |
357 |
+ |
int i = 0; |
358 |
+ |
|
359 |
+ |
if (!outfile) |
360 |
+ |
{ |
361 |
+ |
fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); |
362 |
+ |
return EXIT_FAILURE; |
363 |
+ |
} |
364 |
+ |
|
365 |
+ |
if (args_info->help_given) |
366 |
+ |
write_into_file(outfile, "help", 0, 0 ); |
367 |
+ |
if (args_info->version_given) |
368 |
+ |
write_into_file(outfile, "version", 0, 0 ); |
369 |
+ |
if (args_info->input_given) |
370 |
+ |
write_into_file(outfile, "input", args_info->input_orig, 0); |
371 |
+ |
if (args_info->output_given) |
372 |
+ |
write_into_file(outfile, "output", args_info->output_orig, 0); |
373 |
+ |
if (args_info->step_given) |
374 |
+ |
write_into_file(outfile, "step", args_info->step_orig, 0); |
375 |
+ |
if (args_info->nbins_given) |
376 |
+ |
write_into_file(outfile, "nbins", args_info->nbins_orig, 0); |
377 |
+ |
if (args_info->nbins_x_given) |
378 |
+ |
write_into_file(outfile, "nbins_x", args_info->nbins_x_orig, 0); |
379 |
+ |
if (args_info->nbins_y_given) |
380 |
+ |
write_into_file(outfile, "nbins_y", args_info->nbins_y_orig, 0); |
381 |
+ |
if (args_info->nanglebins_given) |
382 |
+ |
write_into_file(outfile, "nanglebins", args_info->nanglebins_orig, 0); |
383 |
+ |
if (args_info->length_given) |
384 |
+ |
write_into_file(outfile, "length", args_info->length_orig, 0); |
385 |
+ |
if (args_info->rcut_given) |
386 |
+ |
write_into_file(outfile, "rcut", args_info->rcut_orig, 0); |
387 |
+ |
if (args_info->zoffset_given) |
388 |
+ |
write_into_file(outfile, "zoffset", args_info->zoffset_orig, 0); |
389 |
+ |
if (args_info->sele1_given) |
390 |
+ |
write_into_file(outfile, "sele1", args_info->sele1_orig, 0); |
391 |
+ |
if (args_info->sele2_given) |
392 |
+ |
write_into_file(outfile, "sele2", args_info->sele2_orig, 0); |
393 |
+ |
if (args_info->sele3_given) |
394 |
+ |
write_into_file(outfile, "sele3", args_info->sele3_orig, 0); |
395 |
+ |
if (args_info->refsele_given) |
396 |
+ |
write_into_file(outfile, "refsele", args_info->refsele_orig, 0); |
397 |
+ |
if (args_info->comsele_given) |
398 |
+ |
write_into_file(outfile, "comsele", args_info->comsele_orig, 0); |
399 |
+ |
if (args_info->molname_given) |
400 |
+ |
write_into_file(outfile, "molname", args_info->molname_orig, 0); |
401 |
+ |
if (args_info->begin_given) |
402 |
+ |
write_into_file(outfile, "begin", args_info->begin_orig, 0); |
403 |
+ |
if (args_info->end_given) |
404 |
+ |
write_into_file(outfile, "end", args_info->end_orig, 0); |
405 |
+ |
if (args_info->radius_given) |
406 |
+ |
write_into_file(outfile, "radius", args_info->radius_orig, 0); |
407 |
+ |
if (args_info->bo_given) |
408 |
+ |
write_into_file(outfile, "bo", 0, 0 ); |
409 |
+ |
if (args_info->bor_given) |
410 |
+ |
write_into_file(outfile, "bor", 0, 0 ); |
411 |
+ |
if (args_info->bad_given) |
412 |
+ |
write_into_file(outfile, "bad", 0, 0 ); |
413 |
+ |
if (args_info->gofr_given) |
414 |
+ |
write_into_file(outfile, "gofr", 0, 0 ); |
415 |
+ |
if (args_info->gofz_given) |
416 |
+ |
write_into_file(outfile, "gofz", 0, 0 ); |
417 |
+ |
if (args_info->r_theta_given) |
418 |
+ |
write_into_file(outfile, "r_theta", 0, 0 ); |
419 |
+ |
if (args_info->r_omega_given) |
420 |
+ |
write_into_file(outfile, "r_omega", 0, 0 ); |
421 |
+ |
if (args_info->theta_omega_given) |
422 |
+ |
write_into_file(outfile, "theta_omega", 0, 0 ); |
423 |
+ |
if (args_info->gxyz_given) |
424 |
+ |
write_into_file(outfile, "gxyz", 0, 0 ); |
425 |
+ |
if (args_info->p2_given) |
426 |
+ |
write_into_file(outfile, "p2", 0, 0 ); |
427 |
+ |
if (args_info->rp2_given) |
428 |
+ |
write_into_file(outfile, "rp2", 0, 0 ); |
429 |
+ |
if (args_info->scd_given) |
430 |
+ |
write_into_file(outfile, "scd", 0, 0 ); |
431 |
+ |
if (args_info->density_given) |
432 |
+ |
write_into_file(outfile, "density", 0, 0 ); |
433 |
+ |
if (args_info->slab_density_given) |
434 |
+ |
write_into_file(outfile, "slab_density", 0, 0 ); |
435 |
+ |
if (args_info->p_angle_given) |
436 |
+ |
write_into_file(outfile, "p_angle", 0, 0 ); |
437 |
+ |
if (args_info->hxy_given) |
438 |
+ |
write_into_file(outfile, "hxy", 0, 0 ); |
439 |
+ |
if (args_info->rho_r_given) |
440 |
+ |
write_into_file(outfile, "rho_r", 0, 0 ); |
441 |
+ |
if (args_info->hullvol_given) |
442 |
+ |
write_into_file(outfile, "hullvol", 0, 0 ); |
443 |
+ |
|
444 |
+ |
|
445 |
+ |
i = EXIT_SUCCESS; |
446 |
+ |
return i; |
447 |
+ |
} |
448 |
+ |
|
449 |
+ |
int |
450 |
|
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) |
451 |
|
{ |
452 |
|
FILE *outfile; |
460 |
|
return EXIT_FAILURE; |
461 |
|
} |
462 |
|
|
463 |
< |
if (args_info->help_given) { |
396 |
< |
fprintf(outfile, "%s\n", "help"); |
397 |
< |
} |
398 |
< |
if (args_info->version_given) { |
399 |
< |
fprintf(outfile, "%s\n", "version"); |
400 |
< |
} |
401 |
< |
if (args_info->input_given) { |
402 |
< |
if (args_info->input_orig) { |
403 |
< |
fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig); |
404 |
< |
} else { |
405 |
< |
fprintf(outfile, "%s\n", "input"); |
406 |
< |
} |
407 |
< |
} |
408 |
< |
if (args_info->output_given) { |
409 |
< |
if (args_info->output_orig) { |
410 |
< |
fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig); |
411 |
< |
} else { |
412 |
< |
fprintf(outfile, "%s\n", "output"); |
413 |
< |
} |
414 |
< |
} |
415 |
< |
if (args_info->step_given) { |
416 |
< |
if (args_info->step_orig) { |
417 |
< |
fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig); |
418 |
< |
} else { |
419 |
< |
fprintf(outfile, "%s\n", "step"); |
420 |
< |
} |
421 |
< |
} |
422 |
< |
if (args_info->nbins_given) { |
423 |
< |
if (args_info->nbins_orig) { |
424 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); |
425 |
< |
} else { |
426 |
< |
fprintf(outfile, "%s\n", "nbins"); |
427 |
< |
} |
428 |
< |
} |
429 |
< |
if (args_info->nbins_x_given) { |
430 |
< |
if (args_info->nbins_x_orig) { |
431 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); |
432 |
< |
} else { |
433 |
< |
fprintf(outfile, "%s\n", "nbins_x"); |
434 |
< |
} |
435 |
< |
} |
436 |
< |
if (args_info->nbins_y_given) { |
437 |
< |
if (args_info->nbins_y_orig) { |
438 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); |
439 |
< |
} else { |
440 |
< |
fprintf(outfile, "%s\n", "nbins_y"); |
441 |
< |
} |
442 |
< |
} |
443 |
< |
if (args_info->nanglebins_given) { |
444 |
< |
if (args_info->nanglebins_orig) { |
445 |
< |
fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); |
446 |
< |
} else { |
447 |
< |
fprintf(outfile, "%s\n", "nanglebins"); |
448 |
< |
} |
449 |
< |
} |
450 |
< |
if (args_info->length_given) { |
451 |
< |
if (args_info->length_orig) { |
452 |
< |
fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); |
453 |
< |
} else { |
454 |
< |
fprintf(outfile, "%s\n", "length"); |
455 |
< |
} |
456 |
< |
} |
457 |
< |
if (args_info->rcut_given) { |
458 |
< |
if (args_info->rcut_orig) { |
459 |
< |
fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); |
460 |
< |
} else { |
461 |
< |
fprintf(outfile, "%s\n", "rcut"); |
462 |
< |
} |
463 |
< |
} |
464 |
< |
if (args_info->zoffset_given) { |
465 |
< |
if (args_info->zoffset_orig) { |
466 |
< |
fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); |
467 |
< |
} else { |
468 |
< |
fprintf(outfile, "%s\n", "zoffset"); |
469 |
< |
} |
470 |
< |
} |
471 |
< |
if (args_info->sele1_given) { |
472 |
< |
if (args_info->sele1_orig) { |
473 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig); |
474 |
< |
} else { |
475 |
< |
fprintf(outfile, "%s\n", "sele1"); |
476 |
< |
} |
477 |
< |
} |
478 |
< |
if (args_info->sele2_given) { |
479 |
< |
if (args_info->sele2_orig) { |
480 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig); |
481 |
< |
} else { |
482 |
< |
fprintf(outfile, "%s\n", "sele2"); |
483 |
< |
} |
484 |
< |
} |
485 |
< |
if (args_info->sele3_given) { |
486 |
< |
if (args_info->sele3_orig) { |
487 |
< |
fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig); |
488 |
< |
} else { |
489 |
< |
fprintf(outfile, "%s\n", "sele3"); |
490 |
< |
} |
491 |
< |
} |
492 |
< |
if (args_info->refsele_given) { |
493 |
< |
if (args_info->refsele_orig) { |
494 |
< |
fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig); |
495 |
< |
} else { |
496 |
< |
fprintf(outfile, "%s\n", "refsele"); |
497 |
< |
} |
498 |
< |
} |
499 |
< |
if (args_info->molname_given) { |
500 |
< |
if (args_info->molname_orig) { |
501 |
< |
fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig); |
502 |
< |
} else { |
503 |
< |
fprintf(outfile, "%s\n", "molname"); |
504 |
< |
} |
505 |
< |
} |
506 |
< |
if (args_info->begin_given) { |
507 |
< |
if (args_info->begin_orig) { |
508 |
< |
fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig); |
509 |
< |
} else { |
510 |
< |
fprintf(outfile, "%s\n", "begin"); |
511 |
< |
} |
512 |
< |
} |
513 |
< |
if (args_info->end_given) { |
514 |
< |
if (args_info->end_orig) { |
515 |
< |
fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig); |
516 |
< |
} else { |
517 |
< |
fprintf(outfile, "%s\n", "end"); |
518 |
< |
} |
519 |
< |
} |
520 |
< |
if (args_info->radius_given) { |
521 |
< |
if (args_info->radius_orig) { |
522 |
< |
fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); |
523 |
< |
} else { |
524 |
< |
fprintf(outfile, "%s\n", "radius"); |
525 |
< |
} |
526 |
< |
} |
527 |
< |
if (args_info->bo_given) { |
528 |
< |
fprintf(outfile, "%s\n", "bo"); |
529 |
< |
} |
530 |
< |
if (args_info->bor_given) { |
531 |
< |
fprintf(outfile, "%s\n", "bor"); |
532 |
< |
} |
533 |
< |
if (args_info->bad_given) { |
534 |
< |
fprintf(outfile, "%s\n", "bad"); |
535 |
< |
} |
536 |
< |
if (args_info->gofr_given) { |
537 |
< |
fprintf(outfile, "%s\n", "gofr"); |
538 |
< |
} |
539 |
< |
if (args_info->r_theta_given) { |
540 |
< |
fprintf(outfile, "%s\n", "r_theta"); |
541 |
< |
} |
542 |
< |
if (args_info->r_omega_given) { |
543 |
< |
fprintf(outfile, "%s\n", "r_omega"); |
544 |
< |
} |
545 |
< |
if (args_info->theta_omega_given) { |
546 |
< |
fprintf(outfile, "%s\n", "theta_omega"); |
547 |
< |
} |
548 |
< |
if (args_info->gxyz_given) { |
549 |
< |
fprintf(outfile, "%s\n", "gxyz"); |
550 |
< |
} |
551 |
< |
if (args_info->p2_given) { |
552 |
< |
fprintf(outfile, "%s\n", "p2"); |
553 |
< |
} |
554 |
< |
if (args_info->rp2_given) { |
555 |
< |
fprintf(outfile, "%s\n", "rp2"); |
556 |
< |
} |
557 |
< |
if (args_info->scd_given) { |
558 |
< |
fprintf(outfile, "%s\n", "scd"); |
559 |
< |
} |
560 |
< |
if (args_info->density_given) { |
561 |
< |
fprintf(outfile, "%s\n", "density"); |
562 |
< |
} |
563 |
< |
if (args_info->slab_density_given) { |
564 |
< |
fprintf(outfile, "%s\n", "slab_density"); |
565 |
< |
} |
566 |
< |
if (args_info->hxy_given) { |
567 |
< |
fprintf(outfile, "%s\n", "hxy"); |
568 |
< |
} |
569 |
< |
if (args_info->rho_r_given) { |
570 |
< |
fprintf(outfile, "%s\n", "rho_r"); |
571 |
< |
} |
572 |
< |
if (args_info->hullvol_given) { |
573 |
< |
fprintf(outfile, "%s\n", "hullvol"); |
574 |
< |
} |
575 |
< |
|
463 |
> |
i = cmdline_parser_dump(outfile, args_info); |
464 |
|
fclose (outfile); |
465 |
|
|
578 |
– |
i = EXIT_SUCCESS; |
466 |
|
return i; |
467 |
|
} |
468 |
|
|
472 |
|
cmdline_parser_release (args_info); |
473 |
|
} |
474 |
|
|
475 |
< |
|
589 |
< |
/* gengetopt_strdup() */ |
590 |
< |
/* strdup.c replacement of strdup, which is not standard */ |
475 |
> |
/** @brief replacement of strdup, which is not standard */ |
476 |
|
char * |
477 |
|
gengetopt_strdup (const char *s) |
478 |
|
{ |
488 |
|
} |
489 |
|
|
490 |
|
static void |
606 |
– |
reset_group_staticProps(struct gengetopt_args_info *args_info); |
607 |
– |
|
608 |
– |
static void |
491 |
|
reset_group_staticProps(struct gengetopt_args_info *args_info) |
492 |
|
{ |
493 |
|
if (! args_info->staticProps_group_counter) |
497 |
|
args_info->bor_given = 0 ; |
498 |
|
args_info->bad_given = 0 ; |
499 |
|
args_info->gofr_given = 0 ; |
500 |
+ |
args_info->gofz_given = 0 ; |
501 |
|
args_info->r_theta_given = 0 ; |
502 |
|
args_info->r_omega_given = 0 ; |
503 |
|
args_info->theta_omega_given = 0 ; |
507 |
|
args_info->scd_given = 0 ; |
508 |
|
args_info->density_given = 0 ; |
509 |
|
args_info->slab_density_given = 0 ; |
510 |
+ |
args_info->p_angle_given = 0 ; |
511 |
|
args_info->hxy_given = 0 ; |
512 |
|
args_info->rho_r_given = 0 ; |
513 |
|
args_info->hullvol_given = 0 ; |
522 |
|
} |
523 |
|
|
524 |
|
int |
525 |
+ |
cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
526 |
+ |
struct cmdline_parser_params *params) |
527 |
+ |
{ |
528 |
+ |
int result; |
529 |
+ |
result = cmdline_parser_internal (argc, argv, args_info, params, NULL); |
530 |
+ |
|
531 |
+ |
if (result == EXIT_FAILURE) |
532 |
+ |
{ |
533 |
+ |
cmdline_parser_free (args_info); |
534 |
+ |
exit (EXIT_FAILURE); |
535 |
+ |
} |
536 |
+ |
|
537 |
+ |
return result; |
538 |
+ |
} |
539 |
+ |
|
540 |
+ |
int |
541 |
|
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
542 |
|
{ |
543 |
|
int result; |
544 |
+ |
struct cmdline_parser_params params; |
545 |
+ |
|
546 |
+ |
params.override = override; |
547 |
+ |
params.initialize = initialize; |
548 |
+ |
params.check_required = check_required; |
549 |
+ |
params.check_ambiguity = 0; |
550 |
+ |
params.print_errors = 1; |
551 |
|
|
552 |
< |
result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL); |
552 |
> |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, NULL); |
553 |
|
|
554 |
|
if (result == EXIT_FAILURE) |
555 |
|
{ |
601 |
|
return error; |
602 |
|
} |
603 |
|
|
604 |
+ |
|
605 |
+ |
static char *package_name = 0; |
606 |
+ |
|
607 |
+ |
/** |
608 |
+ |
* @brief updates an option |
609 |
+ |
* @param field the generic pointer to the field to update |
610 |
+ |
* @param orig_field the pointer to the orig field |
611 |
+ |
* @param field_given the pointer to the number of occurrence of this option |
612 |
+ |
* @param prev_given the pointer to the number of occurrence already seen |
613 |
+ |
* @param value the argument for this option (if null no arg was specified) |
614 |
+ |
* @param possible_values the possible values for this option (if specified) |
615 |
+ |
* @param default_value the default value (in case the option only accepts fixed values) |
616 |
+ |
* @param arg_type the type of this option |
617 |
+ |
* @param check_ambiguity @see cmdline_parser_params.check_ambiguity |
618 |
+ |
* @param override @see cmdline_parser_params.override |
619 |
+ |
* @param no_free whether to free a possible previous value |
620 |
+ |
* @param multiple_option whether this is a multiple option |
621 |
+ |
* @param long_opt the corresponding long option |
622 |
+ |
* @param short_opt the corresponding short option (or '-' if none) |
623 |
+ |
* @param additional_error possible further error specification |
624 |
+ |
*/ |
625 |
+ |
static |
626 |
+ |
int update_arg(void *field, char **orig_field, |
627 |
+ |
unsigned int *field_given, unsigned int *prev_given, |
628 |
+ |
char *value, char *possible_values[], const char *default_value, |
629 |
+ |
cmdline_parser_arg_type arg_type, |
630 |
+ |
int check_ambiguity, int override, |
631 |
+ |
int no_free, int multiple_option, |
632 |
+ |
const char *long_opt, char short_opt, |
633 |
+ |
const char *additional_error) |
634 |
+ |
{ |
635 |
+ |
char *stop_char = 0; |
636 |
+ |
const char *val = value; |
637 |
+ |
int found; |
638 |
+ |
char **string_field; |
639 |
+ |
|
640 |
+ |
stop_char = 0; |
641 |
+ |
found = 0; |
642 |
+ |
|
643 |
+ |
if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) |
644 |
+ |
{ |
645 |
+ |
if (short_opt != '-') |
646 |
+ |
fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", |
647 |
+ |
package_name, long_opt, short_opt, |
648 |
+ |
(additional_error ? additional_error : "")); |
649 |
+ |
else |
650 |
+ |
fprintf (stderr, "%s: `--%s' option given more than once%s\n", |
651 |
+ |
package_name, long_opt, |
652 |
+ |
(additional_error ? additional_error : "")); |
653 |
+ |
return 1; /* failure */ |
654 |
+ |
} |
655 |
+ |
|
656 |
+ |
|
657 |
+ |
if (field_given && *field_given && ! override) |
658 |
+ |
return 0; |
659 |
+ |
if (prev_given) |
660 |
+ |
(*prev_given)++; |
661 |
+ |
if (field_given) |
662 |
+ |
(*field_given)++; |
663 |
+ |
if (possible_values) |
664 |
+ |
val = possible_values[found]; |
665 |
+ |
|
666 |
+ |
switch(arg_type) { |
667 |
+ |
case ARG_INT: |
668 |
+ |
if (val) *((int *)field) = strtol (val, &stop_char, 0); |
669 |
+ |
break; |
670 |
+ |
case ARG_DOUBLE: |
671 |
+ |
if (val) *((double *)field) = strtod (val, &stop_char); |
672 |
+ |
break; |
673 |
+ |
case ARG_STRING: |
674 |
+ |
if (val) { |
675 |
+ |
string_field = (char **)field; |
676 |
+ |
if (!no_free && *string_field) |
677 |
+ |
free (*string_field); /* free previous string */ |
678 |
+ |
*string_field = gengetopt_strdup (val); |
679 |
+ |
} |
680 |
+ |
break; |
681 |
+ |
default: |
682 |
+ |
break; |
683 |
+ |
}; |
684 |
+ |
|
685 |
+ |
/* check numeric conversion */ |
686 |
+ |
switch(arg_type) { |
687 |
+ |
case ARG_INT: |
688 |
+ |
case ARG_DOUBLE: |
689 |
+ |
if (val && !(stop_char && *stop_char == '\0')) { |
690 |
+ |
fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); |
691 |
+ |
return 1; /* failure */ |
692 |
+ |
} |
693 |
+ |
break; |
694 |
+ |
default: |
695 |
+ |
; |
696 |
+ |
}; |
697 |
+ |
|
698 |
+ |
/* store the original value */ |
699 |
+ |
switch(arg_type) { |
700 |
+ |
case ARG_NO: |
701 |
+ |
break; |
702 |
+ |
default: |
703 |
+ |
if (value && orig_field) { |
704 |
+ |
if (no_free) { |
705 |
+ |
*orig_field = value; |
706 |
+ |
} else { |
707 |
+ |
if (*orig_field) |
708 |
+ |
free (*orig_field); /* free previous string */ |
709 |
+ |
*orig_field = gengetopt_strdup (value); |
710 |
+ |
} |
711 |
+ |
} |
712 |
+ |
}; |
713 |
+ |
|
714 |
+ |
return 0; /* OK */ |
715 |
+ |
} |
716 |
+ |
|
717 |
+ |
|
718 |
|
int |
719 |
< |
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) |
719 |
> |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
720 |
> |
struct cmdline_parser_params *params, const char *additional_error) |
721 |
|
{ |
722 |
|
int c; /* Character of the parsed option. */ |
723 |
|
|
724 |
|
int error = 0; |
725 |
|
struct gengetopt_args_info local_args_info; |
726 |
+ |
|
727 |
+ |
int override; |
728 |
+ |
int initialize; |
729 |
+ |
int check_required; |
730 |
+ |
int check_ambiguity; |
731 |
+ |
|
732 |
+ |
package_name = argv[0]; |
733 |
+ |
|
734 |
+ |
override = params->override; |
735 |
+ |
initialize = params->initialize; |
736 |
+ |
check_required = params->check_required; |
737 |
+ |
check_ambiguity = params->check_ambiguity; |
738 |
|
|
739 |
|
if (initialize) |
740 |
|
cmdline_parser_init (args_info); |
743 |
|
|
744 |
|
optarg = 0; |
745 |
|
optind = 0; |
746 |
< |
opterr = 1; |
746 |
> |
opterr = params->print_errors; |
747 |
|
optopt = '?'; |
748 |
|
|
749 |
|
while (1) |
750 |
|
{ |
751 |
|
int option_index = 0; |
718 |
– |
char *stop_char; |
752 |
|
|
753 |
|
static struct option long_options[] = { |
754 |
|
{ "help", 0, NULL, 'h' }, |
767 |
|
{ "sele2", 1, NULL, 0 }, |
768 |
|
{ "sele3", 1, NULL, 0 }, |
769 |
|
{ "refsele", 1, NULL, 0 }, |
770 |
+ |
{ "comsele", 1, NULL, 0 }, |
771 |
|
{ "molname", 1, NULL, 0 }, |
772 |
|
{ "begin", 1, NULL, 0 }, |
773 |
|
{ "end", 1, NULL, 0 }, |
776 |
|
{ "bor", 0, NULL, 0 }, |
777 |
|
{ "bad", 0, NULL, 0 }, |
778 |
|
{ "gofr", 0, NULL, 'g' }, |
779 |
+ |
{ "gofz", 0, NULL, 0 }, |
780 |
|
{ "r_theta", 0, NULL, 0 }, |
781 |
|
{ "r_omega", 0, NULL, 0 }, |
782 |
|
{ "theta_omega", 0, NULL, 0 }, |
786 |
|
{ "scd", 0, NULL, 's' }, |
787 |
|
{ "density", 0, NULL, 'd' }, |
788 |
|
{ "slab_density", 0, NULL, 0 }, |
789 |
+ |
{ "p_angle", 0, NULL, 0 }, |
790 |
|
{ "hxy", 0, NULL, 0 }, |
791 |
|
{ "rho_r", 0, NULL, 0 }, |
792 |
|
{ "hullvol", 0, NULL, 0 }, |
793 |
|
{ NULL, 0, NULL, 0 } |
794 |
|
}; |
795 |
|
|
760 |
– |
stop_char = 0; |
796 |
|
c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); |
797 |
|
|
798 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
810 |
|
exit (EXIT_SUCCESS); |
811 |
|
|
812 |
|
case 'i': /* input dump file. */ |
813 |
< |
if (local_args_info.input_given) |
814 |
< |
{ |
815 |
< |
fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
816 |
< |
goto failure; |
817 |
< |
} |
818 |
< |
if (args_info->input_given && ! override) |
819 |
< |
continue; |
820 |
< |
local_args_info.input_given = 1; |
821 |
< |
args_info->input_given = 1; |
822 |
< |
if (args_info->input_arg) |
788 |
< |
free (args_info->input_arg); /* free previous string */ |
789 |
< |
args_info->input_arg = gengetopt_strdup (optarg); |
790 |
< |
if (args_info->input_orig) |
791 |
< |
free (args_info->input_orig); /* free previous string */ |
792 |
< |
args_info->input_orig = gengetopt_strdup (optarg); |
813 |
> |
|
814 |
> |
|
815 |
> |
if (update_arg( (void *)&(args_info->input_arg), |
816 |
> |
&(args_info->input_orig), &(args_info->input_given), |
817 |
> |
&(local_args_info.input_given), optarg, 0, 0, ARG_STRING, |
818 |
> |
check_ambiguity, override, 0, 0, |
819 |
> |
"input", 'i', |
820 |
> |
additional_error)) |
821 |
> |
goto failure; |
822 |
> |
|
823 |
|
break; |
794 |
– |
|
824 |
|
case 'o': /* output file name. */ |
825 |
< |
if (local_args_info.output_given) |
826 |
< |
{ |
827 |
< |
fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
828 |
< |
goto failure; |
829 |
< |
} |
830 |
< |
if (args_info->output_given && ! override) |
831 |
< |
continue; |
832 |
< |
local_args_info.output_given = 1; |
804 |
< |
args_info->output_given = 1; |
805 |
< |
if (args_info->output_arg) |
806 |
< |
free (args_info->output_arg); /* free previous string */ |
807 |
< |
args_info->output_arg = gengetopt_strdup (optarg); |
808 |
< |
if (args_info->output_orig) |
809 |
< |
free (args_info->output_orig); /* free previous string */ |
810 |
< |
args_info->output_orig = gengetopt_strdup (optarg); |
811 |
< |
break; |
812 |
< |
|
813 |
< |
case 'n': /* process every n frame. */ |
814 |
< |
if (local_args_info.step_given) |
815 |
< |
{ |
816 |
< |
fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
817 |
< |
goto failure; |
818 |
< |
} |
819 |
< |
if (args_info->step_given && ! override) |
820 |
< |
continue; |
821 |
< |
local_args_info.step_given = 1; |
822 |
< |
args_info->step_given = 1; |
823 |
< |
args_info->step_arg = strtol (optarg, &stop_char, 0); |
824 |
< |
if (!(stop_char && *stop_char == '\0')) { |
825 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
825 |
> |
|
826 |
> |
|
827 |
> |
if (update_arg( (void *)&(args_info->output_arg), |
828 |
> |
&(args_info->output_orig), &(args_info->output_given), |
829 |
> |
&(local_args_info.output_given), optarg, 0, 0, ARG_STRING, |
830 |
> |
check_ambiguity, override, 0, 0, |
831 |
> |
"output", 'o', |
832 |
> |
additional_error)) |
833 |
|
goto failure; |
834 |
< |
} |
828 |
< |
if (args_info->step_orig) |
829 |
< |
free (args_info->step_orig); /* free previous string */ |
830 |
< |
args_info->step_orig = gengetopt_strdup (optarg); |
834 |
> |
|
835 |
|
break; |
836 |
< |
|
836 |
> |
case 'n': /* process every n frame. */ |
837 |
> |
|
838 |
> |
|
839 |
> |
if (update_arg( (void *)&(args_info->step_arg), |
840 |
> |
&(args_info->step_orig), &(args_info->step_given), |
841 |
> |
&(local_args_info.step_given), optarg, 0, "1", ARG_INT, |
842 |
> |
check_ambiguity, override, 0, 0, |
843 |
> |
"step", 'n', |
844 |
> |
additional_error)) |
845 |
> |
goto failure; |
846 |
> |
|
847 |
> |
break; |
848 |
|
case 'b': /* number of bins (general purpose). */ |
849 |
< |
if (local_args_info.nbins_given) |
850 |
< |
{ |
851 |
< |
fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
852 |
< |
goto failure; |
853 |
< |
} |
854 |
< |
if (args_info->nbins_given && ! override) |
855 |
< |
continue; |
856 |
< |
local_args_info.nbins_given = 1; |
842 |
< |
args_info->nbins_given = 1; |
843 |
< |
args_info->nbins_arg = strtol (optarg, &stop_char, 0); |
844 |
< |
if (!(stop_char && *stop_char == '\0')) { |
845 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
849 |
> |
|
850 |
> |
|
851 |
> |
if (update_arg( (void *)&(args_info->nbins_arg), |
852 |
> |
&(args_info->nbins_orig), &(args_info->nbins_given), |
853 |
> |
&(local_args_info.nbins_given), optarg, 0, "100", ARG_INT, |
854 |
> |
check_ambiguity, override, 0, 0, |
855 |
> |
"nbins", 'b', |
856 |
> |
additional_error)) |
857 |
|
goto failure; |
858 |
< |
} |
848 |
< |
if (args_info->nbins_orig) |
849 |
< |
free (args_info->nbins_orig); /* free previous string */ |
850 |
< |
args_info->nbins_orig = gengetopt_strdup (optarg); |
858 |
> |
|
859 |
|
break; |
852 |
– |
|
860 |
|
case 'x': /* number of bins in x axis. */ |
861 |
< |
if (local_args_info.nbins_x_given) |
862 |
< |
{ |
863 |
< |
fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
864 |
< |
goto failure; |
865 |
< |
} |
866 |
< |
if (args_info->nbins_x_given && ! override) |
867 |
< |
continue; |
868 |
< |
local_args_info.nbins_x_given = 1; |
862 |
< |
args_info->nbins_x_given = 1; |
863 |
< |
args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); |
864 |
< |
if (!(stop_char && *stop_char == '\0')) { |
865 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
861 |
> |
|
862 |
> |
|
863 |
> |
if (update_arg( (void *)&(args_info->nbins_x_arg), |
864 |
> |
&(args_info->nbins_x_orig), &(args_info->nbins_x_given), |
865 |
> |
&(local_args_info.nbins_x_given), optarg, 0, "100", ARG_INT, |
866 |
> |
check_ambiguity, override, 0, 0, |
867 |
> |
"nbins_x", 'x', |
868 |
> |
additional_error)) |
869 |
|
goto failure; |
870 |
< |
} |
868 |
< |
if (args_info->nbins_x_orig) |
869 |
< |
free (args_info->nbins_x_orig); /* free previous string */ |
870 |
< |
args_info->nbins_x_orig = gengetopt_strdup (optarg); |
870 |
> |
|
871 |
|
break; |
872 |
– |
|
872 |
|
case 'y': /* number of bins in y axis. */ |
873 |
< |
if (local_args_info.nbins_y_given) |
874 |
< |
{ |
875 |
< |
fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
876 |
< |
goto failure; |
877 |
< |
} |
878 |
< |
if (args_info->nbins_y_given && ! override) |
879 |
< |
continue; |
880 |
< |
local_args_info.nbins_y_given = 1; |
882 |
< |
args_info->nbins_y_given = 1; |
883 |
< |
args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); |
884 |
< |
if (!(stop_char && *stop_char == '\0')) { |
885 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
873 |
> |
|
874 |
> |
|
875 |
> |
if (update_arg( (void *)&(args_info->nbins_y_arg), |
876 |
> |
&(args_info->nbins_y_orig), &(args_info->nbins_y_given), |
877 |
> |
&(local_args_info.nbins_y_given), optarg, 0, "100", ARG_INT, |
878 |
> |
check_ambiguity, override, 0, 0, |
879 |
> |
"nbins_y", 'y', |
880 |
> |
additional_error)) |
881 |
|
goto failure; |
882 |
< |
} |
888 |
< |
if (args_info->nbins_y_orig) |
889 |
< |
free (args_info->nbins_y_orig); /* free previous string */ |
890 |
< |
args_info->nbins_y_orig = gengetopt_strdup (optarg); |
882 |
> |
|
883 |
|
break; |
892 |
– |
|
884 |
|
case 'a': /* number of bins for cos(angle). */ |
885 |
< |
if (local_args_info.nanglebins_given) |
886 |
< |
{ |
887 |
< |
fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
888 |
< |
goto failure; |
889 |
< |
} |
890 |
< |
if (args_info->nanglebins_given && ! override) |
891 |
< |
continue; |
892 |
< |
local_args_info.nanglebins_given = 1; |
902 |
< |
args_info->nanglebins_given = 1; |
903 |
< |
args_info->nanglebins_arg = strtol (optarg, &stop_char, 0); |
904 |
< |
if (!(stop_char && *stop_char == '\0')) { |
905 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
885 |
> |
|
886 |
> |
|
887 |
> |
if (update_arg( (void *)&(args_info->nanglebins_arg), |
888 |
> |
&(args_info->nanglebins_orig), &(args_info->nanglebins_given), |
889 |
> |
&(local_args_info.nanglebins_given), optarg, 0, "50", ARG_INT, |
890 |
> |
check_ambiguity, override, 0, 0, |
891 |
> |
"nanglebins", 'a', |
892 |
> |
additional_error)) |
893 |
|
goto failure; |
894 |
< |
} |
908 |
< |
if (args_info->nanglebins_orig) |
909 |
< |
free (args_info->nanglebins_orig); /* free previous string */ |
910 |
< |
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
894 |
> |
|
895 |
|
break; |
912 |
– |
|
896 |
|
case 'c': /* cutoff radius (rcut). */ |
897 |
< |
if (local_args_info.rcut_given) |
898 |
< |
{ |
899 |
< |
fprintf (stderr, "%s: `--rcut' (`-c') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
900 |
< |
goto failure; |
901 |
< |
} |
902 |
< |
if (args_info->rcut_given && ! override) |
903 |
< |
continue; |
904 |
< |
local_args_info.rcut_given = 1; |
922 |
< |
args_info->rcut_given = 1; |
923 |
< |
args_info->rcut_arg = strtod (optarg, &stop_char); |
924 |
< |
if (!(stop_char && *stop_char == '\0')) { |
925 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
897 |
> |
|
898 |
> |
|
899 |
> |
if (update_arg( (void *)&(args_info->rcut_arg), |
900 |
> |
&(args_info->rcut_orig), &(args_info->rcut_given), |
901 |
> |
&(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE, |
902 |
> |
check_ambiguity, override, 0, 0, |
903 |
> |
"rcut", 'c', |
904 |
> |
additional_error)) |
905 |
|
goto failure; |
906 |
< |
} |
928 |
< |
if (args_info->rcut_orig) |
929 |
< |
free (args_info->rcut_orig); /* free previous string */ |
930 |
< |
args_info->rcut_orig = gengetopt_strdup (optarg); |
906 |
> |
|
907 |
|
break; |
932 |
– |
|
908 |
|
case 'z': /* Where to set the zero for the slab_density calculation. */ |
909 |
< |
if (local_args_info.zoffset_given) |
910 |
< |
{ |
911 |
< |
fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
912 |
< |
goto failure; |
913 |
< |
} |
914 |
< |
if (args_info->zoffset_given && ! override) |
915 |
< |
continue; |
916 |
< |
local_args_info.zoffset_given = 1; |
942 |
< |
args_info->zoffset_given = 1; |
943 |
< |
args_info->zoffset_arg = strtod (optarg, &stop_char); |
944 |
< |
if (!(stop_char && *stop_char == '\0')) { |
945 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
909 |
> |
|
910 |
> |
|
911 |
> |
if (update_arg( (void *)&(args_info->zoffset_arg), |
912 |
> |
&(args_info->zoffset_orig), &(args_info->zoffset_given), |
913 |
> |
&(local_args_info.zoffset_given), optarg, 0, "0", ARG_DOUBLE, |
914 |
> |
check_ambiguity, override, 0, 0, |
915 |
> |
"zoffset", 'z', |
916 |
> |
additional_error)) |
917 |
|
goto failure; |
918 |
< |
} |
948 |
< |
if (args_info->zoffset_orig) |
949 |
< |
free (args_info->zoffset_orig); /* free previous string */ |
950 |
< |
args_info->zoffset_orig = gengetopt_strdup (optarg); |
918 |
> |
|
919 |
|
break; |
952 |
– |
|
920 |
|
case 'g': /* g(r). */ |
921 |
< |
if (local_args_info.gofr_given) |
955 |
< |
{ |
956 |
< |
fprintf (stderr, "%s: `--gofr' (`-g') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
957 |
< |
goto failure; |
958 |
< |
} |
959 |
< |
if (args_info->gofr_given && ! override) |
960 |
< |
continue; |
961 |
< |
local_args_info.gofr_given = 1; |
962 |
< |
args_info->gofr_given = 1; |
921 |
> |
|
922 |
|
if (args_info->staticProps_group_counter && override) |
923 |
|
reset_group_staticProps (args_info); |
924 |
|
args_info->staticProps_group_counter += 1; |
925 |
+ |
|
926 |
+ |
if (update_arg( 0 , |
927 |
+ |
0 , &(args_info->gofr_given), |
928 |
+ |
&(local_args_info.gofr_given), optarg, 0, 0, ARG_NO, |
929 |
+ |
check_ambiguity, override, 0, 0, |
930 |
+ |
"gofr", 'g', |
931 |
+ |
additional_error)) |
932 |
+ |
goto failure; |
933 |
+ |
|
934 |
|
break; |
967 |
– |
|
935 |
|
case 'p': /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
936 |
< |
if (local_args_info.p2_given) |
970 |
< |
{ |
971 |
< |
fprintf (stderr, "%s: `--p2' (`-p') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
972 |
< |
goto failure; |
973 |
< |
} |
974 |
< |
if (args_info->p2_given && ! override) |
975 |
< |
continue; |
976 |
< |
local_args_info.p2_given = 1; |
977 |
< |
args_info->p2_given = 1; |
936 |
> |
|
937 |
|
if (args_info->staticProps_group_counter && override) |
938 |
|
reset_group_staticProps (args_info); |
939 |
|
args_info->staticProps_group_counter += 1; |
940 |
+ |
|
941 |
+ |
if (update_arg( 0 , |
942 |
+ |
0 , &(args_info->p2_given), |
943 |
+ |
&(local_args_info.p2_given), optarg, 0, 0, ARG_NO, |
944 |
+ |
check_ambiguity, override, 0, 0, |
945 |
+ |
"p2", 'p', |
946 |
+ |
additional_error)) |
947 |
+ |
goto failure; |
948 |
+ |
|
949 |
|
break; |
982 |
– |
|
950 |
|
case 's': /* scd order parameter (either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
951 |
< |
if (local_args_info.scd_given) |
985 |
< |
{ |
986 |
< |
fprintf (stderr, "%s: `--scd' (`-s') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
987 |
< |
goto failure; |
988 |
< |
} |
989 |
< |
if (args_info->scd_given && ! override) |
990 |
< |
continue; |
991 |
< |
local_args_info.scd_given = 1; |
992 |
< |
args_info->scd_given = 1; |
951 |
> |
|
952 |
|
if (args_info->staticProps_group_counter && override) |
953 |
|
reset_group_staticProps (args_info); |
954 |
|
args_info->staticProps_group_counter += 1; |
955 |
+ |
|
956 |
+ |
if (update_arg( 0 , |
957 |
+ |
0 , &(args_info->scd_given), |
958 |
+ |
&(local_args_info.scd_given), optarg, 0, 0, ARG_NO, |
959 |
+ |
check_ambiguity, override, 0, 0, |
960 |
+ |
"scd", 's', |
961 |
+ |
additional_error)) |
962 |
+ |
goto failure; |
963 |
+ |
|
964 |
|
break; |
997 |
– |
|
965 |
|
case 'd': /* density plot. */ |
966 |
< |
if (local_args_info.density_given) |
1000 |
< |
{ |
1001 |
< |
fprintf (stderr, "%s: `--density' (`-d') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1002 |
< |
goto failure; |
1003 |
< |
} |
1004 |
< |
if (args_info->density_given && ! override) |
1005 |
< |
continue; |
1006 |
< |
local_args_info.density_given = 1; |
1007 |
< |
args_info->density_given = 1; |
966 |
> |
|
967 |
|
if (args_info->staticProps_group_counter && override) |
968 |
|
reset_group_staticProps (args_info); |
969 |
|
args_info->staticProps_group_counter += 1; |
970 |
+ |
|
971 |
+ |
if (update_arg( 0 , |
972 |
+ |
0 , &(args_info->density_given), |
973 |
+ |
&(local_args_info.density_given), optarg, 0, 0, ARG_NO, |
974 |
+ |
check_ambiguity, override, 0, 0, |
975 |
+ |
"density", 'd', |
976 |
+ |
additional_error)) |
977 |
+ |
goto failure; |
978 |
+ |
|
979 |
|
break; |
980 |
|
|
1013 |
– |
|
981 |
|
case 0: /* Long option with no short option */ |
982 |
|
/* maximum length (Defaults to 1/2 smallest length of first frame). */ |
983 |
|
if (strcmp (long_options[option_index].name, "length") == 0) |
984 |
|
{ |
985 |
< |
if (local_args_info.length_given) |
986 |
< |
{ |
987 |
< |
fprintf (stderr, "%s: `--length' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
988 |
< |
goto failure; |
989 |
< |
} |
990 |
< |
if (args_info->length_given && ! override) |
991 |
< |
continue; |
992 |
< |
local_args_info.length_given = 1; |
1026 |
< |
args_info->length_given = 1; |
1027 |
< |
args_info->length_arg = strtod (optarg, &stop_char); |
1028 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1029 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
985 |
> |
|
986 |
> |
|
987 |
> |
if (update_arg( (void *)&(args_info->length_arg), |
988 |
> |
&(args_info->length_orig), &(args_info->length_given), |
989 |
> |
&(local_args_info.length_given), optarg, 0, 0, ARG_DOUBLE, |
990 |
> |
check_ambiguity, override, 0, 0, |
991 |
> |
"length", '-', |
992 |
> |
additional_error)) |
993 |
|
goto failure; |
994 |
< |
} |
1032 |
< |
if (args_info->length_orig) |
1033 |
< |
free (args_info->length_orig); /* free previous string */ |
1034 |
< |
args_info->length_orig = gengetopt_strdup (optarg); |
994 |
> |
|
995 |
|
} |
996 |
|
/* select the first stuntdouble set. */ |
997 |
|
else if (strcmp (long_options[option_index].name, "sele1") == 0) |
998 |
|
{ |
999 |
< |
if (local_args_info.sele1_given) |
1000 |
< |
{ |
1001 |
< |
fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1002 |
< |
goto failure; |
1003 |
< |
} |
1004 |
< |
if (args_info->sele1_given && ! override) |
1005 |
< |
continue; |
1006 |
< |
local_args_info.sele1_given = 1; |
1007 |
< |
args_info->sele1_given = 1; |
1008 |
< |
if (args_info->sele1_arg) |
1049 |
< |
free (args_info->sele1_arg); /* free previous string */ |
1050 |
< |
args_info->sele1_arg = gengetopt_strdup (optarg); |
1051 |
< |
if (args_info->sele1_orig) |
1052 |
< |
free (args_info->sele1_orig); /* free previous string */ |
1053 |
< |
args_info->sele1_orig = gengetopt_strdup (optarg); |
999 |
> |
|
1000 |
> |
|
1001 |
> |
if (update_arg( (void *)&(args_info->sele1_arg), |
1002 |
> |
&(args_info->sele1_orig), &(args_info->sele1_given), |
1003 |
> |
&(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING, |
1004 |
> |
check_ambiguity, override, 0, 0, |
1005 |
> |
"sele1", '-', |
1006 |
> |
additional_error)) |
1007 |
> |
goto failure; |
1008 |
> |
|
1009 |
|
} |
1010 |
|
/* select the second stuntdouble set. */ |
1011 |
|
else if (strcmp (long_options[option_index].name, "sele2") == 0) |
1012 |
|
{ |
1013 |
< |
if (local_args_info.sele2_given) |
1014 |
< |
{ |
1015 |
< |
fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1016 |
< |
goto failure; |
1017 |
< |
} |
1018 |
< |
if (args_info->sele2_given && ! override) |
1019 |
< |
continue; |
1020 |
< |
local_args_info.sele2_given = 1; |
1021 |
< |
args_info->sele2_given = 1; |
1022 |
< |
if (args_info->sele2_arg) |
1068 |
< |
free (args_info->sele2_arg); /* free previous string */ |
1069 |
< |
args_info->sele2_arg = gengetopt_strdup (optarg); |
1070 |
< |
if (args_info->sele2_orig) |
1071 |
< |
free (args_info->sele2_orig); /* free previous string */ |
1072 |
< |
args_info->sele2_orig = gengetopt_strdup (optarg); |
1013 |
> |
|
1014 |
> |
|
1015 |
> |
if (update_arg( (void *)&(args_info->sele2_arg), |
1016 |
> |
&(args_info->sele2_orig), &(args_info->sele2_given), |
1017 |
> |
&(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING, |
1018 |
> |
check_ambiguity, override, 0, 0, |
1019 |
> |
"sele2", '-', |
1020 |
> |
additional_error)) |
1021 |
> |
goto failure; |
1022 |
> |
|
1023 |
|
} |
1024 |
|
/* select the third stuntdouble set. */ |
1025 |
|
else if (strcmp (long_options[option_index].name, "sele3") == 0) |
1026 |
|
{ |
1027 |
< |
if (local_args_info.sele3_given) |
1028 |
< |
{ |
1029 |
< |
fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1030 |
< |
goto failure; |
1031 |
< |
} |
1032 |
< |
if (args_info->sele3_given && ! override) |
1033 |
< |
continue; |
1034 |
< |
local_args_info.sele3_given = 1; |
1035 |
< |
args_info->sele3_given = 1; |
1036 |
< |
if (args_info->sele3_arg) |
1087 |
< |
free (args_info->sele3_arg); /* free previous string */ |
1088 |
< |
args_info->sele3_arg = gengetopt_strdup (optarg); |
1089 |
< |
if (args_info->sele3_orig) |
1090 |
< |
free (args_info->sele3_orig); /* free previous string */ |
1091 |
< |
args_info->sele3_orig = gengetopt_strdup (optarg); |
1027 |
> |
|
1028 |
> |
|
1029 |
> |
if (update_arg( (void *)&(args_info->sele3_arg), |
1030 |
> |
&(args_info->sele3_orig), &(args_info->sele3_given), |
1031 |
> |
&(local_args_info.sele3_given), optarg, 0, 0, ARG_STRING, |
1032 |
> |
check_ambiguity, override, 0, 0, |
1033 |
> |
"sele3", '-', |
1034 |
> |
additional_error)) |
1035 |
> |
goto failure; |
1036 |
> |
|
1037 |
|
} |
1038 |
|
/* select reference (use and only use with --gxyz). */ |
1039 |
|
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
1040 |
|
{ |
1041 |
< |
if (local_args_info.refsele_given) |
1042 |
< |
{ |
1043 |
< |
fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1044 |
< |
goto failure; |
1045 |
< |
} |
1046 |
< |
if (args_info->refsele_given && ! override) |
1047 |
< |
continue; |
1048 |
< |
local_args_info.refsele_given = 1; |
1049 |
< |
args_info->refsele_given = 1; |
1050 |
< |
if (args_info->refsele_arg) |
1051 |
< |
free (args_info->refsele_arg); /* free previous string */ |
1052 |
< |
args_info->refsele_arg = gengetopt_strdup (optarg); |
1053 |
< |
if (args_info->refsele_orig) |
1054 |
< |
free (args_info->refsele_orig); /* free previous string */ |
1055 |
< |
args_info->refsele_orig = gengetopt_strdup (optarg); |
1041 |
> |
|
1042 |
> |
|
1043 |
> |
if (update_arg( (void *)&(args_info->refsele_arg), |
1044 |
> |
&(args_info->refsele_orig), &(args_info->refsele_given), |
1045 |
> |
&(local_args_info.refsele_given), optarg, 0, 0, ARG_STRING, |
1046 |
> |
check_ambiguity, override, 0, 0, |
1047 |
> |
"refsele", '-', |
1048 |
> |
additional_error)) |
1049 |
> |
goto failure; |
1050 |
> |
|
1051 |
> |
} |
1052 |
> |
/* select stunt doubles for center-of-mass reference point. */ |
1053 |
> |
else if (strcmp (long_options[option_index].name, "comsele") == 0) |
1054 |
> |
{ |
1055 |
> |
|
1056 |
> |
|
1057 |
> |
if (update_arg( (void *)&(args_info->comsele_arg), |
1058 |
> |
&(args_info->comsele_orig), &(args_info->comsele_given), |
1059 |
> |
&(local_args_info.comsele_given), optarg, 0, 0, ARG_STRING, |
1060 |
> |
check_ambiguity, override, 0, 0, |
1061 |
> |
"comsele", '-', |
1062 |
> |
additional_error)) |
1063 |
> |
goto failure; |
1064 |
> |
|
1065 |
|
} |
1066 |
|
/* molecule name. */ |
1067 |
|
else if (strcmp (long_options[option_index].name, "molname") == 0) |
1068 |
|
{ |
1069 |
< |
if (local_args_info.molname_given) |
1070 |
< |
{ |
1071 |
< |
fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1072 |
< |
goto failure; |
1073 |
< |
} |
1074 |
< |
if (args_info->molname_given && ! override) |
1075 |
< |
continue; |
1076 |
< |
local_args_info.molname_given = 1; |
1077 |
< |
args_info->molname_given = 1; |
1078 |
< |
if (args_info->molname_arg) |
1125 |
< |
free (args_info->molname_arg); /* free previous string */ |
1126 |
< |
args_info->molname_arg = gengetopt_strdup (optarg); |
1127 |
< |
if (args_info->molname_orig) |
1128 |
< |
free (args_info->molname_orig); /* free previous string */ |
1129 |
< |
args_info->molname_orig = gengetopt_strdup (optarg); |
1069 |
> |
|
1070 |
> |
|
1071 |
> |
if (update_arg( (void *)&(args_info->molname_arg), |
1072 |
> |
&(args_info->molname_orig), &(args_info->molname_given), |
1073 |
> |
&(local_args_info.molname_given), optarg, 0, 0, ARG_STRING, |
1074 |
> |
check_ambiguity, override, 0, 0, |
1075 |
> |
"molname", '-', |
1076 |
> |
additional_error)) |
1077 |
> |
goto failure; |
1078 |
> |
|
1079 |
|
} |
1080 |
|
/* begin internal index. */ |
1081 |
|
else if (strcmp (long_options[option_index].name, "begin") == 0) |
1082 |
|
{ |
1083 |
< |
if (local_args_info.begin_given) |
1084 |
< |
{ |
1085 |
< |
fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1086 |
< |
goto failure; |
1087 |
< |
} |
1088 |
< |
if (args_info->begin_given && ! override) |
1089 |
< |
continue; |
1090 |
< |
local_args_info.begin_given = 1; |
1142 |
< |
args_info->begin_given = 1; |
1143 |
< |
args_info->begin_arg = strtol (optarg, &stop_char, 0); |
1144 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1145 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1083 |
> |
|
1084 |
> |
|
1085 |
> |
if (update_arg( (void *)&(args_info->begin_arg), |
1086 |
> |
&(args_info->begin_orig), &(args_info->begin_given), |
1087 |
> |
&(local_args_info.begin_given), optarg, 0, 0, ARG_INT, |
1088 |
> |
check_ambiguity, override, 0, 0, |
1089 |
> |
"begin", '-', |
1090 |
> |
additional_error)) |
1091 |
|
goto failure; |
1092 |
< |
} |
1148 |
< |
if (args_info->begin_orig) |
1149 |
< |
free (args_info->begin_orig); /* free previous string */ |
1150 |
< |
args_info->begin_orig = gengetopt_strdup (optarg); |
1092 |
> |
|
1093 |
|
} |
1094 |
|
/* end internal index. */ |
1095 |
|
else if (strcmp (long_options[option_index].name, "end") == 0) |
1096 |
|
{ |
1097 |
< |
if (local_args_info.end_given) |
1098 |
< |
{ |
1099 |
< |
fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1100 |
< |
goto failure; |
1101 |
< |
} |
1102 |
< |
if (args_info->end_given && ! override) |
1103 |
< |
continue; |
1104 |
< |
local_args_info.end_given = 1; |
1163 |
< |
args_info->end_given = 1; |
1164 |
< |
args_info->end_arg = strtol (optarg, &stop_char, 0); |
1165 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1166 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1097 |
> |
|
1098 |
> |
|
1099 |
> |
if (update_arg( (void *)&(args_info->end_arg), |
1100 |
> |
&(args_info->end_orig), &(args_info->end_given), |
1101 |
> |
&(local_args_info.end_given), optarg, 0, 0, ARG_INT, |
1102 |
> |
check_ambiguity, override, 0, 0, |
1103 |
> |
"end", '-', |
1104 |
> |
additional_error)) |
1105 |
|
goto failure; |
1106 |
< |
} |
1169 |
< |
if (args_info->end_orig) |
1170 |
< |
free (args_info->end_orig); /* free previous string */ |
1171 |
< |
args_info->end_orig = gengetopt_strdup (optarg); |
1106 |
> |
|
1107 |
|
} |
1108 |
|
/* nanoparticle radius. */ |
1109 |
|
else if (strcmp (long_options[option_index].name, "radius") == 0) |
1110 |
|
{ |
1111 |
< |
if (local_args_info.radius_given) |
1112 |
< |
{ |
1113 |
< |
fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1114 |
< |
goto failure; |
1115 |
< |
} |
1116 |
< |
if (args_info->radius_given && ! override) |
1117 |
< |
continue; |
1118 |
< |
local_args_info.radius_given = 1; |
1184 |
< |
args_info->radius_given = 1; |
1185 |
< |
args_info->radius_arg = strtod (optarg, &stop_char); |
1186 |
< |
if (!(stop_char && *stop_char == '\0')) { |
1187 |
< |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
1111 |
> |
|
1112 |
> |
|
1113 |
> |
if (update_arg( (void *)&(args_info->radius_arg), |
1114 |
> |
&(args_info->radius_orig), &(args_info->radius_given), |
1115 |
> |
&(local_args_info.radius_given), optarg, 0, 0, ARG_DOUBLE, |
1116 |
> |
check_ambiguity, override, 0, 0, |
1117 |
> |
"radius", '-', |
1118 |
> |
additional_error)) |
1119 |
|
goto failure; |
1120 |
< |
} |
1190 |
< |
if (args_info->radius_orig) |
1191 |
< |
free (args_info->radius_orig); /* free previous string */ |
1192 |
< |
args_info->radius_orig = gengetopt_strdup (optarg); |
1120 |
> |
|
1121 |
|
} |
1122 |
|
/* bond order parameter (--rcut must be specified). */ |
1123 |
|
else if (strcmp (long_options[option_index].name, "bo") == 0) |
1124 |
|
{ |
1125 |
< |
if (local_args_info.bo_given) |
1198 |
< |
{ |
1199 |
< |
fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1200 |
< |
goto failure; |
1201 |
< |
} |
1202 |
< |
if (args_info->bo_given && ! override) |
1203 |
< |
continue; |
1204 |
< |
local_args_info.bo_given = 1; |
1205 |
< |
args_info->bo_given = 1; |
1125 |
> |
|
1126 |
|
if (args_info->staticProps_group_counter && override) |
1127 |
|
reset_group_staticProps (args_info); |
1128 |
|
args_info->staticProps_group_counter += 1; |
1129 |
< |
break; |
1129 |
> |
|
1130 |
> |
if (update_arg( 0 , |
1131 |
> |
0 , &(args_info->bo_given), |
1132 |
> |
&(local_args_info.bo_given), optarg, 0, 0, ARG_NO, |
1133 |
> |
check_ambiguity, override, 0, 0, |
1134 |
> |
"bo", '-', |
1135 |
> |
additional_error)) |
1136 |
> |
goto failure; |
1137 |
> |
|
1138 |
|
} |
1139 |
|
/* bond order parameter as a function of radius (--rcut must be specified). */ |
1140 |
|
else if (strcmp (long_options[option_index].name, "bor") == 0) |
1141 |
|
{ |
1142 |
< |
if (local_args_info.bor_given) |
1215 |
< |
{ |
1216 |
< |
fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1217 |
< |
goto failure; |
1218 |
< |
} |
1219 |
< |
if (args_info->bor_given && ! override) |
1220 |
< |
continue; |
1221 |
< |
local_args_info.bor_given = 1; |
1222 |
< |
args_info->bor_given = 1; |
1142 |
> |
|
1143 |
|
if (args_info->staticProps_group_counter && override) |
1144 |
|
reset_group_staticProps (args_info); |
1145 |
|
args_info->staticProps_group_counter += 1; |
1146 |
< |
break; |
1146 |
> |
|
1147 |
> |
if (update_arg( 0 , |
1148 |
> |
0 , &(args_info->bor_given), |
1149 |
> |
&(local_args_info.bor_given), optarg, 0, 0, ARG_NO, |
1150 |
> |
check_ambiguity, override, 0, 0, |
1151 |
> |
"bor", '-', |
1152 |
> |
additional_error)) |
1153 |
> |
goto failure; |
1154 |
> |
|
1155 |
|
} |
1156 |
|
/* N(theta) bond angle density within (--rcut must be specified). */ |
1157 |
|
else if (strcmp (long_options[option_index].name, "bad") == 0) |
1158 |
|
{ |
1159 |
< |
if (local_args_info.bad_given) |
1232 |
< |
{ |
1233 |
< |
fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1234 |
< |
goto failure; |
1235 |
< |
} |
1236 |
< |
if (args_info->bad_given && ! override) |
1237 |
< |
continue; |
1238 |
< |
local_args_info.bad_given = 1; |
1239 |
< |
args_info->bad_given = 1; |
1159 |
> |
|
1160 |
|
if (args_info->staticProps_group_counter && override) |
1161 |
|
reset_group_staticProps (args_info); |
1162 |
|
args_info->staticProps_group_counter += 1; |
1163 |
< |
break; |
1163 |
> |
|
1164 |
> |
if (update_arg( 0 , |
1165 |
> |
0 , &(args_info->bad_given), |
1166 |
> |
&(local_args_info.bad_given), optarg, 0, 0, ARG_NO, |
1167 |
> |
check_ambiguity, override, 0, 0, |
1168 |
> |
"bad", '-', |
1169 |
> |
additional_error)) |
1170 |
> |
goto failure; |
1171 |
> |
|
1172 |
|
} |
1173 |
+ |
/* g(z). */ |
1174 |
+ |
else if (strcmp (long_options[option_index].name, "gofz") == 0) |
1175 |
+ |
{ |
1176 |
+ |
|
1177 |
+ |
if (args_info->staticProps_group_counter && override) |
1178 |
+ |
reset_group_staticProps (args_info); |
1179 |
+ |
args_info->staticProps_group_counter += 1; |
1180 |
+ |
|
1181 |
+ |
if (update_arg( 0 , |
1182 |
+ |
0 , &(args_info->gofz_given), |
1183 |
+ |
&(local_args_info.gofz_given), optarg, 0, 0, ARG_NO, |
1184 |
+ |
check_ambiguity, override, 0, 0, |
1185 |
+ |
"gofz", '-', |
1186 |
+ |
additional_error)) |
1187 |
+ |
goto failure; |
1188 |
+ |
|
1189 |
+ |
} |
1190 |
|
/* g(r, cos(theta)). */ |
1191 |
|
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |
1192 |
|
{ |
1193 |
< |
if (local_args_info.r_theta_given) |
1249 |
< |
{ |
1250 |
< |
fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1251 |
< |
goto failure; |
1252 |
< |
} |
1253 |
< |
if (args_info->r_theta_given && ! override) |
1254 |
< |
continue; |
1255 |
< |
local_args_info.r_theta_given = 1; |
1256 |
< |
args_info->r_theta_given = 1; |
1193 |
> |
|
1194 |
|
if (args_info->staticProps_group_counter && override) |
1195 |
|
reset_group_staticProps (args_info); |
1196 |
|
args_info->staticProps_group_counter += 1; |
1197 |
< |
break; |
1197 |
> |
|
1198 |
> |
if (update_arg( 0 , |
1199 |
> |
0 , &(args_info->r_theta_given), |
1200 |
> |
&(local_args_info.r_theta_given), optarg, 0, 0, ARG_NO, |
1201 |
> |
check_ambiguity, override, 0, 0, |
1202 |
> |
"r_theta", '-', |
1203 |
> |
additional_error)) |
1204 |
> |
goto failure; |
1205 |
> |
|
1206 |
|
} |
1207 |
|
/* g(r, cos(omega)). */ |
1208 |
|
else if (strcmp (long_options[option_index].name, "r_omega") == 0) |
1209 |
|
{ |
1210 |
< |
if (local_args_info.r_omega_given) |
1266 |
< |
{ |
1267 |
< |
fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1268 |
< |
goto failure; |
1269 |
< |
} |
1270 |
< |
if (args_info->r_omega_given && ! override) |
1271 |
< |
continue; |
1272 |
< |
local_args_info.r_omega_given = 1; |
1273 |
< |
args_info->r_omega_given = 1; |
1210 |
> |
|
1211 |
|
if (args_info->staticProps_group_counter && override) |
1212 |
|
reset_group_staticProps (args_info); |
1213 |
|
args_info->staticProps_group_counter += 1; |
1214 |
< |
break; |
1214 |
> |
|
1215 |
> |
if (update_arg( 0 , |
1216 |
> |
0 , &(args_info->r_omega_given), |
1217 |
> |
&(local_args_info.r_omega_given), optarg, 0, 0, ARG_NO, |
1218 |
> |
check_ambiguity, override, 0, 0, |
1219 |
> |
"r_omega", '-', |
1220 |
> |
additional_error)) |
1221 |
> |
goto failure; |
1222 |
> |
|
1223 |
|
} |
1224 |
|
/* g(cos(theta), cos(omega)). */ |
1225 |
|
else if (strcmp (long_options[option_index].name, "theta_omega") == 0) |
1226 |
|
{ |
1227 |
< |
if (local_args_info.theta_omega_given) |
1283 |
< |
{ |
1284 |
< |
fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1285 |
< |
goto failure; |
1286 |
< |
} |
1287 |
< |
if (args_info->theta_omega_given && ! override) |
1288 |
< |
continue; |
1289 |
< |
local_args_info.theta_omega_given = 1; |
1290 |
< |
args_info->theta_omega_given = 1; |
1227 |
> |
|
1228 |
|
if (args_info->staticProps_group_counter && override) |
1229 |
|
reset_group_staticProps (args_info); |
1230 |
|
args_info->staticProps_group_counter += 1; |
1231 |
< |
break; |
1231 |
> |
|
1232 |
> |
if (update_arg( 0 , |
1233 |
> |
0 , &(args_info->theta_omega_given), |
1234 |
> |
&(local_args_info.theta_omega_given), optarg, 0, 0, ARG_NO, |
1235 |
> |
check_ambiguity, override, 0, 0, |
1236 |
> |
"theta_omega", '-', |
1237 |
> |
additional_error)) |
1238 |
> |
goto failure; |
1239 |
> |
|
1240 |
|
} |
1241 |
|
/* g(x, y, z). */ |
1242 |
|
else if (strcmp (long_options[option_index].name, "gxyz") == 0) |
1243 |
|
{ |
1244 |
< |
if (local_args_info.gxyz_given) |
1300 |
< |
{ |
1301 |
< |
fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1302 |
< |
goto failure; |
1303 |
< |
} |
1304 |
< |
if (args_info->gxyz_given && ! override) |
1305 |
< |
continue; |
1306 |
< |
local_args_info.gxyz_given = 1; |
1307 |
< |
args_info->gxyz_given = 1; |
1244 |
> |
|
1245 |
|
if (args_info->staticProps_group_counter && override) |
1246 |
|
reset_group_staticProps (args_info); |
1247 |
|
args_info->staticProps_group_counter += 1; |
1248 |
< |
break; |
1248 |
> |
|
1249 |
> |
if (update_arg( 0 , |
1250 |
> |
0 , &(args_info->gxyz_given), |
1251 |
> |
&(local_args_info.gxyz_given), optarg, 0, 0, ARG_NO, |
1252 |
> |
check_ambiguity, override, 0, 0, |
1253 |
> |
"gxyz", '-', |
1254 |
> |
additional_error)) |
1255 |
> |
goto failure; |
1256 |
> |
|
1257 |
|
} |
1258 |
|
/* rp2 order parameter (--sele1 and --sele2 must be specified). */ |
1259 |
|
else if (strcmp (long_options[option_index].name, "rp2") == 0) |
1260 |
|
{ |
1261 |
< |
if (local_args_info.rp2_given) |
1317 |
< |
{ |
1318 |
< |
fprintf (stderr, "%s: `--rp2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1319 |
< |
goto failure; |
1320 |
< |
} |
1321 |
< |
if (args_info->rp2_given && ! override) |
1322 |
< |
continue; |
1323 |
< |
local_args_info.rp2_given = 1; |
1324 |
< |
args_info->rp2_given = 1; |
1261 |
> |
|
1262 |
|
if (args_info->staticProps_group_counter && override) |
1263 |
|
reset_group_staticProps (args_info); |
1264 |
|
args_info->staticProps_group_counter += 1; |
1265 |
< |
break; |
1265 |
> |
|
1266 |
> |
if (update_arg( 0 , |
1267 |
> |
0 , &(args_info->rp2_given), |
1268 |
> |
&(local_args_info.rp2_given), optarg, 0, 0, ARG_NO, |
1269 |
> |
check_ambiguity, override, 0, 0, |
1270 |
> |
"rp2", '-', |
1271 |
> |
additional_error)) |
1272 |
> |
goto failure; |
1273 |
> |
|
1274 |
|
} |
1275 |
|
/* slab density. */ |
1276 |
|
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1277 |
|
{ |
1278 |
< |
if (local_args_info.slab_density_given) |
1334 |
< |
{ |
1335 |
< |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1336 |
< |
goto failure; |
1337 |
< |
} |
1338 |
< |
if (args_info->slab_density_given && ! override) |
1339 |
< |
continue; |
1340 |
< |
local_args_info.slab_density_given = 1; |
1341 |
< |
args_info->slab_density_given = 1; |
1278 |
> |
|
1279 |
|
if (args_info->staticProps_group_counter && override) |
1280 |
|
reset_group_staticProps (args_info); |
1281 |
|
args_info->staticProps_group_counter += 1; |
1282 |
< |
break; |
1282 |
> |
|
1283 |
> |
if (update_arg( 0 , |
1284 |
> |
0 , &(args_info->slab_density_given), |
1285 |
> |
&(local_args_info.slab_density_given), optarg, 0, 0, ARG_NO, |
1286 |
> |
check_ambiguity, override, 0, 0, |
1287 |
> |
"slab_density", '-', |
1288 |
> |
additional_error)) |
1289 |
> |
goto failure; |
1290 |
> |
|
1291 |
|
} |
1292 |
+ |
/* p(cos(theta)). */ |
1293 |
+ |
else if (strcmp (long_options[option_index].name, "p_angle") == 0) |
1294 |
+ |
{ |
1295 |
+ |
|
1296 |
+ |
if (args_info->staticProps_group_counter && override) |
1297 |
+ |
reset_group_staticProps (args_info); |
1298 |
+ |
args_info->staticProps_group_counter += 1; |
1299 |
+ |
|
1300 |
+ |
if (update_arg( 0 , |
1301 |
+ |
0 , &(args_info->p_angle_given), |
1302 |
+ |
&(local_args_info.p_angle_given), optarg, 0, 0, ARG_NO, |
1303 |
+ |
check_ambiguity, override, 0, 0, |
1304 |
+ |
"p_angle", '-', |
1305 |
+ |
additional_error)) |
1306 |
+ |
goto failure; |
1307 |
+ |
|
1308 |
+ |
} |
1309 |
|
/* hxy. */ |
1310 |
|
else if (strcmp (long_options[option_index].name, "hxy") == 0) |
1311 |
|
{ |
1312 |
< |
if (local_args_info.hxy_given) |
1351 |
< |
{ |
1352 |
< |
fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1353 |
< |
goto failure; |
1354 |
< |
} |
1355 |
< |
if (args_info->hxy_given && ! override) |
1356 |
< |
continue; |
1357 |
< |
local_args_info.hxy_given = 1; |
1358 |
< |
args_info->hxy_given = 1; |
1312 |
> |
|
1313 |
|
if (args_info->staticProps_group_counter && override) |
1314 |
|
reset_group_staticProps (args_info); |
1315 |
|
args_info->staticProps_group_counter += 1; |
1316 |
< |
break; |
1316 |
> |
|
1317 |
> |
if (update_arg( 0 , |
1318 |
> |
0 , &(args_info->hxy_given), |
1319 |
> |
&(local_args_info.hxy_given), optarg, 0, 0, ARG_NO, |
1320 |
> |
check_ambiguity, override, 0, 0, |
1321 |
> |
"hxy", '-', |
1322 |
> |
additional_error)) |
1323 |
> |
goto failure; |
1324 |
> |
|
1325 |
|
} |
1326 |
|
/* rho of R. */ |
1327 |
|
else if (strcmp (long_options[option_index].name, "rho_r") == 0) |
1328 |
|
{ |
1329 |
< |
if (local_args_info.rho_r_given) |
1368 |
< |
{ |
1369 |
< |
fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1370 |
< |
goto failure; |
1371 |
< |
} |
1372 |
< |
if (args_info->rho_r_given && ! override) |
1373 |
< |
continue; |
1374 |
< |
local_args_info.rho_r_given = 1; |
1375 |
< |
args_info->rho_r_given = 1; |
1329 |
> |
|
1330 |
|
if (args_info->staticProps_group_counter && override) |
1331 |
|
reset_group_staticProps (args_info); |
1332 |
|
args_info->staticProps_group_counter += 1; |
1333 |
< |
break; |
1333 |
> |
|
1334 |
> |
if (update_arg( 0 , |
1335 |
> |
0 , &(args_info->rho_r_given), |
1336 |
> |
&(local_args_info.rho_r_given), optarg, 0, 0, ARG_NO, |
1337 |
> |
check_ambiguity, override, 0, 0, |
1338 |
> |
"rho_r", '-', |
1339 |
> |
additional_error)) |
1340 |
> |
goto failure; |
1341 |
> |
|
1342 |
|
} |
1343 |
|
/* hull volume of nanoparticle. */ |
1344 |
|
else if (strcmp (long_options[option_index].name, "hullvol") == 0) |
1345 |
|
{ |
1346 |
< |
if (local_args_info.hullvol_given) |
1385 |
< |
{ |
1386 |
< |
fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1387 |
< |
goto failure; |
1388 |
< |
} |
1389 |
< |
if (args_info->hullvol_given && ! override) |
1390 |
< |
continue; |
1391 |
< |
local_args_info.hullvol_given = 1; |
1392 |
< |
args_info->hullvol_given = 1; |
1346 |
> |
|
1347 |
|
if (args_info->staticProps_group_counter && override) |
1348 |
|
reset_group_staticProps (args_info); |
1349 |
|
args_info->staticProps_group_counter += 1; |
1350 |
< |
break; |
1350 |
> |
|
1351 |
> |
if (update_arg( 0 , |
1352 |
> |
0 , &(args_info->hullvol_given), |
1353 |
> |
&(local_args_info.hullvol_given), optarg, 0, 0, ARG_NO, |
1354 |
> |
check_ambiguity, override, 0, 0, |
1355 |
> |
"hullvol", '-', |
1356 |
> |
additional_error)) |
1357 |
> |
goto failure; |
1358 |
> |
|
1359 |
|
} |
1360 |
|
|
1361 |
|
break; |