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 */
11
/* If we use autoconf. */
16
#include <stdio.h> /* for FILE */
20
#endif /* __cplusplus */
22
#ifndef CMDLINE_PARSER_PACKAGE
23
/** @brief the program name (used for printing errors) */
24
#define CMDLINE_PARSER_PACKAGE PACKAGE
27
#ifndef CMDLINE_PARSER_PACKAGE_NAME
28
/** @brief the complete program name (used for help and version) */
30
#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME
32
#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE
36
#ifndef CMDLINE_PARSER_VERSION
37
/** @brief the program version */
38
#define CMDLINE_PARSER_VERSION VERSION
41
enum enum_action { action__NULL = -1, action_arg_register =
42
0, action_arg_authenticate
45
/** @brief Where the command line options are stored */
46
struct gengetopt_args_info {
47
const char *help_help;
48
/**< @brief Print help and exit help description. */
49
const char *version_help;
50
/**< @brief Print version and exit help description. */
51
char *origin_arg; /**< @brief Origin URL to use.. */
52
char *origin_orig; /**< @brief Origin URL to use. original value given at command line. */
53
const char *origin_help;
54
/**< @brief Origin URL to use. help description. */
55
char *appid_arg; /**< @brief Application ID to use.. */
56
char *appid_orig; /**< @brief Application ID to use. original value given at command line. */
57
const char *appid_help;
58
/**< @brief Application ID to use. help description. */
59
char *challenge_arg;/**< @brief Challenge (Base64-URL encoded) string to use.. */
60
char *challenge_orig; /**< @brief Challenge (Base64-URL encoded) string to use. original value given at command line. */
61
const char *challenge_help;
62
/**< @brief Challenge (Base64-URL encoded) string to use. help description. */
63
enum enum_action action_arg;/**< @brief Action to take.. */
64
char *action_orig; /**< @brief Action to take. original value given at command line. */
65
const char *action_help;
66
/**< @brief Action to take. help description. */
67
char *key_handle_arg; /**< @brief A file containing a key-handle. */
68
char *key_handle_orig; /**< @brief A file containing a key-handle original value given at command line. */
69
const char *key_handle_help;
70
/**< @brief A file containing a key-handle help description. */
71
char *user_key_arg; /**< @brief A file containing the public user-key. */
72
char *user_key_orig;/**< @brief A file containing the public user-key original value given at command line. */
73
const char *user_key_help;
74
/**< @brief A file containing the public user-key help description. */
75
int debug_flag; /**< @brief Print debug information to standard error (default=off). */
76
const char *debug_help;
77
/**< @brief Print debug information to standard error help description. */
79
unsigned int help_given; /**< @brief Whether help was given. */
80
unsigned int version_given; /**< @brief Whether version was given. */
81
unsigned int origin_given; /**< @brief Whether origin was given. */
82
unsigned int appid_given; /**< @brief Whether appid was given. */
83
unsigned int challenge_given; /**< @brief Whether challenge was given. */
84
unsigned int action_given; /**< @brief Whether action was given. */
85
unsigned int key_handle_given; /**< @brief Whether key-handle was given. */
86
unsigned int user_key_given;/**< @brief Whether user-key was given. */
87
unsigned int debug_given; /**< @brief Whether debug was given. */
91
/** @brief The additional parameters to pass to parser functions */
92
struct cmdline_parser_params {
94
/**< @brief whether to override possibly already present options (default 0) */
96
/**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
98
/**< @brief whether to check that all required options were provided (default 1) */
100
/**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
102
/**< @brief whether getopt_long should print an error message for a bad option (default 1) */
105
/** @brief the purpose string of the program */
106
extern const char *gengetopt_args_info_purpose;
107
/** @brief the usage string of the program */
108
extern const char *gengetopt_args_info_usage;
109
/** @brief the description string of the program */
110
extern const char *gengetopt_args_info_description;
111
/** @brief all the lines making the help output */
112
extern const char *gengetopt_args_info_help[];
115
* The command line parser
116
* @param argc the number of command line options
117
* @param argv the command line options
118
* @param args_info the structure where option information will be stored
119
* @return 0 if everything went fine, NON 0 if an error took place
121
int cmdline_parser(int argc, char **argv,
122
struct gengetopt_args_info *args_info);
125
* The command line parser (version with additional parameters - deprecated)
126
* @param argc the number of command line options
127
* @param argv the command line options
128
* @param args_info the structure where option information will be stored
129
* @param override whether to override possibly already present options
130
* @param initialize whether to initialize the option structure my_args_info
131
* @param check_required whether to check that all required options were provided
132
* @return 0 if everything went fine, NON 0 if an error took place
133
* @deprecated use cmdline_parser_ext() instead
135
int cmdline_parser2(int argc, char **argv,
136
struct gengetopt_args_info *args_info,
137
int override, int initialize, int check_required);
140
* The command line parser (version with additional parameters)
141
* @param argc the number of command line options
142
* @param argv the command line options
143
* @param args_info the structure where option information will be stored
144
* @param params additional parameters for the parser
145
* @return 0 if everything went fine, NON 0 if an error took place
147
int cmdline_parser_ext(int argc, char **argv,
148
struct gengetopt_args_info *args_info,
149
struct cmdline_parser_params *params);
152
* Save the contents of the option struct into an already open FILE stream.
153
* @param outfile the stream where to dump options
154
* @param args_info the option struct to dump
155
* @return 0 if everything went fine, NON 0 if an error took place
157
int cmdline_parser_dump(FILE * outfile,
158
struct gengetopt_args_info *args_info);
161
* Save the contents of the option struct into a (text) file.
162
* This file can be read by the config file parser (if generated by gengetopt)
163
* @param filename the file where to save
164
* @param args_info the option struct to save
165
* @return 0 if everything went fine, NON 0 if an error took place
167
int cmdline_parser_file_save(const char *filename,
168
struct gengetopt_args_info *args_info);
173
void cmdline_parser_print_help(void);
177
void cmdline_parser_print_version(void);
180
* Initializes all the fields a cmdline_parser_params structure
181
* to their default values
182
* @param params the structure to initialize
184
void cmdline_parser_params_init(struct cmdline_parser_params *params);
187
* Allocates dynamically a cmdline_parser_params structure and initializes
188
* all its fields to their default values
189
* @return the created and initialized cmdline_parser_params structure
191
struct cmdline_parser_params *cmdline_parser_params_create(void);
194
* Initializes the passed gengetopt_args_info structure's fields
195
* (also set default values for options that have a default)
196
* @param args_info the structure to initialize
198
void cmdline_parser_init(struct gengetopt_args_info *args_info);
200
* Deallocates the string fields of the gengetopt_args_info structure
201
* (but does not deallocate the structure itself)
202
* @param args_info the structure to deallocate
204
void cmdline_parser_free(struct gengetopt_args_info *args_info);
207
* Checks that all the required options were specified
208
* @param args_info the structure to check
209
* @param prog_name the name of the program that will be used to print
213
int cmdline_parser_required(struct gengetopt_args_info *args_info,
214
const char *prog_name);
216
extern const char *cmdline_parser_action_values[];/**< @brief Possible values for action. */
221
#endif /* __cplusplus */
222
#endif /* CMDLINE_H */