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

« back to all changes in this revision

Viewing changes to lib/stdio.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
/* -*- buffer-read-only: t -*- vi: set ro: */
 
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
1
3
/* A GNU-like <stdio.h>.
2
4
 
3
 
   Copyright (C) 2004, 2007-2009 Free Software Foundation, Inc.
 
5
   Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
4
6
 
5
7
   This program is free software; you can redistribute it and/or modify
6
8
   it under the terms of the GNU General Public License as published by
19
21
#if __GNUC__ >= 3
20
22
@PRAGMA_SYSTEM_HEADER@
21
23
#endif
 
24
@PRAGMA_COLUMNS@
22
25
 
23
 
#if defined __need_FILE || defined __need___FILE
24
 
/* Special invocation convention inside glibc header files.  */
 
26
#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
 
27
/* Special invocation convention:
 
28
   - Inside glibc header files.
 
29
   - On OSF/1 5.1 we have a sequence of nested includes
 
30
     <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
 
31
     <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
 
32
     In this situation, the functions are not yet declared, therefore we cannot
 
33
     provide the C++ aliases.  */
25
34
 
26
35
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
27
36
 
28
37
#else
29
38
/* Normal invocation convention.  */
30
39
 
31
 
#ifndef _GL_STDIO_H
 
40
#ifndef _@GUARD_PREFIX@_STDIO_H
 
41
 
 
42
#define _GL_ALREADY_INCLUDING_STDIO_H
32
43
 
33
44
/* The include_next requires a split double-inclusion guard.  */
34
45
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
35
46
 
36
 
#ifndef _GL_STDIO_H
37
 
#define _GL_STDIO_H
38
 
 
 
47
#undef _GL_ALREADY_INCLUDING_STDIO_H
 
48
 
 
49
#ifndef _@GUARD_PREFIX@_STDIO_H
 
50
#define _@GUARD_PREFIX@_STDIO_H
 
51
 
 
52
/* Get va_list.  Needed on many systems, including glibc 2.8.  */
39
53
#include <stdarg.h>
 
54
 
40
55
#include <stddef.h>
41
56
 
42
 
#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
43
 
  || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
44
 
  || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
45
 
  || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
46
 
/* Get off_t and ssize_t.  */
47
 
# include <sys/types.h>
48
 
#endif
49
 
 
50
 
#ifndef __attribute__
51
 
/* This feature is available in gcc versions 2.5 and later.  */
52
 
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
53
 
#  define __attribute__(Spec) /* empty */
54
 
# endif
55
 
/* The __-protected variants of `format' and `printf' attributes
56
 
   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
57
 
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
58
 
#  define __format__ format
59
 
#  define __printf__ printf
60
 
# endif
61
 
#endif
62
 
 
63
 
 
64
 
/* The definition of GL_LINK_WARNING is copied here.  */
65
 
 
66
 
 
67
 
#ifdef __cplusplus
68
 
extern "C" {
69
 
#endif
70
 
 
71
 
 
72
 
#if @GNULIB_FPRINTF_POSIX@
73
 
# if @REPLACE_FPRINTF@
74
 
#  define fprintf rpl_fprintf
75
 
extern int fprintf (FILE *fp, const char *format, ...)
76
 
       __attribute__ ((__format__ (__printf__, 2, 3)));
77
 
# endif
78
 
#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
79
 
# define fprintf rpl_fprintf
80
 
extern int fprintf (FILE *fp, const char *format, ...)
81
 
       __attribute__ ((__format__ (__printf__, 2, 3)));
82
 
#elif defined GNULIB_POSIXCHECK
83
 
# undef fprintf
84
 
# define fprintf \
85
 
    (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
86
 
                      "use gnulib module fprintf-posix for portable " \
87
 
                      "POSIX compliance"), \
88
 
     fprintf)
89
 
#endif
90
 
 
91
 
#if @GNULIB_VFPRINTF_POSIX@
92
 
# if @REPLACE_VFPRINTF@
93
 
#  define vfprintf rpl_vfprintf
94
 
extern int vfprintf (FILE *fp, const char *format, va_list args)
95
 
       __attribute__ ((__format__ (__printf__, 2, 0)));
96
 
# endif
97
 
#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
98
 
# define vfprintf rpl_vfprintf
99
 
extern int vfprintf (FILE *fp, const char *format, va_list args)
100
 
       __attribute__ ((__format__ (__printf__, 2, 0)));
101
 
#elif defined GNULIB_POSIXCHECK
102
 
# undef vfprintf
103
 
# define vfprintf(s,f,a) \
104
 
    (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
105
 
                      "use gnulib module vfprintf-posix for portable " \
106
 
                      "POSIX compliance"), \
107
 
     vfprintf (s, f, a))
108
 
#endif
109
 
 
110
 
#if @GNULIB_PRINTF_POSIX@
111
 
# if @REPLACE_PRINTF@
112
 
/* Don't break __attribute__((format(printf,M,N))).  */
113
 
#  define printf __printf__
114
 
extern int printf (const char *format, ...)
115
 
       __attribute__ ((__format__ (__printf__, 1, 2)));
116
 
# endif
117
 
#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
118
 
/* Don't break __attribute__((format(printf,M,N))).  */
119
 
# define printf __printf__
120
 
extern int printf (const char *format, ...)
121
 
       __attribute__ ((__format__ (__printf__, 1, 2)));
122
 
#elif defined GNULIB_POSIXCHECK
123
 
# undef printf
124
 
# define printf \
125
 
    (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
126
 
                      "use gnulib module printf-posix for portable " \
127
 
                      "POSIX compliance"), \
128
 
     printf)
129
 
/* Don't break __attribute__((format(printf,M,N))).  */
130
 
# define format(kind,m,n) format (__##kind##__, m, n)
131
 
# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
132
 
# define ____printf____ __printf__
133
 
# define ____scanf____ __scanf__
134
 
# define ____strftime____ __strftime__
135
 
# define ____strfmon____ __strfmon__
136
 
#endif
137
 
 
138
 
#if @GNULIB_VPRINTF_POSIX@
139
 
# if @REPLACE_VPRINTF@
140
 
#  define vprintf rpl_vprintf
141
 
extern int vprintf (const char *format, va_list args)
142
 
       __attribute__ ((__format__ (__printf__, 1, 0)));
143
 
# endif
144
 
#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
145
 
# define vprintf rpl_vprintf
146
 
extern int vprintf (const char *format, va_list args)
147
 
       __attribute__ ((__format__ (__printf__, 1, 0)));
148
 
#elif defined GNULIB_POSIXCHECK
149
 
# undef vprintf
150
 
# define vprintf(f,a) \
151
 
    (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
152
 
                      "use gnulib module vprintf-posix for portable " \
153
 
                      "POSIX compliance"), \
154
 
     vprintf (f, a))
155
 
#endif
156
 
 
157
 
#if @GNULIB_SNPRINTF@
158
 
# if @REPLACE_SNPRINTF@
159
 
#  define snprintf rpl_snprintf
160
 
# endif
161
 
# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
162
 
extern int snprintf (char *str, size_t size, const char *format, ...)
163
 
       __attribute__ ((__format__ (__printf__, 3, 4)));
164
 
# endif
165
 
#elif defined GNULIB_POSIXCHECK
166
 
# undef snprintf
167
 
# define snprintf \
168
 
    (GL_LINK_WARNING ("snprintf is unportable - " \
169
 
                      "use gnulib module snprintf for portability"), \
170
 
     snprintf)
171
 
#endif
172
 
 
173
 
#if @GNULIB_VSNPRINTF@
174
 
# if @REPLACE_VSNPRINTF@
175
 
#  define vsnprintf rpl_vsnprintf
176
 
# endif
177
 
# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
178
 
extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
179
 
       __attribute__ ((__format__ (__printf__, 3, 0)));
180
 
# endif
181
 
#elif defined GNULIB_POSIXCHECK
182
 
# undef vsnprintf
183
 
# define vsnprintf(b,s,f,a) \
184
 
    (GL_LINK_WARNING ("vsnprintf is unportable - " \
185
 
                      "use gnulib module vsnprintf for portability"), \
186
 
     vsnprintf (b, s, f, a))
187
 
#endif
188
 
 
189
 
#if @GNULIB_SPRINTF_POSIX@
190
 
# if @REPLACE_SPRINTF@
191
 
#  define sprintf rpl_sprintf
192
 
extern int sprintf (char *str, const char *format, ...)
193
 
       __attribute__ ((__format__ (__printf__, 2, 3)));
194
 
# endif
195
 
#elif defined GNULIB_POSIXCHECK
196
 
# undef sprintf
197
 
