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

« back to all changes in this revision

Viewing changes to tests/no_strings_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 */
36
38
  char * foo_orig;      /**< @brief foo option original value given at command line.  */
37
39
  const char *foo_help; /**< @brief foo option help description.  */
38
40
  
39
 
  int help_given ;      /**< @brief Whether help was given.  */
40
 
  int version_given ;   /**< @brief Whether version was given.  */
41
 
  int foo_given ;       /**< @brief Whether foo was given.  */
 
41
  unsigned int help_given ;     /**< @brief Whether help was given.  */
 
42
  unsigned int version_given ;  /**< @brief Whether version was given.  */
 
43
  unsigned int foo_given ;      /**< @brief Whether foo was given.  */
42
44
 
43
45
  char **inputs ; /**< @brief unamed options (options without names) */
44
46
  unsigned inputs_num ; /**< @brief unamed options number */
48
50
struct no_strings_cmd_parser_params
49
51
{
50
52
  int override; /**< @brief whether to override possibly already present options (default 0) */
51
 
  int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 0) */
52
 
  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) */
53
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) */
54
57
} ;
55
58
 
56
59
/** @brief the purpose string of the program */
98
101
  struct no_strings_cmd_parser_params *params);
99
102
 
100
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 no_strings_cmd_parser_dump(FILE *outfile,
 
110
  struct gengetopt_args_info *args_info);
 
111
 
 
112
/**
101
113
 * Save the contents of the option struct into a (text) file.
102
114
 * This file can be read by the config file parser (if generated by gengetopt)
103
115
 * @param filename the file where to save
117
129
void no_strings_cmd_parser_print_version(void);
118
130
 
119
131
/**
 
132
 * Initializes all the fields a no_strings_cmd_parser_params structure 
 
133
 * to their default values
 
134
 * @param params the structure to initialize
 
135
 */
 
136
void no_strings_cmd_parser_params_init(struct no_strings_cmd_parser_params *params);
 
137
 
 
138
/**
120
139
 * Allocates dynamically a no_strings_cmd_parser_params structure and initializes
121
 
 * all its fields to 0
122
 
 * @return the initialized no_strings_cmd_parser_params structure
 
140
 * all its fields to their default values
 
141
 * @return the created and initialized no_strings_cmd_parser_params structure
123
142
 */
124
 
struct no_strings_cmd_parser_params *no_strings_cmd_parser_params_init();
 
143
struct no_strings_cmd_parser_params *no_strings_cmd_parser_params_create(void);
125
144
 
126
145
/**
127
146
 * Initializes the passed gengetopt_args_info structure's fields