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

« back to all changes in this revision

Viewing changes to tests/test_conf_parser_cmd.h.test

  • 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:
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 */
101
103
  char * file_save_orig;        /**< @brief save the passed options into a file original value given at command line.  */
102
104
  const char *file_save_help; /**< @brief save the passed options into a file help description.  */
103
105
  
104
 
  int help_given ;      /**< @brief Whether help was given.  */
105
 
  int version_given ;   /**< @brief Whether version was given.  */
106
 
  int opta_given ;      /**< @brief Whether opta was given.  */
107
 
  int optb_given ;      /**< @brief Whether optb was given.  */
108
 
  int optc_given ;      /**< @brief Whether optc was given.  */
109
 
  int optd_given ;      /**< @brief Whether optd was given.  */
110
 
  int string_given ;    /**< @brief Whether string was given.  */
111
 
  int int_given ;       /**< @brief Whether int was given.  */
112
 
  int short_given ;     /**< @brief Whether short was given.  */
113
 
  int long_given ;      /**< @brief Whether long was given.  */
114
 
  int float_given ;     /**< @brief Whether float was given.  */
115
 
  int double_given ;    /**< @brief Whether double was given.  */
116
 
  int longdouble_given ;        /**< @brief Whether longdouble was given.  */
117
 
  int longlong_given ;  /**< @brief Whether longlong was given.  */
118
 
  int flag_given ;      /**< @brief Whether flag was given.  */
119
 
  int function_given ;  /**< @brief Whether function was given.  */
120
 
  int no_short_given ;  /**< @brief Whether no-short was given.  */
121
 
  int required_given ;  /**< @brief Whether required was given.  */
122
 
  int conf_file_given ; /**< @brief Whether conf-file was given.  */
 
106
  unsigned int help_given ;     /**< @brief Whether help was given.  */
 
107
  unsigned int version_given ;  /**< @brief Whether version was given.  */
 
108
  unsigned int opta_given ;     /**< @brief Whether opta was given.  */
 
109
  unsigned int optb_given ;     /**< @brief Whether optb was given.  */
 
110
  unsigned int optc_given ;     /**< @brief Whether optc was given.  */
 
111
  unsigned int optd_given ;     /**< @brief Whether optd was given.  */
 
112
  unsigned int string_given ;   /**< @brief Whether string was given.  */
 
113
  unsigned int int_given ;      /**< @brief Whether int was given.  */
 
114
  unsigned int short_given ;    /**< @brief Whether short was given.  */
 
115
  unsigned int long_given ;     /**< @brief Whether long was given.  */
 
116
  unsigned int float_given ;    /**< @brief Whether float was given.  */
 
117
  unsigned int double_given ;   /**< @brief Whether double was given.  */
 
118
  unsigned int longdouble_given ;       /**< @brief Whether longdouble was given.  */
 
119
  unsigned int longlong_given ; /**< @brief Whether longlong was given.  */
 
120
  unsigned int flag_given ;     /**< @brief Whether flag was given.  */
 
121
  unsigned int function_given ; /**< @brief Whether function was given.  */
 
122
  unsigned int no_short_given ; /**< @brief Whether no-short was given.  */
 
123
  unsigned int required_given ; /**< @brief Whether required was given.  */
 
124
  unsigned int conf_file_given ;        /**< @brief Whether conf-file was given.  */
123
125
  unsigned int multi_string_given ;     /**< @brief Whether multi-string was given.  */
124
126
  unsigned int multi_string_def_given ; /**< @brief Whether multi-string-def was given.  */
125
127
  unsigned int noarg_given ;    /**< @brief Whether noarg was given.  */
126
128
  unsigned int noarg_noshort_given ;    /**< @brief Whether noarg-noshort was given.  */
127
 
  int opt_arg_given ;   /**< @brief Whether opt-arg was given.  */
128
 
  int file_save_given ; /**< @brief Whether file-save was given.  */
 
129
  unsigned int opt_arg_given ;  /**< @brief Whether opt-arg was given.  */
 
130
  unsigned int file_save_given ;        /**< @brief Whether file-save was given.  */
129
131
 
130
132
  char **inputs ; /**< @brief unamed options (options without names) */
131
133
  unsigned inputs_num ; /**< @brief unamed options number */
137
139
struct test_conf_parser_cmd_parser_params
138
140
{
139
141
  int override; /**< @brief whether to override possibly already present options (default 0) */
140
 
  int initialize; /**< @brief whether to initialize the option structure my_args_info (default 0) */
141
 
  int check_required; /**< @brief whether to check that all required options were provided (default 0) */
 
142
  int initialize; /**< @brief whether to initialize the option structure my_args_info (default 1) */
 
143
  int check_required; /**< @brief whether to check that all required options were provided (default 1) */
142
144
  int check_ambiguity; /**< @brief whether to check for options already specified in the option structure my_args_info (default 0) */
 
145
  int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
143
146
} ;
144
147
 
145
148
/** @brief the purpose string of the program */
187
190
  struct test_conf_parser_cmd_parser_params *params);
188
191
 
189
192
/**
 
193
 * Save the contents of the option struct into an already open FILE stream.
 
194
 * @param outfile the stream where to dump options
 
195
 * @param args_info the option struct to dump
 
196
 * @return 0 if everything went fine, NON 0 if an error took place
 
197
 */
 
198
int test_conf_parser_cmd_parser_dump(FILE *outfile,
 
199
  struct my_args_info *args_info);
 
200
 
 
201
/**
190
202
 * Save the contents of the option struct into a (text) file.
191
203
 * This file can be read by the config file parser (if generated by gengetopt)
192
204
 * @param filename the file where to save
206
218
void test_conf_parser_cmd_parser_print_version(void);
207
219
 
208
220
/**
 
221
 * Initializes all the fields a test_conf_parser_cmd_parser_params structure 
 
222
 * to their default values
 
223
 * @param params the structure to initialize
 
224
 */
 
225
void test_conf_parser_cmd_parser_params_init(struct test_conf_parser_cmd_parser_params *params);
 
226
 
 
227
/**
209
228
 * Allocates dynamically a test_conf_parser_cmd_parser_params structure and initializes
210
 
 * all its fields to 0
211
 
 * @return the initialized test_conf_parser_cmd_parser_params structure
 
229
 * all its fields to their default values
 
230
 * @return the created and initialized test_conf_parser_cmd_parser_params structure
212
231
 */
213
 
struct test_conf_parser_cmd_parser_params *test_conf_parser_cmd_parser_params_init();
 
232
struct test_conf_parser_cmd_parser_params *test_conf_parser_cmd_parser_params_create(void);
214
233
 
215
234
/**
216
235
 * Initializes the passed my_args_info structure's fields