# define sprintf \
198
 
    (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
199
 
                      "use gnulib module sprintf-posix for portable " \
200
 
                      "POSIX compliance"), \
201
 
     sprintf)
202
 
#endif
203
 
 
204
 
#if @GNULIB_VSPRINTF_POSIX@
205
 
# if @REPLACE_VSPRINTF@
206
 
#  define vsprintf rpl_vsprintf
207
 
extern int vsprintf (char *str, const char *format, va_list args)
208
 
       __attribute__ ((__format__ (__printf__, 2, 0)));
209
 
# endif
210
 
#elif defined GNULIB_POSIXCHECK
211
 
# undef vsprintf
212
 
# define vsprintf(b,f,a) \
213
 
    (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
214
 
                      "use gnulib module vsprintf-posix for portable " \
215
 
                      "POSIX compliance"), \
216
 
     vsprintf (b, f, a))
217
 
#endif
 
57
/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
 
58
   and eglibc 2.11.2.  */
 
59
#include <sys/types.h>
 
60
 
 
61
/* The __attribute__ feature is available in gcc versions 2.5 and later.
 
62
   The __-protected variants of the attributes 'format' and 'printf' are
 
63
   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
 
64
   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
 
65
   gnulib and libintl do '#define printf __printf__' when they override
 
66
   the 'printf' function.  */
 
67
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
 
68
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
 
69
#else
 
70
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 
71
#endif
 
72
 
 
73
/* _GL_ATTRIBUTE_FORMAT_PRINTF
 
74
   indicates to GCC that the function takes a format string and arguments,
 
75
   where the format string directives are the ones standardized by ISO C99
 
76
   and POSIX.  */
 
77
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
 
78
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
 
79
   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
 
80
#else
 
81
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
 
82
   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
83
#endif
 
84
 
 
85
/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
 
86
   except that it indicates to GCC that the supported format string directives
 
87
   are the ones of the system printf(), rather than the ones standardized by
 
88
   ISO C99 and POSIX.  */
 
89
#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
 
90
  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
91
 
 
92
/* _GL_ATTRIBUTE_FORMAT_SCANF
 
93
   indicates to GCC that the function takes a format string and arguments,
 
94
   where the format string directives are the ones standardized by ISO C99
 
95
   and POSIX.  */
 
96
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
 
97
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
 
98
   _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
 
99
#else
 
100
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
 
101
   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
102
#endif
 
103
 
 
104
/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
 
105
   except that it indicates to GCC that the supported format string directives
 
106
   are the ones of the system scanf(), rather than the ones standardized by
 
107
   ISO C99 and POSIX.  */
 
108
#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
 
109
  _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
110
 
 
111
/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
 
112
/* But in any case avoid namespace pollution on glibc systems.  */
 
113
#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
 
114
    && ! defined __GLIBC__
 
115
# include <unistd.h>
 
116
#endif
 
117
 
 
118
 
 
119
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
120
 
 
121
/* The definition of _GL_ARG_NONNULL is copied here.  */
 
122
 
 
123
/* The definition of _GL_WARN_ON_USE is copied here.  */
 
124
 
 
125
/* Macros for stringification.  */
 
126
#define _GL_STDIO_STRINGIZE(token) #token
 
127
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
 
128
 
218
129
 
219
130
#if @GNULIB_DPRINTF@
220
131
# if @REPLACE_DPRINTF@
221
 
#  define dprintf rpl_dprintf
222
 
# endif
223
 
# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
224
 
extern int dprintf (int fd, const char *format, ...)
225
 
       __attribute__ ((__format__ (__printf__, 2, 3)));
226
 
# endif
 
132
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
133
#   define dprintf rpl_dprintf
 
134
#  endif
 
135
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
 
136
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
137
                                _GL_ARG_NONNULL ((2)));
 
138
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
 
139
# else
 
140
#  if !@HAVE_DPRINTF@
 
141
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
 
142
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
143
                                _GL_ARG_NONNULL ((2)));
 
144
#  endif
 
145
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
 
146
# endif
 
147
_GL_CXXALIASWARN (dprintf);
227
148
#elif defined GNULIB_POSIXCHECK
228
149
# undef dprintf
229
 
# define dprintf(d,f,a) \
230
 
    (GL_LINK_WARNING ("dprintf is unportable - " \
231
 
                      "use gnulib module dprintf for portability"), \
232
 
     dprintf (d, f, a))
233
 
#endif
234
 
 
235
 
#if @GNULIB_VDPRINTF@
236
 
# if @REPLACE_VDPRINTF@
237
 
#  define vdprintf rpl_vdprintf
238
 
# endif
239
 
# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
240
 
extern int vdprintf (int fd, const char *format, va_list args)
241
 
       __attribute__ ((__format__ (__printf__, 2, 0)));
242
 
# endif
243
 
#elif defined GNULIB_POSIXCHECK
244
 
# undef vdprintf
245
 
# define vdprintf(d,f,a) \
246
 
    (GL_LINK_WARNING ("vdprintf is unportable - " \
247
 
                      "use gnulib module vdprintf for portability"), \
248
 
     vdprintf (d, f, a))
249
 
#endif
250
 
 
251
 
#if @GNULIB_VASPRINTF@
252
 
# if @REPLACE_VASPRINTF@
253
 
#  define asprintf rpl_asprintf
254
 
#  define vasprintf rpl_vasprintf
255
 
# endif
256
 
# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
257
 
  /* Write formatted output to a string dynamically allocated with malloc().
258
 
     If the memory allocation succeeds, store the address of the string in
259
 
     *RESULT and return the number of resulting bytes, excluding the trailing
260
 
     NUL.  Upon memory allocation error, or some other error, return -1.  */
261
 
  extern int asprintf (char **result, const char *format, ...)
262
 
    __attribute__ ((__format__ (__printf__, 2, 3)));
263
 
  extern int vasprintf (char **result, const char *format, va_list args)
264
 
    __attribute__ ((__format__ (__printf__, 2, 0)));
265
 
# endif
266
 
#endif
267
 
 
268
 
#if @GNULIB_OBSTACK_PRINTF@
269
 
# if @REPLACE_OBSTACK_PRINTF@
270
 
#  define obstack_printf rpl_osbtack_printf
271
 
#  define obstack_vprintf rpl_obstack_vprintf
272
 
# endif
273
 
# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
274
 
  struct obstack;
275
 
  /* Grow an obstack with formatted output.  Return the number of
276
 
     bytes added to OBS.  No trailing nul byte is added, and the
277
 
     object should be closed with obstack_finish before use.  Upon
278
 
     memory allocation error, call obstack_alloc_failed_handler.  Upon
279
 
     other error, return -1.  */
280
 
  extern int obstack_printf (struct obstack *obs, const char *format, ...)
281
 
    __attribute__ ((__format__ (__printf__, 2, 3)));
282
 
  extern int obstack_vprintf (struct obstack *obs, const char *format,
283
 
                              va_list args)
284
 
    __attribute__ ((__format__ (__printf__, 2, 0)));
285
 
# endif
 
150
# if HAVE_RAW_DECL_DPRINTF
 
151
_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
 
152
                 "use gnulib module dprintf for portability");
 
153
# endif
 
154
#endif
 
155
 
 
156
#if @GNULIB_FCLOSE@
 
157
/* Close STREAM and its underlying file descriptor.  */
 
158
# if @REPLACE_FCLOSE@
 
159
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
160
#   define fclose rpl_fclose
 
161
#  endif
 
162
_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
 
163
_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
 
164
# else
 
165
_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
 
166
# endif
 
167
_GL_CXXALIASWARN (fclose);
 
168
#elif defined GNULIB_POSIXCHECK
 
169
# undef fclose
 
170
/* Assume fclose is always declared.  */
 
171
_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
 
172
                 "use gnulib module fclose for portable POSIX compliance");
 
173
#endif
 
174
 
 
175
#if @GNULIB_FFLUSH@
 
176
/* Flush all pending data on STREAM according to POSIX rules.  Both
 
177
   output and seekable input streams are supported.
 
178
   Note! LOSS OF DATA can occur if fflush is applied on an input stream
 
179
   that is _not_seekable_ or on an update stream that is _not_seekable_
 
180
   and in which the most recent operation was input.  Seekability can
 
181
   be tested with lseek(fileno(fp),0,SEEK_CUR).  */
 
182
# if @REPLACE_FFLUSH@
 
183
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
184
#   define fflush rpl_fflush
 
185
#  endif
 
186
_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
 
187
_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
 
188
# else
 
189
_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
 
190
# endif
 
191
_GL_CXXALIASWARN (fflush);
 
192
#elif defined GNULIB_POSIXCHECK
 
193
# undef fflush
 
194
/* Assume fflush is always declared.  */
 
195
_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
 
