| 1 |
|
/* |
| 2 |
< |
File autogenerated by gengetopt version 2.15 |
| 2 |
> |
File autogenerated by gengetopt version 2.19.1 |
| 3 |
|
generated with the following command: |
| 4 |
< |
gengetopt -u -i DynamicProps.ggo -F DynamicPropsCmd |
| 4 |
> |
gengetopt -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: |
| 21 |
|
|
| 22 |
|
#include "DynamicPropsCmd.h" |
| 23 |
|
|
| 24 |
+ |
const char *gengetopt_args_info_purpose = ""; |
| 25 |
+ |
|
| 26 |
+ |
const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; |
| 27 |
+ |
|
| 28 |
+ |
const char *gengetopt_args_info_description = ""; |
| 29 |
+ |
|
| 30 |
+ |
const char *gengetopt_args_info_help[] = { |
| 31 |
+ |
" -h, --help Print help and exit", |
| 32 |
+ |
" -V, --version Print version and exit", |
| 33 |
+ |
" -i, --input=filename input dump file", |
| 34 |
+ |
" -o, --output=filename output file name", |
| 35 |
+ |
" --sele1=selection script select first stuntdouble set", |
| 36 |
+ |
" --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)", |
| 37 |
+ |
" --order=INT Lengendre Polynomial Order", |
| 38 |
+ |
"\n Group: dynamicProps\n an option of this group is required", |
| 39 |
+ |
" -r, --rcorr rmsd", |
| 40 |
+ |
" -v, --vcorr velocity correlation function", |
| 41 |
+ |
" -d, --dcorr dipole correlation function", |
| 42 |
+ |
" -l, --lcorr Lengendre correlation function", |
| 43 |
+ |
" --r_rcorr Radial rmsd", |
| 44 |
+ |
" --thetacorr Angular rmsd", |
| 45 |
+ |
" --drcorr Directional rmsd for particles with unit \n vectors", |
| 46 |
+ |
0 |
| 47 |
+ |
}; |
| 48 |
+ |
|
| 49 |
|
static |
| 50 |
|
void clear_given (struct gengetopt_args_info *args_info); |
| 51 |
|
static |
| 76 |
|
args_info->lcorr_given = 0 ; |
| 77 |
|
args_info->r_rcorr_given = 0 ; |
| 78 |
|
args_info->thetacorr_given = 0 ; |
| 79 |
+ |
args_info->drcorr_given = 0 ; |
| 80 |
|
args_info->dynamicProps_group_counter = 0 ; |
| 81 |
|
} |
| 82 |
|
|
| 95 |
|
|
| 96 |
|
} |
| 97 |
|
|
| 98 |
+ |
static |
| 99 |
+ |
void init_args_info(struct gengetopt_args_info *args_info) |
| 100 |
+ |
{ |
| 101 |
+ |
args_info->help_help = gengetopt_args_info_help[0] ; |
| 102 |
+ |
args_info->version_help = gengetopt_args_info_help[1] ; |
| 103 |
+ |
args_info->input_help = gengetopt_args_info_help[2] ; |
| 104 |
+ |
args_info->output_help = gengetopt_args_info_help[3] ; |
| 105 |
+ |
args_info->sele1_help = gengetopt_args_info_help[4] ; |
| 106 |
+ |
args_info->sele2_help = gengetopt_args_info_help[5] ; |
| 107 |
+ |
args_info->order_help = gengetopt_args_info_help[6] ; |
| 108 |
+ |
args_info->rcorr_help = gengetopt_args_info_help[7] ; |
| 109 |
+ |
args_info->vcorr_help = gengetopt_args_info_help[8] ; |
| 110 |
+ |
args_info->dcorr_help = gengetopt_args_info_help[9] ; |
| 111 |
+ |
args_info->lcorr_help = gengetopt_args_info_help[10] ; |
| 112 |
+ |
args_info->r_rcorr_help = gengetopt_args_info_help[11] ; |
| 113 |
+ |
args_info->thetacorr_help = gengetopt_args_info_help[12] ; |
| 114 |
+ |
args_info->drcorr_help = gengetopt_args_info_help[13] ; |
| 115 |
+ |
|
| 116 |
+ |
} |
| 117 |
+ |
|
| 118 |
|
void |
| 119 |
|
cmdline_parser_print_version (void) |
| 120 |
|
{ |
| 124 |
|
void |
| 125 |
|
cmdline_parser_print_help (void) |
| 126 |
|
{ |
| 127 |
+ |
int i = 0; |
| 128 |
|
cmdline_parser_print_version (); |
| 129 |
< |
printf("\nUsage: DynamicProps [OPTIONS]... [FILES]...\n\n"); |
| 130 |
< |
printf("%s\n"," -h, --help Print help and exit"); |
| 131 |
< |
printf("%s\n"," -V, --version Print version and exit"); |
| 132 |
< |
printf("%s\n"," -i, --input=filename input dump file"); |
| 133 |
< |
printf("%s\n"," -o, --output=filename output file name"); |
| 134 |
< |
printf("%s\n"," --sele1=selection script select first stuntdouble set"); |
| 135 |
< |
printf("%s\n"," --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)"); |
| 136 |
< |
printf("%s\n"," --order=INT Lengendre Polynomial Order"); |
| 137 |
< |
printf("%s\n","\n Group: dynamicProps\n an option of this group is required"); |
| 138 |
< |
printf("%s\n"," -r, --rcorr rmsd"); |
| 139 |
< |
printf("%s\n"," -v, --vcorr velocity correlation function"); |
| 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 |
< |
|
| 129 |
> |
|
| 130 |
> |
if (strlen(gengetopt_args_info_purpose) > 0) |
| 131 |
> |
printf("\n%s\n", gengetopt_args_info_purpose); |
| 132 |
> |
|
| 133 |
> |
printf("\n%s\n\n", gengetopt_args_info_usage); |
| 134 |
> |
|
| 135 |
> |
if (strlen(gengetopt_args_info_description) > 0) |
| 136 |
> |
printf("%s\n", gengetopt_args_info_description); |
| 137 |
> |
|
| 138 |
> |
while (gengetopt_args_info_help[i]) |
| 139 |
> |
printf("%s\n", gengetopt_args_info_help[i++]); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
void |
| 144 |
|
{ |
| 145 |
|
clear_given (args_info); |
| 146 |
|
clear_args (args_info); |
| 147 |
< |
|
| 106 |
< |
args_info->inputs = NULL; |
| 107 |
< |
args_info->inputs_num = 0; |
| 147 |
> |
init_args_info (args_info); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
static void |
| 151 |
|
cmdline_parser_release (struct gengetopt_args_info *args_info) |
| 152 |
|
{ |
| 153 |
|
|
| 114 |
– |
unsigned int i; |
| 154 |
|
if (args_info->input_arg) |
| 155 |
|
{ |
| 156 |
|
free (args_info->input_arg); /* free previous argument */ |
| 197 |
|
args_info->order_orig = 0; |
| 198 |
|
} |
| 199 |
|
|
| 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 |
– |
|
| 200 |
|
clear_given (args_info); |
| 201 |
|
} |
| 202 |
|
|
| 273 |
|
if (args_info->thetacorr_given) { |
| 274 |
|
fprintf(outfile, "%s\n", "thetacorr"); |
| 275 |
|
} |
| 276 |
+ |
if (args_info->drcorr_given) { |
| 277 |
+ |
fprintf(outfile, "%s\n", "drcorr"); |
| 278 |
+ |
} |
| 279 |
|
|
| 280 |
|
fclose (outfile); |
| 281 |
|
|
| 321 |
|
args_info->lcorr_given = 0 ; |
| 322 |
|
args_info->r_rcorr_given = 0 ; |
| 323 |
|
args_info->thetacorr_given = 0 ; |
| 324 |
+ |
args_info->drcorr_given = 0 ; |
| 325 |
|
|
| 326 |
|
args_info->dynamicProps_group_counter = 0; |
| 327 |
|
} |
| 370 |
|
{ |
| 371 |
|
int error = 0; |
| 372 |
|
|
| 373 |
+ |
/* checks for required options */ |
| 374 |
|
if (! args_info->input_given) |
| 375 |
|
{ |
| 376 |
|
fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); |
| 377 |
|
error = 1; |
| 378 |
|
} |
| 379 |
+ |
|
| 380 |
|
if (args_info->dynamicProps_group_counter == 0) |
| 381 |
|
{ |
| 382 |
|
fprintf (stderr, "%s: %d options of group dynamicProps were given. One is required.%s\n", prog_name, args_info->dynamicProps_group_counter, (additional_error ? additional_error : "")); |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
|
| 387 |
+ |
/* checks for dependences among options */ |
| 388 |
+ |
|
| 389 |
|
return error; |
| 390 |
|
} |
| 391 |
|
|
| 403 |
|
cmdline_parser_init (&local_args_info); |
| 404 |
|
|
| 405 |
|
optarg = 0; |
| 406 |
< |
optind = 1; |
| 406 |
> |
optind = 0; |
| 407 |
|
opterr = 1; |
| 408 |
|
optopt = '?'; |
| 409 |
|
|
| 426 |
|
{ "lcorr", 0, NULL, 'l' }, |
| 427 |
|
{ "r_rcorr", 0, NULL, 0 }, |
| 428 |
|
{ "thetacorr", 0, NULL, 0 }, |
| 429 |
+ |
{ "drcorr", 0, NULL, 0 }, |
| 430 |
|
{ NULL, 0, NULL, 0 } |
| 431 |
|
}; |
| 432 |
|
|
| 638 |
|
args_info->dynamicProps_group_counter += 1; |
| 639 |
|
break; |
| 640 |
|
} |
| 641 |
+ |
/* Directional rmsd for particles with unit vectors. */ |
| 642 |
+ |
else if (strcmp (long_options[option_index].name, "drcorr") == 0) |
| 643 |
+ |
{ |
| 644 |
+ |
if (local_args_info.drcorr_given) |
| 645 |
+ |
{ |
| 646 |
+ |
fprintf (stderr, "%s: `--drcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
| 647 |
+ |
goto failure; |
| 648 |
+ |
} |
| 649 |
+ |
if (args_info->drcorr_given && ! override) |
| 650 |
+ |
continue; |
| 651 |
+ |
local_args_info.drcorr_given = 1; |
| 652 |
+ |
args_info->drcorr_given = 1; |
| 653 |
+ |
if (args_info->dynamicProps_group_counter && override) |
| 654 |
+ |
reset_group_dynamicProps (args_info); |
| 655 |
+ |
args_info->dynamicProps_group_counter += 1; |
| 656 |
+ |
break; |
| 657 |
+ |
} |
| 658 |
|
|
| 659 |
|
break; |
| 660 |
|
case '?': /* Invalid option. */ |
| 685 |
|
if ( error ) |
| 686 |
|
return (EXIT_FAILURE); |
| 687 |
|
|
| 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 |
– |
|
| 688 |
|
return 0; |
| 689 |
|
|
| 690 |
|
failure: |