--- trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2007/01/03 20:47:00 1112 +++ branches/development/src/applications/dynamicProps/DynamicPropsCmd.c 2010/07/09 23:08:25 1465 @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.15 + File autogenerated by gengetopt version 2.14 generated with the following command: - gengetopt -u -i DynamicProps.ggo -F DynamicPropsCmd + gengetopt -i DynamicProps.ggo -F DynamicPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -51,6 +51,8 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; + args_info->drcorr_given = 0 ; + args_info->helfandEcorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -79,7 +81,7 @@ cmdline_parser_print_help (void) cmdline_parser_print_help (void) { cmdline_parser_print_version (); - printf("\nUsage: DynamicProps [OPTIONS]... [FILES]...\n\n"); + printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); printf("%s\n"," -h, --help Print help and exit"); printf("%s\n"," -V, --version Print version and exit"); printf("%s\n"," -i, --input=filename input dump file"); @@ -94,6 +96,8 @@ cmdline_parser_print_help (void) printf("%s\n"," -l, --lcorr Lengendre correlation function"); printf("%s\n"," --r_rcorr Radial rmsd"); printf("%s\n"," --thetacorr Angular rmsd"); + printf("%s\n"," --drcorr Directional rmsd for particles with unit \n vectors"); + printf("%s\n"," --helfandEcorr Helfand moment for thermal conductvity"); } @@ -102,16 +106,12 @@ cmdline_parser_init (struct gengetopt_args_info *args_ { clear_given (args_info); clear_args (args_info); - - args_info->inputs = NULL; - args_info->inputs_num = 0; } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { - unsigned int i; if (args_info->input_arg) { free (args_info->input_arg); /* free previous argument */ @@ -157,12 +157,6 @@ cmdline_parser_release (struct gengetopt_args_info *ar free (args_info->order_orig); /* free previous argument */ args_info->order_orig = 0; } - - for (i = 0; i < args_info->inputs_num; ++i) - free (args_info->inputs [i]); - - if (args_info->inputs_num) - free (args_info->inputs); clear_given (args_info); } @@ -240,6 +234,12 @@ cmdline_parser_file_save(const char *filename, struct if (args_info->thetacorr_given) { fprintf(outfile, "%s\n", "thetacorr"); } + if (args_info->drcorr_given) { + fprintf(outfile, "%s\n", "drcorr"); + } + if (args_info->helfandEcorr_given) { + fprintf(outfile, "%s\n", "helfandEcorr"); + } fclose (outfile); @@ -285,6 +285,8 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; + args_info->drcorr_given = 0 ; + args_info->helfandEcorr_given = 0 ; args_info->dynamicProps_group_counter = 0; } @@ -385,6 +387,8 @@ cmdline_parser_internal (int argc, char * const *argv, { "lcorr", 0, NULL, 'l' }, { "r_rcorr", 0, NULL, 0 }, { "thetacorr", 0, NULL, 0 }, + { "drcorr", 0, NULL, 0 }, + { "helfandEcorr", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -553,11 +557,7 @@ cmdline_parser_internal (int argc, char * const *argv, continue; local_args_info.order_given = 1; args_info->order_given = 1; - args_info->order_arg = strtol (optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); - goto failure; - } + args_info->order_arg = strtol (optarg,&stop_char,0); if (args_info->order_orig) free (args_info->order_orig); /* free previous string */ args_info->order_orig = gengetopt_strdup (optarg); @@ -596,6 +596,40 @@ cmdline_parser_internal (int argc, char * const *argv, args_info->dynamicProps_group_counter += 1; break; } + /* Directional rmsd for particles with unit vectors. */ + else if (strcmp (long_options[option_index].name, "drcorr") == 0) + { + if (local_args_info.drcorr_given) + { + fprintf (stderr, "%s: `--drcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->drcorr_given && ! override) + continue; + local_args_info.drcorr_given = 1; + args_info->drcorr_given = 1; + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + break; + } + /* Helfand moment for thermal conductvity. */ + else if (strcmp (long_options[option_index].name, "helfandEcorr") == 0) + { + if (local_args_info.helfandEcorr_given) + { + fprintf (stderr, "%s: `--helfandEcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->helfandEcorr_given && ! override) + continue; + local_args_info.helfandEcorr_given = 1; + args_info->helfandEcorr_given = 1; + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + break; + } break; case '?': /* Invalid option. */ @@ -626,17 +660,6 @@ cmdline_parser_internal (int argc, char * const *argv, if ( error ) return (EXIT_FAILURE); - if (optind < argc) - { - int i = 0 ; - - args_info->inputs_num = argc - optind ; - args_info->inputs = - (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; - while (optind < argc) - args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ; - } - return 0; failure: