~ubuntu-branches/ubuntu/hardy/gengetopt/hardy

« back to all changes in this revision

Viewing changes to src/cmdline.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-01-29 14:55:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080129145540-bkah1bl330gpelmh
Tags: 2.22-1ubuntu1
* Merge with Debian; remaining changes:
  - Fix build failures with g++-4.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/** @file cmdline.h
2
2
 *  @brief The header file for the command line option parser
3
 
 *  generated by GNU Gengetopt version 2.21
 
3
 *  generated by GNU Gengetopt version 2.22
4
4
 *  http://www.gnu.org/software/gengetopt.
5
5
 *  DO NOT modify this file, since it can be overwritten
6
6
 *  @author GNU Gengetopt by Lorenzo Bettini */
13
13
#include "config.h"
14
14
#endif
15
15
 
 
16
#include <stdio.h> /* for FILE */
 
17
 
16
18
#ifdef __cplusplus
17
19
extern "C" {
18
20
#endif /* __cplusplus */
31
33
struct gengetopt_args_info
32
34
{
33
35
  const char *help_help; /**< @brief Print help and exit help description.  */
 
36
  const char *detailed_help_help; /**< @brief Print help, including all details and hidden options, and exit help description.  */
34
37
  const char *version_help; /**< @brief Print version and exit help description.  */
35
38
  char * input_arg;     /**< @brief input file (default std input).  */
36
39
  char * input_orig;    /**< @brief input file (default std input) original value given at command line.  */
62
65
  const char *string_parser_help; /**< @brief generate a string parser (the string contains the command line) help description.  */
63
66
  const char *include_getopt_help; /**< @brief adds the code for getopt_long in the generated C file help description.  */
64
67
  const char *no_handle_help_help; /**< @brief do not handle --help|-h automatically help description.  */
 
68
  const char *no_help_help; /**< @brief do not add --help|-h automatically help description.  */
65
69
  const char *no_handle_version_help; /**< @brief do not handle --version|-V automatically help description.  */
 
70
  const char *no_version_help; /**< @brief do not add --version|-V automatically help description.  */
66
71
  const char *no_handle_error_help; /**< @brief do not exit on errors help description.  */
67
72
  char * show_required_arg;     /**< @brief in the output of help will specify which options are mandatory, by using the optional passed string (default='(mandatory)').  */
68
73
  char * show_required_orig;    /**< @brief in the output of help will specify which options are mandatory, by using the optional passed string original value given at command line.  */
76
81
  char * set_version_orig;      /**< @brief set the version number (override version defined in the .ggo file) original value given at command line.  */
77
82
  const char *set_version_help; /**< @brief set the version number (override version defined in the .ggo file) help description.  */
78
83
  const char *show_help_help; /**< @brief show the output of --help instead of generating code help description.  */
79
 
  const char *show_full_help_help; /**< @brief show the output of --help (including hidden options) instead of generating code help description.  */
 
84
  const char *show_full_help_help; /**< @brief show the output of --full-help (i.e., including hidden options) instead of generating code help description.  */
 
85
  const char *show_detailed_help_help; /**< @brief show the output of --detailed-help (i.e., including details and hidden options) instead of generating code help description.  */
80
86
  const char *show_version_help; /**< @brief show the output of --version instead of generating code help description.  */
81
87
  
82
 
  int help_given ;      /**< @brief Whether help was given.  */
83
 
  int version_given ;   /**< @brief Whether version was given.  */
84
 
  int input_given ;     /**< @brief Whether input was given.  */
85
 
  int func_name_given ; /**< @brief Whether func-name was given.  */
86
 
  int arg_struct_name_given ;   /**< @brief Whether arg-struct-name was given.  */
87
 
  int file_name_given ; /**< @brief Whether file-name was given.  */
88
 
  int output_dir_given ;        /**< @brief Whether output-dir was given.  */
89
 
  int c_extension_given ;       /**< @brief Whether c-extension was given.  */
90
 
  int header_extension_given ;  /**< @brief Whether header-extension was given.  */
91
 
  int long_help_given ; /**< @brief Whether long-help was given.  */
92
 
  int default_optional_given ;  /**< @brief Whether default-optional was given.  */
93
 
  int unamed_opts_given ;       /**< @brief Whether unamed-opts was given.  */
94
 
  int conf_parser_given ;       /**< @brief Whether conf-parser was given.  */
95
 
  int string_parser_given ;     /**< @brief Whether string-parser was given.  */
96
 
  int include_getopt_given ;    /**< @brief Whether include-getopt was given.  */
97
 
  int no_handle_help_given ;    /**< @brief Whether no-handle-help was given.  */
98
 
  int no_handle_version_given ; /**< @brief Whether no-handle-version was given.  */
99
 
  int no_handle_error_given ;   /**< @brief Whether no-handle-error was given.  */
100
 
  int show_required_given ;     /**< @brief Whether show-required was given.  */
101
 
  int gen_version_given ;       /**< @brief Whether gen-version was given.  */
102
 
  int set_package_given ;       /**< @brief Whether set-package was given.  */
103
 
  int set_version_given ;       /**< @brief Whether set-version was given.  */
104
 
  int show_help_given ; /**< @brief Whether show-help was given.  */
105
 
  int show_full_help_given ;    /**< @brief Whether show-full-help was given.  */
106
 
  int show_version_given ;      /**< @brief Whether show-version was given.  */
 
88
  unsigned int help_given ;     /**< @brief Whether help was given.  */
 
89
  unsigned int detailed_help_given ;    /**< @brief Whether detailed-help was given.  */
 
90
  unsigned int version_given ;  /**< @brief Whether version was given.  */
 
91
  unsigned int input_given ;    /**< @brief Whether input was given.  */
 
92
  unsigned int func_name_given ;        /**< @brief Whether func-name was given.  */
 
93
  unsigned int arg_struct_name_given ;  /**< @brief Whether arg-struct-name was given.  */
 
94
  unsigned int file_name_given ;        /**< @brief Whether file-name was given.  */
 
95
  unsigned int output_dir_given ;       /**< @brief Whether output-dir was given.  */
 
96
  unsigned int c_extension_given ;      /**< @brief Whether c-extension was given.  */
 
97
  unsigned int header_extension_given ; /**< @brief Whether header-extension was given.  */
 
98
  unsigned int long_help_given ;        /**< @brief Whether long-help was given.  */
 
99
  unsigned int default_optional_given ; /**< @brief Whether default-optional was given.  */
 
100
  unsigned int unamed_opts_given ;      /**< @brief Whether unamed-opts was given.  */
 
101
  unsigned int conf_parser_given ;      /**< @brief Whether conf-parser was given.  */
 
102
  unsigned int string_parser_given ;    /**< @brief Whether string-parser was given.  */
 
103
  unsigned int include_getopt_given ;   /**< @brief Whether include-getopt was given.  */
 
104
  unsigned int no_handle_help_given ;   /**< @brief Whether no-handle-help was given.  */
 
105
  unsigned int no_help_given ;  /**< @brief Whether no-help was given.  */
 
106
  unsigned int no_handle_version_given ;        /**< @brief Whether no-handle-version was given.  */
 
107
  unsigned int no_version_given ;       /**< @brief Whether no-version was given.  */
 
108
  unsigned int no_handle_error_given ;  /**< @brief Whether no-handle-error was given.  */
 
109
  unsigned int show_required_given ;    /**< @brief Whether show-required was given.  */
 
110
  unsigned int gen_version_given ;      /**< @brief Whether gen-version was given.  */
 
111
  unsigned int set_package_given ;      /**< @brief Whether set-package was given.  */
 
112
  unsigned int set_version_given ;      /**< @brief Whether set-version was given.  */
 
113
  unsigned int show_help_given ;        /**< @brief Whether show-help was given.  */
 
114
  unsigned int show_full_help_given ;   /**< @brief Whether show-full-help was given.  */
 
115
  unsigned int show_detailed_help_given ;       /**< @brief Whether show-detailed-help was given.  */
 
116
  unsigned int show_version_given ;     /**< @brief Whether show-version was given.  */
107
117
 
108
118
} ;
109
119
 
111
121
struct cmdline_parser_params
112
122
{
113
123
  int override; /**< @brief whether to override possibly already present options (default 0) */
114
 
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 0) */
115
 
  int check_required; /**< @brief whether to check that all required options were provided (default 0) */
 
124
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
 
125
  int check_required; /**< @brief whether to check that all required options were provided (default 1) */
116
126
  int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
 
127
  int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
117
128
} ;
118
129
 
