~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to lib/getopt.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Declarations for getopt.
2
 
   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
3
 
   1999, 2001, 2003, 2004, 2005, 2006, 2007, 2009 Free Software
 
2
   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2011 Free Software
4
3
   Foundation, Inc.
5
4
   This file is part of the GNU C Library.
6
5
 
17
16
   You should have received a copy of the GNU General Public License
18
17
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
18
 
20
 
#ifndef _GETOPT_H
 
19
#ifndef _@GUARD_PREFIX@_GETOPT_H
 
20
 
 
21
#if __GNUC__ >= 3
 
22
@PRAGMA_SYSTEM_HEADER@
 
23
#endif
 
24
@PRAGMA_COLUMNS@
 
25
 
 
26
/* The include_next requires a split double-inclusion guard.  We must
 
27
   also inform the replacement unistd.h to not recursively use
 
28
   <getopt.h>; our definitions will be present soon enough.  */
 
29
#if @HAVE_GETOPT_H@
 
30
# define _GL_SYSTEM_GETOPT
 
31
# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
 
32
# undef _GL_SYSTEM_GETOPT
 
33
#endif
 
34
 
 
35
#ifndef _@GUARD_PREFIX@_GETOPT_H
21
36
 
22
37
#ifndef __need_getopt
23
 
# define _GETOPT_H 1
 
38
# define _@GUARD_PREFIX@_GETOPT_H 1
24
39
#endif
25
40
 
26
41
/* Standalone applications should #define __GETOPT_PREFIX to an
27
42
   identifier that prefixes the external functions and variables
28
43
   defined in this header.  When this happens, include the
29
44
   headers that might declare getopt so that they will not cause
30
 
   confusion if included after this file.  Then systematically rename
 
45
   confusion if included after this file (if the system had <getopt.h>,
 
46
   we have already included it).  Then systematically rename
31
47
   identifiers so that they do not collide with the system functions
32
48
   and variables.  Renaming avoids problems with some compilers and
33
49
   linkers.  */
34
50
#if defined __GETOPT_PREFIX && !defined __need_getopt
35
 
# include <stdlib.h>
36
 
# include <stdio.h>
37
 
# include <unistd.h>
 
51
# if !@HAVE_GETOPT_H@
 
52
#  include <stdlib.h>
 
53
#  include <stdio.h>
 
54
#  include <unistd.h>
 
55
# endif
38
56
# undef __need_getopt
39
57
# undef getopt
40
58
# undef getopt_long
43
61
# undef opterr
44
62
# undef optind
45
63
# undef optopt
 
64
# undef option
46
65
# define __GETOPT_CONCAT(x, y) x ## y
47
66
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
48
67
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
53
72
# define opterr __GETOPT_ID (opterr)
54
73
# define optind __GETOPT_ID (optind)
55
74
# define optopt __GETOPT_ID (optopt)
 
75
# define option __GETOPT_ID (option)
 
76
# define _getopt_internal __GETOPT_ID (getopt_internal)
56
77
#endif
57
78
 
58
79
/* Standalone applications get correct prototypes for getopt_long and
95
116
#  define __GNUC_PREREQ(maj, min) (0)
96
117
# endif
97
118
# if defined __cplusplus && __GNUC_PREREQ (2,8)
98
 
#  define __THROW       throw ()
 
119
#  define __THROW       throw ()
99
120
# else
100
121
#  define __THROW
101
122
# endif
102
123
#endif
103
124
 
 
125
/* The definition of _GL_ARG_NONNULL is copied here.  */
 
126
 
104
127
#ifdef __cplusplus
105
128
extern "C" {
106
129
#endif
143
166
   zero.
144
167
 
145
168
   The field `has_arg' is:
146
 
   no_argument          (or 0) if the option does not take an argument,
147
 
   required_argument    (or 1) if the option requires an argument,
148
 
   optional_argument    (or 2) if the option takes an optional argument.
 
169
   no_argument          (or 0) if the option does not take an argument,
 
170
   required_argument    (or 1) if the option requires an argument,
 
171
   optional_argument    (or 2) if the option takes an optional argument.
149
172
 
150
173
   If the field `flag' is not NULL, it points to a variable that is set
151
174
   to the value given in the field `val' when the option is found, but
158
181
   one).  For long options that have a zero `flag' field, `getopt'
159
182
   returns the contents of the `val' field.  */
160
183
 
 
184
# if !GNULIB_defined_struct_option
161
185
struct option
162
186
{
163
187
  const char *name;
167
191
  int *flag;
168
192
  int val;
169
193
};
 
194
#  define GNULIB_defined_struct_option 1
 
195
# endif
170
196
 
171
197
/* Names for the values of the `has_arg' field of `struct option'.  */
172
198
 
173
 
# define no_argument            0
174
 
# define required_argument      1
175
 
# define optional_argument      2
176
 
#endif  /* need getopt */
 
199
# define no_argument            0
 
200
# define required_argument      1
 
201
# define optional_argument      2
 
202
#endif  /* need getopt */
177
203
 
178
204
 
179
205
/* Get definitions and prototypes for functions to process the
202
228
   the environment, then do not permute arguments.  */
203
229
 
204
230
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
205
 
       __THROW;
 
231
       __THROW _GL_ARG_NONNULL ((2, 3));
206
232
 
207
233
#ifndef __need_getopt
208
234
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
209
 
                        const char *__shortopts,
210
 
                        const struct option *__longopts, int *__longind)
211
 
       __THROW;
 
235
                        const char *__shortopts,
 
236
                        const struct option *__longopts, int *__longind)
 
237
       __THROW _GL_ARG_NONNULL ((2, 3));
212
238
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
213
 
                             const char *__shortopts,
214
 
                             const struct option *__longopts, int *__longind)
215
 
       __THROW;
 
239
                             const char *__shortopts,
 
240
                             const struct option *__longopts, int *__longind)
 
241
       __THROW _GL_ARG_NONNULL ((2, 3));
216
242
 
217
243
#endif
218
244
 
223
249
/* Make sure we later can get all the definitions and declarations.  */
224
250
#undef __need_getopt
225
251
 
226
 
#endif /* getopt.h */
 
252
#endif /* _@GUARD_PREFIX@_GETOPT_H */
 
253
#endif /* _@GUARD_PREFIX@_GETOPT_H */