196
                 "use gnulib module fflush for portable POSIX compliance");
 
197
#endif
 
198
 
 
199
#if @GNULIB_FGETC@
 
200
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
201
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
202
#   undef fgetc
 
203
#   define fgetc rpl_fgetc
 
204
#  endif
 
205
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
 
206
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
 
207
# else
 
208
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
 
209
# endif
 
210
_GL_CXXALIASWARN (fgetc);
 
211
#endif
 
212
 
 
213
#if @GNULIB_FGETS@
 
214
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
215
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
216
#   undef fgets
 
217
#   define fgets rpl_fgets
 
218
#  endif
 
219
_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
 
220
                                 _GL_ARG_NONNULL ((1, 3)));
 
221
_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
 
222
# else
 
223
_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
 
224
# endif
 
225
_GL_CXXALIASWARN (fgets);
286
226
#endif
287
227
 
288
228
#if @GNULIB_FOPEN@
289
229
# if @REPLACE_FOPEN@
290
 
#  undef fopen
291
 
#  define fopen rpl_fopen
292
 
extern FILE * fopen (const char *filename, const char *mode);
 
230
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
231
#   undef fopen
 
232
#   define fopen rpl_fopen
 
233
#  endif
 
234
_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
 
235
                                 _GL_ARG_NONNULL ((1, 2)));
 
236
_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
 
237
# else
 
238
_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
293
239
# endif
 
240
_GL_CXXALIASWARN (fopen);
294
241
#elif defined GNULIB_POSIXCHECK
295
242
# undef fopen
296
 
# define fopen(f,m) \
297
 
   (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
298
 
                     "use gnulib module fopen for portability"), \
299
 
    fopen (f, m))
 
243
/* Assume fopen is always declared.  */
 
244
_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
 
245
                 "use gnulib module fopen for portability");
 
246
#endif
 
247
 
 
248
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
 
249
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
 
250
     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 
251
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
252
#   define fprintf rpl_fprintf
 
253
#  endif
 
254
#  define GNULIB_overrides_fprintf 1
 
255
#  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
256
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
 
257
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
258
                                _GL_ARG_NONNULL ((1, 2)));
 
259
#  else
 
260
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
 
261
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
 
262
                                _GL_ARG_NONNULL ((1, 2)));
 
263
#  endif
 
264
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
 
265
# else
 
266
_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
 
267
# endif
 
268
_GL_CXXALIASWARN (fprintf);
 
269
#endif
 
270
#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 
271
# if !GNULIB_overrides_fprintf
 
272
#  undef fprintf
 
273
# endif
 
274
/* Assume fprintf is always declared.  */
 
275
_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
 
276
                 "use gnulib module fprintf-posix for portable "
 
277
                 "POSIX compliance");
 
278
#endif
 
279
 
 
280
#if @GNULIB_FPURGE@
 
281
/* Discard all pending buffered I/O data on STREAM.
 
282
   STREAM must not be wide-character oriented.
 
283
   When discarding pending output, the file position is set back to where it
 
284
   was before the write calls.  When discarding pending input, the file
 
285
   position is advanced to match the end of the previously read input.
 
286
   Return 0 if successful.  Upon error, return -1 and set errno.  */
 
287
# if @REPLACE_FPURGE@
 
288
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
289
#   define fpurge rpl_fpurge
 
290
#  endif
 
291
_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
 
292
_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
 
293
# else
 
294
#  if !@HAVE_DECL_FPURGE@
 
295
_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
 
296
#  endif
 
297
_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
 
298
# endif
 
299
_GL_CXXALIASWARN (fpurge);
 
300
#elif defined GNULIB_POSIXCHECK
 
301
# undef fpurge
 
302
# if HAVE_RAW_DECL_FPURGE
 
303
_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
 
304
                 "use gnulib module fpurge for portability");
 
305
# endif
 
306
#endif
 
307
 
 
308
#if @GNULIB_FPUTC@
 
309
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
310
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
311
#   undef fputc
 
312
#   define fputc rpl_fputc
 
313
#  endif
 
314
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
 
315
_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
 
316
# else
 
317
_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
 
318
# endif
 
319
_GL_CXXALIASWARN (fputc);
 
320
#endif
 
321
 
 
322
#if @GNULIB_FPUTS@
 
323
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
324
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
325
#   undef fputs
 
326
#   define fputs rpl_fputs
 
327
#  endif
 
328
_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
 
329
                              _GL_ARG_NONNULL ((1, 2)));
 
330
_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
 
331
# else
 
332
_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
 
333
# endif
 
334
_GL_CXXALIASWARN (fputs);
 
335
#endif
 
336
 
 
337
#if @GNULIB_FREAD@
 
338
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
339
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
340
#   undef fread
 
341
#   define fread rpl_fread
 
342
#  endif
 
343
_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
 
344
                                 _GL_ARG_NONNULL ((4)));
 
345
_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 
346
# else
 
347
_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 
348
# endif
 
349
_GL_CXXALIASWARN (fread);
300
350
#endif
301
351
 
302
352
#if @GNULIB_FREOPEN@
303
353
# if @REPLACE_FREOPEN@
304
 
#  undef freopen
305
 
#  define freopen rpl_freopen
306
 
extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
 
354
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
355
#   undef freopen
 
356
#   define freopen rpl_freopen
 
357
#  endif
 
358
_GL_FUNCDECL_RPL (freopen, FILE *,
 
359
                  (const char *filename, const char *mode, FILE *stream)
 
360
                  _GL_ARG_NONNULL ((2, 3)));
 
361
_GL_CXXALIAS_RPL (freopen, FILE *,
 
362
                  (const char *filename, const char *mode, FILE *stream));
 
363
# else
 
364
_GL_CXXALIAS_SYS (freopen, FILE *,
 
365
                  (const char *filename, const char *mode, FILE *stream));
307
366
# endif
 
367
_GL_CXXALIASWARN (freopen);
308
368
#elif defined GNULIB_POSIXCHECK
309
369
# undef freopen
310
 
# define freopen(f,m,s) \
311
 
   (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
312
 
                     "use gnulib module freopen for portability"), \
313
 
    freopen (f, m, s))
 
370
/* Assume freopen is always declared.  */
 
371
_GL_WARN_ON_USE (freopen,
 
372
                 "freopen on Win32 platforms is not POSIX compatible - "
 
373
                 "use gnulib module freopen for portability");
 
374
#endif
 
375
 
 
376
#if @GNULIB_FSCANF@
 
377
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
378
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
379
#   undef fscanf
 
380
#   define fscanf rpl_fscanf
 
381
#  endif
 
382
_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
 
383
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
 
384
                               _GL_ARG_NONNULL ((1, 2)));
 
385
_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
 
386
# else
 
387
_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
 
388
# endif
 
389
_GL_CXXALIASWARN (fscanf);
 
390
#endif
 
391
 
 
392
 
 
393
/* Set up the following warnings, based on which modules are in use.
 
394
   GNU Coding Standards discourage the use of fseek, since it imposes
 
395
   an arbitrary limitation on some 32-bit hosts.  Remember that the
 
396
   fseek module depends on the fseeko module, so we only have three
 
397
   cases to consider:
 
398
 
 
399
   1. The developer is not using either module.  Issue a warning under
 
400
   GNULIB_POSIXCHECK for both functions, to remind them that both
 
401
   functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
 
402
   impact on this warning.
 
403
 
 
404
   2. The developer is using both modules.  They may be unaware of the
 
405
   arbitrary limitations of fseek, so issue a warning under
 
406
   GNULIB_POSIXCHECK.  On the other hand, they may be using both
 
407
   modules intentionally, so the developer can define
 
408
   _GL_NO_LARGE_FILES in the compilation units where the use of fseek
 
409
   is safe, to silence the warning.
 
410
 
 
411
   3. The developer is using the fseeko module, but not fseek.  Gnulib
 
412
   guarantees that fseek will still work around platform bugs in that
 
413
   case, but we presume that the developer is aware of the pitfalls of
 
414
   fseek and was trying to avoid it, so issue a warning even when
 
415
   GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
 
416
   defined to silence the warning in particular compilation units.
 
417
   In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
 
418
   fseek gets defined as a macro, it is recommended that the developer
 
419
   uses the fseek module, even if he is not calling the fseek function.
 
420
 
 
421
   Most gnulib clients that perform stream operations should fall into
 
422
   category 3.  */
 
423
 
 
424
#if @GNULIB_FSEEK@
 
425
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
 
426
#  define _GL_FSEEK_WARN /* Category 2, above.  */
 
427
#  undef fseek
 
428
# endif
 
429
# if @REPLACE_FSEEK@
 
430
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
431
#   undef fseek
 
432
#   define fseek rpl_fseek
 
