annotate lib/stdio.in.h @ 12488:9bd9b7a4b42b

build: pull in conditional headers during GNULIB_POSIXCHECK Any time we conditionally include a header in order to satisfy prerequisites of one module, we must also include that header under GNULIB_POSIXCHECK to avoid compilation errors if that module is not in use. If this is not done, then our link warning override can occur before the system's declaration, which causes a syntax error when the system header is finally included. * lib/stdio.in.h (includes): Using GNULIB_POSIXCHECK also requires definitions from any conditionally-included headers. * lib/stdlib.in.h (includes): Likewise. * lib/unistd.in.h (includes): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Thu, 24 Dec 2009 06:01:43 -0700
parents 419d4e1a3d41
children c2cbabec01dd
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
12488
9bd9b7a4b42b build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents: 12451
diff changeset
42 #if ((@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
9bd9b7a4b42b build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents: 12451
diff changeset
43 || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
9bd9b7a4b42b build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents: 12451
diff changeset
44 || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
9bd9b7a4b42b build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents: 12451
diff changeset
45 || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) \
9bd9b7a4b42b build: pull in conditional headers during GNULIB_POSIXCHECK
Eric Blake <ebb9@byu.net>
parents: 12451
diff changeset
46 || defined GNULIB_POSIXCHECK)
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 /* Get off_t and ssize_t. */
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 # include <sys/types.h>
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #ifndef __attribute__
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 /* 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
53 # 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
54 # define __attribute__(Spec) /* empty */
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 /* The __-protected variants of `format' and `printf' attributes
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 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
58 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 # define __format__ format
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 # define __printf__ printf
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 #endif
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
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 /* 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
66
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
67 /* The definition of _GL_ARG_NONNULL is copied here. */
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
68
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 #ifdef __cplusplus
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 extern "C" {
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
74 #if @GNULIB_DPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
75 # if @REPLACE_DPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
76 # define dprintf rpl_dprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
77 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
78 # if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
79 extern int dprintf (int fd, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
80 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
81 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
82 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
83 # undef dprintf
12451
419d4e1a3d41 fcntl-h, stdio, sys_ioctl: fix declarations
Eric Blake <ebb9@byu.net>
parents: 12422
diff changeset
84 # define dprintf \
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
85 (GL_LINK_WARNING ("dprintf is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
86 "use gnulib module dprintf for portability"), \
12451
419d4e1a3d41 fcntl-h, stdio, sys_ioctl: fix declarations
Eric Blake <ebb9@byu.net>
parents: 12422
diff changeset
87 dprintf)
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
88 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
89
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
90 #if @GNULIB_FCLOSE@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
91 # if @REPLACE_FCLOSE@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
92 # define fclose rpl_fclose
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
93 /* Close STREAM and its underlying file descriptor. */
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
94 extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
95 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
96 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
97 # undef fclose
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
98 # define fclose(f) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
99 (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
100 "use gnulib module fclose for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
101 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
102 fclose (f))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
103 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
104
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
105 #if @GNULIB_FFLUSH@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
106 # if @REPLACE_FFLUSH@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
107 # define fflush rpl_fflush
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
108 /* 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
109 output and seekable input streams are supported.
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
110 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
111 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
112 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
113 be tested with lseek(fileno(fp),0,SEEK_CUR). */
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
114 extern int fflush (FILE *gl_stream);
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
115 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
116 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
117 # undef fflush
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
118 # define fflush(f) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
119 (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
120 "use gnulib module fflush for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
121 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
122 fflush (f))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
123 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
124
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
125 #if @GNULIB_FOPEN@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
126 # if @REPLACE_FOPEN@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
127 # undef fopen
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
128 # define fopen rpl_fopen
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
129 extern FILE * fopen (const char *filename, const char *mode)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
130 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
131 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
132 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
133 # undef fopen
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
134 # define fopen(f,m) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
135 (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
136 "use gnulib module fopen for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
137 fopen (f, m))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
138 #endif
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 #if @GNULIB_FPRINTF_POSIX@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 # if @REPLACE_FPRINTF@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 # define fprintf rpl_fprintf
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 extern int fprintf (FILE *fp, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
144 __attribute__ ((__format__ (__printf__, 2, 3)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
145 _GL_ARG_NONNULL ((1, 2));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 # endif
10487
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
147 #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
148 # define fprintf rpl_fprintf
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
149 extern int fprintf (FILE *fp, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
150 __attribute__ ((__format__ (__printf__, 2, 3)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
151 _GL_ARG_NONNULL ((1, 2));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 #elif defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 # undef fprintf
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 # define fprintf \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155 (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
156 "use gnulib module fprintf-posix for portable " \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 "POSIX compliance"), \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 fprintf)
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
161 #if @GNULIB_FPURGE@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
162 # if @REPLACE_FPURGE@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
163 # define fpurge rpl_fpurge
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
164 # endif
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
165 # if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
166 /* Discard all pending buffered I/O data on STREAM.
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
167 STREAM must not be wide-character oriented.
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
168 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
169 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
170 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
171 Return 0 if successful. Upon error, return -1 and set errno. */
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
172 extern int fpurge (FILE *gl_stream) _GL_ARG_NONNULL ((1));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
174 #elif defined GNULIB_POSIXCHECK
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
175 # undef fpurge
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
176 # define fpurge(f) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
177 (GL_LINK_WARNING ("fpurge is not always present - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
178 "use gnulib module fpurge for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
179 fpurge (f))
11035
bf21f4597784 New modules 'dprintf', 'dprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents: 11033
diff changeset
180 #endif
bf21f4597784 New modules 'dprintf', 'dprintf-posix'.
Bruno Haible <bruno@clisp.org>
parents: 11033
diff changeset
181
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
182 #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
183 # undef fputc
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
184 # define fputc rpl_fputc
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
185 extern int fputc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
188 #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
189 # undef fputs
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
190 # define fputs rpl_fputs
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
191 extern int fputs (const char *string, FILE *stream) _GL_ARG_NONNULL ((1, 2));
9301
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
192 #endif
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
193
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
194 #if @GNULIB_FREOPEN@
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
195 # if @REPLACE_FREOPEN@
10528
97cab1215a7c Tweak patch that overrides open() and fopen().
Bruno Haible <bruno@clisp.org>
parents: 10487
diff changeset
196 # undef freopen
9301
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
197 # define freopen rpl_freopen
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
198 extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
199 _GL_ARG_NONNULL ((2, 3));
9301
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 #elif defined GNULIB_POSIXCHECK
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
202 # undef freopen
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
203 # define freopen(f,m,s) \
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
204 (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
205 "use gnulib module freopen for portability"), \
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
206 freopen (f, m, s))
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
207 #endif
98e1721b4e40 New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents: 9262
diff changeset
208
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209 #if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
210 extern int rpl_fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
211 # undef fseek
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
212 # if defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
213 # define fseek(f,o,w) \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
214 (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
215 "on 32-bit platforms - " \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
216 "use fseeko function for handling of large files"), \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
217 rpl_fseek (f, o, w))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
218 # else
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
219 # define fseek rpl_fseek
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
220 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
221 #elif defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
222 # ifndef fseek
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
223 # define fseek(f,o,w) \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
224 (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
225 "on 32-bit platforms - " \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
226 "use fseeko function for handling of large files"), \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
227 fseek (f, o, w))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
228 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
229 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
230
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
231 #if @GNULIB_FSEEKO@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
232 # if @REPLACE_FSEEKO@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
233 /* Provide fseek, fseeko functions that are aware of a preceding
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
234 fflush(), and which detect pipes. */
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
235 # define fseeko rpl_fseeko
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
236 extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1));
12202
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
237 # if !@GNULIB_FSEEK@
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
238 # undef fseek
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
239 # define fseek(f,o,w) \
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
240 (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
241 "on 32-bit platforms - " \
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
242 "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
243 fseeko (f, o, w))
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
244 # endif
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 #elif defined GNULIB_POSIXCHECK
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
247 # undef fseeko
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
248 # define fseeko(f,o,w) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
249 (GL_LINK_WARNING ("fseeko is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
250 "use gnulib module fseeko for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
251 fseeko (f, o, w))
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
252 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
253
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
254 #if @GNULIB_FTELL@ && @REPLACE_FTELL@
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
255 extern long rpl_ftell (FILE *fp) _GL_ARG_NONNULL ((1));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
256 # undef ftell
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
257 # if GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
258 # define ftell(f) \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
259 (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
260 "on 32-bit platforms - " \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
261 "use ftello function for handling of large files"), \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
262 rpl_ftell (f))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
263 # else
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
264 # define ftell rpl_ftell
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
265 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
266 #elif defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
267 # ifndef ftell
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
268 # define ftell(f) \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
269 (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
270 "on 32-bit platforms - " \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
271 "use ftello function for handling of large files"), \
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
272 ftell (f))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
273 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
274 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
275
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
276 #if @GNULIB_FTELLO@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
277 # if @REPLACE_FTELLO@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
278 # define ftello rpl_ftello
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
279 extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1));
12202
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
280 # if !@GNULIB_FTELL@
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
281 # undef ftell
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
282 # define ftell(f) \
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
283 (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
284 "on 32-bit platforms - " \
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
285 "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
286 ftello (f))
a0f033ee41af fseek: avoid compilation failure when fflush is replaced
Eric Blake <ebb9@byu.net>
parents: 12100
diff changeset
287 # endif
11653
ecb384fccb5b fpurge: migrate into <stdio.h>
Eric Blake <ebb9@byu.net>
parents: 11035
diff changeset
288 # endif
ecb384fccb5b fpurge: migrate into <stdio.h>
Eric Blake <ebb9@byu.net>
parents: 11035
diff changeset
289 #elif defined GNULIB_POSIXCHECK
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
290 # undef ftello
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
291 # define ftello(f) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
292 (GL_LINK_WARNING ("ftello is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
293 "use gnulib module ftello for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
294 ftello (f))
10487
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
295 #endif
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
296
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
297 #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
298 # undef fwrite
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
299 # define fwrite rpl_fwrite
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
300 extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
301 _GL_ARG_NONNULL ((1, 4));
10487
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
302 #endif
953f72c1ffcc Support SIGPIPE in stdio functions for writing.
Bruno Haible <bruno@clisp.org>
parents: 10433
diff changeset
303
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 #if @GNULIB_GETDELIM@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
305 # if !@HAVE_DECL_GETDELIM@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
306 /* 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
307 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
308 *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
309 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
310 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
311 NUL terminator), or -1 on error or EOF. */
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
312 extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
313 FILE *stream)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
314 _GL_ARG_NONNULL ((1, 2, 4));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
315 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
316 #elif defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
317 # undef getdelim
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
318 # define getdelim(l, s, d, f) \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
319 (GL_LINK_WARNING ("getdelim is unportable - " \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
320 "use gnulib module getdelim for portability"), \
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
321 getdelim (l, s, d, f))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
322 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
323
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
324 #if @GNULIB_GETLINE@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
325 # if @REPLACE_GETLINE@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
326 # undef getline
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
327 # define getline rpl_getline
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 # if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
330 /* 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
331 in *LINEPTR (and NUL-terminate it).
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
332 *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
333 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
334 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
335 NUL terminator), or -1 on error or EOF. */
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
336 extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
337 _GL_ARG_NONNULL ((1, 2, 3));
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
338 # endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
339 #elif defined GNULIB_POSIXCHECK
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
340 # undef getline
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
341 # define getline(l, s, f) \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
342 (GL_LINK_WARNING ("getline is unportable - " \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
343 "use gnulib module getline for portability"), \
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
344 getline (l, s, f))
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
345 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
346
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
347 #if @GNULIB_OBSTACK_PRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
348 # if @REPLACE_OBSTACK_PRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
349 # define obstack_printf rpl_osbtack_printf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
350 # define obstack_vprintf rpl_obstack_vprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
351 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
352 # if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
353 struct obstack;
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
354 /* Grow an obstack with formatted output. Return the number of
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
355 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
356 object should be closed with obstack_finish before use. Upon
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
357 memory allocation error, call obstack_alloc_failed_handler. Upon
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
358 other error, return -1. */
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
359 extern int obstack_printf (struct obstack *obs, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
360 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
361 extern int obstack_vprintf (struct obstack *obs, const char *format,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
362 va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
363 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
364 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
365 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
366
10433
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
367 #if @GNULIB_PERROR@
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
368 # if @REPLACE_PERROR@
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
369 # define perror rpl_perror
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
370 /* Print a message to standard error, describing the value of ERRNO,
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
371 (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
372 and terminated with a newline. */
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
373 extern void perror (const char *string);
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
374 # endif
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
375 #elif defined GNULIB_POSIXCHECK
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
376 # undef perror
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
377 # define perror(s) \
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
378 (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
379 "use gnulib module perror for portability"), \
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
380 perror (s))
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
381 #endif
02b0f65bfbfc New module 'perror'.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
382
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
383 #if @GNULIB_POPEN@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
384 # if @REPLACE_POPEN@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
385 # undef popen
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
386 # define popen rpl_popen
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
387 extern FILE *popen (const char *cmd, const char *mode)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
388 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
389 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
390 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
391 # undef popen
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
392 # define popen(c,m) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
393 (GL_LINK_WARNING ("popen is buggy on some platforms - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
394 "use gnulib module popen or pipe for more portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
395 popen (c, m))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
396 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
397
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
398 #if @GNULIB_PRINTF_POSIX@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
399 # if @REPLACE_PRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
400 /* Don't break __attribute__((format(printf,M,N))). */
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
401 # define printf __printf__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
402 extern int printf (const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
403 __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
404 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
405 #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
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 printf __printf__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
408 extern int printf (const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
409 __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
410 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
411 # undef printf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
412 # define printf \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
413 (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
414 "use gnulib module printf-posix for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
415 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
416 printf)
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
417 /* Don't break __attribute__((format(printf,M,N))). */
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
418 # define format(kind,m,n) format (__##kind##__, m, n)
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
419 # define __format__(kind,m,n) __format__ (__##kind##__, m, n)
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
420 # define ____printf____ __printf__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
421 # define ____scanf____ __scanf__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
422 # define ____strftime____ __strftime__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
423 # define ____strfmon____ __strfmon__
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
424 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
425
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
426 #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
427 # undef putc
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
428 # define putc rpl_fputc
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
429 extern int putc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
430 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
431
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
432 #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
433 # undef putchar
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
434 # define putchar rpl_putchar
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
435 extern int putchar (int c);
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
436 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
437
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
438 #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
439 # undef puts
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
440 # define puts rpl_puts
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
441 extern int puts (const char *string) _GL_ARG_NONNULL ((1));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
442 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
443
12041
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
444 #if @GNULIB_REMOVE@
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
445 # if @REPLACE_REMOVE@
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
446 # undef remove
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
447 # define remove rpl_remove
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
448 extern int remove (const char *name) _GL_ARG_NONNULL ((1));
12041
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
449 # endif
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
450 #elif defined GNULIB_POSIXCHECK
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
451 # undef remove
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
452 # define remove(n) \
12041
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
453 (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
454 "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
455 remove (n))
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
456 #endif
73e9ab6e2c90 remove: new module, for mingw and Solaris 9 bugs
Eric Blake <ebb9@byu.net>
parents: 11972
diff changeset
457
11972
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
458 #if @GNULIB_RENAME@
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
459 # if @REPLACE_RENAME@
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
460 # undef rename
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
461 # define rename rpl_rename
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
462 extern int rename (const char *old_filename, const char *new_filename)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
463 _GL_ARG_NONNULL ((1, 2));
11972
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
464 # endif
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
465 #elif defined GNULIB_POSIXCHECK
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
466 # undef rename
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
467 # define rename(o,n) \
11972
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
468 (GL_LINK_WARNING ("rename is buggy on some platforms - " \
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
469 "use gnulib module rename for more portability"), \
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
470 rename (o, n))
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
471 #endif
24ed6ac9fe07 rename: modernize replacement
Eric Blake <ebb9@byu.net>
parents: 11971
diff changeset
472
12099
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
473 #if @GNULIB_RENAMEAT@
12100
8e81b30aa8b7 renameat: fix Solaris bugs
Eric Blake <ebb9@byu.net>
parents: 12099
diff changeset
474 # if @REPLACE_RENAMEAT@
8e81b30aa8b7 renameat: fix Solaris bugs
Eric Blake <ebb9@byu.net>
parents: 12099
diff changeset
475 # undef renameat
8e81b30aa8b7 renameat: fix Solaris bugs
Eric Blake <ebb9@byu.net>
parents: 12099
diff changeset
476 # define renameat rpl_renameat
8e81b30aa8b7 renameat: fix Solaris bugs
Eric Blake <ebb9@byu.net>
parents: 12099
diff changeset
477 # endif
8e81b30aa8b7 renameat: fix Solaris bugs
Eric Blake <ebb9@byu.net>
parents: 12099
diff changeset
478 # if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
479 extern int renameat (int fd1, char const *file1, int fd2, char const *file2)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
480 _GL_ARG_NONNULL ((2, 4));
12099
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
481 # endif
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
482 #elif defined GNULIB_POSIXCHECK
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
483 # undef renameat
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12418
diff changeset
484 # define renameat(d1,f1,d2,f2) \
12099
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
485 (GL_LINK_WARNING ("renameat is not portable - " \
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
486 "use gnulib module renameat for portability"), \
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
487 renameat (d1, f1, d2, f2))
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
488 #endif
01c66cf797b5 renameat: new module
Eric Blake <ebb9@byu.net>
parents: 12041
diff changeset
489
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
490 #if @GNULIB_SNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
491 # if @REPLACE_SNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
492 # define snprintf rpl_snprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
493 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
494 # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
495 extern int snprintf (char *str, size_t size, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
496 __attribute__ ((__format__ (__printf__, 3, 4)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
497 _GL_ARG_NONNULL ((3));
11971
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 snprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
501 # define snprintf \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
502 (GL_LINK_WARNING ("snprintf is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
503 "use gnulib module snprintf for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
504 snprintf)
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
505 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
506
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
507 #if @GNULIB_SPRINTF_POSIX@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
508 # if @REPLACE_SPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
509 # define sprintf rpl_sprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
510 extern int sprintf (char *str, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
511 __attribute__ ((__format__ (__printf__, 2, 3)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
512 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
513 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
514 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
515 # undef sprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
516 # define sprintf \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
517 (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
518 "use gnulib module sprintf-posix for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
519 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
520 sprintf)
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
521 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
522
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
523 #if @GNULIB_VASPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
524 # if @REPLACE_VASPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
525 # define asprintf rpl_asprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
526 # define vasprintf rpl_vasprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
527 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
528 # if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
529 /* Write formatted output to a string dynamically allocated with malloc().
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
530 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
531 *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
532 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
533 extern int asprintf (char **result, const char *format, ...)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
534 __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
535 extern int vasprintf (char **result, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
536 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
537 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
538 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
539
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
540 #if @GNULIB_VDPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
541 # if @REPLACE_VDPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
542 # define vdprintf rpl_vdprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
543 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
544 # if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
545 extern int vdprintf (int fd, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
546 __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
547 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
548 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
549 # undef vdprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
550 # define vdprintf(d,f,a) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
551 (GL_LINK_WARNING ("vdprintf is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
552 "use gnulib module vdprintf for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
553 vdprintf (d, f, a))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
554 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
555
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
556 #if @GNULIB_VFPRINTF_POSIX@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
557 # if @REPLACE_VFPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
558 # define vfprintf rpl_vfprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
559 extern int vfprintf (FILE *fp, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
560 __attribute__ ((__format__ (__printf__, 2, 0)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
561 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
562 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
563 #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
564 # define vfprintf rpl_vfprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
565 extern int vfprintf (FILE *fp, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
566 __attribute__ ((__format__ (__printf__, 2, 0)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
567 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
568 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
569 # undef vfprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
570 # define vfprintf(s,f,a) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
571 (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
572 "use gnulib module vfprintf-posix for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
573 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
574 vfprintf (s, f, a))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
575 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
576
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
577 #if @GNULIB_VPRINTF_POSIX@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
578 # if @REPLACE_VPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
579 # define vprintf rpl_vprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
580 extern int vprintf (const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
581 __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
11971
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 #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
584 # define vprintf rpl_vprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
585 extern int vprintf (const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
586 __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
11971
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 vprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
589 # define vprintf(f,a) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
590 (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
591 "use gnulib module vprintf-posix for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
592 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
593 vprintf (f, a))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
594 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
595
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
596 #if @GNULIB_VSNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
597 # if @REPLACE_VSNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
598 # define vsnprintf rpl_vsnprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
599 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
600 # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
601 extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
602 __attribute__ ((__format__ (__printf__, 3, 0)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
603 _GL_ARG_NONNULL ((3));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
604 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
605 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
606 # undef vsnprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
607 # define vsnprintf(b,s,f,a) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
608 (GL_LINK_WARNING ("vsnprintf is unportable - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
609 "use gnulib module vsnprintf for portability"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
610 vsnprintf (b, s, f, a))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
611 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
612
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
613 #if @GNULIB_VSPRINTF_POSIX@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
614 # if @REPLACE_VSPRINTF@
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
615 # define vsprintf rpl_vsprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
616 extern int vsprintf (char *str, const char *format, va_list args)
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
617 __attribute__ ((__format__ (__printf__, 2, 0)))
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
618 _GL_ARG_NONNULL ((1, 2));
11971
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
619 # endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
620 #elif defined GNULIB_POSIXCHECK
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
621 # undef vsprintf
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
622 # define vsprintf(b,f,a) \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
623 (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
624 "use gnulib module vsprintf-posix for portable " \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
625 "POSIX compliance"), \
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
626 vsprintf (b, f, a))
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
627 #endif
229df0a197d3 stdio: sort witness names
Eric Blake <ebb9@byu.net>
parents: 11848
diff changeset
628
9262
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
629 #ifdef __cplusplus
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
630 }
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
631 #endif
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
632
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
633 #endif /* _GL_STDIO_H */
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
634 #endif /* _GL_STDIO_H */
9857038c7b89 Rename stdio_.h to stdio.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
635 #endif