| 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 -u -F thermalizerCmd |
| 4 |
> |
gengetopt -F thermalizerCmd -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: |
| 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 "thermalizerCmd.h" |
| 27 |
|
|
| 28 |
|
const char *gengetopt_args_info_purpose = "Resamples the velocities for all the integrable objects in an OpenMD file from \na Maxwell-Boltzmann distribution."; |
| 50 |
|
void clear_args (struct gengetopt_args_info *args_info); |
| 51 |
|
|
| 52 |
|
static int |
| 53 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
| 53 |
> |
cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, |
| 54 |
|
struct cmdline_parser_params *params, const char *additional_error); |
| 55 |
|
|
| 56 |
|
static int |
| 71 |
|
static |
| 72 |
|
void clear_args (struct gengetopt_args_info *args_info) |
| 73 |
|
{ |
| 74 |
+ |
FIX_UNUSED (args_info); |
| 75 |
|
args_info->output_arg = NULL; |
| 76 |
|
args_info->output_orig = NULL; |
| 77 |
|
args_info->temperature_orig = NULL; |
| 93 |
|
void |
| 94 |
|
cmdline_parser_print_version (void) |
| 95 |
|
{ |
| 96 |
< |
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); |
| 96 |
> |
printf ("%s %s\n", |
| 97 |
> |
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), |
| 98 |
> |
CMDLINE_PARSER_VERSION); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
static void print_help_common(void) { |
| 110 |
|
printf("\n"); |
| 111 |
|
|
| 112 |
|
if (strlen(gengetopt_args_info_description) > 0) |
| 113 |
< |
printf("%s\n", gengetopt_args_info_description); |
| 113 |
> |
printf("%s\n\n", gengetopt_args_info_description); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
void |
| 129 |
|
clear_args (args_info); |
| 130 |
|
init_args_info (args_info); |
| 131 |
|
|
| 132 |
< |
args_info->inputs = NULL; |
| 132 |
> |
args_info->inputs = 0; |
| 133 |
|
args_info->inputs_num = 0; |
| 134 |
|
} |
| 135 |
|
|
| 186 |
|
|
| 187 |
|
|
| 188 |
|
static void |
| 189 |
< |
write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[]) |
| 189 |
> |
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) |
| 190 |
|
{ |
| 191 |
+ |
FIX_UNUSED (values); |
| 192 |
|
if (arg) { |
| 193 |
|
fprintf(outfile, "%s=\"%s\"\n", opt, arg); |
| 194 |
|
} else { |
| 252 |
|
char * |
| 253 |
|
gengetopt_strdup (const char *s) |
| 254 |
|
{ |
| 255 |
< |
char *result = NULL; |
| 255 |
> |
char *result = 0; |
| 256 |
|
if (!s) |
| 257 |
|
return result; |
| 258 |
|
|
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
int |
| 267 |
< |
cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) |
| 267 |
> |
cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) |
| 268 |
|
{ |
| 269 |
|
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); |
| 270 |
|
} |
| 271 |
|
|
| 272 |
|
int |
| 273 |
< |
cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
| 273 |
> |
cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, |
| 274 |
|
struct cmdline_parser_params *params) |
| 275 |
|
{ |
| 276 |
|
int result; |
| 277 |
< |
result = cmdline_parser_internal (argc, argv, args_info, params, NULL); |
| 277 |
> |
result = cmdline_parser_internal (argc, argv, args_info, params, 0); |
| 278 |
|
|
| 279 |
|
if (result == EXIT_FAILURE) |
| 280 |
|
{ |
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
int |
| 289 |
< |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
| 289 |
> |
cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) |
| 290 |
|
{ |
| 291 |
|
int result; |
| 292 |
|
struct cmdline_parser_params params; |
| 297 |
|
params.check_ambiguity = 0; |
| 298 |
|
params.print_errors = 1; |
| 299 |
|
|
| 300 |
< |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, NULL); |
| 300 |
> |
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); |
| 301 |
|
|
| 302 |
|
if (result == EXIT_FAILURE) |
| 303 |
|
{ |
| 313 |
|
{ |
| 314 |
|
int result = EXIT_SUCCESS; |
| 315 |
|
|
| 316 |
< |
if (cmdline_parser_required2(args_info, prog_name, NULL) > 0) |
| 316 |
> |
if (cmdline_parser_required2(args_info, prog_name, 0) > 0) |
| 317 |
|
result = EXIT_FAILURE; |
| 318 |
|
|
| 319 |
|
if (result == EXIT_FAILURE) |
| 329 |
|
cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error) |
| 330 |
|
{ |
| 331 |
|
int error = 0; |
| 332 |
+ |
FIX_UNUSED (additional_error); |
| 333 |
|
|
| 334 |
|
/* checks for required options */ |
| 335 |
|
if (! args_info->output_given) |
| 374 |
|
static |
| 375 |
|
int update_arg(void *field, char **orig_field, |
| 376 |
|
unsigned int *field_given, unsigned int *prev_given, |
| 377 |
< |
char *value, char *possible_values[], const char *default_value, |
| 377 |
> |
char *value, const char *possible_values[], |
| 378 |
> |
const char *default_value, |
| 379 |
|
cmdline_parser_arg_type arg_type, |
| 380 |
|
int check_ambiguity, int override, |
| 381 |
|
int no_free, int multiple_option, |
| 386 |
|
const char *val = value; |
| 387 |
|
int found; |
| 388 |
|
char **string_field; |
| 389 |
+ |
FIX_UNUSED (field); |
| 390 |
|
|
| 391 |
|
stop_char = 0; |
| 392 |
|
found = 0; |
| 404 |
|
return 1; /* failure */ |
| 405 |
|
} |
| 406 |
|
|
| 407 |
+ |
FIX_UNUSED (default_value); |
| 408 |
|
|
| 409 |
|
if (field_given && *field_given && ! override) |
| 410 |
|
return 0; |
| 464 |
|
|
| 465 |
|
|
| 466 |
|
int |
| 467 |
< |
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info, |
| 467 |
> |
cmdline_parser_internal ( |
| 468 |
> |
int argc, char **argv, struct gengetopt_args_info *args_info, |
| 469 |
|
struct cmdline_parser_params *params, const char *additional_error) |
| 470 |
|
{ |
| 471 |
|
int c; /* Character of the parsed option. */ |
| 504 |
|
{ "version", 0, NULL, 'V' }, |
| 505 |
|
{ "output", 1, NULL, 'o' }, |
| 506 |
|
{ "temperature", 1, NULL, 't' }, |
| 507 |
< |
{ NULL, 0, NULL, 0 } |
| 507 |
> |
{ 0, 0, 0, 0 } |
| 508 |
|
}; |
| 509 |
|
|
| 510 |
|
c = getopt_long (argc, argv, "hVo:t:", long_options, &option_index); |