433
#  endif
 
434
_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
 
435
                              _GL_ARG_NONNULL ((1)));
 
436
_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
 
437
# else
 
438
_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
 
439
# endif
 
440
_GL_CXXALIASWARN (fseek);
314
441
#endif
315
442
 
316
443
#if @GNULIB_FSEEKO@
 
444
# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
 
445
#  define _GL_FSEEK_WARN /* Category 3, above.  */
 
446
#  undef fseek
 
447
# endif
317
448
# if @REPLACE_FSEEKO@
318
 
/* Provide fseek, fseeko functions that are aware of a preceding
319
 
   fflush(), and which detect pipes.  */
320
 
#  define fseeko rpl_fseeko
321
 
extern int fseeko (FILE *fp, off_t offset, int whence);
322
 
#  define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
 
449
/* Provide an fseeko function that is aware of a preceding fflush(), and which
 
450
   detects pipes.  */
 
451
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
452
#   undef fseeko
 
453
#   define fseeko rpl_fseeko
 
454
#  endif
 
455
_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
 
456
                               _GL_ARG_NONNULL ((1)));
 
457
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
 
458
# else
 
459
#  if ! @HAVE_DECL_FSEEKO@
 
460
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
 
461
                               _GL_ARG_NONNULL ((1)));
 
462
#  endif
 
463
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
323
464
# endif
 
465
_GL_CXXALIASWARN (fseeko);
324
466
#elif defined GNULIB_POSIXCHECK
 
467
# define _GL_FSEEK_WARN /* Category 1, above.  */
 
468
# undef fseek
325
469
# undef fseeko
326
 
# define fseeko(f,o,w) \
327
 
   (GL_LINK_WARNING ("fseeko is unportable - " \
328
 
                     "use gnulib module fseeko for portability"), \
329
 
    fseeko (f, o, w))
330
 
#endif
331
 
 
332
 
#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
333
 
extern int rpl_fseek (FILE *fp, long offset, int whence);
334
 
# undef fseek
335
 
# if defined GNULIB_POSIXCHECK
336
 
#  define fseek(f,o,w) \
337
 
     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
338
 
                       "on 32-bit platforms - " \
339
 
                       "use fseeko function for handling of large files"), \
340
 
      rpl_fseek (f, o, w))
 
470
# if HAVE_RAW_DECL_FSEEKO
 
471
_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
 
472
                 "use gnulib module fseeko for portability");
 
473
# endif
 
474
#endif
 
475
 
 
476
#ifdef _GL_FSEEK_WARN
 
477
# undef _GL_FSEEK_WARN
 
478
/* Here, either fseek is undefined (but C89 guarantees that it is
 
479
   declared), or it is defined as rpl_fseek (declared above).  */
 
480
_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
 
481
                 "on 32-bit platforms - "
 
482
                 "use fseeko function for handling of large files");
 
483
#endif
 
484
 
 
485
 
 
486
/* ftell, ftello.  See the comments on fseek/fseeko.  */
 
487
 
 
488
#if @GNULIB_FTELL@
 
489
# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
 
490
#  define _GL_FTELL_WARN /* Category 2, above.  */
 
491
#  undef ftell
 
492
# endif
 
493
# if @REPLACE_FTELL@
 
494
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
495
#   undef ftell
 
496
#   define ftell rpl_ftell
 
497
#  endif
 
498
_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
 
499
_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
341
500
# else
342
 
#  define fseek rpl_fseek
343
 
# endif
344
 
#elif defined GNULIB_POSIXCHECK
345
 
# ifndef fseek
346
 
#  define fseek(f,o,w) \
347
 
     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
348
 
                       "on 32-bit platforms - " \
349
 
                       "use fseeko function for handling of large files"), \
350
 
      fseek (f, o, w))
351
 
# endif
 
501
_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
 
502
# endif
 
503
_GL_CXXALIASWARN (ftell);
352
504
#endif
353
505
 
354
506
#if @GNULIB_FTELLO@
 
507
# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
 
508
#  define _GL_FTELL_WARN /* Category 3, above.  */
 
509
#  undef ftell
 
510
# endif
355
511
# if @REPLACE_FTELLO@
356
 
#  define ftello rpl_ftello
357
 
extern off_t ftello (FILE *fp);
358
 
#  define ftell(fp) ftello (fp)
 
512
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
513
#   undef ftello
 
514
#   define ftello rpl_ftello
 
515
#  endif
 
516
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
 
517
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
 
518
# else
 
519
#  if ! @HAVE_DECL_FTELLO@
 
520
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
 
521
#  endif
 
522
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
359
523
# endif
 
524
_GL_CXXALIASWARN (ftello);
360
525
#elif defined GNULIB_POSIXCHECK
 
526
# define _GL_FTELL_WARN /* Category 1, above.  */
 
527
# undef ftell
361
528
# undef ftello
362
 
# define ftello(f) \
363
 
   (GL_LINK_WARNING ("ftello is unportable - " \
364
 
                     "use gnulib module ftello for portability"), \
365
 
    ftello (f))
366
 
#endif
367
 
 
368
 
#if @GNULIB_FTELL@ && @REPLACE_FTELL@
369
 
extern long rpl_ftell (FILE *fp);
370
 
# undef ftell
371
 
# if GNULIB_POSIXCHECK
372
 
#  define ftell(f) \
373
 
     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
374
 
                       "on 32-bit platforms - " \
375
 
                       "use ftello function for handling of large files"), \
376
 
      rpl_ftell (f))
377
 
# else
378
 
#  define ftell rpl_ftell
379
 
# endif
380
 
#elif defined GNULIB_POSIXCHECK
381
 
# ifndef ftell
382
 
#  define ftell(f) \
383
 
     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
384
 
                       "on 32-bit platforms - " \
385
 
                       "use ftello function for handling of large files"), \
386
 
      ftell (f))
387
 
# endif
388
 
#endif
389
 
 
390
 
#if @GNULIB_FFLUSH@
391
 
# if @REPLACE_FFLUSH@
392
 
#  define fflush rpl_fflush
393
 
  /* Flush all pending data on STREAM according to POSIX rules.  Both
394
 
     output and seekable input streams are supported.
395
 
     Note! LOSS OF DATA can occur if fflush is applied on an input stream
396
 
     that is _not_seekable_ or on an update stream that is _not_seekable_
397
 
     and in which the most recent operation was input.  Seekability can
398
 
     be tested with lseek(fileno(fp),0,SEEK_CUR).  */
399
 
  extern int fflush (FILE *gl_stream);
400
 
# endif
401
 
#elif defined GNULIB_POSIXCHECK
402
 
# undef fflush
403
 
# define fflush(f) \
404
 
   (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
405
 
                     "use gnulib module fflush for portable " \
406
 
                     "POSIX compliance"), \
407
 
    fflush (f))
408
 
#endif
409
 
 
410
 
#if @GNULIB_FPURGE@
411
 
# if @REPLACE_FPURGE@
412
 
#  define fpurge rpl_fpurge
413
 
# endif
414
 
# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
415
 
  /* Discard all pending buffered I/O data on STREAM.
416
 
     STREAM must not be wide-character oriented.
417
 
     When discarding pending output, the file position is set back to where it
418
 
     was before the write calls.  When discarding pending input, the file
419
 
     position is advanced to match the end of the previously read input.
420
 
     Return 0 if successful.  Upon error, return -1 and set errno.  */
421
 
  extern int fpurge (FILE *gl_stream);
422
 
# endif
423
 
#elif defined GNULIB_POSIXCHECK
424
 
# undef fpurge
425
 
# define fpurge(f) \
426
 
   (GL_LINK_WARNING ("fpurge is not always present - " \
427
 
                     "use gnulib module fpurge for portability"), \
428
 
    fpurge (f))
429
 
#endif
430
 
 
431
 
#if @GNULIB_FCLOSE@
432
 
# if @REPLACE_FCLOSE@
433
 
#  define fclose rpl_fclose
434
 
  /* Close STREAM and its underlying file descriptor.  */
435
 
extern int fclose (FILE *stream);
436
 
# endif
437
 
#elif defined GNULIB_POSIXCHECK
438
 
# undef fclose
439
 
# define fclose(f) \
440
 
   (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
441
 
                     "use gnulib module fclose for portable " \
442
 
                     "POSIX compliance"), \
443
 
    fclose (f))
444
 
#endif
445
 
 
446
 
#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
447
 
# undef fputc
448
 
# define fputc rpl_fputc
449
 
extern int fputc (int c, FILE *stream);
450
 
#endif
451
 
 
452
 
#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
453
 
# undef putc
454
 
# define putc rpl_fputc
455
 
extern int putc (int c, FILE *stream);
456
 
