1 cstdio |
1 /* |
|
2 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved. |
|
3 * |
|
4 * Copyright (c) 1999 |
|
5 * Boris Fomitchev |
|
6 * |
|
7 * This material is provided "as is", with absolutely no warranty expressed |
|
8 * or implied. Any use is at your own risk. |
|
9 * |
|
10 * Permission to use or copy this software for any purpose is hereby granted |
|
11 * without fee, provided the above notices are retained on all copies. |
|
12 * Permission to modify the code and to distribute modified code is granted, |
|
13 * provided the above notices are retained, and a notice that the code was |
|
14 * modified is included with the above copyright notice. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _STLP_CSTDIO |
|
19 # define _STLP_CSTDIO |
|
20 |
|
21 # if ! defined (_STLP_WINCE) |
|
22 |
|
23 # ifndef _STLP_OUTERMOST_HEADER_ID |
|
24 # define _STLP_OUTERMOST_HEADER_ID 15 |
|
25 # include <stl/_prolog.h> |
|
26 # endif |
|
27 |
|
28 #if defined (__Lynx__) || defined (__WINS__) |
|
29 #ifdef __SYMBIAN32__ |
|
30 # include <stdarg.h> |
|
31 #else |
|
32 # include _STLP_NATIVE_C_HEADER(stdarg.h) |
|
33 #endif |
|
34 #endif |
|
35 |
|
36 # if defined (_STLP_USE_NEW_C_HEADERS) |
|
37 # include _STLP_NATIVE_CPP_C_HEADER(cstdio) |
|
38 # else |
|
39 #ifdef __SYMBIAN32__ |
|
40 # include <stdio.h> |
|
41 #else |
|
42 # include _STLP_NATIVE_C_HEADER(stdio.h) |
|
43 #endif |
|
44 # endif |
|
45 |
|
46 |
|
47 # if defined(__MWERKS__) && !defined (__SYMBIAN32__) |
|
48 # undef stdin |
|
49 # undef stdout |
|
50 # undef stderr |
|
51 # define stdin (&_STLP_VENDOR_CSTD::__files[0]) |
|
52 # define stdout (&_STLP_VENDOR_CSTD::__files[1]) |
|
53 # define stderr (&_STLP_VENDOR_CSTD::__files[2]) |
|
54 # endif |
|
55 |
|
56 |
|
57 # if (defined (_STLP_MSVC) || defined (__ICL)) && ! defined (__WINS__) |
|
58 namespace _STLP_VENDOR_CSTD { |
|
59 inline |
|
60 int vsnprintf(char *s1, size_t n, const char *s2, va_list v) |
|
61 { |
|
62 return ::_vsnprintf(s1, n, s2, v); |
|
63 } |
|
64 } |
|
65 # endif |
|
66 |
|
67 # ifdef _STLP_IMPORT_VENDOR_CSTD |
|
68 _STLP_BEGIN_NAMESPACE |
|
69 using _STLP_VENDOR_CSTD::FILE; |
|
70 using _STLP_VENDOR_CSTD::fpos_t; |
|
71 using _STLP_VENDOR_CSTD::size_t; |
|
72 |
|
73 // undef obsolete macros |
|
74 # undef putc |
|
75 # undef getc |
|
76 # undef getchar |
|
77 # undef putchar |
|
78 # undef feof |
|
79 # undef ferror |
|
80 # undef clearerr |
|
81 |
|
82 # ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS |
|
83 using _STLP_VENDOR_CSTD::clearerr; |
|
84 using _STLP_VENDOR_CSTD::fclose; |
|
85 using _STLP_VENDOR_CSTD::feof; |
|
86 using _STLP_VENDOR_CSTD::ferror; |
|
87 using _STLP_VENDOR_CSTD::fflush; |
|
88 using _STLP_VENDOR_CSTD::fgetc; |
|
89 using _STLP_VENDOR_CSTD::fgetpos; |
|
90 using _STLP_VENDOR_CSTD::fgets; |
|
91 using _STLP_VENDOR_CSTD::fopen; |
|
92 using _STLP_VENDOR_CSTD::fprintf; |
|
93 using _STLP_VENDOR_CSTD::fputc; |
|
94 using _STLP_VENDOR_CSTD::fputs; |
|
95 using _STLP_VENDOR_CSTD::fread; |
|
96 using _STLP_VENDOR_CSTD::freopen; |
|
97 using _STLP_VENDOR_CSTD::fscanf; |
|
98 using _STLP_VENDOR_CSTD::fseek; |
|
99 using _STLP_VENDOR_CSTD::fsetpos; |
|
100 using _STLP_VENDOR_CSTD::ftell; |
|
101 using _STLP_VENDOR_CSTD::fwrite; |
|
102 |
|
103 # if ( !( defined (__IBMCPP__) && (__IBMCPP__ >= 500) ) ) |
|
104 using _STLP_VENDOR_CSTD::getc; |
|
105 using _STLP_VENDOR_CSTD::getchar; |
|
106 using _STLP_VENDOR_CSTD::putc; |
|
107 using _STLP_VENDOR_CSTD::putchar; |
|
108 # endif |
|
109 |
|
110 using _STLP_VENDOR_CSTD::gets; |
|
111 using _STLP_VENDOR_CSTD::perror; |
|
112 using _STLP_VENDOR_CSTD::printf; |
|
113 using _STLP_VENDOR_CSTD::puts; |
|
114 using _STLP_VENDOR_CSTD::remove; |
|
115 using _STLP_VENDOR_CSTD::rename; |
|
116 using _STLP_VENDOR_CSTD::rewind; |
|
117 using _STLP_VENDOR_CSTD::scanf; |
|
118 using _STLP_VENDOR_CSTD::setbuf; |
|
119 using _STLP_VENDOR_CSTD::setvbuf; |
|
120 using _STLP_VENDOR_CSTD::sprintf; |
|
121 using _STLP_VENDOR_CSTD::sscanf; |
|
122 using _STLP_VENDOR_CSTD::tmpfile; |
|
123 using _STLP_VENDOR_CSTD::tmpnam; |
|
124 using _STLP_VENDOR_CSTD::ungetc; |
|
125 using _STLP_VENDOR_CSTD::vfprintf; |
|
126 using _STLP_VENDOR_CSTD::vprintf; |
|
127 using _STLP_VENDOR_CSTD::vsprintf; |
|
128 # if (defined (__MWERKS__) || defined (_STLP_MSVC) || defined (__ICL) || \ |
|
129 ( defined (__BORLANDC__) && __BORLANDC__ > 0x530)) |
|
130 // using _STLP_VENDOR_CSTD::vsnprintf; |
|
131 # endif |
|
132 # endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */ |
|
133 _STLP_END_NAMESPACE |
|
134 # endif /* _STLP_IMPORT_VENDOR_CSTD */ |
|
135 |
|
136 # if (_STLP_OUTERMOST_HEADER_ID == 15) |
|
137 # include <stl/_epilog.h> |
|
138 # undef _STLP_OUTERMOST_HEADER_ID |
|
139 # endif |
|
140 |
|
141 # endif /* ! defined (_STLP_WINCE) */ |
|
142 |
|
143 #endif |
|
144 |
|
145 // Local Variables: |
|
146 // mode:C++ |
|
147 // End: |