include: Add the msvcrt/crtdefs.h header and include it where needed.
[wine/wine64.git] / include / msvcrt / wchar.h
blobdcefc0f2db4fd80996059039c56dcda0b1401fdb
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
11 #include <crtdefs.h>
12 #include <stdarg.h>
14 #include <pshpack8.h>
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 #ifndef NULL
21 #ifdef __cplusplus
22 #define NULL 0
23 #else
24 #define NULL ((void *)0)
25 #endif
26 #endif
28 #define WCHAR_MIN 0
29 #define WCHAR_MAX ((wchar_t)-1)
31 #ifndef DECLSPEC_ALIGN
32 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
33 # define DECLSPEC_ALIGN(x) __declspec(align(x))
34 # elif defined(__GNUC__)
35 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
36 # else
37 # define DECLSPEC_ALIGN(x)
38 # endif
39 #endif
41 typedef int mbstate_t;
43 #ifndef WEOF
44 #define WEOF (wint_t)(0xFFFF)
45 #endif
47 #ifndef _FSIZE_T_DEFINED
48 typedef unsigned long _fsize_t;
49 #define _FSIZE_T_DEFINED
50 #endif
52 #ifndef _DEV_T_DEFINED
53 typedef unsigned int _dev_t;
54 #define _DEV_T_DEFINED
55 #endif
57 #ifndef _INO_T_DEFINED
58 typedef unsigned short _ino_t;
59 #define _INO_T_DEFINED
60 #endif
62 #ifndef _OFF_T_DEFINED
63 typedef int _off_t;
64 #define _OFF_T_DEFINED
65 #endif
67 #ifndef _TM_DEFINED
68 #define _TM_DEFINED
69 struct tm {
70 int tm_sec;
71 int tm_min;
72 int tm_hour;
73 int tm_mday;
74 int tm_mon;
75 int tm_year;
76 int tm_wday;
77 int tm_yday;
78 int tm_isdst;
80 #endif /* _TM_DEFINED */
82 #ifndef _FILE_DEFINED
83 #define _FILE_DEFINED
84 typedef struct _iobuf
86 char* _ptr;
87 int _cnt;
88 char* _base;
89 int _flag;
90 int _file;
91 int _charbuf;
92 int _bufsiz;
93 char* _tmpfname;
94 } FILE;
95 #endif /* _FILE_DEFINED */
97 #ifndef _WFINDDATA_T_DEFINED
98 #define _WFINDDATA_T_DEFINED
100 struct _wfinddata_t {
101 unsigned attrib;
102 time_t time_create;
103 time_t time_access;
104 time_t time_write;
105 _fsize_t size;
106 wchar_t name[260];
109 struct _wfinddatai64_t {
110 unsigned attrib;
111 time_t time_create;
112 time_t time_access;
113 time_t time_write;
114 __int64 size;
115 wchar_t name[260];
118 #endif /* _WFINDDATA_T_DEFINED */
120 #ifndef _STAT_DEFINED
121 #define _STAT_DEFINED
123 struct _stat {
124 _dev_t st_dev;
125 _ino_t st_ino;
126 unsigned short st_mode;
127 short st_nlink;
128 short st_uid;
129 short st_gid;
130 _dev_t st_rdev;
131 _off_t st_size;
132 time_t st_atime;
133 time_t st_mtime;
134 time_t st_ctime;
137 struct stat {
138 _dev_t st_dev;
139 _ino_t st_ino;
140 unsigned short st_mode;
141 short st_nlink;
142 short st_uid;
143 short st_gid;
144 _dev_t st_rdev;
145 _off_t st_size;
146 time_t st_atime;
147 time_t st_mtime;
148 time_t st_ctime;
151 struct _stati64 {
152 _dev_t st_dev;
153 _ino_t st_ino;
154 unsigned short st_mode;
155 short st_nlink;
156 short st_uid;
157 short st_gid;
158 _dev_t st_rdev;
159 __int64 DECLSPEC_ALIGN(8) st_size;
160 time_t st_atime;
161 time_t st_mtime;
162 time_t st_ctime;
165 struct _stat64 {
166 _dev_t st_dev;
167 _ino_t st_ino;
168 unsigned short st_mode;
169 short st_nlink;
170 short st_uid;
171 short st_gid;
172 _dev_t st_rdev;
173 __int64 DECLSPEC_ALIGN(8) st_size;
174 __time64_t st_atime;
175 __time64_t st_mtime;
176 __time64_t st_ctime;
178 #endif /* _STAT_DEFINED */
180 /* ASCII char classification table - binary compatible */
181 #define _UPPER 0x0001 /* C1_UPPER */
182 #define _LOWER 0x0002 /* C1_LOWER */
183 #define _DIGIT 0x0004 /* C1_DIGIT */
184 #define _SPACE 0x0008 /* C1_SPACE */
185 #define _PUNCT 0x0010 /* C1_PUNCT */
186 #define _CONTROL 0x0020 /* C1_CNTRL */
187 #define _BLANK 0x0040 /* C1_BLANK */
188 #define _HEX 0x0080 /* C1_XDIGIT */
189 #define _LEADBYTE 0x8000
190 #define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
192 #ifndef _WCTYPE_DEFINED
193 #define _WCTYPE_DEFINED
194 int is_wctype(wint_t,wctype_t);
195 int isleadbyte(int);
196 int iswalnum(wint_t);
197 int iswalpha(wint_t);
198 int iswascii(wint_t);
199 int iswcntrl(wint_t);
200 int iswctype(wint_t,wctype_t);
201 int iswdigit(wint_t);
202 int iswgraph(wint_t);
203 int iswlower(wint_t);
204 int iswprint(wint_t);
205 int iswpunct(wint_t);
206 int iswspace(wint_t);
207 int iswupper(wint_t);
208 int iswxdigit(wint_t);
209 wchar_t towlower(wchar_t);
210 wchar_t towupper(wchar_t);
211 #endif /* _WCTYPE_DEFINED */
213 #ifndef _WDIRECT_DEFINED
214 #define _WDIRECT_DEFINED
215 int _wchdir(const wchar_t*);
216 wchar_t* _wgetcwd(wchar_t*,int);
217 wchar_t* _wgetdcwd(int,wchar_t*,int);
218 int _wmkdir(const wchar_t*);
219 int _wrmdir(const wchar_t*);
220 #endif /* _WDIRECT_DEFINED */
222 #ifndef _WIO_DEFINED
223 #define _WIO_DEFINED
224 int _waccess(const wchar_t*,int);
225 int _wchmod(const wchar_t*,int);
226 int _wcreat(const wchar_t*,int);
227 long _wfindfirst(const wchar_t*,struct _wfinddata_t*);
228 long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
229 int _wfindnext(long,struct _wfinddata_t*);
230 int _wfindnexti64(long, struct _wfinddatai64_t*);
231 wchar_t*_wmktemp(wchar_t*);
232 int _wopen(const wchar_t*,int,...);
233 int _wrename(const wchar_t*,const wchar_t*);
234 int _wsopen(const wchar_t*,int,int,...);
235 int _wunlink(const wchar_t*);
236 #endif /* _WIO_DEFINED */
238 #ifndef _WLOCALE_DEFINED
239 #define _WLOCALE_DEFINED
240 wchar_t* _wsetlocale(int,const wchar_t*);
241 #endif /* _WLOCALE_DEFINED */
243 #ifndef _WPROCESS_DEFINED
244 #define _WPROCESS_DEFINED
245 int _wexecl(const wchar_t*,const wchar_t*,...);
246 int _wexecle(const wchar_t*,const wchar_t*,...);
247 int _wexeclp(const wchar_t*,const wchar_t*,...);
248 int _wexeclpe(const wchar_t*,const wchar_t*,...);
249 int _wexecv(const wchar_t*,const wchar_t* const *);
250 int _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
251 int _wexecvp(const wchar_t*,const wchar_t* const *);
252 int _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
253 int _wspawnl(int,const wchar_t*,const wchar_t*,...);
254 int _wspawnle(int,const wchar_t*,const wchar_t*,...);
255 int _wspawnlp(int,const wchar_t*,const wchar_t*,...);
256 int _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
257 int _wspawnv(int,const wchar_t*,const wchar_t* const *);
258 int _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
259 int _wspawnvp(int,const wchar_t*,const wchar_t* const *);
260 int _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
261 int _wsystem(const wchar_t*);
262 #endif /* _WPROCESS_DEFINED */
264 #ifndef _WSTAT_DEFINED
265 #define _WSTAT_DEFINED
266 int _wstat(const wchar_t*,struct _stat*);
267 int _wstati64(const wchar_t*,struct _stati64*);
268 int _wstat64(const wchar_t*,struct _stat64*);
269 #endif /* _WSTAT_DEFINED */
271 #ifndef _WSTDIO_DEFINED
272 #define _WSTDIO_DEFINED
273 wint_t _fgetwchar(void);
274 wint_t _fputwchar(wint_t);
275 wchar_t*_getws(wchar_t*);
276 int _putws(const wchar_t*);
277 int _snwprintf(wchar_t*,size_t,const wchar_t*,...);
278 int _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
279 FILE* _wfdopen(int,const wchar_t*);
280 FILE* _wfopen(const wchar_t*,const wchar_t*);
281 FILE* _wfreopen(const wchar_t*,const wchar_t*,FILE*);
282 FILE* _wfsopen(const wchar_t*,const wchar_t*,int);
283 void _wperror(const wchar_t*);
284 FILE* _wpopen(const wchar_t*,const wchar_t*);
285 int _wremove(const wchar_t*);
286 wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
287 wchar_t*_wtmpnam(wchar_t*);
289 wint_t fgetwc(FILE*);
290 wchar_t*fgetws(wchar_t*,int,FILE*);
291 wint_t fputwc(wint_t,FILE*);
292 int fputws(const wchar_t*,FILE*);
293 int fwprintf(FILE*,const wchar_t*,...);
294 int fputws(const wchar_t*,FILE*);
295 int fwscanf(FILE*,const wchar_t*,...);
296 wint_t getwc(FILE*);
297 wint_t getwchar(void);
298 wchar_t*getws(wchar_t*);
299 wint_t putwc(wint_t,FILE*);
300 wint_t putwchar(wint_t);
301 int putws(const wchar_t*);
302 int swprintf(wchar_t*,const wchar_t*,...);
303 int swscanf(const wchar_t*,const wchar_t*,...);
304 wint_t ungetwc(wint_t,FILE*);
305 int vfwprintf(FILE*,const wchar_t*,va_list);
306 int vswprintf(wchar_t*,const wchar_t*,va_list);
307 int vwprintf(const wchar_t*,va_list);
308 int wprintf(const wchar_t*,...);
309 int wscanf(const wchar_t*,...);
310 #endif /* _WSTDIO_DEFINED */
312 #ifndef _WSTDLIB_DEFINED
313 #define _WSTDLIB_DEFINED
314 wchar_t*_itow(int,wchar_t*,int);
315 wchar_t*_i64tow(__int64,wchar_t*,int);
316 wchar_t*_ltow(long,wchar_t*,int);
317 wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
318 wchar_t*_ultow(unsigned long,wchar_t*,int);
319 wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
320 wchar_t*_wgetenv(const wchar_t*);
321 void _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
322 void _wperror(const wchar_t*);
323 int _wputenv(const wchar_t*);
324 void _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
325 void _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
326 int _wsystem(const wchar_t*);
327 int _wtoi(const wchar_t*);
328 __int64 _wtoi64(const wchar_t*);
329 long _wtol(const wchar_t*);
331 size_t mbstowcs(wchar_t*,const char*,size_t);
332 int mbtowc(wchar_t*,const char*,size_t);
333 double wcstod(const wchar_t*,wchar_t**);
334 long wcstol(const wchar_t*,wchar_t**,int);
335 size_t wcstombs(char*,const wchar_t*,size_t);
336 unsigned long wcstoul(const wchar_t*,wchar_t**,int);
337 int wctomb(char*,wchar_t);
338 #endif /* _WSTDLIB_DEFINED */
340 #ifndef _WSTRING_DEFINED
341 #define _WSTRING_DEFINED
342 wchar_t*_wcsdup(const wchar_t*);
343 int _wcsicmp(const wchar_t*,const wchar_t*);
344 int _wcsicoll(const wchar_t*,const wchar_t*);
345 wchar_t*_wcslwr(wchar_t*);
346 int _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
347 wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
348 wchar_t*_wcsrev(wchar_t*);
349 wchar_t*_wcsset(wchar_t*,wchar_t);
350 wchar_t*_wcsupr(wchar_t*);
352 wchar_t*wcscat(wchar_t*,const wchar_t*);
353 wchar_t*wcschr(const wchar_t*,wchar_t);
354 int wcscmp(const wchar_t*,const wchar_t*);
355 int wcscoll(const wchar_t*,const wchar_t*);
356 wchar_t*wcscpy(wchar_t*,const wchar_t*);
357 size_t wcscspn(const wchar_t*,const wchar_t*);
358 size_t wcslen(const wchar_t*);
359 wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
360 int wcsncmp(const wchar_t*,const wchar_t*,size_t);
361 wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
362 wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
363 wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
364 size_t wcsspn(const wchar_t*,const wchar_t*);
365 wchar_t*wcsstr(const wchar_t*,const wchar_t*);
366 wchar_t*wcstok(wchar_t*,const wchar_t*);
367 size_t wcsxfrm(wchar_t*,const wchar_t*,size_t);
368 #endif /* _WSTRING_DEFINED */
370 #ifndef _WTIME_DEFINED
371 #define _WTIME_DEFINED
372 wchar_t*_wasctime(const struct tm*);
373 size_t wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
374 wchar_t*_wctime(const time_t*);
375 wchar_t*_wstrdate(wchar_t*);
376 wchar_t*_wstrtime(wchar_t*);
377 #endif /* _WTIME_DEFINED */
379 wchar_t btowc(int);
380 size_t mbrlen(const char *,size_t,mbstate_t*);
381 size_t mbrtowc(wchar_t*,const char*,size_t,mbstate_t*);
382 size_t mbsrtowcs(wchar_t*,const char**,size_t,mbstate_t*);
383 size_t wcrtomb(char*,wchar_t,mbstate_t*);
384 size_t wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
385 int wctob(wint_t);
387 #ifdef __cplusplus
389 #endif
391 #include <poppack.h>
393 #endif /* __WINE_WCHAR_H */