--- trunk/src/applications/staticProps/StaticPropsCmd.c 2005/02/10 18:14:03 310 +++ trunk/src/applications/staticProps/StaticPropsCmd.c 2005/04/15 22:04:00 507 @@ -1,7 +1,7 @@ /* File autogenerated by gengetopt version 2.11 generated with the following command: - /home/maul/gezelter/tim/bin/gengetopt -F staticPropsCmd + /home/maul/gezelter/tim/bin/gengetopt -F StaticPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -20,7 +20,7 @@ #include "getopt.h" -#include "staticPropsCmd.h" +#include "StaticPropsCmd.h" void cmdline_parser_print_version (void) @@ -33,25 +33,26 @@ 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"); - printf(" -i, --input=filename input dump file\n"); - printf(" -o, --output=filename output file name\n"); - printf(" -n, --frame=INT print every n frame (default=`1')\n"); - printf(" -d, --ndistebins=INT number of bins for distance (default=`50')\n"); - printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=`50')\n"); - printf(" -l, --length=DOUBLE maximum length\n"); - printf(" --sele1=selection script select first stuntdouble set\n"); - printf(" --sele2=selection script select second stuntdouble set\n"); + printf(" -h, --help Print help and exit\n"); + printf(" -V, --version Print version and exit\n"); + printf(" -i, --input=filename input dump file\n"); + printf(" -o, --output=filename output file name\n"); + printf(" -n, --step=INT process every n frame (default=`1')\n"); + printf(" -r, --nrbins=INT number of bins for distance (default=`100')\n"); + printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=\n `50')\n"); + printf(" -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest \n length of first frame)\n"); + printf(" --sele1=selection script select first stuntdouble set\n"); + printf(" --sele2=selection script select second stuntdouble set\n"); + printf(" --refsele=selection script select reference (use and only use with \n --gxyz)\n"); printf("\n"); printf(" Group: staticProps an option of this group is required\n"); - printf(" --gofr g(r)\n"); - printf(" --r_theta g(r, cos(theta))\n"); - printf(" --r_omega g(r, cos(omega))\n"); - printf(" --theta_omega g(cos(theta), cos(omega))\n"); - printf(" --xyz g(x, y, z)\n"); + printf(" --gofr g(r)\n"); + printf(" --r_theta g(r, cos(theta))\n"); + printf(" --r_omega g(r, cos(omega))\n"); + printf(" --theta_omega g(cos(theta), cos(omega))\n"); + printf(" --gxyz g(x, y, z)\n"); } @@ -81,26 +82,28 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->version_given = 0 ; args_info->input_given = 0 ; args_info->output_given = 0 ; - args_info->frame_given = 0 ; - args_info->ndistebins_given = 0 ; + args_info->step_given = 0 ; + args_info->nrbins_given = 0 ; args_info->nanglebins_given = 0 ; args_info->length_given = 0 ; args_info->sele1_given = 0 ; args_info->sele2_given = 0 ; + args_info->refsele_given = 0 ; args_info->gofr_given = 0 ; args_info->r_theta_given = 0 ; args_info->r_omega_given = 0 ; args_info->theta_omega_given = 0 ; - args_info->xyz_given = 0 ; -#define clear_args() { \ - args_info->input_arg = NULL; \ - args_info->output_arg = NULL; \ - args_info->frame_arg = 1 ;\ - args_info->ndistebins_arg = 50 ;\ - args_info->nanglebins_arg = 50 ;\ - args_info->sele1_arg = NULL; \ - args_info->sele2_arg = NULL; \ -} + args_info->gxyz_given = 0 ; +#define clear_args() { \ + args_info->input_arg = NULL; \ + args_info->output_arg = NULL; \ + args_info->step_arg = 1 ; \ + args_info->nrbins_arg = 100 ; \ + args_info->nanglebins_arg = 50 ; \ + args_info->sele1_arg = NULL; \ + args_info->sele2_arg = NULL; \ + args_info->refsele_arg = NULL; \ + } clear_args(); @@ -119,22 +122,23 @@ cmdline_parser (int argc, char * const *argv, struct g { "version", 0, NULL, 'V' }, { "input", 1, NULL, 'i' }, { "output", 1, NULL, 'o' }, - { "frame", 1, NULL, 'n' }, - { "ndistebins", 1, NULL, 'd' }, + { "step", 1, NULL, 'n' }, + { "nrbins", 1, NULL, 'r' }, { "nanglebins", 1, NULL, 'a' }, { "length", 1, NULL, 'l' }, { "sele1", 1, NULL, 0 }, { "sele2", 1, NULL, 0 }, + { "refsele", 1, NULL, 0 }, { "gofr", 0, NULL, 0 }, { "r_theta", 0, NULL, 0 }, { "r_omega", 0, NULL, 0 }, { "theta_omega", 0, NULL, 0 }, - { "xyz", 0, NULL, 0 }, + { "gxyz", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:o:n:d:a:l:", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:r:a:l:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -172,26 +176,26 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->output_arg = gengetopt_strdup (optarg); break; - case 'n': /* print every n frame. */ - if (args_info->frame_given) + case 'n': /* process every n frame. */ + if (args_info->step_given) { - fprintf (stderr, "%s: `--frame' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--step' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); exit (EXIT_FAILURE); } - args_info->frame_given = 1; - args_info->frame_arg = strtol (optarg,&stop_char,0); + args_info->step_given = 1; + args_info->step_arg = strtol (optarg,&stop_char,0); break; - case 'd': /* number of bins for distance. */ - if (args_info->ndistebins_given) + case 'r': /* number of bins for distance. */ + if (args_info->nrbins_given) { - fprintf (stderr, "%s: `--ndistebins' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); exit (EXIT_FAILURE); } - args_info->ndistebins_given = 1; - args_info->ndistebins_arg = strtol (optarg,&stop_char,0); + args_info->nrbins_given = 1; + args_info->nrbins_arg = strtol (optarg,&stop_char,0); break; case 'a': /* number of bins for cos(angle). */ @@ -205,7 +209,7 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->nanglebins_arg = strtol (optarg,&stop_char,0); break; - case 'l': /* maximum length. */ + case 'l': /* maximum length (Defaults to 1/2 smallest length of first frame). */ if (args_info->length_given) { fprintf (stderr, "%s: `--length' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE); @@ -220,101 +224,115 @@ cmdline_parser (int argc, char * const *argv, struct g case 0: /* Long option with no short option */ /* select first stuntdouble set. */ if (strcmp (long_options[option_index].name, "sele1") == 0) - { - if (args_info->sele1_given) - { - fprintf (stderr, "%s: `--sele1' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->sele1_given = 1; - args_info->sele1_arg = gengetopt_strdup (optarg); - break; - } + { + if (args_info->sele1_given) + { + fprintf (stderr, "%s: `--sele1' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->sele1_given = 1; + args_info->sele1_arg = gengetopt_strdup (optarg); + break; + } /* select second stuntdouble set. */ else if (strcmp (long_options[option_index].name, "sele2") == 0) - { - if (args_info->sele2_given) - { - fprintf (stderr, "%s: `--sele2' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->sele2_given = 1; - args_info->sele2_arg = gengetopt_strdup (optarg); - break; - } + { + if (args_info->sele2_given) + { + fprintf (stderr, "%s: `--sele2' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->sele2_given = 1; + args_info->sele2_arg = gengetopt_strdup (optarg); + break; + } + /* select reference (use and only use with --gxyz). */ + 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; + } + /* g(r). */ else if (strcmp (long_options[option_index].name, "gofr") == 0) - { - if (args_info->gofr_given) - { - fprintf (stderr, "%s: `--gofr' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->gofr_given = 1; staticProps_group_counter += 1; + { + if (args_info->gofr_given) + { + fprintf (stderr, "%s: `--gofr' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->gofr_given = 1; staticProps_group_counter += 1; - break; - } + break; + } /* g(r, cos(theta)). */ else if (strcmp (long_options[option_index].name, "r_theta") == 0) - { - if (args_info->r_theta_given) - { - fprintf (stderr, "%s: `--r_theta' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->r_theta_given = 1; staticProps_group_counter += 1; + { + if (args_info->r_theta_given) + { + fprintf (stderr, "%s: `--r_theta' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->r_theta_given = 1; staticProps_group_counter += 1; - break; - } + break; + } /* g(r, cos(omega)). */ else if (strcmp (long_options[option_index].name, "r_omega") == 0) - { - if (args_info->r_omega_given) - { - fprintf (stderr, "%s: `--r_omega' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->r_omega_given = 1; staticProps_group_counter += 1; + { + if (args_info->r_omega_given) + { + fprintf (stderr, "%s: `--r_omega' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->r_omega_given = 1; staticProps_group_counter += 1; - break; - } + break; + } /* g(cos(theta), cos(omega)). */ else if (strcmp (long_options[option_index].name, "theta_omega") == 0) - { - if (args_info->theta_omega_given) - { - fprintf (stderr, "%s: `--theta_omega' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->theta_omega_given = 1; staticProps_group_counter += 1; + { + if (args_info->theta_omega_given) + { + fprintf (stderr, "%s: `--theta_omega' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->theta_omega_given = 1; staticProps_group_counter += 1; - break; - } + break; + } /* g(x, y, z). */ - else if (strcmp (long_options[option_index].name, "xyz") == 0) - { - if (args_info->xyz_given) - { - fprintf (stderr, "%s: `--xyz' option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->xyz_given = 1; staticProps_group_counter += 1; + else if (strcmp (long_options[option_index].name, "gxyz") == 0) + { + if (args_info->gxyz_given) + { + fprintf (stderr, "%s: `--gxyz' option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->gxyz_given = 1; staticProps_group_counter += 1; - break; - } + break; + } case '?': /* Invalid option. */ @@ -339,11 +357,6 @@ cmdline_parser (int argc, char * const *argv, struct g fprintf (stderr, "%s: '--input' ('-i') option required\n", CMDLINE_PARSER_PACKAGE); missing_required_options = 1; } - if (! args_info->length_given) - { - fprintf (stderr, "%s: '--length' ('-l') option required\n", CMDLINE_PARSER_PACKAGE); - missing_required_options = 1; - } if ( missing_required_options ) exit (EXIT_FAILURE);