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

« back to all changes in this revision

Viewing changes to tests/test_redef_help_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 */
30
32
/** @brief Where the command line options are stored */
31
33
struct gengetopt_args_info
32
34
{
 
35
  const char *help_help; /**< @brief Print help and exit help description.  */
 
36
  const char *version_help; /**< @brief Print version and exit help description.  */
33
37
  const char *height_help; /**< @brief height help description.  */
34
38
  const char *vavoom_help; /**< @brief vavoom instead of version help description.  */
35
39
  
36
 
  int height_given ;    /**< @brief Whether height was given.  */
37
 
  int vavoom_given ;    /**< @brief Whether vavoom was given.  */
 
40
  unsigned int help_given ;     /**< @brief Whether help was given.  */
 
41
  unsigned int version_given ;  /**< @brief Whether version was given.  */
 
42
  unsigned int height_given ;   /**< @brief Whether height was given.  */
 
43
  unsigned int vavoom_given ;   /**< @brief Whether vavoom was given.  */
38
44
 
39
45
  char **inputs ; /**< @brief unamed options (options without names) */
40
46
  unsigned inputs_num ; /**< @brief unamed options number */
44
50
struct test_redef_help_cmd_parser_params
45
51
{
46
52
  int override; /**< @brief whether to override possibly already present options (default 0) */
47
 
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 0) */
48
 
  int check_required; /**< @brief whether to check that all required options were provided (default 0) */
 
53
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
 
54
  int check_required; /**< @brief whether to check that all required options were provided (default 1) */
49
55
  int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
 
56
  int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
50
57
} ;
51
58
 
52
59
/** @brief the purpose string of the program */
94
101
  struct test_redef_help_cmd_parser_params *params);
95
102
 
96
103
/**
 
104
 * Save the contents of the option struct into an already open FILE stream.
 
105
 * @param outfile the stream where to dump options
 
106
 * @param args_info the option struct to dump
 
107
 * @return 0 if everything went fine, NON 0 if an error took place
 
108
 */
 
109
int test_redef_help_cmd_parser_dump(FILE *outfile,
 
110
  struct gengetopt_args_info *args_info);
 
111
 
 
112
/**
97
113
 * Save the contents of the option struct into a (text) file.
98
114
 * This file can be read by the config file parser (if generated by gengetopt)
99
115
 * @param filename the file where to save
113
129
void test_redef_help_cmd_parser_print_version(void);
114
130
 
115
131
/**
 
132
 * Initializes all the fields a test_redef_help_cmd_parser_params structure 
 
133
 * to their default values
 
134
 * @param params the structure to initialize
 
135
 */
 
136
void test_redef_help_cmd_parser_params_init(struct test_redef_help_cmd_parser_params *params);
 
137
 
 
138
/**
116
139
 * Allocates dynamically a test_redef_help_cmd_parser_params structure and initializes
117
 
 * all its fields to 0
118
 
 * @return the initialized test_redef_help_cmd_parser_params structure
 
140
 * all its fields to their default values
 
141
 * @return the created and initialized test_redef_help_cmd_parser_params structure
119
142
 */
120
 
struct test_redef_help_cmd_parser_params *test_redef_help_cmd_parser_params_init();
 
143
struct test_redef_help_cmd_parser_params *test_redef_help_cmd_parser_params_create(void);
121
144
 
122
145
/**
123
146
 * Initializes the passed gengetopt_args_info structure's fields