mkdir: avoid xalloc
[gnulib.git] / lib / stdio.in.h
1 /* A GNU-like <stdio.h>.
2
3    Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2, or (at your option)
8    any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software Foundation,
17    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22
23 #if defined __need_FILE || defined __need___FILE
24 /* Special invocation convention inside glibc header files.  */
25
26 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
27
28 #else
29 /* Normal invocation convention.  */
30
31 #ifndef _GL_STDIO_H
32
33 /* The include_next requires a split double-inclusion guard.  */
34 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
35
36 #ifndef _GL_STDIO_H
37 #define _GL_STDIO_H
38
39 #include <stdarg.h>
40 #include <stddef.h>
41
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      || defined GNULIB_POSIXCHECK)
47 /* Get off_t and ssize_t.  */
48 # include <sys/types.h>
49 #endif
50
51 #ifndef __attribute__
52 /* This feature is available in gcc versions 2.5 and later.  */
53 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
54 #  define __attribute__(Spec) /* empty */
55 # endif
56 /* The __-protected variants of `format' and `printf' attributes
57    are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
58 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
59 #  define __format__ format
60 #  define __printf__ printf
61 # endif
62 #endif
63
64
65 /* The definition of GL_LINK_WARNING is copied here.  */
66
67 /* The definition of _GL_ARG_NONNULL is copied here.  */
68
69
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73
74 #if @GNULIB_DPRINTF@
75 # if @REPLACE_DPRINTF@
76 #  define dprintf rpl_dprintf
77 # endif
78 # if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
79 extern int dprintf (int fd, const char *format, ...)
80        __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((2));
81 # endif
82 #elif defined GNULIB_POSIXCHECK
83 # undef dprintf
84 # define dprintf \
85     (GL_LINK_WARNING ("dprintf is unportable - " \
86                       "use gnulib module dprintf for portability"), \
87      dprintf)
88 #endif
89
90 #if @GNULIB_FCLOSE@
91 # if @REPLACE_FCLOSE@
92 #  define fclose rpl_fclose
93   /* Close STREAM and its underlying file descriptor.  */
94 extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
95 # endif
96 #elif defined GNULIB_POSIXCHECK
97 # undef fclose
98 # define fclose(f) \
99    (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
100                      "use gnulib module fclose for portable " \
101                      "POSIX compliance"), \
102     fclose (f))
103 #endif
104
105 #if @GNULIB_FFLUSH@
106 # if @REPLACE_FFLUSH@
107 #  define fflush rpl_fflush
108   /* Flush all pending data on STREAM according to POSIX rules.  Both
109      output and seekable input streams are supported.
110      Note! LOSS OF DATA can occur if fflush is applied on an input stream
111      that is _not_seekable_ or on an update stream that is _not_seekable_
112      and in which the most recent operation was input.  Seekability can
113      be tested with lseek(fileno(fp),0,SEEK_CUR).  */
114   extern int fflush (FILE *gl_stream);
115 # endif
116 #elif defined GNULIB_POSIXCHECK
117 # undef fflush
118 # define fflush(f) \
119    (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
120                      "use gnulib module fflush for portable " \
121                      "POSIX compliance"), \
122     fflush (f))
123 #endif
124
125 #if @GNULIB_FOPEN@
126 # if @REPLACE_FOPEN@
127 #  undef fopen
128 #  define fopen rpl_fopen
129 extern FILE * fopen (const char *filename, const char *mode)
130      _GL_ARG_NONNULL ((1, 2));
131 # endif
132 #elif defined GNULIB_POSIXCHECK
133 # undef fopen
134 # define fopen(f,m) \
135    (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
136                      "use gnulib module fopen for portability"), \
137     fopen (f, m))
138 #endif
139
140 #if @GNULIB_FPRINTF_POSIX@
141 # if @REPLACE_FPRINTF@
142 #  define fprintf rpl_fprintf
143 extern int fprintf (FILE *fp, const char *format, ...)
144        __attribute__ ((__format__ (__printf__, 2, 3)))
145        _GL_ARG_NONNULL ((1, 2));
146 # endif
147 #elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
148 # define fprintf rpl_fprintf
149 extern int fprintf (FILE *fp, const char *format, ...)
150        __attribute__ ((__format__ (__printf__, 2, 3)))
151        _GL_ARG_NONNULL ((1, 2));
152 #elif defined GNULIB_POSIXCHECK
153 # undef fprintf
154 # define fprintf \
155     (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
156                       "use gnulib module fprintf-posix for portable " \
157                       "POSIX compliance"), \
158      fprintf)
159 #endif
160
161 #if @GNULIB_FPURGE@
162 # if @REPLACE_FPURGE@
163 #  define fpurge rpl_fpurge
164 # endif
165 # if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
166   /* Discard all pending buffered I/O data on STREAM.
167      STREAM must not be wide-character oriented.
168      When discarding pending output, the file position is set back to where it
169      was before the write calls.  When discarding pending input, the file
170      position is advanced to match the end of the previously read input.
171      Return 0 if successful.  Upon error, return -1 and set errno.  */
172   extern int fpurge (FILE *gl_stream) _GL_ARG_NONNULL ((1));
173 # endif
174 #elif defined GNULIB_POSIXCHECK
175 # undef fpurge
176 # define fpurge(f) \
177    (GL_LINK_WARNING ("fpurge is not always present - " \
178                      "use gnulib module fpurge for portability"), \
179     fpurge (f))
180 #endif
181
182 #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
183 # undef fputc
184 # define fputc rpl_fputc
185 extern int fputc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
186 #endif
187
188 #if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
189 # undef fputs
190 # define fputs rpl_fputs
191 extern int fputs (const char *string, FILE *stream) _GL_ARG_NONNULL ((1, 2));
192 #endif
193
194 #if @GNULIB_FREOPEN@
195 # if @REPLACE_FREOPEN@
196 #  undef freopen
197 #  define freopen rpl_freopen
198 extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
199      _GL_ARG_NONNULL ((2, 3));
200 # endif
201 #elif defined GNULIB_POSIXCHECK
202 # undef freopen
203 # define freopen(f,m,s) \
204    (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
205                      "use gnulib module freopen for portability"), \
206     freopen (f, m, s))
207 #endif
208
209 #if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
210 extern int rpl_fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
211 # undef fseek
212 # if defined GNULIB_POSIXCHECK
213 #  define fseek(f,o,w) \
214      (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
215                        "on 32-bit platforms - " \
216                        "use fseeko function for handling of large files"), \
217       rpl_fseek (f, o, w))
218 # else
219 #  define fseek rpl_fseek
220 # endif
221 #elif defined GNULIB_POSIXCHECK
222 # ifndef fseek
223 #  define fseek(f,o,w) \
224      (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
225                        "on 32-bit platforms - " \
226                        "use fseeko function for handling of large files"), \
227       fseek (f, o, w))
228 # endif
229 #endif
230
231 #if @GNULIB_FSEEKO@
232 # if @REPLACE_FSEEKO@
233 /* Provide fseek, fseeko functions that are aware of a preceding
234    fflush(), and which detect pipes.  */
235 #  define fseeko rpl_fseeko
236 extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1));
237 #  if !@GNULIB_FSEEK@
238 #   undef fseek
239 #   define fseek(f,o,w) \
240      (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
241                        "on 32-bit platforms - " \
242                        "use fseeko function for handling of large files"), \
243       fseeko (f, o, w))
244 #  endif
245 # endif
246 #elif defined GNULIB_POSIXCHECK
247 # undef fseeko
248 # define fseeko(f,o,w) \
249    (GL_LINK_WARNING ("fseeko is unportable - " \
250                      "use gnulib module fseeko for portability"), \
251     fseeko (f, o, w))
252 #endif
253
254 #if @GNULIB_FTELL@ && @REPLACE_FTELL@
255 extern long rpl_ftell (FILE *fp) _GL_ARG_NONNULL ((1));
256 # undef ftell
257 # if GNULIB_POSIXCHECK
258 #  define ftell(f) \
259      (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
260                        "on 32-bit platforms - " \
261                        "use ftello function for handling of large files"), \
262       rpl_ftell (f))
263 # else
264 #  define ftell rpl_ftell
265 # endif
266 #elif defined GNULIB_POSIXCHECK
267 # ifndef ftell
268 #  define ftell(f) \
269      (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
270                        "on 32-bit platforms - " \
271                        "use ftello function for handling of large files"), \
272       ftell (f))
273 # endif
274 #endif
275
276 #if @GNULIB_FTELLO@
277 # if @REPLACE_FTELLO@
278 #  define ftello rpl_ftello
279 extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1));
280 #  if !@GNULIB_FTELL@
281 #   undef ftell
282 #   define ftell(f) \
283      (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
284                        "on 32-bit platforms - " \
285                        "use ftello function for handling of large files"), \
286       ftello (f))
287 #  endif
288 # endif
289 #elif defined GNULIB_POSIXCHECK
290 # undef ftello
291 # define ftello(f) \
292    (GL_LINK_WARNING ("ftello is unportable - " \
293                      "use gnulib module ftello for portability"), \
294     ftello (f))
295 #endif
296
297 #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
298 # undef fwrite
299 # define fwrite rpl_fwrite
300 extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
301      _GL_ARG_NONNULL ((1, 4));
302 #endif
303
304 #if @GNULIB_GETDELIM@
305 # if !@HAVE_DECL_GETDELIM@
306 /* Read input, up to (and including) the next occurrence of DELIMITER, from
307    STREAM, store it in *LINEPTR (and NUL-terminate it).
308    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
309    bytes of space.  It is realloc'd as necessary.
310    Return the number of bytes read and stored at *LINEPTR (not including the
311    NUL terminator), or -1 on error or EOF.  */
312 extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
313                          FILE *stream)
314      _GL_ARG_NONNULL ((1, 2, 4));
315 # endif
316 #elif defined GNULIB_POSIXCHECK
317 # undef getdelim
318 # define getdelim(l, s, d, f)                                       \
319   (GL_LINK_WARNING ("getdelim is unportable - "                     \
320                     "use gnulib module getdelim for portability"),  \
321    getdelim (l, s, d, f))
322 #endif
323
324 #if @GNULIB_GETLINE@
325 # if @REPLACE_GETLINE@
326 #  undef getline
327 #  define getline rpl_getline
328 # endif
329 # if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
330 /* Read a line, up to (and including) the next newline, from STREAM, store it
331    in *LINEPTR (and NUL-terminate it).
332    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
333    bytes of space.  It is realloc'd as necessary.
334    Return the number of bytes read and stored at *LINEPTR (not including the
335    NUL terminator), or -1 on error or EOF.  */
336 extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream)
337      _GL_ARG_NONNULL ((1, 2, 3));
338 # endif
339 #elif defined GNULIB_POSIXCHECK
340 # undef getline
341 # define getline(l, s, f)                                               \
342   (GL_LINK_WARNING ("getline is unportable - "                          \
343                     "use gnulib module getline for portability"),       \
344    getline (l, s, f))
345 #endif
346
347 #if @GNULIB_OBSTACK_PRINTF@
348 # if @REPLACE_OBSTACK_PRINTF@
349 #  define obstack_printf rpl_osbtack_printf
350 #  define obstack_vprintf rpl_obstack_vprintf
351 # endif
352 # if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
353   struct obstack;
354   /* Grow an obstack with formatted output.  Return the number of
355      bytes added to OBS.  No trailing nul byte is added, and the
356      object should be closed with obstack_finish before use.  Upon
357      memory allocation error, call obstack_alloc_failed_handler.  Upon
358      other error, return -1.  */
359   extern int obstack_printf (struct obstack *obs, const char *format, ...)
360     __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
361   extern int obstack_vprintf (struct obstack *obs, const char *format,
362                               va_list args)
363     __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
364 # endif
365 #endif
366
367 #if @GNULIB_PERROR@
368 # if @REPLACE_PERROR@
369 #  define perror rpl_perror
370 /* Print a message to standard error, describing the value of ERRNO,
371    (if STRING is not NULL and not empty) prefixed with STRING and ": ",
372    and terminated with a newline.  */
373 extern void perror (const char *string);
374 # endif
375 #elif defined GNULIB_POSIXCHECK
376 # undef perror
377 # define perror(s) \
378     (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
379                       "use gnulib module perror for portability"), \
380      perror (s))
381 #endif
382
383 #if @GNULIB_POPEN@
384 # if @REPLACE_POPEN@
385 #  undef popen
386 #  define popen rpl_popen
387 extern FILE *popen (const char *cmd, const char *mode)
388      _GL_ARG_NONNULL ((1, 2));
389 # endif
390 #elif defined GNULIB_POSIXCHECK
391 # undef popen
392 # define popen(c,m) \
393    (GL_LINK_WARNING ("popen is buggy on some platforms - " \
394                      "use gnulib module popen or pipe for more portability"), \
395     popen (c, m))
396 #endif
397
398 #if @GNULIB_PRINTF_POSIX@
399 # if @REPLACE_PRINTF@
400 /* Don't break __attribute__((format(printf,M,N))).  */
401 #  define printf __printf__
402 extern int printf (const char *format, ...)
403        __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
404 # endif
405 #elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
406 /* Don't break __attribute__((format(printf,M,N))).  */
407 # define printf __printf__
408 extern int printf (const char *format, ...)
409        __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
410 #elif defined GNULIB_POSIXCHECK
411 # undef printf
412 # define printf \
413     (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
414                       "use gnulib module printf-posix for portable " \
415                       "POSIX compliance"), \
416      printf)
417 /* Don't break __attribute__((format(printf,M,N))).  */
418 # define format(kind,m,n) format (__##kind##__, m, n)
419 # define __format__(kind,m,n) __format__ (__##kind##__, m, n)
420 # define ____printf____ __printf__
421 # define ____scanf____ __scanf__
422 # define ____strftime____ __strftime__
423 # define ____strfmon____ __strfmon__
424 #endif
425
426 #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
427 # undef putc
428 # define putc rpl_fputc
429 extern int putc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
430 #endif
431
432 #if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
433 # undef putchar
434 # define putchar rpl_putchar
435 extern int putchar (int c);
436 #endif
437
438 #if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
439 # undef puts
440 # define puts rpl_puts
441 extern int puts (const char *string) _GL_ARG_NONNULL ((1));
442 #endif
443
444 #if @GNULIB_REMOVE@
445 # if @REPLACE_REMOVE@
446 #  undef remove
447 #  define remove rpl_remove
448 extern int remove (const char *name) _GL_ARG_NONNULL ((1));
449 # endif
450 #elif defined GNULIB_POSIXCHECK
451 # undef remove
452 # define remove(n)                                         \
453    (GL_LINK_WARNING ("remove cannot handle directories on some platforms - " \
454                      "use gnulib module remove for more portability"), \
455     remove (n))
456 #endif
457
458 #if @GNULIB_RENAME@
459 # if @REPLACE_RENAME@
460 #  undef rename
461 #  define rename rpl_rename
462 extern int rename (const char *old_filename, const char *new_filename)
463      _GL_ARG_NONNULL ((1, 2));
464 # endif
465 #elif defined GNULIB_POSIXCHECK
466 # undef rename
467 # define rename(o,n)                                       \
468    (GL_LINK_WARNING ("rename is buggy on some platforms - " \
469                      "use gnulib module rename for more portability"), \
470     rename (o, n))
471 #endif
472
473 #if @GNULIB_RENAMEAT@
474 # if @REPLACE_RENAMEAT@
475 #  undef renameat
476 #  define renameat rpl_renameat
477 # endif
478 # if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@
479 extern int renameat (int fd1, char const *file1, int fd2, char const *file2)
480      _GL_ARG_NONNULL ((2, 4));
481 # endif
482 #elif defined GNULIB_POSIXCHECK
483 # undef renameat
484 # define renameat(d1,f1,d2,f2)             \
485     (GL_LINK_WARNING ("renameat is not portable - " \
486                       "use gnulib module renameat for portability"), \
487      renameat (d1, f1, d2, f2))
488 #endif
489
490 #if @GNULIB_SNPRINTF@
491 # if @REPLACE_SNPRINTF@
492 #  define snprintf rpl_snprintf
493 # endif
494 # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
495 extern int snprintf (char *str, size_t size, const char *format, ...)
496        __attribute__ ((__format__ (__printf__, 3, 4)))
497        _GL_ARG_NONNULL ((3));
498 # endif
499 #elif defined GNULIB_POSIXCHECK
500 # undef snprintf
501 # define snprintf \
502     (GL_LINK_WARNING ("snprintf is unportable - " \
503                       "use gnulib module snprintf for portability"), \
504      snprintf)
505 #endif
506
507 #if @GNULIB_SPRINTF_POSIX@
508 # if @REPLACE_SPRINTF@
509 #  define sprintf rpl_sprintf
510 extern int sprintf (char *str, const char *format, ...)
511        __attribute__ ((__format__ (__printf__, 2, 3)))
512        _GL_ARG_NONNULL ((1, 2));
513 # endif
514 #elif defined GNULIB_POSIXCHECK
515 # undef sprintf
516 # define sprintf \
517     (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
518                       "use gnulib module sprintf-posix for portable " \
519                       "POSIX compliance"), \
520      sprintf)
521 #endif
522
523 #if @GNULIB_VASPRINTF@
524 # if @REPLACE_VASPRINTF@
525 #  define asprintf rpl_asprintf
526 #  define vasprintf rpl_vasprintf
527 # endif
528 # if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
529   /* Write formatted output to a string dynamically allocated with malloc().
530      If the memory allocation succeeds, store the address of the string in
531      *RESULT and return the number of resulting bytes, excluding the trailing
532      NUL.  Upon memory allocation error, or some other error, return -1.  */
533   extern int asprintf (char **result, const char *format, ...)
534     __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
535   extern int vasprintf (char **result, const char *format, va_list args)
536     __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
537 # endif
538 #endif
539
540 #if @GNULIB_VDPRINTF@
541 # if @REPLACE_VDPRINTF@
542 #  define vdprintf rpl_vdprintf
543 # endif
544 # if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
545 extern int vdprintf (int fd, const char *format, va_list args)
546        __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2));
547 # endif
548 #elif defined GNULIB_POSIXCHECK
549 # undef vdprintf
550 # define vdprintf(d,f,a) \
551     (GL_LINK_WARNING ("vdprintf is unportable - " \
552                       "use gnulib module vdprintf for portability"), \
553      vdprintf (d, f, a))
554 #endif
555
556 #if @GNULIB_VFPRINTF_POSIX@
557 # if @REPLACE_VFPRINTF@
558 #  define vfprintf rpl_vfprintf
559 extern int vfprintf (FILE *fp, const char *format, va_list args)
560        __attribute__ ((__format__ (__printf__, 2, 0)))
561        _GL_ARG_NONNULL ((1, 2));
562 # endif
563 #elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
564 # define vfprintf rpl_vfprintf
565 extern int vfprintf (FILE *fp, const char *format, va_list args)
566        __attribute__ ((__format__ (__printf__, 2, 0)))
567        _GL_ARG_NONNULL ((1, 2));
568 #elif defined GNULIB_POSIXCHECK
569 # undef vfprintf
570 # define vfprintf(s,f,a) \
571     (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
572                       "use gnulib module vfprintf-posix for portable " \
573                       "POSIX compliance"), \
574      vfprintf (s, f, a))
575 #endif
576
577 #if @GNULIB_VPRINTF_POSIX@
578 # if @REPLACE_VPRINTF@
579 #  define vprintf rpl_vprintf
580 extern int vprintf (const char *format, va_list args)
581        __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
582 # endif
583 #elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
584 # define vprintf rpl_vprintf
585 extern int vprintf (const char *format, va_list args)
586        __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
587 #elif defined GNULIB_POSIXCHECK
588 # undef vprintf
589 # define vprintf(f,a) \
590     (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
591                       "use gnulib module vprintf-posix for portable " \
592                       "POSIX compliance"), \
593      vprintf (f, a))
594 #endif
595
596 #if @GNULIB_VSNPRINTF@
597 # if @REPLACE_VSNPRINTF@
598 #  define vsnprintf rpl_vsnprintf
599 # endif
600 # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
601 extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
602        __attribute__ ((__format__ (__printf__, 3, 0)))
603        _GL_ARG_NONNULL ((3));
604 # endif
605 #elif defined GNULIB_POSIXCHECK
606 # undef vsnprintf
607 # define vsnprintf(b,s,f,a) \
608     (GL_LINK_WARNING ("vsnprintf is unportable - " \
609                       "use gnulib module vsnprintf for portability"), \
610      vsnprintf (b, s, f, a))
611 #endif
612
613 #if @GNULIB_VSPRINTF_POSIX@
614 # if @REPLACE_VSPRINTF@
615 #  define vsprintf rpl_vsprintf
616 extern int vsprintf (char *str, const char *format, va_list args)
617        __attribute__ ((__format__ (__printf__, 2, 0)))
618        _GL_ARG_NONNULL ((1, 2));
619 # endif
620 #elif defined GNULIB_POSIXCHECK
621 # undef vsprintf
622 # define vsprintf(b,f,a) \
623     (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
624                       "use gnulib module vsprintf-posix for portable " \
625                       "POSIX compliance"), \
626      vsprintf (b, f, a))
627 #endif
628
629 #ifdef __cplusplus
630 }
631 #endif
632
633 #endif /* _GL_STDIO_H */
634 #endif /* _GL_STDIO_H */
635 #endif