#endif
457
 
 
458
 
#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
459
 
# undef putchar
460
 
# define putchar rpl_putchar
461
 
extern int putchar (int c);
462
 
#endif
463
 
 
464
 
#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
465
 
# undef fputs
466
 
# define fputs rpl_fputs
467
 
extern int fputs (const char *string, FILE *stream);
468
 
#endif
469
 
 
470
 
#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
471
 
# undef puts
472
 
# define puts rpl_puts
473
 
extern int puts (const char *string);
474
 
#endif
475
 
 
476
 
#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
477
 
# undef fwrite
478
 
# define fwrite rpl_fwrite
479
 
extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
480
 
#endif
481
 
 
482
 
#if @GNULIB_POPEN@
483
 
# if @REPLACE_POPEN@
484
 
#  undef popen
485
 
#  define popen rpl_popen
486
 
extern FILE *popen (const char *cmd, const char *mode);
487
 
# endif
488
 
#elif defined GNULIB_POSIXCHECK
489
 
# undef popen
490
 
# define popen(c,m) \
491
 
   (GL_LINK_WARNING ("popen is buggy on some platforms - " \
492
 
                     "use gnulib module popen or pipe for more portability"), \
493
 
    popen (c, m))
 
529
# if HAVE_RAW_DECL_FTELLO
 
530
_GL_WARN_ON_USE (ftello, "ftello is unportable - "
 
531
                 "use gnulib module ftello for portability");
 
532
# endif
 
533
#endif
 
534
 
 
535
#ifdef _GL_FTELL_WARN
 
536
# undef _GL_FTELL_WARN
 
537
/* Here, either ftell is undefined (but C89 guarantees that it is
 
538
   declared), or it is defined as rpl_ftell (declared above).  */
 
539
_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
 
540
                 "on 32-bit platforms - "
 
541
                 "use ftello function for handling of large files");
 
542
#endif
 
543
 
 
544
 
 
545
#if @GNULIB_FWRITE@
 
546
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
547
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
548
#   undef fwrite
 
549
#   define fwrite rpl_fwrite
 
550
#  endif
 
551
_GL_FUNCDECL_RPL (fwrite, size_t,
 
552
                  (const void *ptr, size_t s, size_t n, FILE *stream)
 
553
                  _GL_ARG_NONNULL ((1, 4)));
 
554
_GL_CXXALIAS_RPL (fwrite, size_t,
 
555
                  (const void *ptr, size_t s, size_t n, FILE *stream));
 
556
# else
 
557
_GL_CXXALIAS_SYS (fwrite, size_t,
 
558
                  (const void *ptr, size_t s, size_t n, FILE *stream));
 
559
 
 
560
/* Work around glibc bug 11959
 
561
   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
 
562
   which sometimes causes an unwanted diagnostic for fwrite calls.
 
563
   This affects only function declaration attributes, so it's not
 
564
   needed for C++.  */
 
565
#  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
 
566
static inline size_t _GL_ARG_NONNULL ((1, 4))
 
567
rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
 
568
{
 
569
  size_t r = fwrite (ptr, s, n, stream);
 
570
  (void) r;
 
571
  return r;
 
572
}
 
573
#   undef fwrite
 
574
#   define fwrite rpl_fwrite
 
575
#  endif
 
576
# endif
 
577
_GL_CXXALIASWARN (fwrite);
 
578
#endif
 
579
 
 
580
#if @GNULIB_GETC@
 
581
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
582
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
583
#   undef getc
 
584
#   define getc rpl_fgetc
 
585
#  endif
 
586
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
 
587
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
 
588
# else
 
589
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
 
590
# endif
 
591
_GL_CXXALIASWARN (getc);
 
592
#endif
 
593
 
 
594
#if @GNULIB_GETCHAR@
 
595
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
596
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
597
#   undef getchar
 
598
#   define getchar rpl_getchar
 
599
#  endif
 
600
_GL_FUNCDECL_RPL (getchar, int, (void));
 
601
_GL_CXXALIAS_RPL (getchar, int, (void));
 
602
# else
 
603
_GL_CXXALIAS_SYS (getchar, int, (void));
 
604
# endif
 
605
_GL_CXXALIASWARN (getchar);
494
606
#endif
495
607
 
496
608
#if @GNULIB_GETDELIM@
497
 
# if !@HAVE_DECL_GETDELIM@
498
609
/* Read input, up to (and including) the next occurrence of DELIMITER, from
499
610
   STREAM, store it in *LINEPTR (and NUL-terminate it).
500
611
   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
501
612
   bytes of space.  It is realloc'd as necessary.
502
613
   Return the number of bytes read and stored at *LINEPTR (not including the
503
614
   NUL terminator), or -1 on error or EOF.  */
504
 
extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
505
 
                         FILE *stream);
 
615
# if @REPLACE_GETDELIM@
 
616
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
617
#   undef getdelim
 
618
#   define getdelim rpl_getdelim
 
619
#  endif
 
620
_GL_FUNCDECL_RPL (getdelim, ssize_t,
 
621
                  (char **lineptr, size_t *linesize, int delimiter,
 
622
                   FILE *stream)
 
623
                  _GL_ARG_NONNULL ((1, 2, 4)));
 
624
_GL_CXXALIAS_RPL (getdelim, ssize_t,
 
625
                  (char **lineptr, size_t *linesize, int delimiter,
 
626
                   FILE *stream));
 
627
# else
 
628
#  if !@HAVE_DECL_GETDELIM@
 
629
_GL_FUNCDECL_SYS (getdelim, ssize_t,
 
630
                  (char **lineptr, size_t *linesize, int delimiter,
 
631
                   FILE *stream)
 
632
                  _GL_ARG_NONNULL ((1, 2, 4)));
 
633
#  endif
 
634
_GL_CXXALIAS_SYS (getdelim, ssize_t,
 
635
                  (char **lineptr, size_t *linesize, int delimiter,
 
636
                   FILE *stream));
506
637
# endif
 
638
_GL_CXXALIASWARN (getdelim);
507
639
#elif defined GNULIB_POSIXCHECK
508
640
# undef getdelim
509
 
# define getdelim(l, s, d, f)                                       \
510
 
  (GL_LINK_WARNING ("getdelim is unportable - "                     \
511
 
                    "use gnulib module getdelim for portability"),  \
512
 
   getdelim (l, s, d, f))
 
641
# if HAVE_RAW_DECL_GETDELIM
 
642
_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
 
643
                 "use gnulib module getdelim for portability");
 
644
# endif
513
645
#endif
514
646
 
515
647
#if @GNULIB_GETLINE@
516
 
# if @REPLACE_GETLINE@
517
 
#  undef getline
518
 
#  define getline rpl_getline
519
 
# endif
520
 
# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
521
648
/* Read a line, up to (and including) the next newline, from STREAM, store it
522
649
   in *LINEPTR (and NUL-terminate it).
523
650
   *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
524
651
   bytes of space.  It is realloc'd as necessary.
525
652
   Return the number of bytes read and stored at *LINEPTR (not including the
526
653
   NUL terminator), or -1 on error or EOF.  */
527
 
extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
 
654
# if @REPLACE_GETLINE@
 
655
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
656
#   undef getline
 
657
#   define getline rpl_getline
 
658
#  endif
 
659
_GL_FUNCDECL_RPL (getline, ssize_t,
 
660
                  (char **lineptr, size_t *linesize, FILE *stream)
 
661
                  _GL_ARG_NONNULL ((1, 2, 3)));
 
662
_GL_CXXALIAS_RPL (getline, ssize_t,
 
663
                  (char **lineptr, size_t *linesize, FILE *stream));
 
664
# else
 
665
#  if !@HAVE_DECL_GETLINE@
 
666
_GL_FUNCDECL_SYS (getline, ssize_t,
 
667
                  (char **lineptr, size_t *linesize, FILE *stream)
 
668
                  _GL_ARG_NONNULL ((1, 2, 3)));
 
669
#  endif
 
670
_GL_CXXALIAS_SYS (getline, ssize_t,
 
671
                  (char **lineptr, size_t *linesize, FILE *stream));
 
672
# endif
 
673
# if @HAVE_DECL_GETLINE@
 
674
_GL_CXXALIASWARN (getline);
528
675
# endif
529
676
#elif defined GNULIB_POSIXCHECK
530
677
# undef getline
531
 
# define getline(l, s, f)                                               \
532
 
  (GL_LINK_WARNING ("getline is unportable - "                          \
533
 
                    "use gnulib module getline for portability"),       \
534
 
   getline (l, s, f))
 
678
# if HAVE_RAW_DECL_GETLINE
 
679
_GL_WARN_ON_USE (getline, "getline is unportable - "
 
680
                 "use gnulib module getline for portability");
 
