annotate lib/stdio.in.h @ 12202:a0f033ee41af

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