119
130
/** @brief the purpose string of the program */
122
133
extern const char *gengetopt_args_info_usage;
123
134
/** @brief all the lines making the help output */
124
135
extern const char *gengetopt_args_info_help[];
 
136
/** @brief all the lines making the detailed help output (including hidden options and details) */
 
137
extern const char *gengetopt_args_info_detailed_help[];
125
138
 
126
139
/**
127
140
 * The command line parser
161
174
  struct cmdline_parser_params *params);
162
175
 
163
176
/**
 
177
 * Save the contents of the option struct into an already open FILE stream.
 
178
 * @param outfile the stream where to dump options
 
179
 * @param args_info the option struct to dump
 
180
 * @return 0 if everything went fine, NON 0 if an error took place
 
181
 */
 
182
int cmdline_parser_dump(FILE *outfile,
 
183
  struct gengetopt_args_info *args_info);
 
184
 
 
185
/**
164
186
 * Save the contents of the option struct into a (text) file.
165
187
 * This file can be read by the config file parser (if generated by gengetopt)
166
188
 * @param filename the file where to save
175
197
 */
176
198
void cmdline_parser_print_help(void);
177
199
/**
 
200
 * Print the detailed help (including hidden options and details)
 
201
 */
 
202
void cmdline_parser_print_detailed_help(void);
 
203
/**
178
204
 * Print the version
179
205
 */
180
206
void cmdline_parser_print_version(void);
181
207
 
182
208
/**
 
209
 * Initializes all the fields a cmdline_parser_params structure 
 
210
 * to their default values
 
211
 * @param params the structure to initialize
 
212
 */
 
213
void cmdline_parser_params_init(struct cmdline_parser_params *params);
 
214
 
 
215
/**
183
216
 * Allocates dynamically a cmdline_parser_params structure and initializes
184
 
 * all its fields to 0
185
 
 * @return the initialized cmdline_parser_params structure
 
217
 * all its fields to their default values
 
218
 * @return the created and initialized cmdline_parser_params structure
186
219
 */
187
 
struct cmdline_parser_params *cmdline_parser_params_init();
 
220
struct cmdline_parser_params *cmdline_parser_params_create(void);
188
221
 
189
222
/**
190
223
 * Initializes the passed gengetopt_args_info structure's fields