681
# endif
 
682
#endif
 
683
 
 
684
#if @GNULIB_GETS@
 
685
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
686
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
687
#   undef gets
 
688
#   define gets rpl_gets
 
689
#  endif
 
690
_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
 
691
_GL_CXXALIAS_RPL (gets, char *, (char *s));
 
692
# else
 
693
_GL_CXXALIAS_SYS (gets, char *, (char *s));
 
694
#  undef gets
 
695
# endif
 
696
_GL_CXXALIASWARN (gets);
 
697
/* It is very rare that the developer ever has full control of stdin,
 
698
   so any use of gets warrants an unconditional warning.  Assume it is
 
699
   always declared, since it is required by C89.  */
 
700
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 
701
#endif
 
702
 
 
703
 
 
704
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
 
705
struct obstack;
 
706
/* Grow an obstack with formatted output.  Return the number of
 
707
   bytes added to OBS.  No trailing nul byte is added, and the
 
708
   object should be closed with obstack_finish before use.  Upon
 
709
   memory allocation error, call obstack_alloc_failed_handler.  Upon
 
710
   other error, return -1.  */
 
711
# if @REPLACE_OBSTACK_PRINTF@
 
712
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
713
#   define obstack_printf rpl_obstack_printf
 
714
#  endif
 
715
_GL_FUNCDECL_RPL (obstack_printf, int,
 
716
                  (struct obstack *obs, const char *format, ...)
 
717
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
718
                  _GL_ARG_NONNULL ((1, 2)));
 
719
_GL_CXXALIAS_RPL (obstack_printf, int,
 
720
                  (struct obstack *obs, const char *format, ...));
 
721
# else
 
722
#  if !@HAVE_DECL_OBSTACK_PRINTF@
 
723
_GL_FUNCDECL_SYS (obstack_printf, int,
 
724
                  (struct obstack *obs, const char *format, ...)
 
725
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
726
                  _GL_ARG_NONNULL ((1, 2)));
 
727
#  endif
 
728
_GL_CXXALIAS_SYS (obstack_printf, int,
 
729
                  (struct obstack *obs, const char *format, ...));
 
730
# endif
 
731
_GL_CXXALIASWARN (obstack_printf);
 
732
# if @REPLACE_OBSTACK_PRINTF@
 
733
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
734
#   define obstack_vprintf rpl_obstack_vprintf
 
735
#  endif
 
736
_GL_FUNCDECL_RPL (obstack_vprintf, int,
 
737
                  (struct obstack *obs, const char *format, va_list args)
 
738
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
739
                  _GL_ARG_NONNULL ((1, 2)));
 
740
_GL_CXXALIAS_RPL (obstack_vprintf, int,
 
741
                  (struct obstack *obs, const char *format, va_list args));
 
742
# else
 
743
#  if !@HAVE_DECL_OBSTACK_PRINTF@
 
744
_GL_FUNCDECL_SYS (obstack_vprintf, int,
 
745
                  (struct obstack *obs, const char *format, va_list args)
 
746
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
747
                  _GL_ARG_NONNULL ((1, 2)));
 
748
#  endif
 
749
_GL_CXXALIAS_SYS (obstack_vprintf, int,
 
750
                  (struct obstack *obs, const char *format, va_list args));
 
751
# endif
 
752
_GL_CXXALIASWARN (obstack_vprintf);
535
753
#endif
536
754
 
537
755
#if @GNULIB_PERROR@
538
 
# if @REPLACE_PERROR@
539
 
#  define perror rpl_perror
540
756
/* Print a message to standard error, describing the value of ERRNO,
541
757
   (if STRING is not NULL and not empty) prefixed with STRING and ": ",
542
758
   and terminated with a newline.  */
543
 
extern void perror (const char *string);
 
759
# if @REPLACE_PERROR@
 
760
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
761
#   define perror rpl_perror
 
762
#  endif
 
763
_GL_FUNCDECL_RPL (perror, void, (const char *string));
 
764
_GL_CXXALIAS_RPL (perror, void, (const char *string));
 
765
# else
 
766
_GL_CXXALIAS_SYS (perror, void, (const char *string));
544
767
# endif
 
768
_GL_CXXALIASWARN (perror);
545
769
#elif defined GNULIB_POSIXCHECK
546
770
# undef perror
547
 
# define perror(s) \
548
 
    (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
549
 
                      "use gnulib module perror for portability"), \
550
 
     perror (s))
551
 
#endif
552
 
 
553
 
#ifdef __cplusplus
554
 
}
555
 
#endif
556
 
 
557
 
#endif /* _GL_STDIO_H */
558
 
#endif /* _GL_STDIO_H */
 
771
/* Assume perror is always declared.  */
 
772
_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
 
773
                 "use gnulib module perror for portability");
 
774
#endif
 
775
 
 
776
#if @GNULIB_POPEN@
 
777
# if @REPLACE_POPEN@
 
778
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
779
#   undef popen
 
780
#   define popen rpl_popen
 
781
#  endif
 
782
_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
 
783
                                 _GL_ARG_NONNULL ((1, 2)));
 
784
_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
 
785
# else
 
786
_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
 
787
# endif
 
788
_GL_CXXALIASWARN (popen);
 
789
#elif defined GNULIB_POSIXCHECK
 
790
# undef popen
 
791
# if HAVE_RAW_DECL_POPEN
 
792
_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
 
793
                 "use gnulib module popen or pipe for more portability");
 
794
# endif
 
795
#endif
 
796
 
 
797
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
 
798
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
 
799
     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 
800
#  if defined __GNUC__
 
801
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
802
/* Don't break __attribute__((format(printf,M,N))).  */
 
803
#    define printf __printf__
 
804
#   endif
 
805
#   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
806
_GL_FUNCDECL_RPL_1 (__printf__, int,
 
807
                    (const char *format, ...)
 
808
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
809
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
 
810
                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
 
811
                    _GL_ARG_NONNULL ((1)));
 
812
#   else
 
813
_GL_FUNCDECL_RPL_1 (__printf__, int,
 
814
                    (const char *format, ...)
 
815
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
816
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
 
817
                    _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
 
818
                    _GL_ARG_NONNULL ((1)));
 
819
#   endif
 
820
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
 
821
#  else
 
822
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
823
#    define printf rpl_printf
 
824
#   endif
 
825
_GL_FUNCDECL_RPL (printf, int,
 
826
                  (const char *format, ...)
 
827
                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
 
828
                  _GL_ARG_NONNULL ((1)));
 
829
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
 
830
#  endif
 
831
#  define GNULIB_overrides_printf 1
 
832
# else
 
833
_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 
834
# endif
 
835
_GL_CXXALIASWARN (printf);
 
836
#endif
 
837
#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 
838
# if !GNULIB_overrides_printf
 
839
#  undef printf
 
840
# endif
 
841
/* Assume printf is always declared.  */
 
842
_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
 
843
                 "use gnulib module printf-posix for portable "
 
844
                 "POSIX compliance");
 
845
#endif
 
846
 
 
847
#if @GNULIB_PUTC@
 
848
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
849
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
850
#   undef putc
 
851
#   define putc rpl_fputc
 
852
#  endif
 
853
_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
 
854
_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
 
855
# else
 
856
_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
 
857
# endif
 
858
_GL_CXXALIASWARN (putc);
 
859
#endif
 
860
 
 
861
#if @GNULIB_PUTCHAR@
 
862
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
863
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
864
#   undef putchar
 
865
#   define putchar rpl_putchar
 
866
#  endif
 
867
_GL_FUNCDECL_RPL (putchar, int, (int c));
 
868
_GL_CXXALIAS_RPL (putchar, int, (int c));
 
869
# else
 
870
_GL_CXXALIAS_SYS (putchar, int, (int c));
 
871
# endif
 
872
_GL_CXXALIASWARN (putchar);
 
873
#endif
 
874
 
 
875
#if @GNULIB_PUTS@
 
876
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
 
877
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
878
#   undef puts
 
879
#   define puts rpl_puts
 
880
#  endif
 
881
_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
 
882
_GL_CXXALIAS_RPL (puts, int, (const char *string));
 
883
# else
 
884
_GL_CXXALIAS_SYS (puts, int, (const char *string));
 
885
# endif
 
886
_GL_CXXALIASWARN (puts);
 
887
#endif
 
888
 
 
889
#if @GNULIB_REMOVE@
 
890
# if @REPLACE_REMOVE@
 
891
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
892
#   undef remove
 
893
#   define remove rpl_remove
 
894
#  endif
 
895
_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
 
896
_GL_CXXALIAS_RPL (remove, int, (const char *name));
 
897
# else
 
