--- trunk/src/applications/dump2Xyz/Dump2XYZCmd.c 2005/04/15 22:04:00 507 +++ trunk/src/applications/dump2Xyz/Dump2XYZCmd.c 2005/05/26 22:45:00 543 @@ -1,7 +1,7 @@ /* File autogenerated by gengetopt version 2.11 generated with the following command: - /home/maul/gezelter/tim/bin/gengetopt -F Dump2XYZCmd + /home/maul/gezelter/tim/bin/gengetopt -i Dump2XYZ.ggo -F Dump2XYZCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -33,7 +33,7 @@ cmdline_parser_print_help (void) { cmdline_parser_print_version (); printf("\n" - "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); + "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); printf("\n"); printf(" -h, --help Print help and exit\n"); printf(" -V, --version Print version and exit\n"); @@ -45,6 +45,7 @@ cmdline_parser_print_help (void) printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); + printf(" -b, --basetype using base atom type (default=off)\n"); printf(" -s, --selection=selection script general selection syntax\n"); printf(" --originsele=selection script select origin\n"); printf(" --refsele=selection script select reference\n"); @@ -84,28 +85,30 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->zconstraint_given = 0 ; args_info->rigidbody_given = 0 ; args_info->watertype_given = 0 ; + args_info->basetype_given = 0 ; args_info->selection_given = 0 ; args_info->originsele_given = 0 ; args_info->refsele_given = 0 ; args_info->repeatX_given = 0 ; args_info->repeatY_given = 0 ; args_info->repeatZ_given = 0 ; -#define clear_args() { \ - args_info->input_arg = NULL; \ - args_info->output_arg = NULL; \ - args_info->frame_arg = 1 ; \ - args_info->water_flag = 0; \ - args_info->periodicBox_flag = 0; \ - args_info->zconstraint_flag = 0; \ - args_info->rigidbody_flag = 0; \ - args_info->watertype_flag = 1; \ - args_info->selection_arg = NULL; \ - args_info->originsele_arg = NULL; \ - args_info->refsele_arg = NULL; \ - args_info->repeatX_arg = 0 ; \ - args_info->repeatY_arg = 0 ; \ - args_info->repeatZ_arg = 0 ; \ - } +#define clear_args() { \ + args_info->input_arg = NULL; \ + args_info->output_arg = NULL; \ + args_info->frame_arg = 1 ;\ + args_info->water_flag = 0;\ + args_info->periodicBox_flag = 0;\ + args_info->zconstraint_flag = 0;\ + args_info->rigidbody_flag = 0;\ + args_info->watertype_flag = 1;\ + args_info->basetype_flag = 0;\ + args_info->selection_arg = NULL; \ + args_info->originsele_arg = NULL; \ + args_info->refsele_arg = NULL; \ + args_info->repeatX_arg = 0 ;\ + args_info->repeatY_arg = 0 ;\ + args_info->repeatZ_arg = 0 ;\ +} clear_args(); @@ -130,6 +133,7 @@ cmdline_parser (int argc, char * const *argv, struct g { "zconstraint", 0, NULL, 'z' }, { "rigidbody", 0, NULL, 'r' }, { "watertype", 0, NULL, 't' }, + { "basetype", 0, NULL, 'b' }, { "selection", 1, NULL, 's' }, { "originsele", 1, NULL, 0 }, { "refsele", 1, NULL, 0 }, @@ -140,7 +144,7 @@ cmdline_parser (int argc, char * const *argv, struct g }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:o:n:wmzrts:", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:wmzrtbs:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -244,6 +248,17 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->watertype_flag = !(args_info->watertype_flag); break; + case 'b': /* using base atom type. */ + if (args_info->basetype_given) + { + fprintf (stderr, "%s: `--basetype' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->basetype_given = 1; + args_info->basetype_flag = !(args_info->basetype_flag); + break; + case 's': /* general selection syntax. */ if (args_info->selection_given) { @@ -259,73 +274,73 @@ cmdline_parser (int argc, char * const *argv, struct g case 0: /* Long option with no short option */ /* select origin. */ if (strcmp (long_options[option_index].name, "originsele") == 0) - { - if (args_info->originsele_given) - { - fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->originsele_given = 1; - args_info->originsele_arg = gengetopt_strdup (optarg); - break; - } + { + if (args_info->originsele_given) + { + fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->originsele_given = 1; + args_info->originsele_arg = gengetopt_strdup (optarg); + break; + } /* select reference. */ else if (strcmp (long_options[option_index].name, "refsele") == 0) - { - if (args_info->refsele_given) - { - fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->refsele_given = 1; - args_info->refsele_arg = gengetopt_strdup (optarg); - break; - } + { + if (args_info->refsele_given) + { + fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->refsele_given = 1; + args_info->refsele_arg = gengetopt_strdup (optarg); + break; + } /* The number of images to repeat in the x direction. */ else if (strcmp (long_options[option_index].name, "repeatX") == 0) - { - if (args_info->repeatX_given) - { - fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->repeatX_given = 1; - args_info->repeatX_arg = strtol (optarg,&stop_char,0); - break; - } + { + if (args_info->repeatX_given) + { + fprintf (stderr, "%s: `--repeatX' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->repeatX_given = 1; + args_info->repeatX_arg = strtol (optarg,&stop_char,0); + break; + } /* The number of images to repeat in the y direction. */ else if (strcmp (long_options[option_index].name, "repeatY") == 0) - { - if (args_info->repeatY_given) - { - fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->repeatY_given = 1; - args_info->repeatY_arg = strtol (optarg,&stop_char,0); - break; - } + { + if (args_info->repeatY_given) + { + fprintf (stderr, "%s: `--repeatY' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->repeatY_given = 1; + args_info->repeatY_arg = strtol (optarg,&stop_char,0); + break; + } /* The number of images to repeat in the z direction. */ else if (strcmp (long_options[option_index].name, "repeatZ") == 0) - { - if (args_info->repeatZ_given) - { - fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->repeatZ_given = 1; - args_info->repeatZ_arg = strtol (optarg,&stop_char,0); - break; - } + { + if (args_info->repeatZ_given) + { + fprintf (stderr, "%s: `--repeatZ' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->repeatZ_given = 1; + args_info->repeatZ_arg = strtol (optarg,&stop_char,0); + break; + } case '?': /* Invalid option. */