1 |
|
/* |
2 |
|
File autogenerated by gengetopt version 2.11 |
3 |
|
generated with the following command: |
4 |
< |
/home/maul/gezelter/tim/bin/gengetopt -F staticPropsCmd |
4 |
> |
/home/maul/gezelter/tim/bin/gengetopt -i StaticProps.ggo -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: |
20 |
|
|
21 |
|
#include "getopt.h" |
22 |
|
|
23 |
< |
#include "staticPropsCmd.h" |
23 |
> |
#include "StaticPropsCmd.h" |
24 |
|
|
25 |
|
void |
26 |
|
cmdline_parser_print_version (void) |
35 |
|
printf("\n" |
36 |
|
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
37 |
|
printf("\n"); |
38 |
< |
printf(" -h, --help Print help and exit\n"); |
39 |
< |
printf(" -V, --version Print version and exit\n"); |
40 |
< |
printf(" -i, --input=filename input dump file\n"); |
41 |
< |
printf(" -o, --output=filename output file name\n"); |
42 |
< |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
43 |
< |
printf(" -d, --ndistebins=INT number of bins for distance (default=`50')\n"); |
44 |
< |
printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')\n"); |
45 |
< |
printf(" -l, --length=DOUBLE maximum length\n"); |
46 |
< |
printf(" --sele1=selection script select first stuntdouble set\n"); |
47 |
< |
printf(" --sele2=selection script select second stuntdouble set\n"); |
38 |
> |
printf(" -h, --help Print help and exit\n"); |
39 |
> |
printf(" -V, --version Print version and exit\n"); |
40 |
> |
printf(" -i, --input=filename input dump file\n"); |
41 |
> |
printf(" -o, --output=filename output file name\n"); |
42 |
> |
printf(" -n, --step=INT process every n frame (default=`1')\n"); |
43 |
> |
printf(" -r, --nrbins=INT number of bins for distance (default=`100')\n"); |
44 |
> |
printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=\n `50')\n"); |
45 |
> |
printf(" -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest \n length of first frame)\n"); |
46 |
> |
printf(" --sele1=selection script select first stuntdouble set\n"); |
47 |
> |
printf(" --sele2=selection script select second stuntdouble set\n"); |
48 |
> |
printf(" --refsele=selection script select reference (use and only use with \n --gxyz)\n"); |
49 |
|
printf("\n"); |
50 |
|
printf(" Group: staticProps an option of this group is required\n"); |
51 |
< |
printf(" --gofr g(r)\n"); |
52 |
< |
printf(" --r_theta g(r, cos(theta))\n"); |
53 |
< |
printf(" --r_omega g(r, cos(omega))\n"); |
54 |
< |
printf(" --theta_omega g(cos(theta), cos(omega))\n"); |
55 |
< |
printf(" --xyz g(x, y, z)\n"); |
51 |
> |
printf(" --gofr g(r)\n"); |
52 |
> |
printf(" --r_theta g(r, cos(theta))\n"); |
53 |
> |
printf(" --r_omega g(r, cos(omega))\n"); |
54 |
> |
printf(" --theta_omega g(cos(theta), cos(omega))\n"); |
55 |
> |
printf(" --gxyz g(x, y, z)\n"); |
56 |
> |
printf(" --p2 p2 order parameter\n"); |
57 |
|
} |
58 |
|
|
59 |
|
|
83 |
|
args_info->version_given = 0 ; |
84 |
|
args_info->input_given = 0 ; |
85 |
|
args_info->output_given = 0 ; |
86 |
< |
args_info->frame_given = 0 ; |
87 |
< |
args_info->ndistebins_given = 0 ; |
86 |
> |
args_info->step_given = 0 ; |
87 |
> |
args_info->nrbins_given = 0 ; |
88 |
|
args_info->nanglebins_given = 0 ; |
89 |
|
args_info->length_given = 0 ; |
90 |
|
args_info->sele1_given = 0 ; |
91 |
|
args_info->sele2_given = 0 ; |
92 |
+ |
args_info->refsele_given = 0 ; |
93 |
|
args_info->gofr_given = 0 ; |
94 |
|
args_info->r_theta_given = 0 ; |
95 |
|
args_info->r_omega_given = 0 ; |
96 |
|
args_info->theta_omega_given = 0 ; |
97 |
< |
args_info->xyz_given = 0 ; |
97 |
> |
args_info->gxyz_given = 0 ; |
98 |
> |
args_info->p2_given = 0 ; |
99 |
|
#define clear_args() { \ |
100 |
|
args_info->input_arg = NULL; \ |
101 |
|
args_info->output_arg = NULL; \ |
102 |
< |
args_info->frame_arg = 1 ;\ |
103 |
< |
args_info->ndistebins_arg = 50 ;\ |
102 |
> |
args_info->step_arg = 1 ;\ |
103 |
> |
args_info->nrbins_arg = 100 ;\ |
104 |
|
args_info->nanglebins_arg = 50 ;\ |
105 |
|
args_info->sele1_arg = NULL; \ |
106 |
|
args_info->sele2_arg = NULL; \ |
107 |
+ |
args_info->refsele_arg = NULL; \ |
108 |
|
} |
109 |
|
|
110 |
|
clear_args(); |
124 |
|
{ "version", 0, NULL, 'V' }, |
125 |
|
{ "input", 1, NULL, 'i' }, |
126 |
|
{ "output", 1, NULL, 'o' }, |
127 |
< |
{ "frame", 1, NULL, 'n' }, |
128 |
< |
{ "ndistebins", 1, NULL, 'd' }, |
127 |
> |
{ "step", 1, NULL, 'n' }, |
128 |
> |
{ "nrbins", 1, NULL, 'r' }, |
129 |
|
{ "nanglebins", 1, NULL, 'a' }, |
130 |
|
{ "length", 1, NULL, 'l' }, |
131 |
|
{ "sele1", 1, NULL, 0 }, |
132 |
|
{ "sele2", 1, NULL, 0 }, |
133 |
+ |
{ "refsele", 1, NULL, 0 }, |
134 |
|
{ "gofr", 0, NULL, 0 }, |
135 |
|
{ "r_theta", 0, NULL, 0 }, |
136 |
|
{ "r_omega", 0, NULL, 0 }, |
137 |
|
{ "theta_omega", 0, NULL, 0 }, |
138 |
< |
{ "xyz", 0, NULL, 0 }, |
138 |
> |
{ "gxyz", 0, NULL, 0 }, |
139 |
> |
{ "p2", 0, NULL, 0 }, |
140 |
|
{ NULL, 0, NULL, 0 } |
141 |
|
}; |
142 |
|
|
143 |
|
stop_char = 0; |
144 |
< |
c = getopt_long (argc, argv, "hVi:o:n:d:a:l:", long_options, &option_index); |
144 |
> |
c = getopt_long (argc, argv, "hVi:o:n:r:a:l:", long_options, &option_index); |
145 |
|
|
146 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
147 |
|
|
179 |
|
args_info->output_arg = gengetopt_strdup (optarg); |
180 |
|
break; |
181 |
|
|
182 |
< |
case 'n': /* print every n frame. */ |
183 |
< |
if (args_info->frame_given) |
182 |
> |
case 'n': /* process every n frame. */ |
183 |
> |
if (args_info->step_given) |
184 |
|
{ |
185 |
< |
fprintf (stderr, "%s: `--frame' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
185 |
> |
fprintf (stderr, "%s: `--step' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
186 |
|
clear_args (); |
187 |
|
exit (EXIT_FAILURE); |
188 |
|
} |
189 |
< |
args_info->frame_given = 1; |
190 |
< |
args_info->frame_arg = strtol (optarg,&stop_char,0); |
189 |
> |
args_info->step_given = 1; |
190 |
> |
args_info->step_arg = strtol (optarg,&stop_char,0); |
191 |
|
break; |
192 |
|
|
193 |
< |
case 'd': /* number of bins for distance. */ |
194 |
< |
if (args_info->ndistebins_given) |
193 |
> |
case 'r': /* number of bins for distance. */ |
194 |
> |
if (args_info->nrbins_given) |
195 |
|
{ |
196 |
< |
fprintf (stderr, "%s: `--ndistebins' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
196 |
> |
fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
197 |
|
clear_args (); |
198 |
|
exit (EXIT_FAILURE); |
199 |
|
} |
200 |
< |
args_info->ndistebins_given = 1; |
201 |
< |
args_info->ndistebins_arg = strtol (optarg,&stop_char,0); |
200 |
> |
args_info->nrbins_given = 1; |
201 |
> |
args_info->nrbins_arg = strtol (optarg,&stop_char,0); |
202 |
|
break; |
203 |
|
|
204 |
|
case 'a': /* number of bins for cos(angle). */ |
212 |
|
args_info->nanglebins_arg = strtol (optarg,&stop_char,0); |
213 |
|
break; |
214 |
|
|
215 |
< |
case 'l': /* maximum length. */ |
215 |
> |
case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ |
216 |
|
if (args_info->length_given) |
217 |
|
{ |
218 |
|
fprintf (stderr, "%s: `--length' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
253 |
|
break; |
254 |
|
} |
255 |
|
|
256 |
+ |
/* select reference (use and only use with --gxyz). */ |
257 |
+ |
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
258 |
+ |
{ |
259 |
+ |
if (args_info->refsele_given) |
260 |
+ |
{ |
261 |
+ |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
262 |
+ |
clear_args (); |
263 |
+ |
exit (EXIT_FAILURE); |
264 |
+ |
} |
265 |
+ |
args_info->refsele_given = 1; |
266 |
+ |
args_info->refsele_arg = gengetopt_strdup (optarg); |
267 |
+ |
break; |
268 |
+ |
} |
269 |
+ |
|
270 |
|
/* g(r). */ |
271 |
|
else if (strcmp (long_options[option_index].name, "gofr") == 0) |
272 |
|
{ |
324 |
|
} |
325 |
|
|
326 |
|
/* g(x, y, z). */ |
327 |
< |
else if (strcmp (long_options[option_index].name, "xyz") == 0) |
327 |
> |
else if (strcmp (long_options[option_index].name, "gxyz") == 0) |
328 |
|
{ |
329 |
< |
if (args_info->xyz_given) |
329 |
> |
if (args_info->gxyz_given) |
330 |
|
{ |
331 |
< |
fprintf (stderr, "%s: `--xyz' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
331 |
> |
fprintf (stderr, "%s: `--gxyz' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
332 |
|
clear_args (); |
333 |
|
exit (EXIT_FAILURE); |
334 |
|
} |
335 |
< |
args_info->xyz_given = 1; staticProps_group_counter += 1; |
335 |
> |
args_info->gxyz_given = 1; staticProps_group_counter += 1; |
336 |
|
|
337 |
|
break; |
338 |
|
} |
339 |
|
|
340 |
+ |
/* p2 order parameter. */ |
341 |
+ |
else if (strcmp (long_options[option_index].name, "p2") == 0) |
342 |
+ |
{ |
343 |
+ |
if (args_info->p2_given) |
344 |
+ |
{ |
345 |
+ |
fprintf (stderr, "%s: `--p2' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
346 |
+ |
clear_args (); |
347 |
+ |
exit (EXIT_FAILURE); |
348 |
+ |
} |
349 |
+ |
args_info->p2_given = 1; staticProps_group_counter += 1; |
350 |
+ |
|
351 |
+ |
break; |
352 |
+ |
} |
353 |
+ |
|
354 |
|
|
355 |
|
case '?': /* Invalid option. */ |
356 |
|
/* `getopt_long' already printed an error message. */ |
374 |
|
fprintf (stderr, "%s: '--input' ('-i') option required\n", CMDLINE_PARSER_PACKAGE); |
375 |
|
missing_required_options = 1; |
376 |
|
} |
342 |
– |
if (! args_info->length_given) |
343 |
– |
{ |
344 |
– |
fprintf (stderr, "%s: '--length' ('-l') option required\n", CMDLINE_PARSER_PACKAGE); |
345 |
– |
missing_required_options = 1; |
346 |
– |
} |
377 |
|
if ( missing_required_options ) |
378 |
|
exit (EXIT_FAILURE); |
379 |
|
|