1 |
/* |
2 |
File autogenerated by gengetopt version 2.16 |
3 |
generated with the following command: |
4 |
gengetopt -F StaticPropsCmd |
5 |
|
6 |
The developers of gengetopt consider the fixed text that goes in all |
7 |
gengetopt output files to be in the public domain: |
8 |
we make no copyright claims on it. |
9 |
*/ |
10 |
|
11 |
/* If we use autoconf. */ |
12 |
#ifdef HAVE_CONFIG_H |
13 |
#include "config.h" |
14 |
#endif |
15 |
|
16 |
#include <stdio.h> |
17 |
#include <stdlib.h> |
18 |
#include <string.h> |
19 |
|
20 |
#include "getopt.h" |
21 |
|
22 |
#include "StaticPropsCmd.h" |
23 |
|
24 |
static |
25 |
void clear_given (struct gengetopt_args_info *args_info); |
26 |
static |
27 |
void clear_args (struct gengetopt_args_info *args_info); |
28 |
|
29 |
static int |
30 |
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); |
31 |
|
32 |
static int |
33 |
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error); |
34 |
|
35 |
static char * |
36 |
gengetopt_strdup (const char *s); |
37 |
|
38 |
static |
39 |
void clear_given (struct gengetopt_args_info *args_info) |
40 |
{ |
41 |
args_info->help_given = 0 ; |
42 |
args_info->version_given = 0 ; |
43 |
args_info->input_given = 0 ; |
44 |
args_info->output_given = 0 ; |
45 |
args_info->step_given = 0 ; |
46 |
args_info->nrbins_given = 0 ; |
47 |
args_info->nbins_x_given = 0 ; |
48 |
args_info->nbins_y_given = 0 ; |
49 |
args_info->nanglebins_given = 0 ; |
50 |
args_info->length_given = 0 ; |
51 |
args_info->zoffset_given = 0 ; |
52 |
args_info->sele1_given = 0 ; |
53 |
args_info->sele2_given = 0 ; |
54 |
args_info->sele3_given = 0 ; |
55 |
args_info->refsele_given = 0 ; |
56 |
args_info->molname_given = 0 ; |
57 |
args_info->begin_given = 0 ; |
58 |
args_info->end_given = 0 ; |
59 |
args_info->gofr_given = 0 ; |
60 |
args_info->r_theta_given = 0 ; |
61 |
args_info->r_omega_given = 0 ; |
62 |
args_info->theta_omega_given = 0 ; |
63 |
args_info->gxyz_given = 0 ; |
64 |
args_info->p2_given = 0 ; |
65 |
args_info->scd_given = 0 ; |
66 |
args_info->density_given = 0 ; |
67 |
args_info->slab_density_given = 0 ; |
68 |
args_info->hxy_given = 0 ; |
69 |
args_info->staticProps_group_counter = 0 ; |
70 |
} |
71 |
|
72 |
static |
73 |
void clear_args (struct gengetopt_args_info *args_info) |
74 |
{ |
75 |
args_info->input_arg = NULL; |
76 |
args_info->input_orig = NULL; |
77 |
args_info->output_arg = NULL; |
78 |
args_info->output_orig = NULL; |
79 |
args_info->step_arg = 1; |
80 |
args_info->step_orig = NULL; |
81 |
args_info->nrbins_arg = 100; |
82 |
args_info->nrbins_orig = NULL; |
83 |
args_info->nbins_x_arg = 100; |
84 |
args_info->nbins_x_orig = NULL; |
85 |
args_info->nbins_y_arg = 100; |
86 |
args_info->nbins_y_orig = NULL; |
87 |
args_info->nanglebins_arg = 50; |
88 |
args_info->nanglebins_orig = NULL; |
89 |
args_info->length_orig = NULL; |
90 |
args_info->zoffset_arg = 0; |
91 |
args_info->zoffset_orig = NULL; |
92 |
args_info->sele1_arg = NULL; |
93 |
args_info->sele1_orig = NULL; |
94 |
args_info->sele2_arg = NULL; |
95 |
args_info->sele2_orig = NULL; |
96 |
args_info->sele3_arg = NULL; |
97 |
args_info->sele3_orig = NULL; |
98 |
args_info->refsele_arg = NULL; |
99 |
args_info->refsele_orig = NULL; |
100 |
args_info->molname_arg = NULL; |
101 |
args_info->molname_orig = NULL; |
102 |
args_info->begin_orig = NULL; |
103 |
args_info->end_orig = NULL; |
104 |
|
105 |
} |
106 |
|
107 |
void |
108 |
cmdline_parser_print_version (void) |
109 |
{ |
110 |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
111 |
} |
112 |
|
113 |
void |
114 |
cmdline_parser_print_help (void) |
115 |
{ |
116 |
cmdline_parser_print_version (); |
117 |
printf("\nUsage: StaticProps [OPTIONS]...\n\n"); |
118 |
printf("%s\n"," -h, --help Print help and exit"); |
119 |
printf("%s\n"," -V, --version Print version and exit"); |
120 |
printf("%s\n"," -i, --input=filename input dump file"); |
121 |
printf("%s\n"," -o, --output=filename output file name"); |
122 |
printf("%s\n"," -n, --step=INT process every n frame (default=`1')"); |
123 |
printf("%s\n"," -r, --nrbins=INT number of bins for distance (default=`100')"); |
124 |
printf("%s\n"," -x, --nbins_x=INT number of bins in x axis (default=`100')"); |
125 |
printf("%s\n"," -y, --nbins_y=INT number of bins in y axis (default=`100')"); |
126 |
printf("%s\n"," -a, --nanglebins=INT number of bins for cos(angle) (default=`50')"); |
127 |
printf("%s\n"," -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest length \n of first frame)"); |
128 |
printf("%s\n"," -z, --zoffset=DOUBLE Where to set the zero for the slab_density \n calculation (default=`0')"); |
129 |
printf("%s\n"," --sele1=selection script select the first stuntdouble set"); |
130 |
printf("%s\n"," --sele2=selection script select the second stuntdouble set"); |
131 |
printf("%s\n"," --sele3=selection script select the third stuntdouble set"); |
132 |
printf("%s\n"," --refsele=selection script\n select reference (use and only use with --gxyz)"); |
133 |
printf("%s\n"," --molname=STRING molecule name"); |
134 |
printf("%s\n"," --begin=INT begin interanl index"); |
135 |
printf("%s\n"," --end=INT end internal index"); |
136 |
printf("%s\n","\n Group: staticProps\n an option of this group is required"); |
137 |
printf("%s\n"," --gofr g(r)"); |
138 |
printf("%s\n"," --r_theta g(r, cos(theta))"); |
139 |
printf("%s\n"," --r_omega g(r, cos(omega))"); |
140 |
printf("%s\n"," --theta_omega g(cos(theta), cos(omega))"); |
141 |
printf("%s\n"," --gxyz g(x, y, z)"); |
142 |
printf("%s\n"," --p2 p2 order parameter (--sele1 and --sele2 must be \n specified)"); |
143 |
printf("%s\n"," --scd scd order parameter(either --sele1, --sele2, \n --sele3 are specified or --molname, --begin, \n --end are specified)"); |
144 |
printf("%s\n"," --density density plot (--sele1 must be specified)"); |
145 |
printf("%s\n"," --slab_density slab density (--sele1 must be specified)"); |
146 |
printf("%s\n"," --hxy hxy (--sele1 must be specified)"); |
147 |
|
148 |
} |
149 |
|
150 |
void |
151 |
cmdline_parser_init (struct gengetopt_args_info *args_info) |
152 |
{ |
153 |
clear_given (args_info); |
154 |
clear_args (args_info); |
155 |
} |
156 |
|
157 |
static void |
158 |
cmdline_parser_release (struct gengetopt_args_info *args_info) |
159 |
{ |
160 |
|
161 |
if (args_info->input_arg) |
162 |
{ |
163 |
free (args_info->input_arg); /* free previous argument */ |
164 |
args_info->input_arg = 0; |
165 |
} |
166 |
if (args_info->input_orig) |
167 |
{ |
168 |
free (args_info->input_orig); /* free previous argument */ |
169 |
args_info->input_orig = 0; |
170 |
} |
171 |
if (args_info->output_arg) |
172 |
{ |
173 |
free (args_info->output_arg); /* free previous argument */ |
174 |
args_info->output_arg = 0; |
175 |
} |
176 |
if (args_info->output_orig) |
177 |
{ |
178 |
free (args_info->output_orig); /* free previous argument */ |
179 |
args_info->output_orig = 0; |
180 |
} |
181 |
if (args_info->step_orig) |
182 |
{ |
183 |
free (args_info->step_orig); /* free previous argument */ |
184 |
args_info->step_orig = 0; |
185 |
} |
186 |
if (args_info->nrbins_orig) |
187 |
{ |
188 |
free (args_info->nrbins_orig); /* free previous argument */ |
189 |
args_info->nrbins_orig = 0; |
190 |
} |
191 |
if (args_info->nbins_x_orig) |
192 |
{ |
193 |
free (args_info->nbins_x_orig); /* free previous argument */ |
194 |
args_info->nbins_x_orig = 0; |
195 |
} |
196 |
if (args_info->nbins_y_orig) |
197 |
{ |
198 |
free (args_info->nbins_y_orig); /* free previous argument */ |
199 |
args_info->nbins_y_orig = 0; |
200 |
} |
201 |
if (args_info->nanglebins_orig) |
202 |
{ |
203 |
free (args_info->nanglebins_orig); /* free previous argument */ |
204 |
args_info->nanglebins_orig = 0; |
205 |
} |
206 |
if (args_info->length_orig) |
207 |
{ |
208 |
free (args_info->length_orig); /* free previous argument */ |
209 |
args_info->length_orig = 0; |
210 |
} |
211 |
if (args_info->zoffset_orig) |
212 |
{ |
213 |
free (args_info->zoffset_orig); /* free previous argument */ |
214 |
args_info->zoffset_orig = 0; |
215 |
} |
216 |
if (args_info->sele1_arg) |
217 |
{ |
218 |
free (args_info->sele1_arg); /* free previous argument */ |
219 |
args_info->sele1_arg = 0; |
220 |
} |
221 |
if (args_info->sele1_orig) |
222 |
{ |
223 |
free (args_info->sele1_orig); /* free previous argument */ |
224 |
args_info->sele1_orig = 0; |
225 |
} |
226 |
if (args_info->sele2_arg) |
227 |
{ |
228 |
free (args_info->sele2_arg); /* free previous argument */ |
229 |
args_info->sele2_arg = 0; |
230 |
} |
231 |
if (args_info->sele2_orig) |
232 |
{ |
233 |
free (args_info->sele2_orig); /* free previous argument */ |
234 |
args_info->sele2_orig = 0; |
235 |
} |
236 |
if (args_info->sele3_arg) |
237 |
{ |
238 |
free (args_info->sele3_arg); /* free previous argument */ |
239 |
args_info->sele3_arg = 0; |
240 |
} |
241 |
if (args_info->sele3_orig) |
242 |
{ |
243 |
free (args_info->sele3_orig); /* free previous argument */ |
244 |
args_info->sele3_orig = 0; |
245 |
} |
246 |
if (args_info->refsele_arg) |
247 |
{ |
248 |
free (args_info->refsele_arg); /* free previous argument */ |
249 |
args_info->refsele_arg = 0; |
250 |
} |
251 |
if (args_info->refsele_orig) |
252 |
{ |
253 |
free (args_info->refsele_orig); /* free previous argument */ |
254 |
args_info->refsele_orig = 0; |
255 |
} |
256 |
if (args_info->molname_arg) |
257 |
{ |
258 |
free (args_info->molname_arg); /* free previous argument */ |
259 |
args_info->molname_arg = 0; |
260 |
} |
261 |
if (args_info->molname_orig) |
262 |
{ |
263 |
free (args_info->molname_orig); /* free previous argument */ |
264 |
args_info->molname_orig = 0; |
265 |
} |
266 |
if (args_info->begin_orig) |
267 |
{ |
268 |
free (args_info->begin_orig); /* free previous argument */ |
269 |
args_info->begin_orig = 0; |
270 |
} |
271 |
if (args_info->end_orig) |
272 |
{ |
273 |
free (args_info->end_orig); /* free previous argument */ |
274 |
args_info->end_orig = 0; |
275 |
} |
276 |
|
277 |
clear_given (args_info); |
278 |
} |
279 |
|
280 |
int |
281 |
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) |
282 |
{ |
283 |
FILE *outfile; |
284 |
int i = 0; |
285 |
|
286 |
outfile = fopen(filename, "w"); |
287 |
|
288 |
if (!outfile) |
289 |
{ |
290 |
fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); |
291 |
return EXIT_FAILURE; |
292 |
} |
293 |
|
294 |
if (args_info->help_given) { |
295 |
fprintf(outfile, "%s\n", "help"); |
296 |
} |
297 |
if (args_info->version_given) { |
298 |
fprintf(outfile, "%s\n", "version"); |
299 |
} |
300 |
if (args_info->input_given) { |
301 |
if (args_info->input_orig) { |
302 |
fprintf(outfile, "%s=\"%s\"\n", "input", args_info->input_orig); |
303 |
} else { |
304 |
fprintf(outfile, "%s\n", "input"); |
305 |
} |
306 |
} |
307 |
if (args_info->output_given) { |
308 |
if (args_info->output_orig) { |
309 |
fprintf(outfile, "%s=\"%s\"\n", "output", args_info->output_orig); |
310 |
} else { |
311 |
fprintf(outfile, "%s\n", "output"); |
312 |
} |
313 |
} |
314 |
if (args_info->step_given) { |
315 |
if (args_info->step_orig) { |
316 |
fprintf(outfile, "%s=\"%s\"\n", "step", args_info->step_orig); |
317 |
} else { |
318 |
fprintf(outfile, "%s\n", "step"); |
319 |
} |
320 |
} |
321 |
if (args_info->nrbins_given) { |
322 |
if (args_info->nrbins_orig) { |
323 |
fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); |
324 |
} else { |
325 |
fprintf(outfile, "%s\n", "nrbins"); |
326 |
} |
327 |
} |
328 |
if (args_info->nbins_x_given) { |
329 |
if (args_info->nbins_x_orig) { |
330 |
fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig); |
331 |
} else { |
332 |
fprintf(outfile, "%s\n", "nbins_x"); |
333 |
} |
334 |
} |
335 |
if (args_info->nbins_y_given) { |
336 |
if (args_info->nbins_y_orig) { |
337 |
fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig); |
338 |
} else { |
339 |
fprintf(outfile, "%s\n", "nbins_y"); |
340 |
} |
341 |
} |
342 |
if (args_info->nanglebins_given) { |
343 |
if (args_info->nanglebins_orig) { |
344 |
fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig); |
345 |
} else { |
346 |
fprintf(outfile, "%s\n", "nanglebins"); |
347 |
} |
348 |
} |
349 |
if (args_info->length_given) { |
350 |
if (args_info->length_orig) { |
351 |
fprintf(outfile, "%s=\"%s\"\n", "length", args_info->length_orig); |
352 |
} else { |
353 |
fprintf(outfile, "%s\n", "length"); |
354 |
} |
355 |
} |
356 |
if (args_info->zoffset_given) { |
357 |
if (args_info->zoffset_orig) { |
358 |
fprintf(outfile, "%s=\"%s\"\n", "zoffset", args_info->zoffset_orig); |
359 |
} else { |
360 |
fprintf(outfile, "%s\n", "zoffset"); |
361 |
} |
362 |
} |
363 |
if (args_info->sele1_given) { |
364 |
if (args_info->sele1_orig) { |
365 |
fprintf(outfile, "%s=\"%s\"\n", "sele1", args_info->sele1_orig); |
366 |
} else { |
367 |
fprintf(outfile, "%s\n", "sele1"); |
368 |
} |
369 |
} |
370 |
if (args_info->sele2_given) { |
371 |
if (args_info->sele2_orig) { |
372 |
fprintf(outfile, "%s=\"%s\"\n", "sele2", args_info->sele2_orig); |
373 |
} else { |
374 |
fprintf(outfile, "%s\n", "sele2"); |
375 |
} |
376 |
} |
377 |
if (args_info->sele3_given) { |
378 |
if (args_info->sele3_orig) { |
379 |
fprintf(outfile, "%s=\"%s\"\n", "sele3", args_info->sele3_orig); |
380 |
} else { |
381 |
fprintf(outfile, "%s\n", "sele3"); |
382 |
} |
383 |
} |
384 |
if (args_info->refsele_given) { |
385 |
if (args_info->refsele_orig) { |
386 |
fprintf(outfile, "%s=\"%s\"\n", "refsele", args_info->refsele_orig); |
387 |
} else { |
388 |
fprintf(outfile, "%s\n", "refsele"); |
389 |
} |
390 |
} |
391 |
if (args_info->molname_given) { |
392 |
if (args_info->molname_orig) { |
393 |
fprintf(outfile, "%s=\"%s\"\n", "molname", args_info->molname_orig); |
394 |
} else { |
395 |
fprintf(outfile, "%s\n", "molname"); |
396 |
} |
397 |
} |
398 |
if (args_info->begin_given) { |
399 |
if (args_info->begin_orig) { |
400 |
fprintf(outfile, "%s=\"%s\"\n", "begin", args_info->begin_orig); |
401 |
} else { |
402 |
fprintf(outfile, "%s\n", "begin"); |
403 |
} |
404 |
} |
405 |
if (args_info->end_given) { |
406 |
if (args_info->end_orig) { |
407 |
fprintf(outfile, "%s=\"%s\"\n", "end", args_info->end_orig); |
408 |
} else { |
409 |
fprintf(outfile, "%s\n", "end"); |
410 |
} |
411 |
} |
412 |
if (args_info->gofr_given) { |
413 |
fprintf(outfile, "%s\n", "gofr"); |
414 |
} |
415 |
if (args_info->r_theta_given) { |
416 |
fprintf(outfile, "%s\n", "r_theta"); |
417 |
} |
418 |
if (args_info->r_omega_given) { |
419 |
fprintf(outfile, "%s\n", "r_omega"); |
420 |
} |
421 |
if (args_info->theta_omega_given) { |
422 |
fprintf(outfile, "%s\n", "theta_omega"); |
423 |
} |
424 |
if (args_info->gxyz_given) { |
425 |
fprintf(outfile, "%s\n", "gxyz"); |
426 |
} |
427 |
if (args_info->p2_given) { |
428 |
fprintf(outfile, "%s\n", "p2"); |
429 |
} |
430 |
if (args_info->scd_given) { |
431 |
fprintf(outfile, "%s\n", "scd"); |
432 |
} |
433 |
if (args_info->density_given) { |
434 |
fprintf(outfile, "%s\n", "density"); |
435 |
} |
436 |
if (args_info->slab_density_given) { |
437 |
fprintf(outfile, "%s\n", "slab_density"); |
438 |
} |
439 |
if (args_info->hxy_given) { |
440 |
fprintf(outfile, "%s\n", "hxy"); |
441 |
} |
442 |
|
443 |
fclose (outfile); |
444 |
|
445 |
i = EXIT_SUCCESS; |
446 |
return i; |
447 |
} |
448 |
|
449 |
void |
450 |
cmdline_parser_free (struct gengetopt_args_info *args_info) |
451 |
{ |
452 |
cmdline_parser_release (args_info); |
453 |
} |
454 |
|
455 |
|
456 |
/* gengetopt_strdup() */ |
457 |
/* strdup.c replacement of strdup, which is not standard */ |
458 |
char * |
459 |
gengetopt_strdup (const char *s) |
460 |
{ |
461 |
char *result = NULL; |
462 |
if (!s) |
463 |
return result; |
464 |
|
465 |
result = (char*)malloc(strlen(s) + 1); |
466 |
if (result == (char*)0) |
467 |
return (char*)0; |
468 |
strcpy(result, s); |
469 |
return result; |
470 |
} |
471 |
|
472 |
static void |
473 |
reset_group_staticProps(struct gengetopt_args_info *args_info); |
474 |
|
475 |
static void |
476 |
reset_group_staticProps(struct gengetopt_args_info *args_info) |
477 |
{ |
478 |
if (! args_info->staticProps_group_counter) |
479 |
return; |
480 |
|
481 |
args_info->gofr_given = 0 ; |
482 |
args_info->r_theta_given = 0 ; |
483 |
args_info->r_omega_given = 0 ; |
484 |
args_info->theta_omega_given = 0 ; |
485 |
args_info->gxyz_given = 0 ; |
486 |
args_info->p2_given = 0 ; |
487 |
args_info->scd_given = 0 ; |
488 |
args_info->density_given = 0 ; |
489 |
args_info->slab_density_given = 0 ; |
490 |
args_info->hxy_given = 0 ; |
491 |
|
492 |
args_info->staticProps_group_counter = 0; |
493 |
} |
494 |
|
495 |
int |
496 |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
497 |
{ |
498 |
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
499 |
} |
500 |
|
501 |
int |
502 |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
503 |
{ |
504 |
int result; |
505 |
|
506 |
result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL); |
507 |
|
508 |
if (result == EXIT_FAILURE) |
509 |
{ |
510 |
cmdline_parser_free (args_info); |
511 |
exit (EXIT_FAILURE); |
512 |
} |
513 |
|
514 |
return result; |
515 |
} |
516 |
|
517 |
int |
518 |
cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) |
519 |
{ |
520 |
int result = EXIT_SUCCESS; |
521 |
|
522 |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
523 |
result = EXIT_FAILURE; |
524 |
|
525 |
if (result == EXIT_FAILURE) |
526 |
{ |
527 |
cmdline_parser_free (args_info); |
528 |
exit (EXIT_FAILURE); |
529 |
} |
530 |
|
531 |
return result; |
532 |
} |
533 |
|
534 |
int |
535 |
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
536 |
{ |
537 |
int error = 0; |
538 |
|
539 |
if (! args_info->input_given) |
540 |
{ |
541 |
fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); |
542 |
error = 1; |
543 |
} |
544 |
if (args_info->staticProps_group_counter == 0) |
545 |
{ |
546 |
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 : "")); |
547 |
error = 1; |
548 |
} |
549 |
|
550 |
|
551 |
return error; |
552 |
} |
553 |
|
554 |
int |
555 |
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) |
556 |
{ |
557 |
int c; /* Character of the parsed option. */ |
558 |
|
559 |
int error = 0; |
560 |
struct gengetopt_args_info local_args_info; |
561 |
|
562 |
if (initialize) |
563 |
cmdline_parser_init (args_info); |
564 |
|
565 |
cmdline_parser_init (&local_args_info); |
566 |
|
567 |
optarg = 0; |
568 |
optind = 0; |
569 |
opterr = 1; |
570 |
optopt = '?'; |
571 |
|
572 |
while (1) |
573 |
{ |
574 |
int option_index = 0; |
575 |
char *stop_char; |
576 |
|
577 |
static struct option long_options[] = { |
578 |
{ "help", 0, NULL, 'h' }, |
579 |
{ "version", 0, NULL, 'V' }, |
580 |
{ "input", 1, NULL, 'i' }, |
581 |
{ "output", 1, NULL, 'o' }, |
582 |
{ "step", 1, NULL, 'n' }, |
583 |
{ "nrbins", 1, NULL, 'r' }, |
584 |
{ "nbins_x", 1, NULL, 'x' }, |
585 |
{ "nbins_y", 1, NULL, 'y' }, |
586 |
{ "nanglebins", 1, NULL, 'a' }, |
587 |
{ "length", 1, NULL, 'l' }, |
588 |
{ "zoffset", 1, NULL, 'z' }, |
589 |
{ "sele1", 1, NULL, 0 }, |
590 |
{ "sele2", 1, NULL, 0 }, |
591 |
{ "sele3", 1, NULL, 0 }, |
592 |
{ "refsele", 1, NULL, 0 }, |
593 |
{ "molname", 1, NULL, 0 }, |
594 |
{ "begin", 1, NULL, 0 }, |
595 |
{ "end", 1, NULL, 0 }, |
596 |
{ "gofr", 0, NULL, 0 }, |
597 |
{ "r_theta", 0, NULL, 0 }, |
598 |
{ "r_omega", 0, NULL, 0 }, |
599 |
{ "theta_omega", 0, NULL, 0 }, |
600 |
{ "gxyz", 0, NULL, 0 }, |
601 |
{ "p2", 0, NULL, 0 }, |
602 |
{ "scd", 0, NULL, 0 }, |
603 |
{ "density", 0, NULL, 0 }, |
604 |
{ "slab_density", 0, NULL, 0 }, |
605 |
{ "hxy", 0, NULL, 0 }, |
606 |
{ NULL, 0, NULL, 0 } |
607 |
}; |
608 |
|
609 |
stop_char = 0; |
610 |
c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:z:", long_options, &option_index); |
611 |
|
612 |
if (c == -1) break; /* Exit from `while (1)' loop. */ |
613 |
|
614 |
switch (c) |
615 |
{ |
616 |
case 'h': /* Print help and exit. */ |
617 |
cmdline_parser_print_help (); |
618 |
cmdline_parser_free (&local_args_info); |
619 |
exit (EXIT_SUCCESS); |
620 |
|
621 |
case 'V': /* Print version and exit. */ |
622 |
cmdline_parser_print_version (); |
623 |
cmdline_parser_free (&local_args_info); |
624 |
exit (EXIT_SUCCESS); |
625 |
|
626 |
case 'i': /* input dump file. */ |
627 |
if (local_args_info.input_given) |
628 |
{ |
629 |
fprintf (stderr, "%s: `--input' (`-i') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
630 |
goto failure; |
631 |
} |
632 |
if (args_info->input_given && ! override) |
633 |
continue; |
634 |
local_args_info.input_given = 1; |
635 |
args_info->input_given = 1; |
636 |
if (args_info->input_arg) |
637 |
free (args_info->input_arg); /* free previous string */ |
638 |
args_info->input_arg = gengetopt_strdup (optarg); |
639 |
if (args_info->input_orig) |
640 |
free (args_info->input_orig); /* free previous string */ |
641 |
args_info->input_orig = gengetopt_strdup (optarg); |
642 |
break; |
643 |
|
644 |
case 'o': /* output file name. */ |
645 |
if (local_args_info.output_given) |
646 |
{ |
647 |
fprintf (stderr, "%s: `--output' (`-o') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
648 |
goto failure; |
649 |
} |
650 |
if (args_info->output_given && ! override) |
651 |
continue; |
652 |
local_args_info.output_given = 1; |
653 |
args_info->output_given = 1; |
654 |
if (args_info->output_arg) |
655 |
free (args_info->output_arg); /* free previous string */ |
656 |
args_info->output_arg = gengetopt_strdup (optarg); |
657 |
if (args_info->output_orig) |
658 |
free (args_info->output_orig); /* free previous string */ |
659 |
args_info->output_orig = gengetopt_strdup (optarg); |
660 |
break; |
661 |
|
662 |
case 'n': /* process every n frame. */ |
663 |
if (local_args_info.step_given) |
664 |
{ |
665 |
fprintf (stderr, "%s: `--step' (`-n') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
666 |
goto failure; |
667 |
} |
668 |
if (args_info->step_given && ! override) |
669 |
continue; |
670 |
local_args_info.step_given = 1; |
671 |
args_info->step_given = 1; |
672 |
args_info->step_arg = strtol (optarg, &stop_char, 0); |
673 |
if (!(stop_char && *stop_char == '\0')) { |
674 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
675 |
goto failure; |
676 |
} |
677 |
if (args_info->step_orig) |
678 |
free (args_info->step_orig); /* free previous string */ |
679 |
args_info->step_orig = gengetopt_strdup (optarg); |
680 |
break; |
681 |
|
682 |
case 'r': /* number of bins for distance. */ |
683 |
if (local_args_info.nrbins_given) |
684 |
{ |
685 |
fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
686 |
goto failure; |
687 |
} |
688 |
if (args_info->nrbins_given && ! override) |
689 |
continue; |
690 |
local_args_info.nrbins_given = 1; |
691 |
args_info->nrbins_given = 1; |
692 |
args_info->nrbins_arg = strtol (optarg, &stop_char, 0); |
693 |
if (!(stop_char && *stop_char == '\0')) { |
694 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
695 |
goto failure; |
696 |
} |
697 |
if (args_info->nrbins_orig) |
698 |
free (args_info->nrbins_orig); /* free previous string */ |
699 |
args_info->nrbins_orig = gengetopt_strdup (optarg); |
700 |
break; |
701 |
|
702 |
case 'x': /* number of bins in x axis. */ |
703 |
if (local_args_info.nbins_x_given) |
704 |
{ |
705 |
fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
706 |
goto failure; |
707 |
} |
708 |
if (args_info->nbins_x_given && ! override) |
709 |
continue; |
710 |
local_args_info.nbins_x_given = 1; |
711 |
args_info->nbins_x_given = 1; |
712 |
args_info->nbins_x_arg = strtol (optarg, &stop_char, 0); |
713 |
if (!(stop_char && *stop_char == '\0')) { |
714 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
715 |
goto failure; |
716 |
} |
717 |
if (args_info->nbins_x_orig) |
718 |
free (args_info->nbins_x_orig); /* free previous string */ |
719 |
args_info->nbins_x_orig = gengetopt_strdup (optarg); |
720 |
break; |
721 |
|
722 |
case 'y': /* number of bins in y axis. */ |
723 |
if (local_args_info.nbins_y_given) |
724 |
{ |
725 |
fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
726 |
goto failure; |
727 |
} |
728 |
if (args_info->nbins_y_given && ! override) |
729 |
continue; |
730 |
local_args_info.nbins_y_given = 1; |
731 |
args_info->nbins_y_given = 1; |
732 |
args_info->nbins_y_arg = strtol (optarg, &stop_char, 0); |
733 |
if (!(stop_char && *stop_char == '\0')) { |
734 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
735 |
goto failure; |
736 |
} |
737 |
if (args_info->nbins_y_orig) |
738 |
free (args_info->nbins_y_orig); /* free previous string */ |
739 |
args_info->nbins_y_orig = gengetopt_strdup (optarg); |
740 |
break; |
741 |
|
742 |
case 'a': /* number of bins for cos(angle). */ |
743 |
if (local_args_info.nanglebins_given) |
744 |
{ |
745 |
fprintf (stderr, "%s: `--nanglebins' (`-a') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
746 |
goto failure; |
747 |
} |
748 |
if (args_info->nanglebins_given && ! override) |
749 |
continue; |
750 |
local_args_info.nanglebins_given = 1; |
751 |
args_info->nanglebins_given = 1; |
752 |
args_info->nanglebins_arg = strtol (optarg, &stop_char, 0); |
753 |
if (!(stop_char && *stop_char == '\0')) { |
754 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
755 |
goto failure; |
756 |
} |
757 |
if (args_info->nanglebins_orig) |
758 |
free (args_info->nanglebins_orig); /* free previous string */ |
759 |
args_info->nanglebins_orig = gengetopt_strdup (optarg); |
760 |
break; |
761 |
|
762 |
case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
763 |
if (local_args_info.length_given) |
764 |
{ |
765 |
fprintf (stderr, "%s: `--length' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
766 |
goto failure; |
767 |
} |
768 |
if (args_info->length_given && ! override) |
769 |
continue; |
770 |
local_args_info.length_given = 1; |
771 |
args_info->length_given = 1; |
772 |
args_info->length_arg = strtod (optarg, &stop_char); |
773 |
if (!(stop_char && *stop_char == '\0')) { |
774 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
775 |
goto failure; |
776 |
} |
777 |
if (args_info->length_orig) |
778 |
free (args_info->length_orig); /* free previous string */ |
779 |
args_info->length_orig = gengetopt_strdup (optarg); |
780 |
break; |
781 |
|
782 |
case 'z': /* Where to set the zero for the slab_density calculation. */ |
783 |
if (local_args_info.zoffset_given) |
784 |
{ |
785 |
fprintf (stderr, "%s: `--zoffset' (`-z') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
786 |
goto failure; |
787 |
} |
788 |
if (args_info->zoffset_given && ! override) |
789 |
continue; |
790 |
local_args_info.zoffset_given = 1; |
791 |
args_info->zoffset_given = 1; |
792 |
args_info->zoffset_arg = strtod (optarg, &stop_char); |
793 |
if (!(stop_char && *stop_char == '\0')) { |
794 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
795 |
goto failure; |
796 |
} |
797 |
if (args_info->zoffset_orig) |
798 |
free (args_info->zoffset_orig); /* free previous string */ |
799 |
args_info->zoffset_orig = gengetopt_strdup (optarg); |
800 |
break; |
801 |
|
802 |
|
803 |
case 0: /* Long option with no short option */ |
804 |
/* select the first stuntdouble set. */ |
805 |
if (strcmp (long_options[option_index].name, "sele1") == 0) |
806 |
{ |
807 |
if (local_args_info.sele1_given) |
808 |
{ |
809 |
fprintf (stderr, "%s: `--sele1' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
810 |
goto failure; |
811 |
} |
812 |
if (args_info->sele1_given && ! override) |
813 |
continue; |
814 |
local_args_info.sele1_given = 1; |
815 |
args_info->sele1_given = 1; |
816 |
if (args_info->sele1_arg) |
817 |
free (args_info->sele1_arg); /* free previous string */ |
818 |
args_info->sele1_arg = gengetopt_strdup (optarg); |
819 |
if (args_info->sele1_orig) |
820 |
free (args_info->sele1_orig); /* free previous string */ |
821 |
args_info->sele1_orig = gengetopt_strdup (optarg); |
822 |
} |
823 |
/* select the second stuntdouble set. */ |
824 |
else if (strcmp (long_options[option_index].name, "sele2") == 0) |
825 |
{ |
826 |
if (local_args_info.sele2_given) |
827 |
{ |
828 |
fprintf (stderr, "%s: `--sele2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
829 |
goto failure; |
830 |
} |
831 |
if (args_info->sele2_given && ! override) |
832 |
continue; |
833 |
local_args_info.sele2_given = 1; |
834 |
args_info->sele2_given = 1; |
835 |
if (args_info->sele2_arg) |
836 |
free (args_info->sele2_arg); /* free previous string */ |
837 |
args_info->sele2_arg = gengetopt_strdup (optarg); |
838 |
if (args_info->sele2_orig) |
839 |
free (args_info->sele2_orig); /* free previous string */ |
840 |
args_info->sele2_orig = gengetopt_strdup (optarg); |
841 |
} |
842 |
/* select the third stuntdouble set. */ |
843 |
else if (strcmp (long_options[option_index].name, "sele3") == 0) |
844 |
{ |
845 |
if (local_args_info.sele3_given) |
846 |
{ |
847 |
fprintf (stderr, "%s: `--sele3' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
848 |
goto failure; |
849 |
} |
850 |
if (args_info->sele3_given && ! override) |
851 |
continue; |
852 |
local_args_info.sele3_given = 1; |
853 |
args_info->sele3_given = 1; |
854 |
if (args_info->sele3_arg) |
855 |
free (args_info->sele3_arg); /* free previous string */ |
856 |
args_info->sele3_arg = gengetopt_strdup (optarg); |
857 |
if (args_info->sele3_orig) |
858 |
free (args_info->sele3_orig); /* free previous string */ |
859 |
args_info->sele3_orig = gengetopt_strdup (optarg); |
860 |
} |
861 |
/* select reference (use and only use with --gxyz). */ |
862 |
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
863 |
{ |
864 |
if (local_args_info.refsele_given) |
865 |
{ |
866 |
fprintf (stderr, "%s: `--refsele' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
867 |
goto failure; |
868 |
} |
869 |
if (args_info->refsele_given && ! override) |
870 |
continue; |
871 |
local_args_info.refsele_given = 1; |
872 |
args_info->refsele_given = 1; |
873 |
if (args_info->refsele_arg) |
874 |
free (args_info->refsele_arg); /* free previous string */ |
875 |
args_info->refsele_arg = gengetopt_strdup (optarg); |
876 |
if (args_info->refsele_orig) |
877 |
free (args_info->refsele_orig); /* free previous string */ |
878 |
args_info->refsele_orig = gengetopt_strdup (optarg); |
879 |
} |
880 |
/* molecule name. */ |
881 |
else if (strcmp (long_options[option_index].name, "molname") == 0) |
882 |
{ |
883 |
if (local_args_info.molname_given) |
884 |
{ |
885 |
fprintf (stderr, "%s: `--molname' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
886 |
goto failure; |
887 |
} |
888 |
if (args_info->molname_given && ! override) |
889 |
continue; |
890 |
local_args_info.molname_given = 1; |
891 |
args_info->molname_given = 1; |
892 |
if (args_info->molname_arg) |
893 |
free (args_info->molname_arg); /* free previous string */ |
894 |
args_info->molname_arg = gengetopt_strdup (optarg); |
895 |
if (args_info->molname_orig) |
896 |
free (args_info->molname_orig); /* free previous string */ |
897 |
args_info->molname_orig = gengetopt_strdup (optarg); |
898 |
} |
899 |
/* begin interanl index. */ |
900 |
else if (strcmp (long_options[option_index].name, "begin") == 0) |
901 |
{ |
902 |
if (local_args_info.begin_given) |
903 |
{ |
904 |
fprintf (stderr, "%s: `--begin' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
905 |
goto failure; |
906 |
} |
907 |
if (args_info->begin_given && ! override) |
908 |
continue; |
909 |
local_args_info.begin_given = 1; |
910 |
args_info->begin_given = 1; |
911 |
args_info->begin_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); |
914 |
goto failure; |
915 |
} |
916 |
if (args_info->begin_orig) |
917 |
free (args_info->begin_orig); /* free previous string */ |
918 |
args_info->begin_orig = gengetopt_strdup (optarg); |
919 |
} |
920 |
/* end internal index. */ |
921 |
else if (strcmp (long_options[option_index].name, "end") == 0) |
922 |
{ |
923 |
if (local_args_info.end_given) |
924 |
{ |
925 |
fprintf (stderr, "%s: `--end' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
926 |
goto failure; |
927 |
} |
928 |
if (args_info->end_given && ! override) |
929 |
continue; |
930 |
local_args_info.end_given = 1; |
931 |
args_info->end_given = 1; |
932 |
args_info->end_arg = strtol (optarg, &stop_char, 0); |
933 |
if (!(stop_char && *stop_char == '\0')) { |
934 |
fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
935 |
goto failure; |
936 |
} |
937 |
if (args_info->end_orig) |
938 |
free (args_info->end_orig); /* free previous string */ |
939 |
args_info->end_orig = gengetopt_strdup (optarg); |
940 |
} |
941 |
/* g(r). */ |
942 |
else if (strcmp (long_options[option_index].name, "gofr") == 0) |
943 |
{ |
944 |
if (local_args_info.gofr_given) |
945 |
{ |
946 |
fprintf (stderr, "%s: `--gofr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
947 |
goto failure; |
948 |
} |
949 |
if (args_info->gofr_given && ! override) |
950 |
continue; |
951 |
local_args_info.gofr_given = 1; |
952 |
args_info->gofr_given = 1; |
953 |
if (args_info->staticProps_group_counter && override) |
954 |
reset_group_staticProps (args_info); |
955 |
args_info->staticProps_group_counter += 1; |
956 |
break; |
957 |
} |
958 |
/* g(r, cos(theta)). */ |
959 |
else if (strcmp (long_options[option_index].name, "r_theta") == 0) |
960 |
{ |
961 |
if (local_args_info.r_theta_given) |
962 |
{ |
963 |
fprintf (stderr, "%s: `--r_theta' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
964 |
goto failure; |
965 |
} |
966 |
if (args_info->r_theta_given && ! override) |
967 |
continue; |
968 |
local_args_info.r_theta_given = 1; |
969 |
args_info->r_theta_given = 1; |
970 |
if (args_info->staticProps_group_counter && override) |
971 |
reset_group_staticProps (args_info); |
972 |
args_info->staticProps_group_counter += 1; |
973 |
break; |
974 |
} |
975 |
/* g(r, cos(omega)). */ |
976 |
else if (strcmp (long_options[option_index].name, "r_omega") == 0) |
977 |
{ |
978 |
if (local_args_info.r_omega_given) |
979 |
{ |
980 |
fprintf (stderr, "%s: `--r_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
981 |
goto failure; |
982 |
} |
983 |
if (args_info->r_omega_given && ! override) |
984 |
continue; |
985 |
local_args_info.r_omega_given = 1; |
986 |
args_info->r_omega_given = 1; |
987 |
if (args_info->staticProps_group_counter && override) |
988 |
reset_group_staticProps (args_info); |
989 |
args_info->staticProps_group_counter += 1; |
990 |
break; |
991 |
} |
992 |
/* g(cos(theta), cos(omega)). */ |
993 |
else if (strcmp (long_options[option_index].name, "theta_omega") == 0) |
994 |
{ |
995 |
if (local_args_info.theta_omega_given) |
996 |
{ |
997 |
fprintf (stderr, "%s: `--theta_omega' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
998 |
goto failure; |
999 |
} |
1000 |
if (args_info->theta_omega_given && ! override) |
1001 |
continue; |
1002 |
local_args_info.theta_omega_given = 1; |
1003 |
args_info->theta_omega_given = 1; |
1004 |
if (args_info->staticProps_group_counter && override) |
1005 |
reset_group_staticProps (args_info); |
1006 |
args_info->staticProps_group_counter += 1; |
1007 |
break; |
1008 |
} |
1009 |
/* g(x, y, z). */ |
1010 |
else if (strcmp (long_options[option_index].name, "gxyz") == 0) |
1011 |
{ |
1012 |
if (local_args_info.gxyz_given) |
1013 |
{ |
1014 |
fprintf (stderr, "%s: `--gxyz' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1015 |
goto failure; |
1016 |
} |
1017 |
if (args_info->gxyz_given && ! override) |
1018 |
continue; |
1019 |
local_args_info.gxyz_given = 1; |
1020 |
args_info->gxyz_given = 1; |
1021 |
if (args_info->staticProps_group_counter && override) |
1022 |
reset_group_staticProps (args_info); |
1023 |
args_info->staticProps_group_counter += 1; |
1024 |
break; |
1025 |
} |
1026 |
/* p2 order parameter (--sele1 and --sele2 must be specified). */ |
1027 |
else if (strcmp (long_options[option_index].name, "p2") == 0) |
1028 |
{ |
1029 |
if (local_args_info.p2_given) |
1030 |
{ |
1031 |
fprintf (stderr, "%s: `--p2' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1032 |
goto failure; |
1033 |
} |
1034 |
if (args_info->p2_given && ! override) |
1035 |
continue; |
1036 |
local_args_info.p2_given = 1; |
1037 |
args_info->p2_given = 1; |
1038 |
if (args_info->staticProps_group_counter && override) |
1039 |
reset_group_staticProps (args_info); |
1040 |
args_info->staticProps_group_counter += 1; |
1041 |
break; |
1042 |
} |
1043 |
/* scd order parameter(either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
1044 |
else if (strcmp (long_options[option_index].name, "scd") == 0) |
1045 |
{ |
1046 |
if (local_args_info.scd_given) |
1047 |
{ |
1048 |
fprintf (stderr, "%s: `--scd' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1049 |
goto failure; |
1050 |
} |
1051 |
if (args_info->scd_given && ! override) |
1052 |
continue; |
1053 |
local_args_info.scd_given = 1; |
1054 |
args_info->scd_given = 1; |
1055 |
if (args_info->staticProps_group_counter && override) |
1056 |
reset_group_staticProps (args_info); |
1057 |
args_info->staticProps_group_counter += 1; |
1058 |
break; |
1059 |
} |
1060 |
/* density plot (--sele1 must be specified). */ |
1061 |
else if (strcmp (long_options[option_index].name, "density") == 0) |
1062 |
{ |
1063 |
if (local_args_info.density_given) |
1064 |
{ |
1065 |
fprintf (stderr, "%s: `--density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1066 |
goto failure; |
1067 |
} |
1068 |
if (args_info->density_given && ! override) |
1069 |
continue; |
1070 |
local_args_info.density_given = 1; |
1071 |
args_info->density_given = 1; |
1072 |
if (args_info->staticProps_group_counter && override) |
1073 |
reset_group_staticProps (args_info); |
1074 |
args_info->staticProps_group_counter += 1; |
1075 |
break; |
1076 |
} |
1077 |
/* slab density (--sele1 must be specified). */ |
1078 |
else if (strcmp (long_options[option_index].name, "slab_density") == 0) |
1079 |
{ |
1080 |
if (local_args_info.slab_density_given) |
1081 |
{ |
1082 |
fprintf (stderr, "%s: `--slab_density' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1083 |
goto failure; |
1084 |
} |
1085 |
if (args_info->slab_density_given && ! override) |
1086 |
continue; |
1087 |
local_args_info.slab_density_given = 1; |
1088 |
args_info->slab_density_given = 1; |
1089 |
if (args_info->staticProps_group_counter && override) |
1090 |
reset_group_staticProps (args_info); |
1091 |
args_info->staticProps_group_counter += 1; |
1092 |
break; |
1093 |
} |
1094 |
/* hxy (--sele1 must be specified). */ |
1095 |
else if (strcmp (long_options[option_index].name, "hxy") == 0) |
1096 |
{ |
1097 |
if (local_args_info.hxy_given) |
1098 |
{ |
1099 |
fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
1100 |
goto failure; |
1101 |
} |
1102 |
if (args_info->hxy_given && ! override) |
1103 |
continue; |
1104 |
local_args_info.hxy_given = 1; |
1105 |
args_info->hxy_given = 1; |
1106 |
if (args_info->staticProps_group_counter && override) |
1107 |
reset_group_staticProps (args_info); |
1108 |
args_info->staticProps_group_counter += 1; |
1109 |
break; |
1110 |
} |
1111 |
|
1112 |
break; |
1113 |
case '?': /* Invalid option. */ |
1114 |
/* `getopt_long' already printed an error message. */ |
1115 |
goto failure; |
1116 |
|
1117 |
default: /* bug: option not considered. */ |
1118 |
fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); |
1119 |
abort (); |
1120 |
} /* switch */ |
1121 |
} /* while */ |
1122 |
|
1123 |
if (args_info->staticProps_group_counter > 1) |
1124 |
{ |
1125 |
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 : "")); |
1126 |
error = 1; |
1127 |
} |
1128 |
|
1129 |
|
1130 |
|
1131 |
if (check_required) |
1132 |
{ |
1133 |
error += cmdline_parser_required2 (args_info, argv[0], additional_error); |
1134 |
} |
1135 |
|
1136 |
cmdline_parser_release (&local_args_info); |
1137 |
|
1138 |
if ( error ) |
1139 |
return (EXIT_FAILURE); |
1140 |
|
1141 |
return 0; |
1142 |
|
1143 |
failure: |
1144 |
|
1145 |
cmdline_parser_release (&local_args_info); |
1146 |
return (EXIT_FAILURE); |
1147 |
} |