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

Comparing trunk/src/applications/dynamicProps/DynamicPropsCmd.c (file contents):
Revision 1111 by chuckv, Thu Dec 14 19:38:56 2006 UTC vs.
Revision 1112 by chuckv, Wed Jan 3 20:47:00 2007 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.15
3    generated with the following command:
4 <  gengetopt -i DynamicProps.ggo --file-name=DynamicPropsCmd
4 >  gengetopt -u -i DynamicProps.ggo -F DynamicPropsCmd
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 50 | Line 50 | void clear_given (struct gengetopt_args_info *args_inf
50    args_info->dcorr_given = 0 ;
51    args_info->lcorr_given = 0 ;
52    args_info->r_rcorr_given = 0 ;
53 +  args_info->thetacorr_given = 0 ;
54    args_info->dynamicProps_group_counter = 0 ;
55   }
56  
# Line 78 | Line 79 | cmdline_parser_print_help (void)
79   cmdline_parser_print_help (void)
80   {
81    cmdline_parser_print_version ();
82 <  printf("\nUsage: DynamicProps [OPTIONS]...\n\n");
82 >  printf("\nUsage: DynamicProps [OPTIONS]... [FILES]...\n\n");
83    printf("%s\n","  -h, --help                    Print help and exit");
84    printf("%s\n","  -V, --version                 Print version and exit");
85    printf("%s\n","  -i, --input=filename          input dump file");
# Line 92 | Line 93 | cmdline_parser_print_help (void)
93    printf("%s\n","  -d, --dcorr                   dipole correlation function");
94    printf("%s\n","  -l, --lcorr                   Lengendre correlation function");
95    printf("%s\n","      --r_rcorr                 Radial rmsd");
96 +  printf("%s\n","      --thetacorr               Angular rmsd");
97    
98   }
99  
# Line 100 | Line 102 | cmdline_parser_init (struct gengetopt_args_info *args_
102   {
103    clear_given (args_info);
104    clear_args (args_info);
105 +
106 +  args_info->inputs = NULL;
107 +  args_info->inputs_num = 0;
108   }
109  
110   static void
111   cmdline_parser_release (struct gengetopt_args_info *args_info)
112   {
113    
114 +  unsigned int i;
115    if (args_info->input_arg)
116      {
117        free (args_info->input_arg); /* free previous argument */
# Line 151 | Line 157 | cmdline_parser_release (struct gengetopt_args_info *ar
157        free (args_info->order_orig); /* free previous argument */
158        args_info->order_orig = 0;
159      }
160 +  
161 +  for (i = 0; i < args_info->inputs_num; ++i)
162 +    free (args_info->inputs [i]);
163    
164 +  if (args_info->inputs_num)
165 +    free (args_info->inputs);
166 +  
167    clear_given (args_info);
168   }
169  
# Line 225 | Line 237 | cmdline_parser_file_save(const char *filename, struct
237    if (args_info->r_rcorr_given) {
238      fprintf(outfile, "%s\n", "r_rcorr");
239    }
240 +  if (args_info->thetacorr_given) {
241 +    fprintf(outfile, "%s\n", "thetacorr");
242 +  }
243    
244    fclose (outfile);
245  
# Line 269 | Line 284 | reset_group_dynamicProps(struct gengetopt_args_info *a
284    args_info->dcorr_given = 0 ;
285    args_info->lcorr_given = 0 ;
286    args_info->r_rcorr_given = 0 ;
287 +  args_info->thetacorr_given = 0 ;
288  
289    args_info->dynamicProps_group_counter = 0;
290   }
# Line 368 | Line 384 | cmdline_parser_internal (int argc, char * const *argv,
384          { "dcorr",      0, NULL, 'd' },
385          { "lcorr",      0, NULL, 'l' },
386          { "r_rcorr",    0, NULL, 0 },
387 +        { "thetacorr",  0, NULL, 0 },
388          { NULL, 0, NULL, 0 }
389        };
390  
# Line 562 | Line 579 | cmdline_parser_internal (int argc, char * const *argv,
579              args_info->dynamicProps_group_counter += 1;
580              break;
581            }
582 +          /* Angular rmsd.  */
583 +          else if (strcmp (long_options[option_index].name, "thetacorr") == 0)
584 +          {
585 +            if (local_args_info.thetacorr_given)
586 +              {
587 +                fprintf (stderr, "%s: `--thetacorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
588 +                goto failure;
589 +              }
590 +            if (args_info->thetacorr_given && ! override)
591 +              continue;
592 +            local_args_info.thetacorr_given = 1;
593 +            args_info->thetacorr_given = 1;
594 +            if (args_info->dynamicProps_group_counter && override)
595 +              reset_group_dynamicProps (args_info);
596 +            args_info->dynamicProps_group_counter += 1;
597 +            break;
598 +          }
599            
600            break;
601          case '?':       /* Invalid option.  */
# Line 592 | Line 626 | cmdline_parser_internal (int argc, char * const *argv,
626    if ( error )
627      return (EXIT_FAILURE);
628  
629 +  if (optind < argc)
630 +    {
631 +      int i = 0 ;
632 +
633 +      args_info->inputs_num = argc - optind ;
634 +      args_info->inputs =
635 +        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ;
636 +      while (optind < argc)
637 +        args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
638 +    }
639 +
640    return 0;
641  
642   failure:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines