0ed942e50f458fd31c192ae7896ca06201148f41
[gnulib.git] / lib / stdio_.h
1 /* A GNU-like <stdio.h>.
2
3    Copyright (C) 2004, 2007 Free Software Foundation, Inc.
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2, or (at your option)
8    any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software Foundation,
17    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
19 #if defined __need_FILE || defined __need___FILE
20 /* Special invocation convention inside glibc header files.  */
21
22 #include @ABSOLUTE_STDIO_H@
23
24 #else
25 /* Normal invocation convention.  */
26 #ifndef _GL_STDIO_H
27 #define _GL_STDIO_H
28
29 #include @ABSOLUTE_STDIO_H@
30
31 #include <stdarg.h>
32 #include <stddef.h>
33
34
35 /* The definition of GL_LINK_WARNING is copied here.  */
36
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42
43 #if @GNULIB_VFPRINTF_POSIX@
44 # if @REPLACE_VFPRINTF@
45 #  define vfprintf rpl_vfprintf
46 extern int vfprintf (FILE *fp, const char *format, va_list args);
47 # endif
48 #elif defined GNULIB_POSIXCHECK
49 # undef vfprintf
50 # define vfprintf(s,f,a) \
51     (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
52                       "use gnulib module vfprintf-posix for portable " \
53                       "POSIX compliance"), \
54      vfprintf (s, f, a))
55 #endif
56
57 #if @GNULIB_SNPRINTF@
58 # if @REPLACE_SNPRINTF@
59 #  define snprintf rpl_snprintf
60 # endif
61 # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
62 extern int snprintf (char *str, size_t size, const char *format, ...);
63 # endif
64 #elif defined GNULIB_POSIXCHECK
65 # undef snprintf
66 # define snprintf \
67     (GL_LINK_WARNING ("snprintf is unportable - " \
68                       "use gnulib module snprintf for portability"), \
69      snprintf)
70 #endif
71
72 #if @GNULIB_VSNPRINTF@
73 # if @REPLACE_VSNPRINTF@
74 #  define vsnprintf rpl_vsnprintf
75 # endif
76 # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
77 extern int vsnprintf (char *str, size_t size, const char *format, va_list args);
78 # endif
79 #elif defined GNULIB_POSIXCHECK
80 # undef vsnprintf
81 # define vsnprintf(b,s,f,a) \
82     (GL_LINK_WARNING ("vsnprintf is unportable - " \
83                       "use gnulib module vsnprintf for portability"), \
84      vsnprintf (b, s, f, a))
85 #endif
86
87 #if @GNULIB_SPRINTF_POSIX@
88 # if @REPLACE_SPRINTF@
89 #  define sprintf rpl_sprintf
90 extern int sprintf (char *str, const char *format, ...);
91 # endif
92 #elif defined GNULIB_POSIXCHECK
93 # undef sprintf
94 # define sprintf \
95     (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
96                       "use gnulib module sprintf-posix for portable " \
97                       "POSIX compliance"), \
98      sprintf)
99 #endif
100
101 #if @GNULIB_VSPRINTF_POSIX@
102 # if @REPLACE_VSPRINTF@
103 #  define vsprintf rpl_vsprintf
104 extern int vsprintf (char *str, const char *format, va_list args);
105 # endif
106 #elif defined GNULIB_POSIXCHECK
107 # undef vsprintf
108 # define vsprintf(b,f,a) \
109     (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
110                       "use gnulib module vsprintf-posix for portable " \
111                       "POSIX compliance"), \
112      vsprintf (b, f, a))
113 #endif
114
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif /* _GL_STDIO_H */
121 #endif