Disable 'variable' in Win32 spec files.
[wine/testsucceed.git] / include / msvcrt / wchar.h
blob6fe4ddd33b24efdefcc1233fb9c0158abddee3fe
1 /*
2 * Unicode definitions
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8 #ifndef __WINE_WCHAR_H
9 #define __WINE_WCHAR_H
10 #define __WINE_USE_MSVCRT
12 #include <stdarg.h>
14 #ifndef MSVCRT
15 # ifdef USE_MSVCRT_PREFIX
16 # define MSVCRT(x) MSVCRT_##x
17 # else
18 # define MSVCRT(x) x
19 # endif
20 #endif
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 #ifndef MSVCRT_WCHAR_T_DEFINED
27 #define MSVCRT_WCHAR_T_DEFINED
28 #ifndef __cplusplus
29 typedef unsigned short MSVCRT(wchar_t);
30 #endif
31 #endif
33 #ifndef NULL
34 #ifdef __cplusplus
35 #define NULL 0
36 #else
37 #define NULL ((void *)0)
38 #endif
39 #endif
41 #define WCHAR_MIN 0
42 #define WCHAR_MAX ((MSVCRT(wchar_t))-1)
44 typedef int MSVCRT(mbstate_t);
46 #ifndef MSVCRT_SIZE_T_DEFINED
47 typedef unsigned int MSVCRT(size_t);
48 #define MSVCRT_SIZE_T_DEFINED
49 #endif
51 #ifndef MSVCRT_WCTYPE_T_DEFINED
52 typedef MSVCRT(wchar_t) MSVCRT(wint_t);
53 typedef MSVCRT(wchar_t) MSVCRT(wctype_t);
54 #define MSVCRT_WCTYPE_T_DEFINED
55 #endif
57 #ifndef _MSC_VER
58 # ifndef __int64
59 # define __int64 long long
60 # endif
61 #endif
63 #ifndef USE_MSVCRT_PREFIX
64 # ifndef WEOF
65 # define WEOF (wint_t)(0xFFFF)
66 # endif
67 #else
68 # ifndef MSVCRT_WEOF
69 # define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
70 # endif
71 #endif /* USE_MSVCRT_PREFIX */
73 #ifndef MSVCRT_FSIZE_T_DEFINED
74 typedef unsigned long _fsize_t;
75 #define MSVCRT_FSIZE_T_DEFINED
76 #endif
78 #ifndef MSVCRT_DEV_T_DEFINED
79 typedef unsigned int _dev_t;
80 #define MSVCRT_DEV_T_DEFINED
81 #endif
83 #ifndef MSVCRT_INO_T_DEFINED
84 typedef unsigned short _ino_t;
85 #define MSVCRT_INO_T_DEFINED
86 #endif
88 #ifndef MSVCRT_OFF_T_DEFINED
89 typedef int MSVCRT(_off_t);
90 #define MSVCRT_OFF_T_DEFINED
91 #endif
93 #ifndef MSVCRT_TIME_T_DEFINED
94 typedef long MSVCRT(time_t);
95 #define MSVCRT_TIME_T_DEFINED
96 #endif
98 #ifndef MSVCRT_TM_DEFINED
99 #define MSVCRT_TM_DEFINED
100 struct MSVCRT(tm) {
101 int tm_sec;
102 int tm_min;
103 int tm_hour;
104 int tm_mday;
105 int tm_mon;
106 int tm_year;
107 int tm_wday;
108 int tm_yday;
109 int tm_isdst;
111 #endif /* MSVCRT_TM_DEFINED */
113 #ifndef MSVCRT_FILE_DEFINED
114 #define MSVCRT_FILE_DEFINED
115 typedef struct MSVCRT(_iobuf)
117 char* _ptr;
118 int _cnt;
119 char* _base;
120 int _flag;
121 int _file;
122 int _charbuf;
123 int _bufsiz;
124 char* _tmpfname;
125 } MSVCRT(FILE);
126 #endif /* MSVCRT_FILE_DEFINED */
128 #ifndef MSVCRT_WFINDDATA_T_DEFINED
129 #define MSVCRT_WFINDDATA_T_DEFINED
131 struct _wfinddata_t {
132 unsigned attrib;
133 MSVCRT(time_t) time_create;
134 MSVCRT(time_t) time_access;
135 MSVCRT(time_t) time_write;
136 _fsize_t size;
137 MSVCRT(wchar_t) name[260];
140 struct _wfinddatai64_t {
141 unsigned attrib;
142 MSVCRT(time_t) time_create;
143 MSVCRT(time_t) time_access;
144 MSVCRT(time_t) time_write;
145 __int64 size;
146 MSVCRT(wchar_t) name[260];
149 #endif /* MSVCRT_WFINDDATA_T_DEFINED */
151 #ifndef MSVCRT_STAT_DEFINED
152 #define MSVCRT_STAT_DEFINED
154 struct _stat {
155 _dev_t st_dev;
156 _ino_t st_ino;
157 unsigned short st_mode;
158 short st_nlink;
159 short st_uid;
160 short st_gid;
161 _dev_t st_rdev;
162 MSVCRT(_off_t) st_size;
163 MSVCRT(time_t) st_atime;
164 MSVCRT(time_t) st_mtime;
165 MSVCRT(time_t) st_ctime;
168 struct _stati64 {
169 _dev_t st_dev;
170 _ino_t st_ino;
171 unsigned short st_mode;
172 short st_nlink;
173 short st_uid;
174 short st_gid;
175 _dev_t st_rdev;
176 __int64 st_size;
177 MSVCRT(time_t) st_atime;
178 MSVCRT(time_t) st_mtime;
179 MSVCRT(time_t) st_ctime;
181 #endif /* MSVCRT_STAT_DEFINED */
183 /* ASCII char classification table - binary compatible */
184 #define _UPPER 0x0001 /* C1_UPPER */
185 #define _LOWER 0x0002 /* C1_LOWER */
186 #define _DIGIT 0x0004 /* C1_DIGIT */
187 #define _SPACE 0x0008 /* C1_SPACE */
188 #define _PUNCT 0x0010 /* C1_PUNCT */
189 #define _CONTROL 0x0020 /* C1_CNTRL */
190 #define _BLANK 0x0040 /* C1_BLANK */
191 #define _HEX 0x0080 /* C1_XDIGIT */
192 #define _LEADBYTE 0x8000
193 #define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
195 #ifndef MSVCRT_WCTYPE_DEFINED
196 #define MSVCRT_WCTYPE_DEFINED
197 int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
198 int MSVCRT(isleadbyte)(int);
199 int MSVCRT(iswalnum)(MSVCRT(wint_t));
200 int MSVCRT(iswalpha)(MSVCRT(wint_t));
201 int MSVCRT(iswascii)(MSVCRT(wint_t));
202 int MSVCRT(iswcntrl)(MSVCRT(wint_t));
203 int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
204 int MSVCRT(iswdigit)(MSVCRT(wint_t));
205 int MSVCRT(iswgraph)(MSVCRT(wint_t));
206 int MSVCRT(iswlower)(MSVCRT(wint_t));
207 int MSVCRT(iswprint)(MSVCRT(wint_t));
208 int MSVCRT(iswpunct)(MSVCRT(wint_t));
209 int MSVCRT(iswspace)(MSVCRT(wint_t));
210 int MSVCRT(iswupper)(MSVCRT(wint_t));
211 int MSVCRT(iswxdigit)(MSVCRT(wint_t));
212 MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
213 MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
214 #endif /* MSVCRT_WCTYPE_DEFINED */
216 #ifndef MSVCRT_WDIRECT_DEFINED
217 #define MSVCRT_WDIRECT_DEFINED
218 int _wchdir(const MSVCRT(wchar_t)*);
219 MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
220 MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
221 int _wmkdir(const MSVCRT(wchar_t)*);
222 int _wrmdir(const MSVCRT(wchar_t)*);
223 #endif /* MSVCRT_WDIRECT_DEFINED */
225 #ifndef MSVCRT_WIO_DEFINED
226 #define MSVCRT_WIO_DEFINED
227 int _waccess(const MSVCRT(wchar_t)*,int);
228 int _wchmod(const MSVCRT(wchar_t)*,int);
229 int _wcreat(const MSVCRT(wchar_t)*,int);
230 long _wfindfirst(const MSVCRT(wchar_t)*,struct _wfinddata_t*);
231 long _wfindfirsti64(const MSVCRT(wchar_t)*, struct _wfinddatai64_t*);
232 int _wfindnext(long,struct _wfinddata_t*);
233 int _wfindnexti64(long, struct _wfinddatai64_t*);
234 MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
235 int _wopen(const MSVCRT(wchar_t)*,int,...);
236 int _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
237 int _wsopen(const MSVCRT(wchar_t)*,int,int,...);
238 int _wunlink(const MSVCRT(wchar_t)*);
239 #endif /* MSVCRT_WIO_DEFINED */
241 #ifndef MSVCRT_WLOCALE_DEFINED
242 #define MSVCRT_WLOCALE_DEFINED
243 MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
244 #endif /* MSVCRT_WLOCALE_DEFINED */
246 #ifndef MSVCRT_WPROCESS_DEFINED
247 #define MSVCRT_WPROCESS_DEFINED
248 int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
249 int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
250 int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
251 int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
252 int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
253 int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
254 int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
255 int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
256 int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
257 int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
258 int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
259 int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
260 int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
261 int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
262 int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
263 int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
264 int _wsystem(const MSVCRT(wchar_t)*);
265 #endif /* MSVCRT_WPROCESS_DEFINED */
267 #ifndef MSVCRT_WSTAT_DEFINED
268 #define MSVCRT_WSTAT_DEFINED
269 int _wstat(const MSVCRT(wchar_t)*,struct _stat*);
270 int _wstati64(const MSVCRT(wchar_t)*,struct _stati64*);
271 #endif /* MSVCRT_WSTAT_DEFINED */
273 #ifndef MSVCRT_WSTDIO_DEFINED
274 #define MSVCRT_WSTDIO_DEFINED
275 MSVCRT(wint_t) _fgetwchar(void);
276 MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
277 MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
278 int _putws(const MSVCRT(wchar_t)*);
279 int _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
280 int _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
281 MSVCRT(FILE)* _wfdopen(int,const MSVCRT(wchar_t)*);
282 MSVCRT(FILE)* _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
283 MSVCRT(FILE)* _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
284 MSVCRT(FILE)* _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
285 void _wperror(const MSVCRT(wchar_t)*);
286 MSVCRT(FILE)* _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
287 int _wremove(const MSVCRT(wchar_t)*);
288 MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
289 MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
291 MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
292 MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
293 MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
294 int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
295 int MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
296 int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
297 int MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
298 MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
299 MSVCRT(wint_t) MSVCRT(getwchar)(void);
300 MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
301 MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
302 MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
303 int MSVCRT(putws)(const MSVCRT(wchar_t)*);
304 int MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
305 int MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
306 MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
307 int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
308 int MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
309 int MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
310 int MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
311 int MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
312 #endif /* MSVCRT_WSTDIO_DEFINED */
314 #ifndef MSVCRT_WSTDLIB_DEFINED
315 #define MSVCRT_WSTDLIB_DEFINED
316 MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
317 MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
318 MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
319 MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
320 MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
321 MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,size_t);
322 MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
323 void _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
324 void _wperror(const MSVCRT(wchar_t)*);
325 int _wputenv(const MSVCRT(wchar_t)*);
326 void _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
327 void _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
328 int _wsystem(const MSVCRT(wchar_t)*);
329 int _wtoi(const MSVCRT(wchar_t)*);
330 __int64 _wtoi64(const MSVCRT(wchar_t)*);
331 long _wtol(const MSVCRT(wchar_t)*);
333 MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
334 int MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
335 double MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
336 long MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
337 MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
338 unsigned long MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
339 int MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
340 #endif /* MSVCRT_WSTDLIB_DEFINED */
342 #ifndef MSVCRT_WSTRING_DEFINED
343 #define MSVCRT_WSTRING_DEFINED
344 MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
345 int _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
346 int _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
347 MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
348 int _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
349 MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
350 MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
351 MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
352 MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
354 MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
355 MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
356 int MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
357 int MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
358 MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
359 MSVCRT(size_t) MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
360 MSVCRT(size_t) MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
361 MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
362 int MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
363 MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
364 MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
365 MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
366 MSVCRT(size_t) MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
367 MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
368 MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
369 MSVCRT(size_t) MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
370 #endif /* MSVCRT_WSTRING_DEFINED */
372 #ifndef MSVCRT_WTIME_DEFINED
373 #define MSVCRT_WTIME_DEFINED
374 MSVCRT(wchar_t)*_wasctime(const struct MSVCRT(tm)*);
375 MSVCRT(size_t) wcsftime(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
376 MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
377 MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
378 MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
379 #endif /* MSVCRT_WTIME_DEFINED */
381 MSVCRT(wchar_t) btowc(int);
382 MSVCRT(size_t) mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
383 MSVCRT(size_t) mbrtowc(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
384 MSVCRT(size_t) mbsrtowcs(MSVCRT(wchar_t)*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
385 MSVCRT(size_t) wcrtomb(char*,MSVCRT(wchar_t),MSVCRT(mbstate_t)*);
386 MSVCRT(size_t) wcsrtombs(char*,const MSVCRT(wchar_t)**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
387 int wctob(MSVCRT(wint_t));
389 #ifdef __cplusplus
391 #endif
393 #endif /* __WINE_WCHAR_H */