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

Comparing branches/development/src/applications/dump2Xyz/Dump2XYZCmd.c (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1630 by gezelter, Wed Sep 14 21:40:12 2011 UTC

# Line 1 | Line 1
1   /*
2 <  File autogenerated by gengetopt version 2.22
2 >  File autogenerated by gengetopt version 2.22.4
3    generated with the following command:
4    gengetopt -F Dump2XYZCmd -u
5  
# Line 17 | Line 17
17   #include <stdlib.h>
18   #include <string.h>
19  
20 < #include "getopt.h"
20 > #ifndef FIX_UNUSED
21 > #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22 > #endif
23  
24 + #include <getopt.h>
25 +
26   #include "Dump2XYZCmd.h"
27  
28   const char *gengetopt_args_info_purpose = "";
# Line 64 | Line 68 | static int
68   void clear_args (struct gengetopt_args_info *args_info);
69  
70   static int
71 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
71 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
72                          struct cmdline_parser_params *params, const char *additional_error);
73  
74   static int
# Line 102 | Line 106 | void clear_args (struct gengetopt_args_info *args_info
106   static
107   void clear_args (struct gengetopt_args_info *args_info)
108   {
109 +  FIX_UNUSED (args_info);
110    args_info->input_arg = NULL;
111    args_info->input_orig = NULL;
112    args_info->output_arg = NULL;
# Line 165 | Line 170 | cmdline_parser_print_version (void)
170   void
171   cmdline_parser_print_version (void)
172   {
173 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
173 >  printf ("%s %s\n",
174 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
175 >     CMDLINE_PARSER_VERSION);
176   }
177  
178   static void print_help_common(void) {
# Line 180 | Line 187 | static void print_help_common(void) {
187    printf("\n");
188  
189    if (strlen(gengetopt_args_info_description) > 0)
190 <    printf("%s\n", gengetopt_args_info_description);
190 >    printf("%s\n\n", gengetopt_args_info_description);
191   }
192  
193   void
# Line 199 | Line 206 | cmdline_parser_init (struct gengetopt_args_info *args_
206    clear_args (args_info);
207    init_args_info (args_info);
208  
209 <  args_info->inputs = NULL;
209 >  args_info->inputs = 0;
210    args_info->inputs_num = 0;
211   }
212  
# Line 267 | Line 274 | static void
274  
275  
276   static void
277 < write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
277 > write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
278   {
279 +  FIX_UNUSED (values);
280    if (arg) {
281      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
282    } else {
# Line 366 | Line 374 | gengetopt_strdup (const char *s)
374   char *
375   gengetopt_strdup (const char *s)
376   {
377 <  char *result = NULL;
377 >  char *result = 0;
378    if (!s)
379      return result;
380  
# Line 378 | Line 386 | int
386   }
387  
388   int
389 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
389 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
390   {
391    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
392   }
393  
394   int
395 < cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
395 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
396                     struct cmdline_parser_params *params)
397   {
398    int result;
399 <  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
399 >  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
400  
401    if (result == EXIT_FAILURE)
402      {
# Line 400 | Line 408 | int
408   }
409  
410   int
411 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
411 > cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
412   {
413    int result;
414    struct cmdline_parser_params params;
# Line 411 | Line 419 | cmdline_parser2 (int argc, char * const *argv, struct
419    params.check_ambiguity = 0;
420    params.print_errors = 1;
421  
422 <  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
422 >  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
423  
424    if (result == EXIT_FAILURE)
425      {
# Line 427 | Line 435 | cmdline_parser_required (struct gengetopt_args_info *a
435   {
436    int result = EXIT_SUCCESS;
437  
438 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
438 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
439      result = EXIT_FAILURE;
440  
441    if (result == EXIT_FAILURE)
# Line 443 | Line 451 | cmdline_parser_required2 (struct gengetopt_args_info *
451   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
452   {
453    int error = 0;
454 +  FIX_UNUSED (additional_error);
455  
456    /* checks for required options */
457    if (! args_info->input_given)
# Line 481 | Line 490 | int update_arg(void *field, char **orig_field,
490   static
491   int update_arg(void *field, char **orig_field,
492                 unsigned int *field_given, unsigned int *prev_given,
493 <               char *value, char *possible_values[], const char *default_value,
493 >               char *value, const char *possible_values[],
494 >               const char *default_value,
495                 cmdline_parser_arg_type arg_type,
496                 int check_ambiguity, int override,
497                 int no_free, int multiple_option,
# Line 492 | Line 502 | int update_arg(void *field, char **orig_field,
502    const char *val = value;
503    int found;
504    char **string_field;
505 +  FIX_UNUSED (field);
506  
507    stop_char = 0;
508    found = 0;
# Line 509 | Line 520 | int update_arg(void *field, char **orig_field,
520        return 1; /* failure */
521      }
522  
523 +  FIX_UNUSED (default_value);
524      
525    if (field_given && *field_given && ! override)
526      return 0;
# Line 572 | Line 584 | int
584  
585  
586   int
587 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
587 > cmdline_parser_internal (
588 >  int argc, char **argv, struct gengetopt_args_info *args_info,
589                          struct cmdline_parser_params *params, const char *additional_error)
590   {
591    int c;        /* Character of the parsed option.  */
# Line 628 | Line 641 | cmdline_parser_internal (int argc, char * const *argv,
641          { "forces",     0, NULL, 'f' },
642          { "vectors",    0, NULL, 'u' },
643          { "charges",    0, NULL, 'c' },
644 <        { NULL, 0, NULL, 0 }
644 >        { 0,  0, 0, 0 }
645        };
646  
647        c = getopt_long (argc, argv, "hVi:o:n:wmzrts:bvfuc", long_options, &option_index);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines