83d970d1ae8bd8c23f642fc06cca26eef40ae18e
[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
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_SNPRINTF@
44 # if @REPLACE_SNPRINTF@
45 #  define snprintf rpl_snprintf
46 # endif
47 # if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
48 extern int snprintf (char *str, size_t size, const char *format, ...);
49 # endif
50 #elif defined GNULIB_POSIXCHECK
51 # undef snprintf
52 # define snprintf \
53     (GL_LINK_WARNING ("snprintf is unportable - " \
54                       "use gnulib module snprintf for portability"), \
55      snprintf)
56 #endif
57
58 #if @GNULIB_VSNPRINTF@
59 # if @REPLACE_VSNPRINTF@
60 #  define vsnprintf rpl_vsnprintf
61 # endif
62 # if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
63 extern int vsnprintf (char *str, size_t size, const char *format, va_list args);
64 # endif
65 #elif defined GNULIB_POSIXCHECK
66 # undef vsnprintf
67 # define vsnprintf(b,s,f,a) \
68     (GL_LINK_WARNING ("vsnprintf is unportable - " \
69                       "use gnulib module vsnprintf for portability"), \
70      vsnprintf (b, s, f, a))
71 #endif
72
73 #if @GNULIB_SPRINTF_POSIX@
74 # if @REPLACE_SPRINTF@
75 #  define sprintf rpl_sprintf
76 extern int sprintf (char *str, const char *format, ...);
77 # endif
78 #elif defined GNULIB_POSIXCHECK
79 # undef sprintf
80 # define sprintf \
81     (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
82                       "use gnulib module sprintf-posix for portable " \
83                       "POSIX compliance"), \
84      sprintf)
85 #endif
86
87 #if @GNULIB_VSPRINTF_POSIX@
88 # if @REPLACE_VSPRINTF@
89 #  define vsprintf rpl_vsprintf
90 extern int vsprintf (char *str, const char *format, va_list args);
91 # endif
92 #elif defined GNULIB_POSIXCHECK
93 # undef vsprintf
94 # define vsprintf(b,f,a) \
95     (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
96                       "use gnulib module vsprintf-posix for portable " \
97                       "POSIX compliance"), \
98      vsprintf (b, f, a))
99 #endif
100
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif /* _GL_STDIO_H */
107 #endif