OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
recenterCmd.hpp
Go to the documentation of this file.
1/** @file recenterCmd.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 RECENTERCMD_H
9#define RECENTERCMD_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 "recenter"
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 "recenter"
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
46 unsigned int help_given ; /**< @brief Whether help was given. */
47 unsigned int version_given ; /**< @brief Whether version was given. */
48 unsigned int output_given ; /**< @brief Whether output was given. */
49
50 char **inputs ; /**< @brief unamed options (options without names) */
51 unsigned inputs_num ; /**< @brief unamed options number */
52} ;
53
54/** @brief The additional parameters to pass to parser functions */
56{
57 int override; /**< @brief whether to override possibly already present options (default 0) */
58 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
59 int check_required; /**< @brief whether to check that all required options were provided (default 1) */
60 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
61 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
62} ;
63
64/** @brief the purpose string of the program */
65extern const char *gengetopt_args_info_purpose;
66/** @brief the usage string of the program */
67extern const char *gengetopt_args_info_usage;
68/** @brief the description string of the program */
69extern const char *gengetopt_args_info_description;
70/** @brief all the lines making the help output */
71extern const char *gengetopt_args_info_help[];
72
73/**
74 * The command line parser
75 * @param argc the number of command line options
76 * @param argv the command line options
77 * @param args_info the structure where option information will be stored
78 * @return 0 if everything went fine, NON 0 if an error took place
79 */
80int cmdline_parser (int argc, char **argv,
81 struct gengetopt_args_info *args_info);
82
83/**
84 * The command line parser (version with additional parameters - deprecated)
85 * @param argc the number of command line options
86 * @param argv the command line options
87 * @param args_info the structure where option information will be stored
88 * @param override whether to override possibly already present options
89 * @param initialize whether to initialize the option structure my_args_info
90 * @param check_required whether to check that all required options were provided
91 * @return 0 if everything went fine, NON 0 if an error took place
92 * @deprecated use cmdline_parser_ext() instead
93 */
94int cmdline_parser2 (int argc, char **argv,
95 struct gengetopt_args_info *args_info,
96 int override, int initialize, int check_required);
97
98/**
99 * The command line parser (version with additional parameters)
100 * @param argc the number of command line options
101 * @param argv the command line options
102 * @param args_info the structure where option information will be stored
103 * @param params additional parameters for the parser
104 * @return 0 if everything went fine, NON 0 if an error took place
105 */
106int cmdline_parser_ext (int argc, char **argv,
107 struct gengetopt_args_info *args_info,
108 struct cmdline_parser_params *params);
109
110/**
111 * Save the contents of the option struct into an already open FILE stream.
112 * @param outfile the stream where to dump options
113 * @param args_info the option struct to dump
114 * @return 0 if everything went fine, NON 0 if an error took place
115 */
116int cmdline_parser_dump(FILE *outfile,
117 struct gengetopt_args_info *args_info);
118
119/**
120 * Save the contents of the option struct into a (text) file.
121 * This file can be read by the config file parser (if generated by gengetopt)
122 * @param filename the file where to save
123 * @param args_info the option struct to save
124 * @return 0 if everything went fine, NON 0 if an error took place
125 */
126int cmdline_parser_file_save(const char *filename,
127 struct gengetopt_args_info *args_info);
128
129/**
130 * Print the help
131 */
133/**
134 * Print the version
135 */
137
138/**
139 * Initializes all the fields a cmdline_parser_params structure
140 * to their default values
141 * @param params the structure to initialize
142 */
144
145/**
146 * Allocates dynamically a cmdline_parser_params structure and initializes
147 * all its fields to their default values
148 * @return the created and initialized cmdline_parser_params structure
149 */
151
152/**
153 * Initializes the passed gengetopt_args_info structure's fields
154 * (also set default values for options that have a default)
155 * @param args_info the structure to initialize
156 */
157void cmdline_parser_init (struct gengetopt_args_info *args_info);
158/**
159 * Deallocates the string fields of the gengetopt_args_info structure
160 * (but does not deallocate the structure itself)
161 * @param args_info the structure to deallocate
162 */
163void cmdline_parser_free (struct gengetopt_args_info *args_info);
164
165/**
166 * The config file parser (deprecated version)
167 * @param filename the name of the config file
168 * @param args_info the structure where option information will be stored
169 * @param override whether to override possibly already present options
170 * @param initialize whether to initialize the option structure my_args_info
171 * @param check_required whether to check that all required options were provided
172 * @return 0 if everything went fine, NON 0 if an error took place
173 * @deprecated use cmdline_parser_config_file() instead
174 */
175int cmdline_parser_configfile (const char *filename,
176 struct gengetopt_args_info *args_info,
177 int override, int initialize, int check_required);
178
179/**
180 * The config file parser
181 * @param filename the name of the config file
182 * @param args_info the structure where option information will be stored
183 * @param params additional parameters for the parser
184 * @return 0 if everything went fine, NON 0 if an error took place
185 */
186int cmdline_parser_config_file (const char *filename,
187 struct gengetopt_args_info *args_info,
188 struct cmdline_parser_params *params);
189
190/**
191 * Checks that all the required options were specified
192 * @param args_info the structure to check
193 * @param prog_name the name of the program that will be used to print
194 * possible errors
195 * @return
196 */
197int cmdline_parser_required (struct gengetopt_args_info *args_info,
198 const char *prog_name);
199
200
201#ifdef __cplusplus
202}
203#endif /* __cplusplus */
204#endif /* RECENTERCMD_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.
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.
int cmdline_parser_config_file(const char *filename, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
The config file parser.
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.
int cmdline_parser_configfile(const char *filename, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
The config file parser (deprecated version)
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.
char * output_orig
output file name original value given at command line.
const char * output_help
output file name help description.
unsigned inputs_num
unamed options number
const char * help_help
Print help and exit help description.
char * output_arg
output file name.
char ** inputs
unamed options (options without names)
unsigned int help_given
Whether help was given.
unsigned int version_given
Whether version was given.
const char * version_help
Print version and exit help description.