ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/dynamicProps/DynamicPropsCmd.c
(Generate patch)

Comparing trunk/src/applications/dynamicProps/DynamicPropsCmd.c (file contents):
Revision 1614 by jmichalk, Mon Aug 8 18:53:40 2011 UTC vs.
Revision 1615 by gezelter, Fri Aug 26 17:55:44 2011 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4 <  /usr/local/bin/gengetopt -F DynamicPropsCmd -i DynamicProps.ggo
4 >  gengetopt -F DynamicPropsCmd -u
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 27 | Line 27 | const char *gengetopt_args_info_purpose = "";
27  
28   const char *gengetopt_args_info_purpose = "";
29  
30 < const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]...";
30 > const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]... [FILES]...";
31  
32   const char *gengetopt_args_info_description = "";
33  
# Line 50 | Line 50 | const char *gengetopt_args_info_help[] = {
50    "      --thetacorr               Angular rmsd",
51    "      --drcorr                  Directional rmsd for particles with unit \n                                  vectors",
52    "      --helfandEcorr            Helfand moment for thermal conductvity",
53 +  "  -p, --momentum                Helfand momentum for viscosity",
54    "      --stresscorr              Stress tensor correlation function",
55      0
56   };
# Line 94 | Line 95 | void clear_given (struct gengetopt_args_info *args_inf
95    args_info->thetacorr_given = 0 ;
96    args_info->drcorr_given = 0 ;
97    args_info->helfandEcorr_given = 0 ;
98 +  args_info->momentum_given = 0 ;
99    args_info->stresscorr_given = 0 ;
100    args_info->dynamicProps_group_counter = 0 ;
101   }
# Line 138 | Line 140 | void init_args_info(struct gengetopt_args_info *args_i
140    args_info->thetacorr_help = gengetopt_args_info_help[15] ;
141    args_info->drcorr_help = gengetopt_args_info_help[16] ;
142    args_info->helfandEcorr_help = gengetopt_args_info_help[17] ;
143 <  args_info->stresscorr_help = gengetopt_args_info_help[18] ;
143 >  args_info->momentum_help = gengetopt_args_info_help[18] ;
144 >  args_info->stresscorr_help = gengetopt_args_info_help[19] ;
145    
146   }
147  
# Line 180 | Line 183 | cmdline_parser_init (struct gengetopt_args_info *args_
183    clear_given (args_info);
184    clear_args (args_info);
185    init_args_info (args_info);
186 +
187 +  args_info->inputs = 0;
188 +  args_info->inputs_num = 0;
189   }
190  
191   void
# Line 218 | Line 224 | cmdline_parser_release (struct gengetopt_args_info *ar
224   static void
225   cmdline_parser_release (struct gengetopt_args_info *args_info)
226   {
227 <
227 >  unsigned int i;
228    free_string_field (&(args_info->input_arg));
229    free_string_field (&(args_info->input_orig));
230    free_string_field (&(args_info->output_arg));
# Line 232 | Line 238 | cmdline_parser_release (struct gengetopt_args_info *ar
238    free_string_field (&(args_info->memory_orig));
239    
240    
241 +  for (i = 0; i < args_info->inputs_num; ++i)
242 +    free (args_info->inputs [i]);
243 +
244 +  if (args_info->inputs_num)
245 +    free (args_info->inputs);
246  
247    clear_given (args_info);
248   }
# Line 294 | Line 305 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
305      write_into_file(outfile, "drcorr", 0, 0 );
306    if (args_info->helfandEcorr_given)
307      write_into_file(outfile, "helfandEcorr", 0, 0 );
308 +  if (args_info->momentum_given)
309 +    write_into_file(outfile, "momentum", 0, 0 );
310    if (args_info->stresscorr_given)
311      write_into_file(outfile, "stresscorr", 0, 0 );
312    
# Line 358 | Line 371 | reset_group_dynamicProps(struct gengetopt_args_info *a
371    args_info->thetacorr_given = 0 ;
372    args_info->drcorr_given = 0 ;
373    args_info->helfandEcorr_given = 0 ;
374 +  args_info->momentum_given = 0 ;
375    args_info->stresscorr_given = 0 ;
376  
377    args_info->dynamicProps_group_counter = 0;
# Line 617 | Line 631 | cmdline_parser_internal (
631          { "thetacorr",  0, NULL, 0 },
632          { "drcorr",     0, NULL, 0 },
633          { "helfandEcorr",       0, NULL, 0 },
634 +        { "momentum",   0, NULL, 'p' },
635          { "stresscorr", 0, NULL, 0 },
636          { 0,  0, 0, 0 }
637        };
638  
639 <      c = getopt_long (argc, argv, "hVi:o:m:rvdls", long_options, &option_index);
639 >      c = getopt_long (argc, argv, "hVi:o:m:rvdlsp", long_options, &option_index);
640  
641        if (c == -1) break;       /* Exit from `while (1)' loop.  */
642  
# Line 744 | Line 759 | cmdline_parser_internal (
759                &(local_args_info.sdcorr_given), optarg, 0, 0, ARG_NO,
760                check_ambiguity, override, 0, 0,
761                "sdcorr", 's',
762 +              additional_error))
763 +            goto failure;
764 +        
765 +          break;
766 +        case 'p':       /* Helfand momentum for viscosity.  */
767 +        
768 +          if (args_info->dynamicProps_group_counter && override)
769 +            reset_group_dynamicProps (args_info);
770 +          args_info->dynamicProps_group_counter += 1;
771 +        
772 +          if (update_arg( 0 ,
773 +               0 , &(args_info->momentum_given),
774 +              &(local_args_info.momentum_given), optarg, 0, 0, ARG_NO,
775 +              check_ambiguity, override, 0, 0,
776 +              "momentum", 'p',
777                additional_error))
778              goto failure;
779          
# Line 907 | Line 937 | cmdline_parser_internal (
937    if ( error )
938      return (EXIT_FAILURE);
939  
940 +  if (optind < argc)
941 +    {
942 +      int i = 0 ;
943 +      int found_prog_name = 0;
944 +      /* whether program name, i.e., argv[0], is in the remaining args
945 +         (this may happen with some implementations of getopt,
946 +          but surely not with the one included by gengetopt) */
947 +
948 +      i = optind;
949 +      while (i < argc)
950 +        if (argv[i++] == argv[0]) {
951 +          found_prog_name = 1;
952 +          break;
953 +        }
954 +      i = 0;
955 +
956 +      args_info->inputs_num = argc - optind - found_prog_name;
957 +      args_info->inputs =
958 +        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
959 +      while (optind < argc)
960 +        if (argv[optind++] != argv[0])
961 +          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
962 +    }
963 +
964    return 0;
965  
966   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines