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