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 # include _STLP_NATIVE_C_HEADER(stdarg.h) |
|
30 #endif |
|
31 |
|
32 # if defined (_STLP_USE_NEW_C_HEADERS) |
|
33 # include _STLP_NATIVE_CPP_C_HEADER(cstdio) |
|
34 # else |
|
35 #ifdef __SYMBIAN32__ |
|
36 # include <stdio.h> |
|
37 #else |
|
38 # include _STLP_NATIVE_C_HEADER(stdio.h) |
|
39 #endif |
|
40 # endif |
|
41 |
|
42 |
|
43 # if defined(__MWERKS__) && !defined (__SYMBIAN32__) |
|
44 # undef stdin |
|
45 # undef stdout |
|
46 # undef stderr |
|
47 # define stdin (&_STLP_VENDOR_CSTD::__files[0]) |
|
48 # define stdout (&_STLP_VENDOR_CSTD::__files[1]) |
|
49 # define stderr (&_STLP_VENDOR_CSTD::__files[2]) |
|
50 # endif |
|
51 |
|
52 |
|
53 # if (defined (_STLP_MSVC) || defined (__ICL)) && ! defined (__WINS__) |
|
54 namespace _STLP_VENDOR_CSTD { |
|
55 inline |
|
56 int vsnprintf(char *s1, size_t n, const char *s2, va_list v) |
|
57 { |
|
58 return ::_vsnprintf(s1, n, s2, v); |
|
59 } |
|
60 } |
|
61 # endif |
|
62 |
|
63 # ifdef _STLP_IMPORT_VENDOR_CSTD |
|
64 _STLP_BEGIN_NAMESPACE |
|
65 using _STLP_VENDOR_CSTD::FILE; |
|
66 using _STLP_VENDOR_CSTD::fpos_t; |
|
67 using _STLP_VENDOR_CSTD::size_t; |
|
68 |
|
69 // undef obsolete macros |
|
70 # undef putc |
|
71 # undef getc |
|
72 # undef getchar |
|
73 # undef putchar |
|
74 # undef feof |
|
75 # undef ferror |
|
76 # undef clearerr |
|
77 # ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS |
|
78 using _STLP_VENDOR_CSTD::clearerr; |
|
79 using _STLP_VENDOR_CSTD::fclose; |
|
80 using _STLP_VENDOR_CSTD::feof; |
|
81 using _STLP_VENDOR_CSTD::ferror; |
|
82 using _STLP_VENDOR_CSTD::fflush; |
|
83 using _STLP_VENDOR_CSTD::fgetc; |
|
84 using _STLP_VENDOR_CSTD::fgetpos; |
|
85 using _STLP_VENDOR_CSTD::fgets; |
|
86 using _STLP_VENDOR_CSTD::fopen; |
|
87 using _STLP_VENDOR_CSTD::fprintf; |
|
88 using _STLP_VENDOR_CSTD::fputc; |
|
89 using _STLP_VENDOR_CSTD::fputs; |
|
90 using _STLP_VENDOR_CSTD::fread; |
|
91 using _STLP_VENDOR_CSTD::freopen; |
|
92 using _STLP_VENDOR_CSTD::fscanf; |
|
93 using _STLP_VENDOR_CSTD::fseek; |
|
94 using _STLP_VENDOR_CSTD::fsetpos; |
|
95 using _STLP_VENDOR_CSTD::ftell; |
|
96 using _STLP_VENDOR_CSTD::fwrite; |
|
97 |
|
98 # if ( !( defined (__IBMCPP__) && (__IBMCPP__ >= 500) ) ) |
|
99 using _STLP_VENDOR_CSTD::getc; |
|
100 using _STLP_VENDOR_CSTD::getchar; |
|
101 using _STLP_VENDOR_CSTD::putc; |
|
102 using _STLP_VENDOR_CSTD::putchar; |
|
103 # endif |
|
104 |
|
105 using _STLP_VENDOR_CSTD::gets; |
|
106 using _STLP_VENDOR_CSTD::perror; |
|
107 using _STLP_VENDOR_CSTD::printf; |
|
108 using _STLP_VENDOR_CSTD::puts; |
|
109 using _STLP_VENDOR_CSTD::remove; |
|
110 using _STLP_VENDOR_CSTD::rename; |
|
111 using _STLP_VENDOR_CSTD::rewind; |
|
112 using _STLP_VENDOR_CSTD::scanf; |
|
113 using _STLP_VENDOR_CSTD::setbuf; |
|
114 using _STLP_VENDOR_CSTD::setvbuf; |
|
115 using _STLP_VENDOR_CSTD::sprintf; |
|
116 using _STLP_VENDOR_CSTD::sscanf; |
|
117 using _STLP_VENDOR_CSTD::tmpfile; |
|
118 using _STLP_VENDOR_CSTD::tmpnam; |
|
119 using _STLP_VENDOR_CSTD::ungetc; |
|
120 using _STLP_VENDOR_CSTD::vfprintf; |
|
121 using _STLP_VENDOR_CSTD::vprintf; |
|
122 using _STLP_VENDOR_CSTD::vsprintf; |
|
123 # if (defined (__MWERKS__) || defined (_STLP_MSVC) || defined (__ICL) || \ |
|
124 ( defined (__BORLANDC__) && __BORLANDC__ > 0x530)) |
|
125 // using _STLP_VENDOR_CSTD::vsnprintf; |
|
126 # endif |
|
127 # endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */ |
|
128 _STLP_END_NAMESPACE |
|
129 # endif /* _STLP_IMPORT_VENDOR_CSTD */ |
|
130 |
|
131 # if (_STLP_OUTERMOST_HEADER_ID == 15) |
|
132 # include <stl/_epilog.h> |
|
133 # undef _STLP_OUTERMOST_HEADER_ID |
|
134 # endif |
|
135 |
|
136 # endif /* ! defined (_STLP_WINCE) */ |
|
137 |
|
138 #endif |
|
139 |
|
140 // Local Variables: |
|
141 // mode:C++ |
|
142 // End: |