comparison lib/getopt.in.h @ 12421:e8d2c6fc33ad

Use spaces for indentation, not tabs.
author Bruno Haible <bruno@clisp.org>
date Thu, 10 Dec 2009 20:28:30 +0100
parents 4ace69c0279d
children f7842310a565
comparison
equal deleted inserted replaced
12420:5850b9a81029 12421:e8d2c6fc33ad
113 #ifndef __THROW 113 #ifndef __THROW
114 # ifndef __GNUC_PREREQ 114 # ifndef __GNUC_PREREQ
115 # define __GNUC_PREREQ(maj, min) (0) 115 # define __GNUC_PREREQ(maj, min) (0)
116 # endif 116 # endif
117 # if defined __cplusplus && __GNUC_PREREQ (2,8) 117 # if defined __cplusplus && __GNUC_PREREQ (2,8)
118 # define __THROW throw () 118 # define __THROW throw ()
119 # else 119 # else
120 # define __THROW 120 # define __THROW
121 # endif 121 # endif
122 #endif 122 #endif
123 123
161 The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector 161 The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
162 of `struct option' terminated by an element containing a name which is 162 of `struct option' terminated by an element containing a name which is
163 zero. 163 zero.
164 164
165 The field `has_arg' is: 165 The field `has_arg' is:
166 no_argument (or 0) if the option does not take an argument, 166 no_argument (or 0) if the option does not take an argument,
167 required_argument (or 1) if the option requires an argument, 167 required_argument (or 1) if the option requires an argument,
168 optional_argument (or 2) if the option takes an optional argument. 168 optional_argument (or 2) if the option takes an optional argument.
169 169
170 If the field `flag' is not NULL, it points to a variable that is set 170 If the field `flag' is not NULL, it points to a variable that is set
171 to the value given in the field `val' when the option is found, but 171 to the value given in the field `val' when the option is found, but
172 left unchanged if the option is not found. 172 left unchanged if the option is not found.
173 173
188 int val; 188 int val;
189 }; 189 };
190 190
191 /* Names for the values of the `has_arg' field of `struct option'. */ 191 /* Names for the values of the `has_arg' field of `struct option'. */
192 192
193 # define no_argument 0 193 # define no_argument 0
194 # define required_argument 1 194 # define required_argument 1
195 # define optional_argument 2 195 # define optional_argument 2
196 #endif /* need getopt */ 196 #endif /* need getopt */
197 197
198 198
199 /* Get definitions and prototypes for functions to process the 199 /* Get definitions and prototypes for functions to process the
200 arguments in ARGV (ARGC of them, minus the program name) for 200 arguments in ARGV (ARGC of them, minus the program name) for
201 options given in OPTS. 201 options given in OPTS.
224 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) 224 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
225 __THROW; 225 __THROW;
226 226
227 #ifndef __need_getopt 227 #ifndef __need_getopt
228 extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, 228 extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
229 const char *__shortopts, 229 const char *__shortopts,
230 const struct option *__longopts, int *__longind) 230 const struct option *__longopts, int *__longind)
231 __THROW; 231 __THROW;
232 extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, 232 extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
233 const char *__shortopts, 233 const char *__shortopts,
234 const struct option *__longopts, int *__longind) 234 const struct option *__longopts, int *__longind)
235 __THROW; 235 __THROW;
236 236
237 #endif 237 #endif
238 238
239 #ifdef __cplusplus 239 #ifdef __cplusplus