21#define FIX_UNUSED(X) (void) (X)
27const char *gengetopt_args_info_purpose =
"Creates single-component geometric solids that can be useful in\nsimulating nanostructures. Like the other builders, it requires an\ninitial, but skeletal OpenMD file to specify the component that is to\nbe placed on the lattice. The total number of placed molecules will be\nshown at the top of the configuration file that is generated, and that\nnumber may not match the original meta-data file, so a new meta-data\nfile is also generated which matches the lattice structure.";
29const char *gengetopt_args_info_usage =
"Usage: icosahedralBuilder [OPTIONS]... [FILES]...";
31const char *gengetopt_args_info_versiontext =
"";
33const char *gengetopt_args_info_description =
"";
35const char *gengetopt_args_info_help[] = {
36 " -h, --help Print help and exit",
37 " -V, --version Print version and exit",
38 " -o, --output=STRING Output file name (mandatory)",
39 " -n, --shells=INT Nanoparticle shells",
40 " -d, --latticeConstant=DOUBLE Lattice spacing in Angstroms for cubic lattice.",
41 " -l, --lattice=STRING Lattice Type (possible values=\"FCC\",\n \"BCC\", \"SC\")",
42 " -c, --columnAtoms=INT Number of atoms along central column\n (Decahedron only)",
43 " -t, --twinAtoms=INT Number of atoms along twin boundary (Decahedron\n only)",
44 " -p, --truncatedPlanes=INT Number of truncated planes (Curling-stone\n Decahedra and Truncated Cubes only)",
45 " -u, --unitCells=INT Number of unit cell (Cuboctahedron and\n Truncated Cube only)",
46 "\n Group: clusterShape\n a cluster shape is required",
47 " --ico Create an Icosahedral cluster",
48 " --deca Create a regualar Decahedral cluster",
49 " --ino Create an Ino Decahedral cluster",
50 " --marks Create a Marks Decahedral cluster",
51 " --stone Create a Curling-stone Decahedral cluster",
52 " --cuboctahedron Create a regular Cuboctahedron (requires\n lattice)",
53 " --truncatedCube Create a Truncated Cube (requires lattice)",
61} cmdline_parser_arg_type;
73cmdline_parser_required2 (
struct gengetopt_args_info *args_info,
const char *prog_name,
const char *additional_error);
75const char *cmdline_parser_lattice_values[] = {
"FCC",
"BCC",
"SC", 0};
78gengetopt_strdup (
const char *s);
106 FIX_UNUSED (args_info);
125 args_info->
help_help = gengetopt_args_info_help[0] ;
127 args_info->
output_help = gengetopt_args_info_help[2] ;
128 args_info->
shells_help = gengetopt_args_info_help[3] ;
135 args_info->
ico_help = gengetopt_args_info_help[11] ;
136 args_info->
deca_help = gengetopt_args_info_help[12] ;
137 args_info->
ino_help = gengetopt_args_info_help[13] ;
138 args_info->
marks_help = gengetopt_args_info_help[14] ;
139 args_info->
stone_help = gengetopt_args_info_help[15] ;
146cmdline_parser_print_version (
void)
152 if (strlen(gengetopt_args_info_versiontext) > 0)
153 printf(
"\n%s\n", gengetopt_args_info_versiontext);
156static void print_help_common(
void) {
157 cmdline_parser_print_version ();
159 if (strlen(gengetopt_args_info_purpose) > 0)
160 printf(
"\n%s\n", gengetopt_args_info_purpose);
162 if (strlen(gengetopt_args_info_usage) > 0)
163 printf(
"\n%s\n", gengetopt_args_info_usage);
167 if (strlen(gengetopt_args_info_description) > 0)
168 printf(
"%s\n\n", gengetopt_args_info_description);
172cmdline_parser_print_help (
void)
176 while (gengetopt_args_info_help[i])
177 printf(
"%s\n", gengetopt_args_info_help[i++]);
183 clear_given (args_info);
184 clear_args (args_info);
185 init_args_info (args_info);
214free_string_field (
char **s)
241 free (args_info->
inputs [i]);
246 clear_given (args_info);
257check_possible_values(
const char *val,
const char *values[])
267 for (i = 0, len = strlen(val); values[i]; ++i)
269 if (strncmp(val, values[i], len) == 0)
273 if (strlen(values[i]) == len)
281 return (found ? -2 : -1);
286write_into_file(FILE *outfile,
const char *opt,
const char *arg,
const char *values[])
291 found = check_possible_values(arg, values);
294 fprintf(outfile,
"%s=\"%s\" # %s\n", opt, arg, values[found]);
296 fprintf(outfile,
"%s=\"%s\"\n", opt, arg);
298 fprintf(outfile,
"%s\n", opt);
315 write_into_file(outfile,
"help", 0, 0 );
317 write_into_file(outfile,
"version", 0, 0 );
319 write_into_file(outfile,
"output", args_info->
output_orig, 0);
321 write_into_file(outfile,
"shells", args_info->
shells_orig, 0);
325 write_into_file(outfile,
"lattice", args_info->
lattice_orig, cmdline_parser_lattice_values);
329 write_into_file(outfile,
"twinAtoms", args_info->
twinAtoms_orig, 0);
333 write_into_file(outfile,
"unitCells", args_info->
unitCells_orig, 0);
335 write_into_file(outfile,
"ico", 0, 0 );
337 write_into_file(outfile,
"deca", 0, 0 );
339 write_into_file(outfile,
"ino", 0, 0 );
341 write_into_file(outfile,
"marks", 0, 0 );
343 write_into_file(outfile,
"stone", 0, 0 );
345 write_into_file(outfile,
"cuboctahedron", 0, 0 );
347 write_into_file(outfile,
"truncatedCube", 0, 0 );
360 outfile = fopen(filename,
"w");
377 cmdline_parser_release (args_info);
382gengetopt_strdup (
const char *s)
388 result = (
char*)malloc(strlen(s) + 1);
389 if (result == (
char*)0)
423 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
440 result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0);
448 int result = EXIT_SUCCESS;
450 if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
451 result = EXIT_FAILURE;
457cmdline_parser_required2 (
struct gengetopt_args_info *args_info,
const char *prog_name,
const char *additional_error)
459 int error_occurred = 0;
460 FIX_UNUSED (additional_error);
465 fprintf (stderr,
"%s: '--output' ('-o') option required%s\n", prog_name, (additional_error ? additional_error :
""));
471 fprintf (stderr,
"%s: %d options of group clusterShape were given. One is required%s.\n", prog_name, args_info->
clusterShape_group_counter, (additional_error ? additional_error :
""));
478 return error_occurred;
536#ifndef required_argument
537#define required_argument 1
540#ifndef optional_argument
541#define optional_argument 2
544struct custom_getopt_data {
586static char *custom_optarg;
603static int custom_optind = 1;
609static int custom_opterr = 1;
615static int custom_optopt =
'?';
625static void exchange(
char **argv,
struct custom_getopt_data *d)
627 int bottom = d->first_nonopt;
628 int middle = d->last_nonopt;
629 int top = d->custom_optind;
638 while (top > middle && middle > bottom) {
639 if (top - middle > middle - bottom) {
641 int len = middle - bottom;
645 for (i = 0; i < len; i++) {
646 tem = argv[bottom + i];
648 argv[top - (middle - bottom) + i];
649 argv[top - (middle - bottom) + i] = tem;
655 int len = top - middle;
659 for (i = 0; i < len; i++) {
660 tem = argv[bottom + i];
661 argv[bottom + i] = argv[middle + i];
662 argv[middle + i] = tem;
669 d->first_nonopt += (d->custom_optind - d->last_nonopt);
670 d->last_nonopt = d->custom_optind;
674static void custom_getopt_initialize(
struct custom_getopt_data *d)
681 d->first_nonopt = d->last_nonopt = d->custom_optind;
686#define NONOPTION_P (argv[d->custom_optind][0] != '-' || argv[d->custom_optind][1] == '\0')
689static int shuffle_argv(
int argc,
char *
const *argv,
const struct option *longopts,
690 struct custom_getopt_data *d)
696 if (d->last_nonopt > d->custom_optind)
697 d->last_nonopt = d->custom_optind;
698 if (d->first_nonopt > d->custom_optind)
699 d->first_nonopt = d->custom_optind;
704 if (d->first_nonopt != d->last_nonopt &&
705 d->last_nonopt != d->custom_optind)
706 exchange((
char **) argv, d);
707 else if (d->last_nonopt != d->custom_optind)
708 d->first_nonopt = d->custom_optind;
713 while (d->custom_optind < argc && NONOPTION_P)
715 d->last_nonopt = d->custom_optind;
721 if (d->custom_optind != argc && !strcmp(argv[d->custom_optind],
"--")) {
723 if (d->first_nonopt != d->last_nonopt
724 && d->last_nonopt != d->custom_optind)
725 exchange((
char **) argv, d);
726 else if (d->first_nonopt == d->last_nonopt)
727 d->first_nonopt = d->custom_optind;
728 d->last_nonopt = argc;
729 d->custom_optind = argc;
735 if (d->custom_optind == argc) {
740 if (d->first_nonopt != d->last_nonopt)
741 d->custom_optind = d->first_nonopt;
749 d->custom_optarg = argv[d->custom_optind++];
756 d->nextchar = (argv[d->custom_optind] + 1 + (longopts != NULL && argv[d->custom_optind][1] ==
'-'));
770static int check_long_opt(
int argc,
char *
const *argv,
const char *optstring,
771 const struct option *longopts,
int *longind,
772 int print_errors,
struct custom_getopt_data *d)
775 const struct option *p;
776 const struct option *pfound = NULL;
782 for (nameend = d->nextchar; *nameend && *nameend !=
'='; nameend++)
786 for (p = longopts, option_index = 0; p->name; p++, option_index++)
787 if (!strncmp(p->name, d->nextchar, nameend - d->nextchar)) {
788 if ((
unsigned int) (nameend - d->nextchar)
789 == (
unsigned int) strlen(p->name)) {
792 indfound = option_index;
795 }
else if (pfound == NULL) {
798 indfound = option_index;
799 }
else if (pfound->has_arg != p->has_arg
800 || pfound->flag != p->flag
801 || pfound->val != p->val)
805 if (ambig && !exact) {
808 "%s: option `%s' is ambiguous\n",
809 argv[0], argv[d->custom_optind]);
811 d->nextchar += strlen(d->nextchar);
813 d->custom_optopt = 0;
817 option_index = indfound;
820 if (pfound->has_arg != no_argument)
821 d->custom_optarg = nameend + 1;
824 if (argv[d->custom_optind - 1][1] ==
'-') {
826 fprintf(stderr,
"%s: option `--%s' doesn't allow an argument\n",
827 argv[0], pfound->name);
830 fprintf(stderr,
"%s: option `%c%s' doesn't allow an argument\n",
831 argv[0], argv[d->custom_optind - 1][0], pfound->name);
835 d->nextchar += strlen(d->nextchar);
836 d->custom_optopt = pfound->val;
839 }
else if (pfound->has_arg == required_argument) {
840 if (d->custom_optind < argc)
841 d->custom_optarg = argv[d->custom_optind++];
845 "%s: option `%s' requires an argument\n",
847 argv[d->custom_optind - 1]);
849 d->nextchar += strlen(d->nextchar);
850 d->custom_optopt = pfound->val;
851 return optstring[0] ==
':' ?
':' :
'?';
854 d->nextchar += strlen(d->nextchar);
856 *longind = option_index;
858 *(pfound->flag) = pfound->val;
869 if (argv[d->custom_optind][1] ==
'-') {
872 "%s: unrecognized option `--%s'\n",
873 argv[0], d->nextchar);
877 "%s: unrecognized option `%c%s'\n",
878 argv[0], argv[d->custom_optind][0],
882 d->nextchar = (
char *)
"";
884 d->custom_optopt = 0;
888static int check_short_opt(
int argc,
char *
const *argv,
const char *optstring,
889 int print_errors,
struct custom_getopt_data *d)
891 char c = *d->nextchar++;
892 const char *temp = strchr(optstring, c);
895 if (*d->nextchar ==
'\0')
897 if (!temp || c ==
':') {
899 fprintf(stderr,
"%s: invalid option -- %c\n", argv[0], c);
901 d->custom_optopt = c;
904 if (temp[1] ==
':') {
905 if (temp[2] ==
':') {
907 if (*d->nextchar !=
'\0') {
908 d->custom_optarg = d->nextchar;
911 d->custom_optarg = NULL;
915 if (*d->nextchar !=
'\0') {
916 d->custom_optarg = d->nextchar;
923 }
else if (d->custom_optind == argc) {
926 "%s: option requires an argument -- %c\n",
929 d->custom_optopt = c;
930 if (optstring[0] ==
':')
940 d->custom_optarg = argv[d->custom_optind++];
1017static int getopt_internal_r(
int argc,
char *
const *argv,
const char *optstring,
1018 const struct option *longopts,
int *longind,
1019 struct custom_getopt_data *d)
1021 int ret, print_errors = d->custom_opterr;
1023 if (optstring[0] ==
':')
1027 d->custom_optarg = NULL;
1033 if (d->custom_optind == 0 || !d->initialized) {
1034 if (d->custom_optind == 0)
1035 d->custom_optind = 1;
1036 custom_getopt_initialize(d);
1038 if (d->nextchar == NULL || *d->nextchar ==
'\0') {
1039 ret = shuffle_argv(argc, argv, longopts, d);
1043 if (longopts && (argv[d->custom_optind][1] ==
'-' ))
1044 return check_long_opt(argc, argv, optstring, longopts,
1045 longind, print_errors, d);
1046 return check_short_opt(argc, argv, optstring, print_errors, d);
1049static int custom_getopt_internal(
int argc,
char *
const *argv,
const char *optstring,
1050 const struct option *longopts,
int *longind)
1054 static struct custom_getopt_data d;
1056 d.custom_optind = custom_optind;
1057 d.custom_opterr = custom_opterr;
1058 result = getopt_internal_r(argc, argv, optstring, longopts,
1060 custom_optind = d.custom_optind;
1061 custom_optarg = d.custom_optarg;
1062 custom_optopt = d.custom_optopt;
1066static int custom_getopt_long (
int argc,
char *
const *argv,
const char *options,
1067 const struct option *long_options,
int *opt_index)
1069 return custom_getopt_internal(argc, argv, options, long_options,
1074static char *package_name = 0;
1095int update_arg(
void *field,
char **orig_field,
1096 unsigned int *field_given,
unsigned int *prev_given,
1097 char *value,
const char *possible_values[],
1098 const char *default_value,
1099 cmdline_parser_arg_type arg_type,
1100 int check_ambiguity,
int override,
1101 int no_free,
int multiple_option,
1102 const char *long_opt,
char short_opt,
1103 const char *additional_error)
1105 char *stop_char = 0;
1106 const char *val = value;
1108 char **string_field;
1114 if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
1116 if (short_opt !=
'-')
1117 fprintf (stderr,
"%s: `--%s' (`-%c') option given more than once%s\n",
1118 package_name, long_opt, short_opt,
1119 (additional_error ? additional_error :
""));
1121 fprintf (stderr,
"%s: `--%s' option given more than once%s\n",
1122 package_name, long_opt,
1123 (additional_error ? additional_error :
""));
1127 if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
1129 if (short_opt !=
'-')
1130 fprintf (stderr,
"%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
1131 package_name, (found == -2) ?
"ambiguous" :
"invalid", value, long_opt, short_opt,
1132 (additional_error ? additional_error :
""));
1134 fprintf (stderr,
"%s: %s argument, \"%s\", for option `--%s'%s\n",
1135 package_name, (found == -2) ?
"ambiguous" :
"invalid", value, long_opt,
1136 (additional_error ? additional_error :
""));
1140 if (field_given && *field_given && !
override)
1146 if (possible_values)
1147 val = possible_values[found];
1151 if (val) *((
int *)field) = strtol (val, &stop_char, 0);
1154 if (val) *((
double *)field) = strtod (val, &stop_char);
1158 string_field = (
char **)field;
1159 if (!no_free && *string_field)
1160 free (*string_field);
1161 *string_field = gengetopt_strdup (val);
1172 if (val && !(stop_char && *stop_char ==
'\0')) {
1173 fprintf(stderr,
"%s: invalid numeric value: %s\n", package_name, val);
1186 if (value && orig_field) {
1188 *orig_field = value;
1192 *orig_field = gengetopt_strdup (value);
1202cmdline_parser_internal (
1208 int error_occurred = 0;
1214 int check_ambiguity;
1221 package_name = argv[0];
1240 int option_index = 0;
1242 static struct option long_options[] = {
1243 {
"help", 0, NULL,
'h' },
1244 {
"version", 0, NULL,
'V' },
1245 {
"output", 1, NULL,
'o' },
1246 {
"shells", 1, NULL,
'n' },
1247 {
"latticeConstant", 1, NULL,
'd' },
1248 {
"lattice", 1, NULL,
'l' },
1249 {
"columnAtoms", 1, NULL,
'c' },
1250 {
"twinAtoms", 1, NULL,
't' },
1251 {
"truncatedPlanes", 1, NULL,
'p' },
1252 {
"unitCells", 1, NULL,
'u' },
1253 {
"ico", 0, NULL, 0 },
1254 {
"deca", 0, NULL, 0 },
1255 {
"ino", 0, NULL, 0 },
1256 {
"marks", 0, NULL, 0 },
1257 {
"stone", 0, NULL, 0 },
1258 {
"cuboctahedron", 0, NULL, 0 },
1259 {
"truncatedCube", 0, NULL, 0 },
1263 custom_optarg = optarg;
1264 custom_optind = optind;
1265 custom_opterr = opterr;
1266 custom_optopt = optopt;
1268 c = custom_getopt_long (argc, argv,
"hVo:n:d:l:c:t:p:u:", long_options, &option_index);
1270 optarg = custom_optarg;
1271 optind = custom_optind;
1272 opterr = custom_opterr;
1273 optopt = custom_optopt;
1280 cmdline_parser_print_help ();
1281 cmdline_parser_free (&local_args_info);
1282 exit (EXIT_SUCCESS);
1285 cmdline_parser_print_version ();
1286 cmdline_parser_free (&local_args_info);
1287 exit (EXIT_SUCCESS);
1292 if (update_arg( (
void *)&(args_info->
output_arg),
1294 &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
1295 check_ambiguity,
override, 0, 0,
1304 if (update_arg( (
void *)&(args_info->
shells_arg),
1306 &(local_args_info.shells_given), optarg, 0, 0, ARG_INT,
1307 check_ambiguity,
override, 0, 0,
1318 &(local_args_info.latticeConstant_given), optarg, 0, 0, ARG_DOUBLE,
1319 check_ambiguity,
override, 0, 0,
1320 "latticeConstant",
'd',
1328 if (update_arg( (
void *)&(args_info->
lattice_arg),
1330 &(local_args_info.lattice_given), optarg, cmdline_parser_lattice_values, 0, ARG_STRING,
1331 check_ambiguity,
override, 0, 0,
1342 &(local_args_info.columnAtoms_given), optarg, 0, 0, ARG_INT,
1343 check_ambiguity,
override, 0, 0,
1354 &(local_args_info.twinAtoms_given), optarg, 0, 0, ARG_INT,
1355 check_ambiguity,
override, 0, 0,
1366 &(local_args_info.truncatedPlanes_given), optarg, 0, 0, ARG_INT,
1367 check_ambiguity,
override, 0, 0,
1368 "truncatedPlanes",
'p',
1378 &(local_args_info.unitCells_given), optarg, 0, 0, ARG_INT,
1379 check_ambiguity,
override, 0, 0,
1388 if (strcmp (long_options[option_index].name,
"ico") == 0)
1392 reset_group_clusterShape (args_info);
1397 &(local_args_info.ico_given), optarg, 0, 0, ARG_NO,
1398 check_ambiguity,
override, 0, 0,
1405 else if (strcmp (long_options[option_index].name,
"deca") == 0)
1409 reset_group_clusterShape (args_info);
1414 &(local_args_info.deca_given), optarg, 0, 0, ARG_NO,
1415 check_ambiguity,
override, 0, 0,
1422 else if (strcmp (long_options[option_index].name,
"ino") == 0)
1426 reset_group_clusterShape (args_info);
1431 &(local_args_info.ino_given), optarg, 0, 0, ARG_NO,
1432 check_ambiguity,
override, 0, 0,
1439 else if (strcmp (long_options[option_index].name,
"marks") == 0)
1443 reset_group_clusterShape (args_info);
1448 &(local_args_info.marks_given), optarg, 0, 0, ARG_NO,
1449 check_ambiguity,
override, 0, 0,
1456 else if (strcmp (long_options[option_index].name,
"stone") == 0)
1460 reset_group_clusterShape (args_info);
1465 &(local_args_info.stone_given), optarg, 0, 0, ARG_NO,
1466 check_ambiguity,
override, 0, 0,
1473 else if (strcmp (long_options[option_index].name,
"cuboctahedron") == 0)
1477 reset_group_clusterShape (args_info);
1482 &(local_args_info.cuboctahedron_given), optarg, 0, 0, ARG_NO,
1483 check_ambiguity,
override, 0, 0,
1484 "cuboctahedron",
'-',
1490 else if (strcmp (long_options[option_index].name,
"truncatedCube") == 0)
1494 reset_group_clusterShape (args_info);
1499 &(local_args_info.truncatedCube_given), optarg, 0, 0, ARG_NO,
1500 check_ambiguity,
override, 0, 0,
1501 "truncatedCube",
'-',
1513 fprintf (stderr,
"%s: option unknown: %c%s\n",
CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error :
""));
1520 fprintf (stderr,
"%s: %d options of group clusterShape were given. One is required%s.\n", argv[0], args_info->
clusterShape_group_counter, (additional_error ? additional_error :
""));
1528 error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error);
1531 cmdline_parser_release (&local_args_info);
1533 if ( error_occurred )
1534 return (EXIT_FAILURE);
1539 int found_prog_name = 0;
1545 args_info->
inputs_num = argc - optind - found_prog_name;
1547 (
char **)(malloc ((args_info->
inputs_num)*
sizeof(
char *))) ;
1548 while (optind < argc)
1549 args_info->
inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
1556 cmdline_parser_release (&local_args_info);
1557 return (EXIT_FAILURE);
#define CMDLINE_PARSER_VERSION
the program version
#define CMDLINE_PARSER_PACKAGE_NAME
the complete program name (used for help and version)
#define CMDLINE_PARSER_PACKAGE
the program name (used for printing errors)
The header file for the command line option parser generated by GNU Gengetopt version 2....
The additional parameters to pass to parser functions.
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
int check_required
whether to check that all required options were provided (default 1)
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
int override
whether to override possibly already present options (default 0)
Where the command line options are stored.
unsigned int ico_given
Whether ico was given.
const char * ino_help
Create an Ino Decahedral cluster help description.
const char * stone_help
Create a Curling-stone Decahedral cluster help description.
unsigned int output_given
Whether output was given.
int clusterShape_group_counter
Counter for group clusterShape.
unsigned int latticeConstant_given
Whether latticeConstant was given.
char * output_orig
output file name original value given at command line.
const char * output_help
output file name help description.
int unitCells_arg
Number of unit cell (Cuboctahedron and Truncated Cube only).
char * twinAtoms_orig
Number of atoms along twin boundary (Decahedron only) original value given at command line.
int shells_arg
Nanoparticle shells.
unsigned int truncatedPlanes_given
Whether truncatedPlanes was given.
unsigned inputs_num
unamed options number
unsigned int marks_given
Whether marks was given.
unsigned int ino_given
Whether ino was given.
const char * columnAtoms_help
Number of atoms along central column (Decahedron only) help description.
const char * shells_help
Nanoparticle shells help description.
unsigned int cuboctahedron_given
Whether cuboctahedron was given.
unsigned int stone_given
Whether stone was given.
const char * latticeConstant_help
Lattice spacing in Angstroms for cubic lattice.
char * truncatedPlanes_orig
Number of truncated planes (Curling-stone Decahedra and Truncated Cubes only) original value given at...
unsigned int lattice_given
Whether lattice was given.
const char * truncatedPlanes_help
Number of truncated planes (Curling-stone Decahedra and Truncated Cubes only) help description.
const char * lattice_help
Lattice Type help description.
unsigned int shells_given
Whether shells was given.
const char * help_help
Print help and exit help description.
int columnAtoms_arg
Number of atoms along central column (Decahedron only).
char * output_arg
output file name.
char ** inputs
unamed options (options without names)
unsigned int deca_given
Whether deca was given.
const char * unitCells_help
Number of unit cell (Cuboctahedron and Truncated Cube only) help description.
int truncatedPlanes_arg
Number of truncated planes (Curling-stone Decahedra and Truncated Cubes only).
char * latticeConstant_orig
Lattice spacing in Angstroms for cubic lattice.
const char * twinAtoms_help
Number of atoms along twin boundary (Decahedron only) help description.
unsigned int twinAtoms_given
Whether twinAtoms was given.
const char * deca_help
Create a regualar Decahedral cluster help description.
const char * ico_help
Create an Icosahedral cluster help description.
int twinAtoms_arg
Number of atoms along twin boundary (Decahedron only).
unsigned int help_given
Whether help was given.
const char * marks_help
Create a Marks Decahedral cluster help description.
char * shells_orig
Nanoparticle shells original value given at command line.
char * lattice_orig
Lattice Type original value given at command line.
unsigned int version_given
Whether version was given.
unsigned int truncatedCube_given
Whether truncatedCube was given.
const char * version_help
Print version and exit help description.
const char * truncatedCube_help
Create a Truncated Cube (requires lattice) help description.
unsigned int columnAtoms_given
Whether columnAtoms was given.
double latticeConstant_arg
Lattice spacing in Angstroms for cubic lattice.
unsigned int unitCells_given
Whether unitCells was given.
char * lattice_arg
Lattice Type.
char * columnAtoms_orig
Number of atoms along central column (Decahedron only) original value given at command line.
const char * cuboctahedron_help
Create a regular Cuboctahedron (requires lattice) help description.
char * unitCells_orig
Number of unit cell (Cuboctahedron and Truncated Cube only) original value given at command line.
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Save the contents of the option struct into an already open FILE stream.
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
The command line parser.
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Save the contents of the option struct into a (text) file.
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
The command line parser (version with additional parameters - deprecated)
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Checks that all the required options were specified.
struct cmdline_parser_params * cmdline_parser_params_create(void)
Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their defau...
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
The command line parser (version with additional parameters)
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Initializes the passed gengetopt_args_info structure's fields (also set default values for options th...
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the struc...
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Initializes all the fields a cmdline_parser_params structure to their default values.