1 |
gezelter |
1860 |
/** @file icosahedralBuilderCmd.h |
2 |
|
|
* @brief The header file for the command line option parser |
3 |
|
|
* generated by GNU Gengetopt version 2.22.4 |
4 |
|
|
* http://www.gnu.org/software/gengetopt. |
5 |
|
|
* DO NOT modify this file, since it can be overwritten |
6 |
|
|
* @author GNU Gengetopt by Lorenzo Bettini */ |
7 |
|
|
|
8 |
|
|
#ifndef ICOSAHEDRALBUILDERCMD_H |
9 |
|
|
#define ICOSAHEDRALBUILDERCMD_H |
10 |
|
|
|
11 |
|
|
/* If we use autoconf. */ |
12 |
|
|
#ifdef HAVE_CONFIG_H |
13 |
|
|
#include "config.h" |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <stdio.h> /* for FILE */ |
17 |
|
|
|
18 |
|
|
#ifdef __cplusplus |
19 |
|
|
extern "C" { |
20 |
|
|
#endif /* __cplusplus */ |
21 |
|
|
|
22 |
|
|
#ifndef CMDLINE_PARSER_PACKAGE |
23 |
|
|
/** @brief the program name (used for printing errors) */ |
24 |
|
|
#define CMDLINE_PARSER_PACKAGE "icosahedralBuilder" |
25 |
|
|
#endif |
26 |
|
|
|
27 |
|
|
#ifndef CMDLINE_PARSER_PACKAGE_NAME |
28 |
|
|
/** @brief the complete program name (used for help and version) */ |
29 |
|
|
#define CMDLINE_PARSER_PACKAGE_NAME "icosahedralBuilder" |
30 |
|
|
#endif |
31 |
|
|
|
32 |
|
|
#ifndef CMDLINE_PARSER_VERSION |
33 |
|
|
/** @brief the program version */ |
34 |
|
|
#define CMDLINE_PARSER_VERSION "1.0" |
35 |
|
|
#endif |
36 |
|
|
|
37 |
|
|
/** @brief Where the command line options are stored */ |
38 |
|
|
struct gengetopt_args_info |
39 |
|
|
{ |
40 |
|
|
const char *help_help; /**< @brief Print help and exit help description. */ |
41 |
|
|
const char *version_help; /**< @brief Print version and exit help description. */ |
42 |
|
|
char * output_arg; /**< @brief Output file name. */ |
43 |
|
|
char * output_orig; /**< @brief Output file name original value given at command line. */ |
44 |
|
|
const char *output_help; /**< @brief Output file name help description. */ |
45 |
|
|
double latticeConstant_arg; /**< @brief Lattice spacing in Angstroms for cubic lattice.. */ |
46 |
|
|
char * latticeConstant_orig; /**< @brief Lattice spacing in Angstroms for cubic lattice. original value given at command line. */ |
47 |
|
|
const char *latticeConstant_help; /**< @brief Lattice spacing in Angstroms for cubic lattice. help description. */ |
48 |
|
|
int shells_arg; /**< @brief Nanoparticle shells. */ |
49 |
|
|
char * shells_orig; /**< @brief Nanoparticle shells original value given at command line. */ |
50 |
|
|
const char *shells_help; /**< @brief Nanoparticle shells help description. */ |
51 |
|
|
|
52 |
|
|
unsigned int help_given ; /**< @brief Whether help was given. */ |
53 |
|
|
unsigned int version_given ; /**< @brief Whether version was given. */ |
54 |
|
|
unsigned int output_given ; /**< @brief Whether output was given. */ |
55 |
|
|
unsigned int latticeConstant_given ; /**< @brief Whether latticeConstant was given. */ |
56 |
|
|
unsigned int shells_given ; /**< @brief Whether shells was given. */ |
57 |
|
|
|
58 |
|
|
char **inputs ; /**< @brief unamed options (options without names) */ |
59 |
|
|
unsigned inputs_num ; /**< @brief unamed options number */ |
60 |
|
|
} ; |
61 |
|
|
|
62 |
|
|
/** @brief The additional parameters to pass to parser functions */ |
63 |
|
|
struct cmdline_parser_params |
64 |
|
|
{ |
65 |
|
|
int override; /**< @brief whether to override possibly already present options (default 0) */ |
66 |
|
|
int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ |
67 |
|
|
int check_required; /**< @brief whether to check that all required options were provided (default 1) */ |
68 |
|
|
int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ |
69 |
|
|
int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ |
70 |
|
|
} ; |
71 |
|
|
|
72 |
|
|
/** @brief the purpose string of the program */ |
73 |
|
|
extern const char *gengetopt_args_info_purpose; |
74 |
|
|
/** @brief the usage string of the program */ |
75 |
|
|
extern const char *gengetopt_args_info_usage; |
76 |
|
|
/** @brief all the lines making the help output */ |
77 |
|
|
extern const char *gengetopt_args_info_help[]; |
78 |
|
|
|
79 |
|
|
/** |
80 |
|
|
* The command line parser |
81 |
|
|
* @param argc the number of command line options |
82 |
|
|
* @param argv the command line options |
83 |
|
|
* @param args_info the structure where option information will be stored |
84 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
85 |
|
|
*/ |
86 |
|
|
int cmdline_parser (int argc, char **argv, |
87 |
|
|
struct gengetopt_args_info *args_info); |
88 |
|
|
|
89 |
|
|
/** |
90 |
|
|
* The command line parser (version with additional parameters - deprecated) |
91 |
|
|
* @param argc the number of command line options |
92 |
|
|
* @param argv the command line options |
93 |
|
|
* @param args_info the structure where option information will be stored |
94 |
|
|
* @param override whether to override possibly already present options |
95 |
|
|
* @param initialize whether to initialize the option structure my_args_info |
96 |
|
|
* @param check_required whether to check that all required options were provided |
97 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
98 |
|
|
* @deprecated use cmdline_parser_ext() instead |
99 |
|
|
*/ |
100 |
|
|
int cmdline_parser2 (int argc, char **argv, |
101 |
|
|
struct gengetopt_args_info *args_info, |
102 |
|
|
int override, int initialize, int check_required); |
103 |
|
|
|
104 |
|
|
/** |
105 |
|
|
* The command line parser (version with additional parameters) |
106 |
|
|
* @param argc the number of command line options |
107 |
|
|
* @param argv the command line options |
108 |
|
|
* @param args_info the structure where option information will be stored |
109 |
|
|
* @param params additional parameters for the parser |
110 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
111 |
|
|
*/ |
112 |
|
|
int cmdline_parser_ext (int argc, char **argv, |
113 |
|
|
struct gengetopt_args_info *args_info, |
114 |
|
|
struct cmdline_parser_params *params); |
115 |
|
|
|
116 |
|
|
/** |
117 |
|
|
* Save the contents of the option struct into an already open FILE stream. |
118 |
|
|
* @param outfile the stream where to dump options |
119 |
|
|
* @param args_info the option struct to dump |
120 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
121 |
|
|
*/ |
122 |
|
|
int cmdline_parser_dump(FILE *outfile, |
123 |
|
|
struct gengetopt_args_info *args_info); |
124 |
|
|
|
125 |
|
|
/** |
126 |
|
|
* Save the contents of the option struct into a (text) file. |
127 |
|
|
* This file can be read by the config file parser (if generated by gengetopt) |
128 |
|
|
* @param filename the file where to save |
129 |
|
|
* @param args_info the option struct to save |
130 |
|
|
* @return 0 if everything went fine, NON 0 if an error took place |
131 |
|
|
*/ |
132 |
|
|
int cmdline_parser_file_save(const char *filename, |
133 |
|
|
struct gengetopt_args_info *args_info); |
134 |
|
|
|
135 |
|
|
/** |
136 |
|
|
* Print the help |
137 |
|
|
*/ |
138 |
|
|
void cmdline_parser_print_help(void); |
139 |
|
|
/** |
140 |
|
|
* Print the version |
141 |
|
|
*/ |
142 |
|
|
void cmdline_parser_print_version(void); |
143 |
|
|
|
144 |
|
|
/** |
145 |
|
|
* Initializes all the fields a cmdline_parser_params structure |
146 |
|
|
* to their default values |
147 |
|
|
* @param params the structure to initialize |
148 |
|
|
*/ |
149 |
|
|
void cmdline_parser_params_init(struct cmdline_parser_params *params); |
150 |
|
|
|
151 |
|
|
/** |
152 |
|
|
* Allocates dynamically a cmdline_parser_params structure and initializes |
153 |
|
|
* all its fields to their default values |
154 |
|
|
* @return the created and initialized cmdline_parser_params structure |
155 |
|
|
*/ |
156 |
|
|
struct cmdline_parser_params *cmdline_parser_params_create(void); |
157 |
|
|
|
158 |
|
|
/** |
159 |
|
|
* Initializes the passed gengetopt_args_info structure's fields |
160 |
|
|
* (also set default values for options that have a default) |
161 |
|
|
* @param args_info the structure to initialize |
162 |
|
|
*/ |
163 |
|
|
void cmdline_parser_init (struct gengetopt_args_info *args_info); |
164 |
|
|
/** |
165 |
|
|
* Deallocates the string fields of the gengetopt_args_info structure |
166 |
|
|
* (but does not deallocate the structure itself) |
167 |
|
|
* @param args_info the structure to deallocate |
168 |
|
|
*/ |
169 |
|
|
void cmdline_parser_free (struct gengetopt_args_info *args_info); |
170 |
|
|
|
171 |
|
|
/** |
172 |
|
|
* Checks that all the required options were specified |
173 |
|
|
* @param args_info the structure to check |
174 |
|
|
* @param prog_name the name of the program that will be used to print |
175 |
|
|
* possible errors |
176 |
|
|
* @return |
177 |
|
|
*/ |
178 |
|
|
int cmdline_parser_required (struct gengetopt_args_info *args_info, |
179 |
|
|
const char *prog_name); |
180 |
|
|
|
181 |
|
|
|
182 |
|
|
#ifdef __cplusplus |
183 |
|
|
} |
184 |
|
|
#endif /* __cplusplus */ |
185 |
|
|
#endif /* ICOSAHEDRALBUILDERCMD_H */ |