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