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