OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
simpleBuilderCmd.hpp
Go to the documentation of this file.
1/** @file simpleBuilderCmd.hpp
2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.6
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 SIMPLEBUILDERCMD_H
9#define SIMPLEBUILDERCMD_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
19extern "C" {
20#endif /* __cplusplus */
21
22#ifndef CMDLINE_PARSER_PACKAGE
23/** @brief the program name (used for printing errors) */
24#define CMDLINE_PARSER_PACKAGE "simpleBuilder"
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 "simpleBuilder"
30#endif
31
32#ifndef CMDLINE_PARSER_VERSION
33/** @brief the program version */
34#define CMDLINE_PARSER_VERSION ""
35#endif
36
37/** @brief Where the command line options are stored */
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 density_arg; /**< @brief density (g/cm^3). */
46 char * density_orig; /**< @brief density (g/cm^3) original value given at command line. */
47 const char *density_help; /**< @brief density (g/cm^3) help description. */
48 int nx_arg; /**< @brief number of unit cells in x. */
49 char * nx_orig; /**< @brief number of unit cells in x original value given at command line. */
50 const char *nx_help; /**< @brief number of unit cells in x help description. */
51 int ny_arg; /**< @brief number of unit cells in y. */
52 char * ny_orig; /**< @brief number of unit cells in y original value given at command line. */
53 const char *ny_help; /**< @brief number of unit cells in y help description. */
54 int nz_arg; /**< @brief number of unit cells in z. */
55 char * nz_orig; /**< @brief number of unit cells in z original value given at command line. */
56 const char *nz_help; /**< @brief number of unit cells in z help description. */
57 char * lattice_arg; /**< @brief Lattice Type. */
58 char * lattice_orig; /**< @brief Lattice Type original value given at command line. */
59 const char *lattice_help; /**< @brief Lattice Type help description. */
60
61 unsigned int help_given ; /**< @brief Whether help was given. */
62 unsigned int version_given ; /**< @brief Whether version was given. */
63 unsigned int output_given ; /**< @brief Whether output was given. */
64 unsigned int density_given ; /**< @brief Whether density was given. */
65 unsigned int nx_given ; /**< @brief Whether nx was given. */
66 unsigned int ny_given ; /**< @brief Whether ny was given. */
67 unsigned int nz_given ; /**< @brief Whether nz was given. */
68 unsigned int lattice_given ; /**< @brief Whether lattice was given. */
69
70 char **inputs ; /**< @brief unamed options (options without names) */
71 unsigned inputs_num ; /**< @brief unamed options number */
72} ;
73
74/** @brief The additional parameters to pass to parser functions */
76{
77 int override; /**< @brief whether to override possibly already present options (default 0) */
78 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
79 int check_required; /**< @brief whether to check that all required options were provided (default 1) */
80 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
81 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
82} ;
83
84/** @brief the purpose string of the program */
85extern const char *gengetopt_args_info_purpose;
86/** @brief the usage string of the program */
87extern const char *gengetopt_args_info_usage;
88/** @brief the description string of the program */
89extern const char *gengetopt_args_info_description;
90/** @brief all the lines making the help output */
91extern const char *gengetopt_args_info_help[];
92
93/**
94 * The command line parser
95 * @param argc the number of command line options
96 * @param argv the command line options
97 * @param args_info the structure where option information will be stored
98 * @return 0 if everything went fine, NON 0 if an error took place
99 */
100int cmdline_parser (int argc, char **argv,
101 struct gengetopt_args_info *args_info);
102
103/**
104 * The command line parser (version with additional parameters - deprecated)
105 * @param argc the number of command line options
106 * @param argv the command line options
107 * @param args_info the structure where option information will be stored
108 * @param override whether to override possibly already present options
109 * @param initialize whether to initialize the option structure my_args_info
110 * @param check_required whether to check that all required options were provided
111 * @return 0 if everything went fine, NON 0 if an error took place
112 * @deprecated use cmdline_parser_ext() instead
113 */
114int cmdline_parser2 (int argc, char **argv,
115 struct gengetopt_args_info *args_info,
116 int override, int initialize, int check_required);
117
118/**
119 * The command line parser (version with additional parameters)
120 * @param argc the number of command line options
121 * @param argv the command line options
122 * @param args_info the structure where option information will be stored
123 * @param params additional parameters for the parser
124 * @return 0 if everything went fine, NON 0 if an error took place
125 */
126int cmdline_parser_ext (int argc, char **argv,
127 struct gengetopt_args_info *args_info,
128 struct cmdline_parser_params *params);
129
130/**
131 * Save the contents of the option struct into an already open FILE stream.
132 * @param outfile the stream where to dump options
133 * @param args_info the option struct to dump
134 * @return 0 if everything went fine, NON 0 if an error took place
135 */
136int cmdline_parser_dump(FILE *outfile,
137 struct gengetopt_args_info *args_info);
138
139/**
140 * Save the contents of the option struct into a (text) file.
141 * This file can be read by the config file parser (if generated by gengetopt)
142 * @param filename the file where to save
143 * @param args_info the option struct to save
144 * @return 0 if everything went fine, NON 0 if an error took place
145 */
146int cmdline_parser_file_save(const char *filename,
147 struct gengetopt_args_info *args_info);
148
149/**
150 * Print the help
151 */
153/**
154 * Print the version
155 */
157
158/**
159 * Initializes all the fields a cmdline_parser_params structure
160 * to their default values
161 * @param params the structure to initialize
162 */
164
165/**
166 * Allocates dynamically a cmdline_parser_params structure and initializes
167 * all its fields to their default values
168 * @return the created and initialized cmdline_parser_params structure
169 */
171
172/**
173 * Initializes the passed gengetopt_args_info structure's fields
174 * (also set default values for options that have a default)
175 * @param args_info the structure to initialize
176 */
177void cmdline_parser_init (struct gengetopt_args_info *args_info);
178/**
179 * Deallocates the string fields of the gengetopt_args_info structure
180 * (but does not deallocate the structure itself)
181 * @param args_info the structure to deallocate
182 */
183void cmdline_parser_free (struct gengetopt_args_info *args_info);
184
185/**
186 * Checks that all the required options were specified
187 * @param args_info the structure to check
188 * @param prog_name the name of the program that will be used to print
189 * possible errors
190 * @return
191 */
192int cmdline_parser_required (struct gengetopt_args_info *args_info,
193 const char *prog_name);
194
195extern const char *cmdline_parser_lattice_values[]; /**< @brief Possible values for lattice. */
196
197
198#ifdef __cplusplus
199}
200#endif /* __cplusplus */
201#endif /* SIMPLEBUILDERCMD_H */
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.
const char * cmdline_parser_lattice_values[]
Possible values for lattice.
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.
const char * gengetopt_args_info_purpose
the purpose string of the program
const char * gengetopt_args_info_help[]
all the lines making the help output
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.
void cmdline_parser_print_version(void)
Print the version.
struct cmdline_parser_params * cmdline_parser_params_create(void)
Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their defau...
const char * gengetopt_args_info_usage
the usage string of the program
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...
const char * gengetopt_args_info_description
the description string of the program
void cmdline_parser_print_help(void)
Print the help.
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.
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)
Where the command line options are stored.
unsigned int output_given
Whether output was given.
unsigned int density_given
Whether density was given.
char * output_orig
output file name original value given at command line.
const char * output_help
output file name help description.
unsigned int ny_given
Whether ny was given.
char * nx_orig
number of unit cells in x original value given at command line.
const char * ny_help
number of unit cells in y help description.
unsigned inputs_num
unamed options number
unsigned int nx_given
Whether nx was given.
unsigned int nz_given
Whether nz was given.
unsigned int lattice_given
Whether lattice was given.
char * density_orig
density (g/cm^3) original value given at command line.
const char * lattice_help
Lattice Type help description.
const char * help_help
Print help and exit help description.
char * ny_orig
number of unit cells in y original value given at command line.
char * output_arg
output file name.
char ** inputs
unamed options (options without names)
const char * nx_help
number of unit cells in x help description.
int ny_arg
number of unit cells in y.
char * nz_orig
number of unit cells in z original value given at command line.
int nz_arg
number of unit cells in z.
const char * nz_help
number of unit cells in z help description.
double density_arg
density (g/cm^3).
unsigned int help_given
Whether help was given.
int nx_arg
number of unit cells in x.
char * lattice_orig
Lattice Type original value given at command line.
unsigned int version_given
Whether version was given.
const char * version_help
Print version and exit help description.
char * lattice_arg
Lattice Type.
const char * density_help
density (g/cm^3) help description.