Rev 6099 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | #ifndef _WCHAR_H_ |
2 | #define _WCHAR_H_ |
||
3 | |||
4 | #include <_ansi.h> |
||
5 | |||
6 | #include |
||
7 | |||
8 | #define __need_size_t |
||
9 | #define __need_wchar_t |
||
10 | #define __need_wint_t |
||
4921 | Serge | 11 | #define __need_NULL |
4349 | Serge | 12 | #include |
13 | |||
14 | #define __need___va_list |
||
15 | #include |
||
16 | |||
17 | /* For _mbstate_t definition. */ |
||
18 | #include |
||
6099 | serge | 19 | #include |
4349 | Serge | 20 | /* For __STDC_ISO_10646__ */ |
21 | #include |
||
22 | |||
23 | #ifndef WEOF |
||
24 | # define WEOF ((wint_t)-1) |
||
25 | #endif |
||
26 | |||
6099 | serge | 27 | /* This must match definition in |
4349 | Serge | 28 | #ifndef WCHAR_MIN |
4921 | Serge | 29 | #ifdef __WCHAR_MIN__ |
30 | #define WCHAR_MIN __WCHAR_MIN__ |
||
31 | #elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) |
||
32 | #define WCHAR_MIN (0 + L'\0') |
||
33 | #else |
||
34 | #define WCHAR_MIN (-0x7fffffff - 1 + L'\0') |
||
4349 | Serge | 35 | #endif |
4921 | Serge | 36 | #endif |
4349 | Serge | 37 | |
6099 | serge | 38 | /* This must match definition in |
4349 | Serge | 39 | #ifndef WCHAR_MAX |
40 | #ifdef __WCHAR_MAX__ |
||
41 | #define WCHAR_MAX __WCHAR_MAX__ |
||
4921 | Serge | 42 | #elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) |
43 | #define WCHAR_MAX (0xffffffffu + L'\0') |
||
4349 | Serge | 44 | #else |
4921 | Serge | 45 | #define WCHAR_MAX (0x7fffffff + L'\0') |
4349 | Serge | 46 | #endif |
47 | #endif |
||
48 | |||
49 | _BEGIN_STD_C |
||
50 | |||
4921 | Serge | 51 | /* As in stdio.h, |
6099 | serge | 52 | #if !defined(__FILE_defined) |
4921 | Serge | 53 | typedef __FILE FILE; |
6099 | serge | 54 | # define __FILE_defined |
55 | #endif |
||
4921 | Serge | 56 | |
4349 | Serge | 57 | /* As required by POSIX.1-2008, declare tm as incomplete type. |
58 | The actual definition is in time.h. */ |
||
59 | struct tm; |
||
60 | |||
61 | #ifndef _MBSTATE_T |
||
62 | #define _MBSTATE_T |
||
63 | typedef _mbstate_t mbstate_t; |
||
64 | #endif /* _MBSTATE_T */ |
||
65 | |||
66 | wint_t _EXFUN(btowc, (int)); |
||
67 | int _EXFUN(wctob, (wint_t)); |
||
4921 | Serge | 68 | size_t _EXFUN(mbrlen, (const char *__restrict, size_t, mbstate_t *__restrict)); |
69 | size_t _EXFUN(mbrtowc, (wchar_t *__restrict, const char *__restrict, size_t, |
||
70 | mbstate_t *__restrict)); |
||
4349 | Serge | 71 | size_t _EXFUN(_mbrtowc_r, (struct _reent *, wchar_t * , const char * , |
72 | size_t, mbstate_t *)); |
||
73 | int _EXFUN(mbsinit, (const mbstate_t *)); |
||
4921 | Serge | 74 | size_t _EXFUN(mbsnrtowcs, (wchar_t *__restrict, const char **__restrict, |
75 | size_t, size_t, mbstate_t *__restrict)); |
||
4349 | Serge | 76 | size_t _EXFUN(_mbsnrtowcs_r, (struct _reent *, wchar_t * , const char ** , |
77 | size_t, size_t, mbstate_t *)); |
||
4921 | Serge | 78 | size_t _EXFUN(mbsrtowcs, (wchar_t *__restrict, const char **__restrict, size_t, |
79 | mbstate_t *__restrict)); |
||
4349 | Serge | 80 | size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); |
4921 | Serge | 81 | size_t _EXFUN(wcrtomb, (char *__restrict, wchar_t, mbstate_t *__restrict)); |
4349 | Serge | 82 | size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); |
4921 | Serge | 83 | size_t _EXFUN(wcsnrtombs, (char *__restrict, const wchar_t **__restrict, |
84 | size_t, size_t, mbstate_t *__restrict)); |
||
4349 | Serge | 85 | size_t _EXFUN(_wcsnrtombs_r, (struct _reent *, char * , const wchar_t ** , |
86 | size_t, size_t, mbstate_t *)); |
||
4921 | Serge | 87 | size_t _EXFUN(wcsrtombs, (char *__restrict, const wchar_t **__restrict, |
88 | size_t, mbstate_t *__restrict)); |
||
4349 | Serge | 89 | size_t _EXFUN(_wcsrtombs_r, (struct _reent *, char * , const wchar_t ** , |
90 | size_t, mbstate_t *)); |
||
91 | int _EXFUN(wcscasecmp, (const wchar_t *, const wchar_t *)); |
||
4921 | Serge | 92 | wchar_t *_EXFUN(wcscat, (wchar_t *__restrict, const wchar_t *__restrict)); |
4349 | Serge | 93 | wchar_t *_EXFUN(wcschr, (const wchar_t *, wchar_t)); |
94 | int _EXFUN(wcscmp, (const wchar_t *, const wchar_t *)); |
||
95 | int _EXFUN(wcscoll, (const wchar_t *, const wchar_t *)); |
||
4921 | Serge | 96 | wchar_t *_EXFUN(wcscpy, (wchar_t *__restrict, const wchar_t *__restrict)); |
97 | wchar_t *_EXFUN(wcpcpy, (wchar_t *__restrict, |
||
98 | const wchar_t *__restrict)); |
||
4349 | Serge | 99 | wchar_t *_EXFUN(wcsdup, (const wchar_t *)); |
100 | wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * )); |
||
101 | size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *)); |
||
4921 | Serge | 102 | size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t, |
103 | const wchar_t *__restrict, const struct tm *__restrict)); |
||
4349 | Serge | 104 | size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t)); |
105 | size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t)); |
||
106 | size_t _EXFUN(wcslen, (const wchar_t *)); |
||
107 | int _EXFUN(wcsncasecmp, (const wchar_t *, const wchar_t *, size_t)); |
||
4921 | Serge | 108 | wchar_t *_EXFUN(wcsncat, (wchar_t *__restrict, |
109 | const wchar_t *__restrict, size_t)); |
||
4349 | Serge | 110 | int _EXFUN(wcsncmp, (const wchar_t *, const wchar_t *, size_t)); |
4921 | Serge | 111 | wchar_t *_EXFUN(wcsncpy, (wchar_t *__restrict, |
112 | const wchar_t *__restrict, size_t)); |
||
113 | wchar_t *_EXFUN(wcpncpy, (wchar_t *__restrict, |
||
114 | const wchar_t *__restrict, size_t)); |
||
4349 | Serge | 115 | size_t _EXFUN(wcsnlen, (const wchar_t *, size_t)); |
116 | wchar_t *_EXFUN(wcspbrk, (const wchar_t *, const wchar_t *)); |
||
117 | wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t)); |
||
118 | size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *)); |
||
4921 | Serge | 119 | wchar_t *_EXFUN(wcsstr, (const wchar_t *__restrict, |
120 | const wchar_t *__restrict)); |
||
121 | wchar_t *_EXFUN(wcstok, (wchar_t *__restrict, const wchar_t *__restrict, |
||
122 | wchar_t **__restrict)); |
||
123 | double _EXFUN(wcstod, (const wchar_t *__restrict, wchar_t **__restrict)); |
||
4349 | Serge | 124 | double _EXFUN(_wcstod_r, (struct _reent *, const wchar_t *, wchar_t **)); |
4921 | Serge | 125 | float _EXFUN(wcstof, (const wchar_t *__restrict, wchar_t **__restrict)); |
4349 | Serge | 126 | float _EXFUN(_wcstof_r, (struct _reent *, const wchar_t *, wchar_t **)); |
127 | int _EXFUN(wcswidth, (const wchar_t *, size_t)); |
||
4921 | Serge | 128 | size_t _EXFUN(wcsxfrm, (wchar_t *__restrict, const wchar_t *__restrict, |
129 | size_t)); |
||
4349 | Serge | 130 | int _EXFUN(wcwidth, (const wchar_t)); |
131 | wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t)); |
||
132 | int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t)); |
||
4921 | Serge | 133 | wchar_t *_EXFUN(wmemcpy, (wchar_t *__restrict, const wchar_t *__restrict, |
134 | size_t)); |
||
4349 | Serge | 135 | wchar_t *_EXFUN(wmemmove, (wchar_t *, const wchar_t *, size_t)); |
136 | wchar_t *_EXFUN(wmemset, (wchar_t *, wchar_t, size_t)); |
||
137 | |||
4921 | Serge | 138 | long _EXFUN(wcstol, (const wchar_t *__restrict, wchar_t **__restrict, int)); |
139 | long long _EXFUN(wcstoll, (const wchar_t *__restrict, wchar_t **__restrict, |
||
140 | int)); |
||
141 | unsigned long _EXFUN(wcstoul, (const wchar_t *__restrict, wchar_t **__restrict, |
||
142 | int)); |
||
143 | unsigned long long _EXFUN(wcstoull, (const wchar_t *__restrict, |
||
144 | wchar_t **__restrict, int)); |
||
4349 | Serge | 145 | long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); |
146 | long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); |
||
147 | unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); |
||
148 | unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); |
||
4921 | Serge | 149 | long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); |
4349 | Serge | 150 | |
151 | wint_t _EXFUN(fgetwc, (__FILE *)); |
||
4921 | Serge | 152 | wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); |
4349 | Serge | 153 | wint_t _EXFUN(fputwc, (wchar_t, __FILE *)); |
4921 | Serge | 154 | int _EXFUN(fputws, (const wchar_t *__restrict, __FILE *__restrict)); |
4349 | Serge | 155 | int _EXFUN (fwide, (__FILE *, int)); |
156 | wint_t _EXFUN (getwc, (__FILE *)); |
||
157 | wint_t _EXFUN (getwchar, (void)); |
||
158 | wint_t _EXFUN(putwc, (wchar_t, __FILE *)); |
||
159 | wint_t _EXFUN(putwchar, (wchar_t)); |
||
160 | wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *)); |
||
161 | |||
162 | wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *)); |
||
6099 | serge | 163 | wint_t _EXFUN(_fgetwc_unlocked_r, (struct _reent *, __FILE *)); |
4349 | Serge | 164 | wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *)); |
6099 | serge | 165 | wchar_t *_EXFUN(_fgetws_unlocked_r, (struct _reent *, wchar_t *, int, __FILE *)); |
4349 | Serge | 166 | wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *)); |
6099 | serge | 167 | wint_t _EXFUN(_fputwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); |
4349 | Serge | 168 | int _EXFUN(_fputws_r, (struct _reent *, const wchar_t *, __FILE *)); |
6099 | serge | 169 | int _EXFUN(_fputws_unlocked_r, (struct _reent *, const wchar_t *, __FILE *)); |
4349 | Serge | 170 | int _EXFUN (_fwide_r, (struct _reent *, __FILE *, int)); |
171 | wint_t _EXFUN (_getwc_r, (struct _reent *, __FILE *)); |
||
6099 | serge | 172 | wint_t _EXFUN (_getwc_unlocked_r, (struct _reent *, __FILE *)); |
4349 | Serge | 173 | wint_t _EXFUN (_getwchar_r, (struct _reent *ptr)); |
6099 | serge | 174 | wint_t _EXFUN (_getwchar_unlocked_r, (struct _reent *ptr)); |
4349 | Serge | 175 | wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *)); |
6099 | serge | 176 | wint_t _EXFUN(_putwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); |
4349 | Serge | 177 | wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t)); |
6099 | serge | 178 | wint_t _EXFUN(_putwchar_unlocked_r, (struct _reent *, wchar_t)); |
4349 | Serge | 179 | wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *)); |
180 | |||
6099 | serge | 181 | #if __GNU_VISIBLE |
182 | wint_t _EXFUN(fgetwc_unlocked, (__FILE *)); |
||
183 | wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict)); |
||
184 | wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *)); |
||
185 | int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict)); |
||
186 | wint_t _EXFUN(getwc_unlocked, (__FILE *)); |
||
187 | wint_t _EXFUN(getwchar_unlocked, (void)); |
||
188 | wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *)); |
||
189 | wint_t _EXFUN(putwchar_unlocked, (wchar_t)); |
||
190 | #endif |
||
191 | |||
6536 | serge | 192 | #if __POSIX_VISIBLE >= 200809 |
4349 | Serge | 193 | __FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *)); |
6536 | serge | 194 | #endif |
4349 | Serge | 195 | __FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); |
196 | |||
197 | #ifndef __VALIST |
||
198 | #ifdef __GNUC__ |
||
199 | #define __VALIST __gnuc_va_list |
||
200 | #else |
||
201 | #define __VALIST char* |
||
202 | #endif |
||
203 | #endif |
||
204 | |||
4921 | Serge | 205 | int _EXFUN(fwprintf, (__FILE *__restrict, const wchar_t *__restrict, ...)); |
206 | int _EXFUN(swprintf, (wchar_t *__restrict, size_t, |
||
207 | const wchar_t *__restrict, ...)); |
||
208 | int _EXFUN(vfwprintf, (__FILE *__restrict, const wchar_t *__restrict, |
||
209 | __VALIST)); |
||
210 | int _EXFUN(vswprintf, (wchar_t *__restrict, size_t, |
||
211 | const wchar_t *__restrict, __VALIST)); |
||
212 | int _EXFUN(vwprintf, (const wchar_t *__restrict, __VALIST)); |
||
213 | int _EXFUN(wprintf, (const wchar_t *__restrict, ...)); |
||
4349 | Serge | 214 | |
215 | int _EXFUN(_fwprintf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); |
||
216 | int _EXFUN(_swprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, ...)); |
||
217 | int _EXFUN(_vfwprintf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); |
||
218 | int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, __VALIST)); |
||
219 | int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST)); |
||
220 | int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...)); |
||
221 | |||
4921 | Serge | 222 | int _EXFUN(fwscanf, (__FILE *__restrict, const wchar_t *__restrict, ...)); |
223 | int _EXFUN(swscanf, (const wchar_t *__restrict, |
||
224 | const wchar_t *__restrict, ...)); |
||
225 | int _EXFUN(vfwscanf, (__FILE *__restrict, const wchar_t *__restrict, |
||
226 | __VALIST)); |
||
227 | int _EXFUN(vswscanf, (const wchar_t *__restrict, const wchar_t *__restrict, |
||
228 | __VALIST)); |
||
229 | int _EXFUN(vwscanf, (const wchar_t *__restrict, __VALIST)); |
||
230 | int _EXFUN(wscanf, (const wchar_t *__restrict, ...)); |
||
4349 | Serge | 231 | |
232 | int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); |
||
233 | int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...)); |
||
234 | int _EXFUN(_vfwscanf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); |
||
235 | int _EXFUN(_vswscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, __VALIST)); |
||
236 | int _EXFUN(_vwscanf_r, (struct _reent *, const wchar_t *, __VALIST)); |
||
237 | int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); |
||
238 | |||
239 | #define getwc(fp) fgetwc(fp) |
||
240 | #define putwc(wc,fp) fputwc((wc), (fp)) |
||
241 | #define getwchar() fgetwc(_REENT->_stdin) |
||
242 | #define putwchar(wc) fputwc((wc), _REENT->_stdout) |
||
243 | |||
6099 | serge | 244 | #if __GNU_VISIBLE |
245 | #define getwc_unlocked(fp) fgetwc_unlocked(fp) |
||
246 | #define putwc_unlocked(wc,fp) fputwc_unlocked((wc), (fp)) |
||
247 | #define getwchar_unlocked() fgetwc_unlocked(_REENT->_stdin) |
||
248 | #define putwchar_unlocked(wc) fputwc_unlocked((wc), _REENT->_stdout) |
||
249 | #endif |
||
250 | |||
4349 | Serge | 251 | _END_STD_C |
252 | |||
253 | #endif /* _WCHAR_H_ */ |