898
_GL_CXXALIAS_SYS (remove, int, (const char *name));
 
899
# endif
 
900
_GL_CXXALIASWARN (remove);
 
901
#elif defined GNULIB_POSIXCHECK
 
902
# undef remove
 
903
/* Assume remove is always declared.  */
 
904
_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
 
905
                 "use gnulib module remove for more portability");
 
906
#endif
 
907
 
 
908
#if @GNULIB_RENAME@
 
909
# if @REPLACE_RENAME@
 
910
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
911
#   undef rename
 
912
#   define rename rpl_rename
 
913
#  endif
 
914
_GL_FUNCDECL_RPL (rename, int,
 
915
                  (const char *old_filename, const char *new_filename)
 
916
                  _GL_ARG_NONNULL ((1, 2)));
 
917
_GL_CXXALIAS_RPL (rename, int,
 
918
                  (const char *old_filename, const char *new_filename));
 
919
# else
 
920
_GL_CXXALIAS_SYS (rename, int,
 
921
                  (const char *old_filename, const char *new_filename));
 
922
# endif
 
923
_GL_CXXALIASWARN (rename);
 
924
#elif defined GNULIB_POSIXCHECK
 
925
# undef rename
 
926
/* Assume rename is always declared.  */
 
927
_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
 
928
                 "use gnulib module rename for more portability");
 
929
#endif
 
930
 
 
931
#if @GNULIB_RENAMEAT@
 
932
# if @REPLACE_RENAMEAT@
 
933
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
934
#   undef renameat
 
935
#   define renameat rpl_renameat
 
936
#  endif
 
937
_GL_FUNCDECL_RPL (renameat, int,
 
938
                  (int fd1, char const *file1, int fd2, char const *file2)
 
939
                  _GL_ARG_NONNULL ((2, 4)));
 
940
_GL_CXXALIAS_RPL (renameat, int,
 
941
                  (int fd1, char const *file1, int fd2, char const *file2));
 
942
# else
 
943
#  if !@HAVE_RENAMEAT@
 
944
_GL_FUNCDECL_SYS (renameat, int,
 
945
                  (int fd1, char const *file1, int fd2, char const *file2)
 
946
                  _GL_ARG_NONNULL ((2, 4)));
 
947
#  endif
 
948
_GL_CXXALIAS_SYS (renameat, int,
 
949
                  (int fd1, char const *file1, int fd2, char const *file2));
 
950
# endif
 
951
_GL_CXXALIASWARN (renameat);
 
952
#elif defined GNULIB_POSIXCHECK
 
953
# undef renameat
 
954
# if HAVE_RAW_DECL_RENAMEAT
 
955
_GL_WARN_ON_USE (renameat, "renameat is not portable - "
 
956
                 "use gnulib module renameat for portability");
 
957
# endif
 
958
#endif
 
959
 
 
960
#if @GNULIB_SCANF@
 
961
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
962
#  if defined __GNUC__
 
963
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
964
#    undef scanf
 
965
/* Don't break __attribute__((format(scanf,M,N))).  */
 
966
#    define scanf __scanf__
 
967
#   endif
 
968
_GL_FUNCDECL_RPL_1 (__scanf__, int,
 
969
                    (const char *format, ...)
 
970
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
971
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
 
972
                    _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
 
973
                    _GL_ARG_NONNULL ((1)));
 
974
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
 
975
#  else
 
976
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
977
#    undef scanf
 
978
#    define scanf rpl_scanf
 
979
#   endif
 
980
_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
 
981
                              _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
 
982
                              _GL_ARG_NONNULL ((1)));
 
983
_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
 
984
#  endif
 
985
# else
 
986
_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
 
987
# endif
 
988
_GL_CXXALIASWARN (scanf);
 
989
#endif
 
990
 
 
991
#if @GNULIB_SNPRINTF@
 
992
# if @REPLACE_SNPRINTF@
 
993
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
994
#   define snprintf rpl_snprintf
 
995
#  endif
 
996
_GL_FUNCDECL_RPL (snprintf, int,
 
997
                  (char *str, size_t size, const char *format, ...)
 
998
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
 
999
                  _GL_ARG_NONNULL ((3)));
 
1000
_GL_CXXALIAS_RPL (snprintf, int,
 
1001
                  (char *str, size_t size, const char *format, ...));
 
1002
# else
 
1003
#  if !@HAVE_DECL_SNPRINTF@
 
1004
_GL_FUNCDECL_SYS (snprintf, int,
 
1005
                  (char *str, size_t size, const char *format, ...)
 
1006
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
 
1007
                  _GL_ARG_NONNULL ((3)));
 
1008
#  endif
 
1009
_GL_CXXALIAS_SYS (snprintf, int,
 
1010
                  (char *str, size_t size, const char *format, ...));
 
1011
# endif
 
1012
_GL_CXXALIASWARN (snprintf);
 
1013
#elif defined GNULIB_POSIXCHECK
 
1014
# undef snprintf
 
1015
# if HAVE_RAW_DECL_SNPRINTF
 
1016
_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 
1017
                 "use gnulib module snprintf for portability");
 
1018
# endif
 
1019
#endif
 
1020
 
 
1021
/* Some people would argue that sprintf should be handled like gets
 
1022
   (for example, OpenBSD issues a link warning for both functions),
 
1023
   since both can cause security holes due to buffer overruns.
 
1024
   However, we believe that sprintf can be used safely, and is more
 
1025
   efficient than snprintf in those safe cases; and as proof of our
 
1026
   belief, we use sprintf in several gnulib modules.  So this header
 
1027
   intentionally avoids adding a warning to sprintf except when
 
1028
   GNULIB_POSIXCHECK is defined.  */
 
1029
 
 
1030
#if @GNULIB_SPRINTF_POSIX@
 
1031
# if @REPLACE_SPRINTF@
 
1032
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1033
#   define sprintf rpl_sprintf
 
1034
#  endif
 
1035
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
 
1036
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
1037
                                _GL_ARG_NONNULL ((1, 2)));
 
1038
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
 
1039
# else
 
1040
_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
 
1041
# endif
 
1042
_GL_CXXALIASWARN (sprintf);
 
1043
#elif defined GNULIB_POSIXCHECK
 
1044
# undef sprintf
 
1045
/* Assume sprintf is always declared.  */
 
1046
_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
 
1047
                 "use gnulib module sprintf-posix for portable "
 
1048
                 "POSIX compliance");
 
1049
#endif
 
1050
 
 
1051
#if @GNULIB_TMPFILE@
 
1052
# if @REPLACE_TMPFILE@
 
1053
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1054
#   define tmpfile rpl_tmpfile
 
1055
#  endif
 
1056
_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
 
1057
_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
 
1058
# else
 
1059
_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
 
1060
# endif
 
1061
_GL_CXXALIASWARN (tmpfile);
 
1062
#elif defined GNULIB_POSIXCHECK
 
1063
# undef tmpfile
 
1064
# if HAVE_RAW_DECL_TMPFILE
 
1065
_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
 
1066
                 "use gnulib module tmpfile for portability");
 
1067
# endif
 
1068
#endif
 
1069
 
 
1070
#if @GNULIB_VASPRINTF@
 
1071
/* Write formatted output to a string dynamically allocated with malloc().
 
1072
   If the memory allocation succeeds, store the address of the string in
 
1073
   *RESULT and return the number of resulting bytes, excluding the trailing
 
1074
   NUL.  Upon memory allocation error, or some other error, return -1.  */
 
1075
# if @REPLACE_VASPRINTF@
 
1076
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1077
#   define asprintf rpl_asprintf
 
1078
#  endif
 
1079
_GL_FUNCDECL_RPL (asprintf, int,
 
1080
                  (char **result, const char *format, ...)
 
1081
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
1082
                  _GL_ARG_NONNULL ((1, 2)));
 
1083
_GL_CXXALIAS_RPL (asprintf, int,
 
1084
                  (char **result, const char *format, ...));
 
1085
# else
 
1086
#  if !@HAVE_VASPRINTF@
 
1087
_GL_FUNCDECL_SYS (asprintf, int,
 
1088
                  (char **result, const char *format, ...)
 
1089
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
1090
                  _GL_ARG_NONNULL ((1, 2)));
 
1091
#  endif
 
1092
_GL_CXXALIAS_SYS (asprintf, int,
 
1093
                  (char **result, const char *format, ...));
 
1094
# endif
 
1095
_GL_CXXALIASWARN (asprintf);
 
1096
# if @REPLACE_VASPRINTF@
 
1097
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1098
#   define vasprintf rpl_vasprintf
 
1099
#  endif
 
1100
_GL_FUNCDECL_RPL (vasprintf, int,
 
1101
                  (char **result, const char *format, va_list args)
 
1102
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1103
                  _GL_ARG_NONNULL ((1, 2)));
 
