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

« back to all changes in this revision

Viewing changes to tests/test_multiple_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 */
52
54
  int long_min; /**< @brief long option's minimum occurreces */
53
55
  int long_max; /**< @brief long option's maximum occurreces */
54
56
  const char *long_help; /**< @brief long option help description.  */
 
57
  #ifdef HAVE_LONG_LONG
 
58
  long long int* longlong_arg;  /**< @brief long long option.  */
 
59
  #else
 
60
  long* longlong_arg;   /**< @brief long long option.  */
 
61
  #endif
 
62
  char ** longlong_orig;        /**< @brief long long option original value given at command line.  */
 
63
  int longlong_min; /**< @brief long long option's minimum occurreces */
 
64
  int longlong_max; /**< @brief long long option's maximum occurreces */
 
65
  const char *longlong_help; /**< @brief long long option help description.  */
55
66
  char ** limited_arg;  /**< @brief limited multiple option.  */
56
67
  char ** limited_orig; /**< @brief limited multiple option original value given at command line.  */
57
68
  int limited_min; /**< @brief limited multiple option's minimum occurreces */
107
118
  char * file_save_orig;        /**< @brief save the passed options into a file original value given at command line.  */
108
119
  const char *file_save_help; /**< @brief save the passed options into a file help description.  */
109
120
  
110
 
  int help_given ;      /**< @brief Whether help was given.  */
111
 
  int version_given ;   /**< @brief Whether version was given.  */
 
121
  unsigned int help_given ;     /**< @brief Whether help was given.  */
 
122
  unsigned int version_given ;  /**< @brief Whether version was given.  */
112
123
  unsigned int string_given ;   /**< @brief Whether string was given.  */
113
124
  unsigned int int_given ;      /**< @brief Whether int was given.  */
114
125
  unsigned int short_given ;    /**< @brief Whether short was given.  */
115
126
  unsigned int long_given ;     /**< @brief Whether long was given.  */
 
127
  unsigned int longlong_given ; /**< @brief Whether longlong was given.  */
116
128
  unsigned int limited_given ;  /**< @brief Whether limited was given.  */
117
129
  unsigned int limited_interval_given ; /**< @brief Whether limited-interval was given.  */
118
130
  unsigned int big_limited_interval_given ;     /**< @brief Whether big-limited-interval was given.  */
124
136
  unsigned int noarg_noshort_given ;    /**< @brief Whether noarg-noshort was given.  */
125
137
  unsigned int optarg_given ;   /**< @brief Whether optarg was given.  */
126
138
  unsigned int optarg_noshort_given ;   /**< @brief Whether optarg-noshort was given.  */
127
 
  int file_save_given ; /**< @brief Whether file-save was given.  */
 
139
  unsigned int file_save_given ;        /**< @brief Whether file-save was given.  */
128
140
 
129
141
  char **inputs ; /**< @brief unamed options (options without names) */
130
142
  unsigned inputs_num ; /**< @brief unamed options number */
134
146
struct test_multiple_cmd_parser_params
135
147
{
136
148
  int override; /**< @brief whether to override possibly already present options (default 0) */
137
 
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 0) */
138
 
  int check_required; /**< @brief whether to check that all required options were provided (default 0) */
 
149
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
 
150
  int check_required; /**< @brief whether to check that all required options were provided (default 1) */
139
151
  int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
 
152
  int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
140
153
} ;
141
154
 
142
155
/** @brief the purpose string of the program */
184
197
  struct test_multiple_cmd_parser_params *params);
185
198
 
186
199
/**
 
200
 * Save the contents of the option struct into an already open FILE stream.
 
201
 * @param outfile the stream where to dump options
 
202
 * @param args_info the option struct to dump
 
203
 * @return 0 if everything went fine, NON 0 if an error took place
 
204
 */
 
205
int test_multiple_cmd_parser_dump(FILE *outfile,
 
206
  struct gengetopt_args_info *args_info);
 
207
 
 
208
/**
187
209
 * Save the contents of the option struct into a (text) file.
188
210
 * This file can be read by the config file parser (if generated by gengetopt)
189
211
 * @param filename the file where to save
203
225
void test_multiple_cmd_parser_print_version(void);
204
226
 
205
227
/**
 
228
 * Initializes all the fields a test_multiple_cmd_parser_params structure 
 
229
 * to their default values
 
230
 * @param params the structure to initialize
 
231
 */
 
232
void test_multiple_cmd_parser_params_init(struct test_multiple_cmd_parser_params *params);
 
233
 
 
234
/**
206
235
 * Allocates dynamically a test_multiple_cmd_parser_params structure and initializes
207
 
 * all its fields to 0
208
 
 * @return the initialized test_multiple_cmd_parser_params structure
 
236
 * all its fields to their default values
 
237
 * @return the created and initialized test_multiple_cmd_parser_params structure
209
238
 */
210
 
struct test_multiple_cmd_parser_params *test_multiple_cmd_parser_params_init();
 
239
struct test_multiple_cmd_parser_params *test_multiple_cmd_parser_params_create(void);
211
240
 
212
241
/**
213
242
 * Initializes the passed gengetopt_args_info structure's fields