--- trunk/src/applications/staticProps/StaticPropsCmd.cpp 2014/08/13 20:42:43 2015 +++ trunk/src/applications/staticProps/StaticPropsCmd.cpp 2014/10/31 18:40:40 2031 @@ -1,7 +1,7 @@ /* File autogenerated by gengetopt version 2.22.4 generated with the following command: - gengetopt --file-name=StaticPropsCmd --unamed-opts + gengetopt -i StaticProps.ggo -F StaticPropsCmd -c cpp The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -21,17 +21,13 @@ #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif -#ifdef WIN32 -#include "utils/wingetopt.h" -#else #include -#endif #include "StaticPropsCmd.h" const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]..."; +const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]..."; const char *gengetopt_args_info_description = ""; @@ -97,6 +93,7 @@ const char *gengetopt_args_info_help[] = { " --rnemdrt shell and angle-resolved RNEMD statistics \n (temperature, density, angular velocity)", " --nitrile electrostatic potential to frequency map based \n on the Cho nitrile fits", " -m, --multipole average multipole moments contained within \n cutoff spheres as a function of radius", + " --surfDiffusion X, Y, and R (surface diffusion if Z exposed and \n bulk immobile) diffusion", 0 }; @@ -184,6 +181,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->rnemdrt_given = 0 ; args_info->nitrile_given = 0 ; args_info->multipole_given = 0 ; + args_info->surfDiffusion_given = 0 ; args_info->staticProps_group_counter = 0 ; } @@ -300,6 +298,7 @@ void init_args_info(struct gengetopt_args_info *args_i args_info->rnemdrt_help = gengetopt_args_info_help[58] ; args_info->nitrile_help = gengetopt_args_info_help[59] ; args_info->multipole_help = gengetopt_args_info_help[60] ; + args_info->surfDiffusion_help = gengetopt_args_info_help[61] ; } @@ -341,9 +340,6 @@ cmdline_parser_init (struct gengetopt_args_info *args_ clear_given (args_info); clear_args (args_info); init_args_info (args_info); - - args_info->inputs = 0; - args_info->inputs_num = 0; } void @@ -382,7 +378,7 @@ cmdline_parser_release (struct gengetopt_args_info *ar static void cmdline_parser_release (struct gengetopt_args_info *args_info) { - unsigned int i; + free_string_field (&(args_info->input_arg)); free_string_field (&(args_info->input_orig)); free_string_field (&(args_info->output_arg)); @@ -419,11 +415,6 @@ cmdline_parser_release (struct gengetopt_args_info *ar free_string_field (&(args_info->gaussWidth_orig)); - 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); } @@ -572,6 +563,8 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_ar write_into_file(outfile, "nitrile", 0, 0 ); if (args_info->multipole_given) write_into_file(outfile, "multipole", 0, 0 ); + if (args_info->surfDiffusion_given) + write_into_file(outfile, "surfDiffusion", 0, 0 ); i = EXIT_SUCCESS; @@ -657,6 +650,7 @@ reset_group_staticProps(struct gengetopt_args_info *ar args_info->rnemdrt_given = 0 ; args_info->nitrile_given = 0 ; args_info->multipole_given = 0 ; + args_info->surfDiffusion_given = 0 ; args_info->staticProps_group_counter = 0; } @@ -962,6 +956,7 @@ cmdline_parser_internal ( { "rnemdrt", 0, NULL, 0 }, { "nitrile", 0, NULL, 0 }, { "multipole", 0, NULL, 'm' }, + { "surfDiffusion", 0, NULL, 0 }, { 0, 0, 0, 0 } }; @@ -1855,6 +1850,23 @@ cmdline_parser_internal ( &(local_args_info.nitrile_given), optarg, 0, 0, ARG_NO, check_ambiguity, override, 0, 0, "nitrile", '-', + additional_error)) + goto failure; + + } + /* X, Y, and R (surface diffusion if Z exposed and bulk immobile) diffusion. */ + else if (strcmp (long_options[option_index].name, "surfDiffusion") == 0) + { + + if (args_info->staticProps_group_counter && override) + reset_group_staticProps (args_info); + args_info->staticProps_group_counter += 1; + + if (update_arg( 0 , + 0 , &(args_info->surfDiffusion_given), + &(local_args_info.surfDiffusion_given), optarg, 0, 0, ARG_NO, + check_ambiguity, override, 0, 0, + "surfDiffusion", '-', additional_error)) goto failure; @@ -1889,30 +1901,6 @@ cmdline_parser_internal ( if ( error ) return (EXIT_FAILURE); - if (optind < argc) - { - int i = 0 ; - int found_prog_name = 0; - /* whether program name, i.e., argv[0], is in the remaining args - (this may happen with some implementations of getopt, - but surely not with the one included by gengetopt) */ - - i = optind; - while (i < argc) - if (argv[i++] == argv[0]) { - found_prog_name = 1; - break; - } - i = 0; - - args_info->inputs_num = argc - optind - found_prog_name; - args_info->inputs = - (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; - while (optind < argc) - if (argv[optind++] != argv[0]) - args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; - } - return 0; failure: