| 1 |
|
/* |
| 2 |
|
File autogenerated by gengetopt version 2.11 |
| 3 |
|
generated with the following command: |
| 4 |
< |
/home/maul/gezelter/tim/bin/gengetopt -F Dump2XYZCmd |
| 4 |
> |
/home/maul/gezelter/tim/bin/gengetopt -i Dump2XYZ.ggo -F Dump2XYZCmd |
| 5 |
|
|
| 6 |
|
The developers of gengetopt consider the fixed text that goes in all |
| 7 |
|
gengetopt output files to be in the public domain: |
| 33 |
|
{ |
| 34 |
|
cmdline_parser_print_version (); |
| 35 |
|
printf("\n" |
| 36 |
< |
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
| 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"); |
| 45 |
|
printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); |
| 46 |
|
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); |
| 47 |
|
printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); |
| 48 |
+ |
printf(" -b, --basetype using base atom type (default=off)\n"); |
| 49 |
|
printf(" -s, --selection=selection script general selection syntax\n"); |
| 50 |
|
printf(" --originsele=selection script select origin\n"); |
| 51 |
|
printf(" --refsele=selection script select reference\n"); |
| 85 |
|
args_info->zconstraint_given = 0 ; |
| 86 |
|
args_info->rigidbody_given = 0 ; |
| 87 |
|
args_info->watertype_given = 0 ; |
| 88 |
+ |
args_info->basetype_given = 0 ; |
| 89 |
|
args_info->selection_given = 0 ; |
| 90 |
|
args_info->originsele_given = 0 ; |
| 91 |
|
args_info->refsele_given = 0 ; |
| 92 |
|
args_info->repeatX_given = 0 ; |
| 93 |
|
args_info->repeatY_given = 0 ; |
| 94 |
|
args_info->repeatZ_given = 0 ; |
| 95 |
< |
#define clear_args() { \ |
| 96 |
< |
args_info->input_arg = NULL; \ |
| 97 |
< |
args_info->output_arg = NULL; \ |
| 98 |
< |
args_info->frame_arg = 1 ; \ |
| 99 |
< |
args_info->water_flag = 0; \ |
| 100 |
< |
args_info->periodicBox_flag = 0; \ |
| 101 |
< |
args_info->zconstraint_flag = 0; \ |
| 102 |
< |
args_info->rigidbody_flag = 0; \ |
| 103 |
< |
args_info->watertype_flag = 1; \ |
| 104 |
< |
args_info->selection_arg = NULL; \ |
| 105 |
< |
args_info->originsele_arg = NULL; \ |
| 106 |
< |
args_info->refsele_arg = NULL; \ |
| 107 |
< |
args_info->repeatX_arg = 0 ; \ |
| 108 |
< |
args_info->repeatY_arg = 0 ; \ |
| 109 |
< |
args_info->repeatZ_arg = 0 ; \ |
| 110 |
< |
} |
| 95 |
> |
#define clear_args() { \ |
| 96 |
> |
args_info->input_arg = NULL; \ |
| 97 |
> |
args_info->output_arg = NULL; \ |
| 98 |
> |
args_info->frame_arg = 1 ;\ |
| 99 |
> |
args_info->water_flag = 0;\ |
| 100 |
> |
args_info->periodicBox_flag = 0;\ |
| 101 |
> |
args_info->zconstraint_flag = 0;\ |
| 102 |
> |
args_info->rigidbody_flag = 0;\ |
| 103 |
> |
args_info->watertype_flag = 1;\ |
| 104 |
> |
args_info->basetype_flag = 0;\ |
| 105 |
> |
args_info->selection_arg = NULL; \ |
| 106 |
> |
args_info->originsele_arg = NULL; \ |
| 107 |
> |
args_info->refsele_arg = NULL; \ |
| 108 |
> |
args_info->repeatX_arg = 0 ;\ |
| 109 |
> |
args_info->repeatY_arg = 0 ;\ |
| 110 |
> |
args_info->repeatZ_arg = 0 ;\ |
| 111 |
> |
} |
| 112 |
|
|
| 113 |
|
clear_args(); |
| 114 |
|
|
| 133 |
|
{ "zconstraint", 0, NULL, 'z' }, |
| 134 |
|
{ "rigidbody", 0, NULL, 'r' }, |
| 135 |
|
{ "watertype", 0, NULL, 't' }, |
| 136 |
+ |
{ "basetype", 0, NULL, 'b' }, |
| 137 |
|
{ "selection", 1, NULL, 's' }, |
| 138 |
|
{ "originsele", 1, NULL, 0 }, |
| 139 |
|
{ "refsele", 1, NULL, 0 }, |
| 144 |
|
}; |
| 145 |
|
|
| 146 |
|
stop_char = 0; |
| 147 |
< |
c = getopt_long (argc, argv, "hVi:o:n:wmzrts:", long_options, &option_index); |
| 147 |
> |
c = getopt_long (argc, argv, "hVi:o:n:wmzrtbs:", long_options, &option_index); |
| 148 |
|
|
| 149 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
| 150 |
|
|
| 248 |
|
args_info->watertype_flag = !(args_info->watertype_flag); |
| 249 |
|
break; |
| 250 |
|
|
| 251 |
+ |
case 'b': /* using base atom type. */ |
| 252 |
+ |
if (args_info->basetype_given) |
| 253 |
+ |
{ |
| 254 |
+ |
fprintf (stderr, "%s: `--basetype' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 255 |
+ |
clear_args (); |
| 256 |
+ |
exit (EXIT_FAILURE); |
| 257 |
+ |
} |
| 258 |
+ |
args_info->basetype_given = 1; |
| 259 |
+ |
args_info->basetype_flag = !(args_info->basetype_flag); |
| 260 |
+ |
break; |
| 261 |
+ |
|
| 262 |
|
case 's': /* general selection syntax. */ |
| 263 |
|
if (args_info->selection_given) |
| 264 |
|
{ |
| 274 |
|
case 0: /* Long option with no short option */ |
| 275 |
|
/* select origin. */ |
| 276 |
|
if (strcmp (long_options[option_index].name, "originsele") == 0) |
| 277 |
< |
{ |
| 278 |
< |
if (args_info->originsele_given) |
| 279 |
< |
{ |
| 280 |
< |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 281 |
< |
clear_args (); |
| 282 |
< |
exit (EXIT_FAILURE); |
| 283 |
< |
} |
| 284 |
< |
args_info->originsele_given = 1; |
| 285 |
< |
args_info->originsele_arg = gengetopt_strdup (optarg); |
| 286 |
< |
break; |
| 287 |
< |
} |
| 277 |
> |
{ |
| 278 |
> |
if (args_info->originsele_given) |
| 279 |
> |
{ |
| 280 |
> |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 281 |
> |
clear_args (); |
| 282 |
> |
exit (EXIT_FAILURE); |
| 283 |
> |
} |
| 284 |
> |
args_info->originsele_given = 1; |
| 285 |
> |
args_info->originsele_arg = gengetopt_strdup (optarg); |
| 286 |
> |
break; |
| 287 |
> |
} |
| 288 |
|
|
| 289 |
|
/* select reference. */ |
| 290 |
|
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
| 291 |
< |
{ |
| 292 |
< |
if (args_info->refsele_given) |
| 293 |
< |
{ |
| 294 |
< |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 295 |
< |
clear_args (); |
| 296 |
< |
exit (EXIT_FAILURE); |
| 297 |
< |
} |
| 298 |
< |
args_info->refsele_given = 1; |
| 299 |
< |
args_info->refsele_arg = gengetopt_strdup (optarg); |
| 300 |
< |
break; |
| 301 |
< |
} |
| 291 |
> |
{ |
| 292 |
> |
if (args_info->refsele_given) |
| 293 |
> |
{ |
| 294 |
> |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 295 |
> |
clear_args (); |
| 296 |
> |
exit (EXIT_FAILURE); |
| 297 |
> |
} |
| 298 |
> |
args_info->refsele_given = 1; |
| 299 |
> |
args_info->refsele_arg = gengetopt_strdup (optarg); |
| 300 |
> |
break; |
| 301 |
> |
} |
| 302 |
|
|
| 303 |
|
/* The number of images to repeat in the x direction. */ |
| 304 |
|
else if (strcmp (long_options[option_index].name, "repeatX") == 0) |
| 305 |
< |
{ |
| 306 |
< |
if (args_info->repeatX_given) |
| 307 |
< |
{ |
| 308 |
< |
fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 309 |
< |
clear_args (); |
| 310 |
< |
exit (EXIT_FAILURE); |
| 311 |
< |
} |
| 312 |
< |
args_info->repeatX_given = 1; |
| 313 |
< |
args_info->repeatX_arg = strtol (optarg,&stop_char,0); |
| 314 |
< |
break; |
| 315 |
< |
} |
| 305 |
> |
{ |
| 306 |
> |
if (args_info->repeatX_given) |
| 307 |
> |
{ |
| 308 |
> |
fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 309 |
> |
clear_args (); |
| 310 |
> |
exit (EXIT_FAILURE); |
| 311 |
> |
} |
| 312 |
> |
args_info->repeatX_given = 1; |
| 313 |
> |
args_info->repeatX_arg = strtol (optarg,&stop_char,0); |
| 314 |
> |
break; |
| 315 |
> |
} |
| 316 |
|
|
| 317 |
|
/* The number of images to repeat in the y direction. */ |
| 318 |
|
else if (strcmp (long_options[option_index].name, "repeatY") == 0) |
| 319 |
< |
{ |
| 320 |
< |
if (args_info->repeatY_given) |
| 321 |
< |
{ |
| 322 |
< |
fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 323 |
< |
clear_args (); |
| 324 |
< |
exit (EXIT_FAILURE); |
| 325 |
< |
} |
| 326 |
< |
args_info->repeatY_given = 1; |
| 327 |
< |
args_info->repeatY_arg = strtol (optarg,&stop_char,0); |
| 328 |
< |
break; |
| 329 |
< |
} |
| 319 |
> |
{ |
| 320 |
> |
if (args_info->repeatY_given) |
| 321 |
> |
{ |
| 322 |
> |
fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 323 |
> |
clear_args (); |
| 324 |
> |
exit (EXIT_FAILURE); |
| 325 |
> |
} |
| 326 |
> |
args_info->repeatY_given = 1; |
| 327 |
> |
args_info->repeatY_arg = strtol (optarg,&stop_char,0); |
| 328 |
> |
break; |
| 329 |
> |
} |
| 330 |
|
|
| 331 |
|
/* The number of images to repeat in the z direction. */ |
| 332 |
|
else if (strcmp (long_options[option_index].name, "repeatZ") == 0) |
| 333 |
< |
{ |
| 334 |
< |
if (args_info->repeatZ_given) |
| 335 |
< |
{ |
| 336 |
< |
fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 337 |
< |
clear_args (); |
| 338 |
< |
exit (EXIT_FAILURE); |
| 339 |
< |
} |
| 340 |
< |
args_info->repeatZ_given = 1; |
| 341 |
< |
args_info->repeatZ_arg = strtol (optarg,&stop_char,0); |
| 342 |
< |
break; |
| 343 |
< |
} |
| 333 |
> |
{ |
| 334 |
> |
if (args_info->repeatZ_given) |
| 335 |
> |
{ |
| 336 |
> |
fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 337 |
> |
clear_args (); |
| 338 |
> |
exit (EXIT_FAILURE); |
| 339 |
> |
} |
| 340 |
> |
args_info->repeatZ_given = 1; |
| 341 |
> |
args_info->repeatZ_arg = strtol (optarg,&stop_char,0); |
| 342 |
> |
break; |
| 343 |
> |
} |
| 344 |
|
|
| 345 |
|
|
| 346 |
|
case '?': /* Invalid option. */ |