diff options
Diffstat (limited to 'gl/stdio.in.h')
-rw-r--r-- | gl/stdio.in.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/gl/stdio.in.h b/gl/stdio.in.h index 434fa8e7..96cb2573 100644 --- a/gl/stdio.in.h +++ b/gl/stdio.in.h | |||
@@ -16,6 +16,10 @@ | |||
16 | along with this program; if not, write to the Free Software Foundation, | 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. */ | 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
18 | 18 | ||
19 | #if __GNUC__ >= 3 | ||
20 | @PRAGMA_SYSTEM_HEADER@ | ||
21 | #endif | ||
22 | |||
19 | #if defined __need_FILE || defined __need___FILE | 23 | #if defined __need_FILE || defined __need___FILE |
20 | /* Special invocation convention inside glibc header files. */ | 24 | /* Special invocation convention inside glibc header files. */ |
21 | 25 | ||
@@ -71,6 +75,10 @@ extern "C" { | |||
71 | extern int fprintf (FILE *fp, const char *format, ...) | 75 | extern int fprintf (FILE *fp, const char *format, ...) |
72 | __attribute__ ((__format__ (__printf__, 2, 3))); | 76 | __attribute__ ((__format__ (__printf__, 2, 3))); |
73 | # endif | 77 | # endif |
78 | #elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
79 | # define fprintf rpl_fprintf | ||
80 | extern int fprintf (FILE *fp, const char *format, ...) | ||
81 | __attribute__ ((__format__ (__printf__, 2, 3))); | ||
74 | #elif defined GNULIB_POSIXCHECK | 82 | #elif defined GNULIB_POSIXCHECK |
75 | # undef fprintf | 83 | # undef fprintf |
76 | # define fprintf \ | 84 | # define fprintf \ |
@@ -86,6 +94,10 @@ extern int fprintf (FILE *fp, const char *format, ...) | |||
86 | extern int vfprintf (FILE *fp, const char *format, va_list args) | 94 | extern int vfprintf (FILE *fp, const char *format, va_list args) |
87 | __attribute__ ((__format__ (__printf__, 2, 0))); | 95 | __attribute__ ((__format__ (__printf__, 2, 0))); |
88 | # endif | 96 | # endif |
97 | #elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
98 | # define vfprintf rpl_vfprintf | ||
99 | extern int vfprintf (FILE *fp, const char *format, va_list args) | ||
100 | __attribute__ ((__format__ (__printf__, 2, 0))); | ||
89 | #elif defined GNULIB_POSIXCHECK | 101 | #elif defined GNULIB_POSIXCHECK |
90 | # undef vfprintf | 102 | # undef vfprintf |
91 | # define vfprintf(s,f,a) \ | 103 | # define vfprintf(s,f,a) \ |
@@ -102,6 +114,11 @@ extern int vfprintf (FILE *fp, const char *format, va_list args) | |||
102 | extern int printf (const char *format, ...) | 114 | extern int printf (const char *format, ...) |
103 | __attribute__ ((__format__ (__printf__, 1, 2))); | 115 | __attribute__ ((__format__ (__printf__, 1, 2))); |
104 | # endif | 116 | # endif |
117 | #elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
118 | /* Don't break __attribute__((format(printf,M,N))). */ | ||
119 | # define printf __printf__ | ||
120 | extern int printf (const char *format, ...) | ||
121 | __attribute__ ((__format__ (__printf__, 1, 2))); | ||
105 | #elif defined GNULIB_POSIXCHECK | 122 | #elif defined GNULIB_POSIXCHECK |
106 | # undef printf | 123 | # undef printf |
107 | # define printf \ | 124 | # define printf \ |
@@ -124,6 +141,10 @@ extern int printf (const char *format, ...) | |||
124 | extern int vprintf (const char *format, va_list args) | 141 | extern int vprintf (const char *format, va_list args) |
125 | __attribute__ ((__format__ (__printf__, 1, 0))); | 142 | __attribute__ ((__format__ (__printf__, 1, 0))); |
126 | # endif | 143 | # endif |
144 | #elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
145 | # define vprintf rpl_vprintf | ||
146 | extern int vprintf (const char *format, va_list args) | ||
147 | __attribute__ ((__format__ (__printf__, 1, 0))); | ||
127 | #elif defined GNULIB_POSIXCHECK | 148 | #elif defined GNULIB_POSIXCHECK |
128 | # undef vprintf | 149 | # undef vprintf |
129 | # define vprintf(f,a) \ | 150 | # define vprintf(f,a) \ |
@@ -212,8 +233,29 @@ extern int vsprintf (char *str, const char *format, va_list args) | |||
212 | # endif | 233 | # endif |
213 | #endif | 234 | #endif |
214 | 235 | ||
236 | #if @GNULIB_OBSTACK_PRINTF@ | ||
237 | # if @REPLACE_OBSTACK_PRINTF@ | ||
238 | # define obstack_printf rpl_osbtack_printf | ||
239 | # define obstack_vprintf rpl_obstack_vprintf | ||
240 | # endif | ||
241 | # if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@ | ||
242 | struct obstack; | ||
243 | /* Grow an obstack with formatted output. Return the number of | ||
244 | bytes added to OBS. No trailing nul byte is added, and the | ||
245 | object should be closed with obstack_finish before use. Upon | ||
246 | memory allocation error, call obstack_alloc_failed_handler. Upon | ||
247 | other error, return -1. */ | ||
248 | extern int obstack_printf (struct obstack *obs, const char *format, ...) | ||
249 | __attribute__ ((__format__ (__printf__, 2, 3))); | ||
250 | extern int obstack_vprintf (struct obstack *obs, const char *format, | ||
251 | va_list args) | ||
252 | __attribute__ ((__format__ (__printf__, 2, 0))); | ||
253 | # endif | ||
254 | #endif | ||
255 | |||
215 | #if @GNULIB_FOPEN@ | 256 | #if @GNULIB_FOPEN@ |
216 | # if @REPLACE_FOPEN@ | 257 | # if @REPLACE_FOPEN@ |
258 | # undef fopen | ||
217 | # define fopen rpl_fopen | 259 | # define fopen rpl_fopen |
218 | extern FILE * fopen (const char *filename, const char *mode); | 260 | extern FILE * fopen (const char *filename, const char *mode); |
219 | # endif | 261 | # endif |
@@ -227,6 +269,7 @@ extern FILE * fopen (const char *filename, const char *mode); | |||
227 | 269 | ||
228 | #if @GNULIB_FREOPEN@ | 270 | #if @GNULIB_FREOPEN@ |
229 | # if @REPLACE_FREOPEN@ | 271 | # if @REPLACE_FREOPEN@ |
272 | # undef freopen | ||
230 | # define freopen rpl_freopen | 273 | # define freopen rpl_freopen |
231 | extern FILE * freopen (const char *filename, const char *mode, FILE *stream); | 274 | extern FILE * freopen (const char *filename, const char *mode, FILE *stream); |
232 | # endif | 275 | # endif |
@@ -332,6 +375,57 @@ extern long rpl_ftell (FILE *fp); | |||
332 | fflush (f)) | 375 | fflush (f)) |
333 | #endif | 376 | #endif |
334 | 377 | ||
378 | #if @GNULIB_FCLOSE@ | ||
379 | # if @REPLACE_FCLOSE@ | ||
380 | # define fclose rpl_fclose | ||
381 | /* Close STREAM and its underlying file descriptor. */ | ||
382 | extern int fclose (FILE *stream); | ||
383 | # endif | ||
384 | #elif defined GNULIB_POSIXCHECK | ||
385 | # undef fclose | ||
386 | # define fclose(f) \ | ||
387 | (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \ | ||
388 | "use gnulib module fclose for portable " \ | ||
389 | "POSIX compliance"), \ | ||
390 | fclose (f)) | ||
391 | #endif | ||
392 | |||
393 | #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
394 | # undef fputc | ||
395 | # define fputc rpl_fputc | ||
396 | extern int fputc (int c, FILE *stream); | ||
397 | #endif | ||
398 | |||
399 | #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
400 | # undef putc | ||
401 | # define putc rpl_fputc | ||
402 | extern int putc (int c, FILE *stream); | ||
403 | #endif | ||
404 | |||
405 | #if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
406 | # undef putchar | ||
407 | # define putchar rpl_putchar | ||
408 | extern int putchar (int c); | ||
409 | #endif | ||
410 | |||
411 | #if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
412 | # undef fputs | ||
413 | # define fputs rpl_fputs | ||
414 | extern int fputs (const char *string, FILE *stream); | ||
415 | #endif | ||
416 | |||
417 | #if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
418 | # undef puts | ||
419 | # define puts rpl_puts | ||
420 | extern int puts (const char *string); | ||
421 | #endif | ||
422 | |||
423 | #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@ | ||
424 | # undef fwrite | ||
425 | # define fwrite rpl_fwrite | ||
426 | extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream); | ||
427 | #endif | ||
428 | |||
335 | #if @GNULIB_GETDELIM@ | 429 | #if @GNULIB_GETDELIM@ |
336 | # if !@HAVE_DECL_GETDELIM@ | 430 | # if !@HAVE_DECL_GETDELIM@ |
337 | /* Read input, up to (and including) the next occurrence of DELIMITER, from | 431 | /* Read input, up to (and including) the next occurrence of DELIMITER, from |
@@ -373,6 +467,22 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); | |||
373 | getline (l, s, f)) | 467 | getline (l, s, f)) |
374 | #endif | 468 | #endif |
375 | 469 | ||
470 | #if @GNULIB_PERROR@ | ||
471 | # if @REPLACE_PERROR@ | ||
472 | # define perror rpl_perror | ||
473 | /* Print a message to standard error, describing the value of ERRNO, | ||
474 | (if STRING is not NULL and not empty) prefixed with STRING and ": ", | ||
475 | and terminated with a newline. */ | ||
476 | extern void perror (const char *string); | ||
477 | # endif | ||
478 | #elif defined GNULIB_POSIXCHECK | ||
479 | # undef perror | ||
480 | # define perror(s) \ | ||
481 | (GL_LINK_WARNING ("perror is not always POSIX compliant - " \ | ||
482 | "use gnulib module perror for portability"), \ | ||
483 | perror (s)) | ||
484 | #endif | ||
485 | |||
376 | #ifdef __cplusplus | 486 | #ifdef __cplusplus |
377 | } | 487 | } |
378 | #endif | 488 | #endif |