1104
_GL_CXXALIAS_RPL (vasprintf, int,
 
1105
                  (char **result, const char *format, va_list args));
 
1106
# else
 
1107
#  if !@HAVE_VASPRINTF@
 
1108
_GL_FUNCDECL_SYS (vasprintf, int,
 
1109
                  (char **result, const char *format, va_list args)
 
1110
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1111
                  _GL_ARG_NONNULL ((1, 2)));
 
1112
#  endif
 
1113
_GL_CXXALIAS_SYS (vasprintf, int,
 
1114
                  (char **result, const char *format, va_list args));
 
1115
# endif
 
1116
_GL_CXXALIASWARN (vasprintf);
 
1117
#endif
 
1118
 
 
1119
#if @GNULIB_VDPRINTF@
 
1120
# if @REPLACE_VDPRINTF@
 
1121
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1122
#   define vdprintf rpl_vdprintf
 
1123
#  endif
 
1124
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
 
1125
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1126
                                 _GL_ARG_NONNULL ((2)));
 
1127
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
 
1128
# else
 
1129
#  if !@HAVE_VDPRINTF@
 
1130
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
 
1131
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1132
                                 _GL_ARG_NONNULL ((2)));
 
1133
#  endif
 
1134
/* Need to cast, because on Solaris, the third parameter will likely be
 
1135
                                                    __va_list args.  */
 
1136
_GL_CXXALIAS_SYS_CAST (vdprintf, int,
 
1137
                       (int fd, const char *format, va_list args));
 
1138
# endif
 
1139
_GL_CXXALIASWARN (vdprintf);
 
1140
#elif defined GNULIB_POSIXCHECK
 
1141
# undef vdprintf
 
1142
# if HAVE_RAW_DECL_VDPRINTF
 
1143
_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 
1144
                 "use gnulib module vdprintf for portability");
 
1145
# endif
 
1146
#endif
 
1147
 
 
1148
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
 
1149
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
 
1150
     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 
1151
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1152
#   define vfprintf rpl_vfprintf
 
1153
#  endif
 
1154
#  define GNULIB_overrides_vfprintf 1
 
1155
#  if @GNULIB_VFPRINTF_POSIX@
 
1156
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
 
1157
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1158
                                 _GL_ARG_NONNULL ((1, 2)));
 
1159
#  else
 
1160
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
 
1161
                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
 
1162
                                 _GL_ARG_NONNULL ((1, 2)));
 
1163
#  endif
 
1164
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
 
1165
# else
 
1166
/* Need to cast, because on Solaris, the third parameter is
 
1167
                                                      __va_list args
 
1168
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
 
1169
_GL_CXXALIAS_SYS_CAST (vfprintf, int,
 
1170
                       (FILE *fp, const char *format, va_list args));
 
1171
# endif
 
1172
_GL_CXXALIASWARN (vfprintf);
 
1173
#endif
 
1174
#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 
1175
# if !GNULIB_overrides_vfprintf
 
1176
#  undef vfprintf
 
1177
# endif
 
1178
/* Assume vfprintf is always declared.  */
 
1179
_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
 
1180
                 "use gnulib module vfprintf-posix for portable "
 
1181
                      "POSIX compliance");
 
1182
#endif
 
1183
 
 
1184
#if @GNULIB_VFSCANF@
 
1185
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
1186
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1187
#   undef vfscanf
 
1188
#   define vfscanf rpl_vfscanf
 
1189
#  endif
 
1190
_GL_FUNCDECL_RPL (vfscanf, int,
 
1191
                  (FILE *stream, const char *format, va_list args)
 
1192
                  _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
 
1193
                  _GL_ARG_NONNULL ((1, 2)));
 
1194
_GL_CXXALIAS_RPL (vfscanf, int,
 
1195
                  (FILE *stream, const char *format, va_list args));
 
1196
# else
 
1197
_GL_CXXALIAS_SYS (vfscanf, int,
 
1198
                  (FILE *stream, const char *format, va_list args));
 
1199
# endif
 
1200
_GL_CXXALIASWARN (vfscanf);
 
1201
#endif
 
1202
 
 
1203
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
 
1204
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
 
1205
     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 
1206
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1207
#   define vprintf rpl_vprintf
 
1208
#  endif
 
1209
#  define GNULIB_overrides_vprintf 1
 
1210
#  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
1211
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
 
1212
                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
 
1213
                                _GL_ARG_NONNULL ((1)));
 
1214
#  else
 
1215
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
 
1216
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
 
1217
                                _GL_ARG_NONNULL ((1)));
 
1218
#  endif
 
1219
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
 
1220
# else
 
1221
/* Need to cast, because on Solaris, the second parameter is
 
1222
                                                          __va_list args
 
1223
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
 
1224
_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
 
1225
# endif
 
1226
_GL_CXXALIASWARN (vprintf);
 
1227
#endif
 
1228
#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 
1229
# if !GNULIB_overrides_vprintf
 
1230
#  undef vprintf
 
1231
# endif
 
1232
/* Assume vprintf is always declared.  */
 
1233
_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
 
1234
                 "use gnulib module vprintf-posix for portable "
 
1235
                 "POSIX compliance");
 
1236
#endif
 
1237
 
 
1238
#if @GNULIB_VSCANF@
 
1239
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
1240
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1241
#   undef vscanf
 
1242
#   define vscanf rpl_vscanf
 
1243
#  endif
 
1244
_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
 
1245
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
 
1246
                               _GL_ARG_NONNULL ((1)));
 
1247
_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
 
1248
# else
 
1249
_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
 
1250
# endif
 
1251
_GL_CXXALIASWARN (vscanf);
 
1252
#endif
 
1253
 
 
1254
#if @GNULIB_VSNPRINTF@
 
1255
# if @REPLACE_VSNPRINTF@
 
1256
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1257
#   define vsnprintf rpl_vsnprintf
 
1258
#  endif
 
1259
_GL_FUNCDECL_RPL (vsnprintf, int,
 
1260
                  (char *str, size_t size, const char *format, va_list args)
 
1261
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
 
1262
                  _GL_ARG_NONNULL ((3)));
 
1263
_GL_CXXALIAS_RPL (vsnprintf, int,
 
1264
                  (char *str, size_t size, const char *format, va_list args));
 
1265
# else
 
1266
#  if !@HAVE_DECL_VSNPRINTF@
 
1267
_GL_FUNCDECL_SYS (vsnprintf, int,
 
1268
                  (char *str, size_t size, const char *format, va_list args)
 
1269
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
 
1270
                  _GL_ARG_NONNULL ((3)));
 
1271
#  endif
 
1272
_GL_CXXALIAS_SYS (vsnprintf, int,
 
1273
                  (char *str, size_t size, const char *format, va_list args));
 
1274
# endif
 
1275
_GL_CXXALIASWARN (vsnprintf);
 
1276
#elif defined GNULIB_POSIXCHECK
 
1277
# undef vsnprintf
 
1278
# if HAVE_RAW_DECL_VSNPRINTF
 
1279
_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 
1280
                 "use gnulib module vsnprintf for portability");
 
1281
# endif
 
1282
#endif
 
1283
 
 
1284
#if @GNULIB_VSPRINTF_POSIX@
 
1285
# if @REPLACE_VSPRINTF@
 
1286
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1287
#   define vsprintf rpl_vsprintf
 
1288
#  endif
 
1289
_GL_FUNCDECL_RPL (vsprintf, int,
 
1290
                  (char *str, const char *format, va_list args)
 
1291
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1292
                  _GL_ARG_NONNULL ((1, 2)));
 
1293
_GL_CXXALIAS_RPL (vsprintf, int,
 
1294
                  (char *str, const char *format, va_list args));
 
1295
# else
 
1296
/* Need to cast, because on Solaris, the third parameter is
 
1297
                                                       __va_list args
 
1298
   and GCC's fixincludes did not change this to __gnuc_va_list.  */
 
1299
_GL_CXXALIAS_SYS_CAST (vsprintf, int,
 
1300
                       (char *str, const char *format, va_list args));
 
1301
# endif
 
1302
_GL_CXXALIASWARN (vsprintf);
 
1303
#elif defined GNULIB_POSIXCHECK
 
1304
# undef vsprintf
 
1305
/* Assume vsprintf is always declared.  */
 
1306
_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
 
1307
                 "use gnulib module vsprintf-posix for portable "
 
1308
                      "POSIX compliance");
 
1309
#endif
 
1310
 
 
1311
 
 
1312
#endif /* _@GUARD_PREFIX@_STDIO_H */
 
1313
#endif /* _@GUARD_PREFIX@_STDIO_H */
559
1314
#endif