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.
trunk/src/applications/dump2Xyz/Dump2XYZCmd.cpp (file contents), Revision 1795 by gezelter, Fri Sep 7 18:13:55 2012 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 + #ifdef WIN32
25 + #include "utils/wingetopt.h"
26 + #else
27 + #include <getopt.h>
28 + #endif
29 +
30   #include "Dump2XYZCmd.h"
31  
32   const char *gengetopt_args_info_purpose = "";
# Line 64 | Line 72 | static int
72   void clear_args (struct gengetopt_args_info *args_info);
73  
74   static int
75 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
75 > cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
76                          struct cmdline_parser_params *params, const char *additional_error);
77  
78   static int
# Line 102 | Line 110 | void clear_args (struct gengetopt_args_info *args_info
110   static
111   void clear_args (struct gengetopt_args_info *args_info)
112   {
113 +  FIX_UNUSED (args_info);
114    args_info->input_arg = NULL;
115    args_info->input_orig = NULL;
116    args_info->output_arg = NULL;
# Line 165 | Line 174 | cmdline_parser_print_version (void)
174   void
175   cmdline_parser_print_version (void)
176   {
177 <  printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
177 >  printf ("%s %s\n",
178 >     (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
179 >     CMDLINE_PARSER_VERSION);
180   }
181  
182   static void print_help_common(void) {
# Line 180 | Line 191 | static void print_help_common(void) {
191    printf("\n");
192  
193    if (strlen(gengetopt_args_info_description) > 0)
194 <    printf("%s\n", gengetopt_args_info_description);
194 >    printf("%s\n\n", gengetopt_args_info_description);
195   }
196  
197   void
# Line 199 | Line 210 | cmdline_parser_init (struct gengetopt_args_info *args_
210    clear_args (args_info);
211    init_args_info (args_info);
212  
213 <  args_info->inputs = NULL;
213 >  args_info->inputs = 0;
214    args_info->inputs_num = 0;
215   }
216  
# Line 267 | Line 278 | static void
278  
279  
280   static void
281 < write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
281 > write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
282   {
283 +  FIX_UNUSED (values);
284    if (arg) {
285      fprintf(outfile, "%s=\"%s\"\n", opt, arg);
286    } else {
# Line 366 | Line 378 | gengetopt_strdup (const char *s)
378   char *
379   gengetopt_strdup (const char *s)
380   {
381 <  char *result = NULL;
381 >  char *result = 0;
382    if (!s)
383      return result;
384  
# Line 378 | Line 390 | int
390   }
391  
392   int
393 < cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
393 > cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
394   {
395    return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
396   }
397  
398   int
399 < cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
399 > cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
400                     struct cmdline_parser_params *params)
401   {
402    int result;
403 <  result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
403 >  result = cmdline_parser_internal (argc, argv, args_info, params, 0);
404  
405    if (result == EXIT_FAILURE)
406      {
# Line 400 | Line 412 | int
412   }
413  
414   int
415 < cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
415 > cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
416   {
417    int result;
418    struct cmdline_parser_params params;
# Line 411 | Line 423 | cmdline_parser2 (int argc, char * const *argv, struct
423    params.check_ambiguity = 0;
424    params.print_errors = 1;
425  
426 <  result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
426 >  result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
427  
428    if (result == EXIT_FAILURE)
429      {
# Line 427 | Line 439 | cmdline_parser_required (struct gengetopt_args_info *a
439   {
440    int result = EXIT_SUCCESS;
441  
442 <  if (cmdline_parser_required2(args_info, prog_name, NULL) > 0)
442 >  if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
443      result = EXIT_FAILURE;
444  
445    if (result == EXIT_FAILURE)
# Line 443 | Line 455 | cmdline_parser_required2 (struct gengetopt_args_info *
455   cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
456   {
457    int error = 0;
458 +  FIX_UNUSED (additional_error);
459  
460    /* checks for required options */
461    if (! args_info->input_given)
# Line 481 | Line 494 | int update_arg(void *field, char **orig_field,
494   static
495   int update_arg(void *field, char **orig_field,
496                 unsigned int *field_given, unsigned int *prev_given,
497 <               char *value, char *possible_values[], const char *default_value,
497 >               char *value, const char *possible_values[],
498 >               const char *default_value,
499                 cmdline_parser_arg_type arg_type,
500                 int check_ambiguity, int override,
501                 int no_free, int multiple_option,
# Line 492 | Line 506 | int update_arg(void *field, char **orig_field,
506    const char *val = value;
507    int found;
508    char **string_field;
509 +  FIX_UNUSED (field);
510  
511    stop_char = 0;
512    found = 0;
# Line 509 | Line 524 | int update_arg(void *field, char **orig_field,
524        return 1; /* failure */
525      }
526  
527 +  FIX_UNUSED (default_value);
528      
529    if (field_given && *field_given && ! override)
530      return 0;
# Line 572 | Line 588 | int
588  
589  
590   int
591 < cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
591 > cmdline_parser_internal (
592 >  int argc, char **argv, struct gengetopt_args_info *args_info,
593                          struct cmdline_parser_params *params, const char *additional_error)
594   {
595    int c;        /* Character of the parsed option.  */
# Line 628 | Line 645 | cmdline_parser_internal (int argc, char * const *argv,
645          { "forces",     0, NULL, 'f' },
646          { "vectors",    0, NULL, 'u' },
647          { "charges",    0, NULL, 'c' },
648 <        { NULL, 0, NULL, 0 }
648 >        { 0,  0, 0, 0 }
649        };
650  
651        c = getopt_long (argc, argv, "hVi:o:n:wmzrts:bvfuc", long_options, &option_index);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines