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 1566 by chuckv, Thu May 19 18:12:09 2011 UTC vs.
Revision 1596 by gezelter, Mon Jul 25 17:30:53 2011 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4 <  gengetopt
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 39 | Line 39 | const char *gengetopt_args_info_help[] = {
39    "      --sele1=selection script  select first stuntdouble set",
40    "      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)",
41    "      --order=INT               Lengendre Polynomial Order",
42 +  "  -m, --memory=memory specification\n                                Available memory (defaults to 2G)  \n                                  (default=`2G')",
43    "\n Group: dynamicProps\n   an option of this group is required",
44    "  -r, --rcorr                   rmsd",
45    "  -v, --vcorr                   velocity correlation function",
# Line 82 | Line 83 | void clear_given (struct gengetopt_args_info *args_inf
83    args_info->sele1_given = 0 ;
84    args_info->sele2_given = 0 ;
85    args_info->order_given = 0 ;
86 +  args_info->memory_given = 0 ;
87    args_info->rcorr_given = 0 ;
88    args_info->vcorr_given = 0 ;
89    args_info->dcorr_given = 0 ;
# Line 107 | Line 109 | void clear_args (struct gengetopt_args_info *args_info
109    args_info->sele2_arg = NULL;
110    args_info->sele2_orig = NULL;
111    args_info->order_orig = NULL;
112 +  args_info->memory_arg = gengetopt_strdup ("2G");
113 +  args_info->memory_orig = NULL;
114    
115   }
116  
# Line 122 | Line 126 | void init_args_info(struct gengetopt_args_info *args_i
126    args_info->sele1_help = gengetopt_args_info_help[4] ;
127    args_info->sele2_help = gengetopt_args_info_help[5] ;
128    args_info->order_help = gengetopt_args_info_help[6] ;
129 <  args_info->rcorr_help = gengetopt_args_info_help[8] ;
130 <  args_info->vcorr_help = gengetopt_args_info_help[9] ;
131 <  args_info->dcorr_help = gengetopt_args_info_help[10] ;
132 <  args_info->lcorr_help = gengetopt_args_info_help[11] ;
133 <  args_info->r_rcorr_help = gengetopt_args_info_help[12] ;
134 <  args_info->thetacorr_help = gengetopt_args_info_help[13] ;
135 <  args_info->drcorr_help = gengetopt_args_info_help[14] ;
136 <  args_info->helfandEcorr_help = gengetopt_args_info_help[15] ;
137 <  args_info->stresscorr_help = gengetopt_args_info_help[16] ;
129 >  args_info->memory_help = gengetopt_args_info_help[7] ;
130 >  args_info->rcorr_help = gengetopt_args_info_help[9] ;
131 >  args_info->vcorr_help = gengetopt_args_info_help[10] ;
132 >  args_info->dcorr_help = gengetopt_args_info_help[11] ;
133 >  args_info->lcorr_help = gengetopt_args_info_help[12] ;
134 >  args_info->r_rcorr_help = gengetopt_args_info_help[13] ;
135 >  args_info->thetacorr_help = gengetopt_args_info_help[14] ;
136 >  args_info->drcorr_help = gengetopt_args_info_help[15] ;
137 >  args_info->helfandEcorr_help = gengetopt_args_info_help[16] ;
138 >  args_info->stresscorr_help = gengetopt_args_info_help[17] ;
139    
140   }
141  
# Line 172 | Line 177 | cmdline_parser_init (struct gengetopt_args_info *args_
177    clear_given (args_info);
178    clear_args (args_info);
179    init_args_info (args_info);
180 +
181 +  args_info->inputs = 0;
182 +  args_info->inputs_num = 0;
183   }
184  
185   void
# Line 210 | Line 218 | cmdline_parser_release (struct gengetopt_args_info *ar
218   static void
219   cmdline_parser_release (struct gengetopt_args_info *args_info)
220   {
221 <
221 >  unsigned int i;
222    free_string_field (&(args_info->input_arg));
223    free_string_field (&(args_info->input_orig));
224    free_string_field (&(args_info->output_arg));
# Line 220 | Line 228 | cmdline_parser_release (struct gengetopt_args_info *ar
228    free_string_field (&(args_info->sele2_arg));
229    free_string_field (&(args_info->sele2_orig));
230    free_string_field (&(args_info->order_orig));
231 +  free_string_field (&(args_info->memory_arg));
232 +  free_string_field (&(args_info->memory_orig));
233    
234    
235 +  for (i = 0; i < args_info->inputs_num; ++i)
236 +    free (args_info->inputs [i]);
237  
238 +  if (args_info->inputs_num)
239 +    free (args_info->inputs);
240 +
241    clear_given (args_info);
242   }
243  
# Line 264 | Line 279 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
279      write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
280    if (args_info->order_given)
281      write_into_file(outfile, "order", args_info->order_orig, 0);
282 +  if (args_info->memory_given)
283 +    write_into_file(outfile, "memory", args_info->memory_orig, 0);
284    if (args_info->rcorr_given)
285      write_into_file(outfile, "rcorr", 0, 0 );
286    if (args_info->vcorr_given)
# Line 592 | Line 609 | cmdline_parser_internal (
609          { "sele1",      1, NULL, 0 },
610          { "sele2",      1, NULL, 0 },
611          { "order",      1, NULL, 0 },
612 +        { "memory",     1, NULL, 'm' },
613          { "rcorr",      0, NULL, 'r' },
614          { "vcorr",      0, NULL, 'v' },
615          { "dcorr",      0, NULL, 'd' },
# Line 604 | Line 622 | cmdline_parser_internal (
622          { 0,  0, 0, 0 }
623        };
624  
625 <      c = getopt_long (argc, argv, "hVi:o:rvdl", long_options, &option_index);
625 >      c = getopt_long (argc, argv, "hVi:o:m:rvdl", long_options, &option_index);
626  
627        if (c == -1) break;       /* Exit from `while (1)' loop.  */
628  
# Line 644 | Line 662 | cmdline_parser_internal (
662              goto failure;
663          
664            break;
665 +        case 'm':       /* Available memory (defaults to 2G).  */
666 +        
667 +        
668 +          if (update_arg( (void *)&(args_info->memory_arg),
669 +               &(args_info->memory_orig), &(args_info->memory_given),
670 +              &(local_args_info.memory_given), optarg, 0, "2G", ARG_STRING,
671 +              check_ambiguity, override, 0, 0,
672 +              "memory", 'm',
673 +              additional_error))
674 +            goto failure;
675 +        
676 +          break;
677          case 'r':       /* rmsd.  */
678          
679            if (args_info->dynamicProps_group_counter && override)
# Line 863 | Line 893 | cmdline_parser_internal (
893    if ( error )
894      return (EXIT_FAILURE);
895  
896 +  if (optind < argc)
897 +    {
898 +      int i = 0 ;
899 +      int found_prog_name = 0;
900 +      /* whether program name, i.e., argv[0], is in the remaining args
901 +         (this may happen with some implementations of getopt,
902 +          but surely not with the one included by gengetopt) */
903 +
904 +      i = optind;
905 +      while (i < argc)
906 +        if (argv[i++] == argv[0]) {
907 +          found_prog_name = 1;
908 +          break;
909 +        }
910 +      i = 0;
911 +
912 +      args_info->inputs_num = argc - optind - found_prog_name;
913 +      args_info->inputs =
914 +        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
915 +      while (optind < argc)
916 +        if (argv[optind++] != argv[0])
917 +          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ;
918 +    }
919 +
920    return 0;
921  
922   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines