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.
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
17 # ifdef USE_MSVCRT_PREFIX
18 # define MSVCRT(x) MSVCRT_##x
28 #ifndef MSVCRT_WCHAR_T_DEFINED
29 #define MSVCRT_WCHAR_T_DEFINED
31 typedef unsigned short MSVCRT(wchar_t);
39 #define NULL ((void *)0)
44 #define WCHAR_MAX ((MSVCRT(wchar_t))-1)
46 typedef int MSVCRT(mbstate_t);
48 #ifndef MSVCRT_SIZE_T_DEFINED
49 typedef unsigned int MSVCRT(size_t);
50 #define MSVCRT_SIZE_T_DEFINED
53 #ifndef MSVCRT_WCTYPE_T_DEFINED
54 typedef MSVCRT(wchar_t) MSVCRT(wint_t);
55 typedef MSVCRT(wchar_t) MSVCRT(wctype_t);
56 #define MSVCRT_WCTYPE_T_DEFINED
61 # define __int64 long long
65 #ifndef USE_MSVCRT_PREFIX
67 # define WEOF (wint_t)(0xFFFF)
71 # define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
73 #endif /* USE_MSVCRT_PREFIX */
75 #ifndef MSVCRT_FSIZE_T_DEFINED
76 typedef unsigned long _fsize_t
;
77 #define MSVCRT_FSIZE_T_DEFINED
80 #ifndef MSVCRT_DEV_T_DEFINED
81 typedef unsigned int _dev_t
;
82 #define MSVCRT_DEV_T_DEFINED
85 #ifndef MSVCRT_INO_T_DEFINED
86 typedef unsigned short _ino_t
;
87 #define MSVCRT_INO_T_DEFINED
90 #ifndef MSVCRT_OFF_T_DEFINED
91 typedef int MSVCRT(_off_t
);
92 #define MSVCRT_OFF_T_DEFINED
95 #ifndef MSVCRT_TIME_T_DEFINED
96 typedef long MSVCRT(time_t);
97 #define MSVCRT_TIME_T_DEFINED
100 #ifndef MSVCRT_TM_DEFINED
101 #define MSVCRT_TM_DEFINED
113 #endif /* MSVCRT_TM_DEFINED */
115 #ifndef MSVCRT_FILE_DEFINED
116 #define MSVCRT_FILE_DEFINED
117 typedef struct MSVCRT(_iobuf
)
128 #endif /* MSVCRT_FILE_DEFINED */
130 #ifndef MSVCRT_WFINDDATA_T_DEFINED
131 #define MSVCRT_WFINDDATA_T_DEFINED
133 struct _wfinddata_t
{
135 MSVCRT(time_t) time_create
;
136 MSVCRT(time_t) time_access
;
137 MSVCRT(time_t) time_write
;
139 MSVCRT(wchar_t) name
[260];
142 struct _wfinddatai64_t
{
144 MSVCRT(time_t) time_create
;
145 MSVCRT(time_t) time_access
;
146 MSVCRT(time_t) time_write
;
148 MSVCRT(wchar_t) name
[260];
151 #endif /* MSVCRT_WFINDDATA_T_DEFINED */
153 #ifndef MSVCRT_STAT_DEFINED
154 #define MSVCRT_STAT_DEFINED
159 unsigned short st_mode
;
164 MSVCRT(_off_t
) st_size
;
165 MSVCRT(time_t) st_atime
;
166 MSVCRT(time_t) st_mtime
;
167 MSVCRT(time_t) st_ctime
;
173 unsigned short st_mode
;
179 MSVCRT(time_t) st_atime
;
180 MSVCRT(time_t) st_mtime
;
181 MSVCRT(time_t) st_ctime
;
183 #endif /* MSVCRT_STAT_DEFINED */
185 /* ASCII char classification table - binary compatible */
186 #define _UPPER 0x0001 /* C1_UPPER */
187 #define _LOWER 0x0002 /* C1_LOWER */
188 #define _DIGIT 0x0004 /* C1_DIGIT */
189 #define _SPACE 0x0008 /* C1_SPACE */
190 #define _PUNCT 0x0010 /* C1_PUNCT */
191 #define _CONTROL 0x0020 /* C1_CNTRL */
192 #define _BLANK 0x0040 /* C1_BLANK */
193 #define _HEX 0x0080 /* C1_XDIGIT */
194 #define _LEADBYTE 0x8000
195 #define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
197 #ifndef MSVCRT_WCTYPE_DEFINED
198 #define MSVCRT_WCTYPE_DEFINED
199 int MSVCRT(is_wctype
)(MSVCRT(wint_t),MSVCRT(wctype_t));
200 int MSVCRT(isleadbyte
)(int);
201 int MSVCRT(iswalnum
)(MSVCRT(wint_t));
202 int MSVCRT(iswalpha
)(MSVCRT(wint_t));
203 int MSVCRT(iswascii
)(MSVCRT(wint_t));
204 int MSVCRT(iswcntrl
)(MSVCRT(wint_t));
205 int MSVCRT(iswctype
)(MSVCRT(wint_t),MSVCRT(wctype_t));
206 int MSVCRT(iswdigit
)(MSVCRT(wint_t));
207 int MSVCRT(iswgraph
)(MSVCRT(wint_t));
208 int MSVCRT(iswlower
)(MSVCRT(wint_t));
209 int MSVCRT(iswprint
)(MSVCRT(wint_t));
210 int MSVCRT(iswpunct
)(MSVCRT(wint_t));
211 int MSVCRT(iswspace
)(MSVCRT(wint_t));
212 int MSVCRT(iswupper
)(MSVCRT(wint_t));
213 int MSVCRT(iswxdigit
)(MSVCRT(wint_t));
214 MSVCRT(wchar_t) MSVCRT(towlower
)(MSVCRT(wchar_t));
215 MSVCRT(wchar_t) MSVCRT(towupper
)(MSVCRT(wchar_t));
216 #endif /* MSVCRT_WCTYPE_DEFINED */
218 #ifndef MSVCRT_WDIRECT_DEFINED
219 #define MSVCRT_WDIRECT_DEFINED
220 int _wchdir(const MSVCRT(wchar_t)*);
221 MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
222 MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
223 int _wmkdir(const MSVCRT(wchar_t)*);
224 int _wrmdir(const MSVCRT(wchar_t)*);
225 #endif /* MSVCRT_WDIRECT_DEFINED */
227 #ifndef MSVCRT_WIO_DEFINED
228 #define MSVCRT_WIO_DEFINED
229 int _waccess(const MSVCRT(wchar_t)*,int);
230 int _wchmod(const MSVCRT(wchar_t)*,int);
231 int _wcreat(const MSVCRT(wchar_t)*,int);
232 long _wfindfirst(const MSVCRT(wchar_t)*,struct _wfinddata_t
*);
233 long _wfindfirsti64(const MSVCRT(wchar_t)*, struct _wfinddatai64_t
*);
234 int _wfindnext(long,struct _wfinddata_t
*);
235 int _wfindnexti64(long, struct _wfinddatai64_t
*);
236 MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
237 int _wopen(const MSVCRT(wchar_t)*,int,...);
238 int _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
239 int _wsopen(const MSVCRT(wchar_t)*,int,int,...);
240 int _wunlink(const MSVCRT(wchar_t)*);
241 #endif /* MSVCRT_WIO_DEFINED */
243 #ifndef MSVCRT_WLOCALE_DEFINED
244 #define MSVCRT_WLOCALE_DEFINED
245 MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
246 #endif /* MSVCRT_WLOCALE_DEFINED */
248 #ifndef MSVCRT_WPROCESS_DEFINED
249 #define MSVCRT_WPROCESS_DEFINED
250 int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
251 int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
252 int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
253 int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
254 int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
255 int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
256 int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
257 int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
258 int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
259 int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
260 int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
261 int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
262 int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
263 int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
264 int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
265 int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
266 int _wsystem(const MSVCRT(wchar_t)*);
267 #endif /* MSVCRT_WPROCESS_DEFINED */
269 #ifndef MSVCRT_WSTAT_DEFINED
270 #define MSVCRT_WSTAT_DEFINED
271 int _wstat(const MSVCRT(wchar_t)*,struct _stat
*);
272 int _wstati64(const MSVCRT(wchar_t)*,struct _stati64
*);
273 #endif /* MSVCRT_WSTAT_DEFINED */
275 #ifndef MSVCRT_WSTDIO_DEFINED
276 #define MSVCRT_WSTDIO_DEFINED
277 MSVCRT(wint_t) _fgetwchar(void);
278 MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
279 MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
280 int _putws(const MSVCRT(wchar_t)*);
281 int _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
282 int _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
283 MSVCRT(FILE)* _wfdopen(int,const MSVCRT(wchar_t)*);
284 MSVCRT(FILE)* _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
285 MSVCRT(FILE)* _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
286 MSVCRT(FILE)* _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
287 void _wperror(const MSVCRT(wchar_t)*);
288 MSVCRT(FILE)* _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
289 int _wremove(const MSVCRT(wchar_t)*);
290 MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
291 MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
293 MSVCRT(wint_t) MSVCRT(fgetwc
)(MSVCRT(FILE)*);
294 MSVCRT(wchar_t)*MSVCRT(fgetws
)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
295 MSVCRT(wint_t) MSVCRT(fputwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
296 int MSVCRT(fputws
)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
297 int MSVCRT(fwprintf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
298 int MSVCRT(fputws
)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
299 int MSVCRT(fwscanf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
300 MSVCRT(wint_t) MSVCRT(getwc
)(MSVCRT(FILE)*);
301 MSVCRT(wint_t) MSVCRT(getwchar
)(void);
302 MSVCRT(wchar_t)*MSVCRT(getws
)(MSVCRT(wchar_t)*);
303 MSVCRT(wint_t) MSVCRT(putwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
304 MSVCRT(wint_t) MSVCRT(putwchar
)(MSVCRT(wint_t));
305 int MSVCRT(putws
)(const MSVCRT(wchar_t)*);
306 int MSVCRT(swprintf
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
307 int MSVCRT(swscanf
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
308 MSVCRT(wint_t) MSVCRT(ungetwc
)(MSVCRT(wint_t),MSVCRT(FILE)*);
309 int MSVCRT(vfwprintf
)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
310 int MSVCRT(vswprintf
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
311 int MSVCRT(vwprintf
)(const MSVCRT(wchar_t)*,va_list);
312 int MSVCRT(wprintf
)(const MSVCRT(wchar_t)*,...);
313 int MSVCRT(wscanf
)(const MSVCRT(wchar_t)*,...);
314 #endif /* MSVCRT_WSTDIO_DEFINED */
316 #ifndef MSVCRT_WSTDLIB_DEFINED
317 #define MSVCRT_WSTDLIB_DEFINED
318 MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
319 MSVCRT(wchar_t)*_i64tow(__int64
,MSVCRT(wchar_t)*,int);
320 MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
321 MSVCRT(wchar_t)*_ui64tow(unsigned __int64
,MSVCRT(wchar_t)*,int);
322 MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
323 MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,size_t);
324 MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
325 void _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
326 void _wperror(const MSVCRT(wchar_t)*);
327 int _wputenv(const MSVCRT(wchar_t)*);
328 void _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
329 void _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
330 int _wsystem(const MSVCRT(wchar_t)*);
331 int _wtoi(const MSVCRT(wchar_t)*);
332 __int64
_wtoi64(const MSVCRT(wchar_t)*);
333 long _wtol(const MSVCRT(wchar_t)*);
335 MSVCRT(size_t) MSVCRT(mbstowcs
)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
336 int MSVCRT(mbtowc
)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
337 double MSVCRT(wcstod
)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
338 long MSVCRT(wcstol
)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
339 MSVCRT(size_t) MSVCRT(wcstombs
)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
340 unsigned long MSVCRT(wcstoul
)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
341 int MSVCRT(wctomb
)(char*,MSVCRT(wchar_t));
342 #endif /* MSVCRT_WSTDLIB_DEFINED */
344 #ifndef MSVCRT_WSTRING_DEFINED
345 #define MSVCRT_WSTRING_DEFINED
346 MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
347 int _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
348 int _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
349 MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
350 int _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
351 MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
352 MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
353 MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
354 MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
356 MSVCRT(wchar_t)*MSVCRT(wcscat
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
357 MSVCRT(wchar_t)*MSVCRT(wcschr
)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
358 int MSVCRT(wcscmp
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
359 int MSVCRT(wcscoll
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
360 MSVCRT(wchar_t)*MSVCRT(wcscpy
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
361 MSVCRT(size_t) MSVCRT(wcscspn
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
362 MSVCRT(size_t) MSVCRT(wcslen
)(const MSVCRT(wchar_t)*);
363 MSVCRT(wchar_t)*MSVCRT(wcsncat
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
364 int MSVCRT(wcsncmp
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
365 MSVCRT(wchar_t)*MSVCRT(wcsncpy
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
366 MSVCRT(wchar_t)*MSVCRT(wcspbrk
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
367 MSVCRT(wchar_t)*MSVCRT(wcsrchr
)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor
);
368 MSVCRT(size_t) MSVCRT(wcsspn
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
369 MSVCRT(wchar_t)*MSVCRT(wcsstr
)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
370 MSVCRT(wchar_t)*MSVCRT(wcstok
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
371 MSVCRT(size_t) MSVCRT(wcsxfrm
)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
372 #endif /* MSVCRT_WSTRING_DEFINED */
374 #ifndef MSVCRT_WTIME_DEFINED
375 #define MSVCRT_WTIME_DEFINED
376 MSVCRT(wchar_t)*_wasctime(const struct MSVCRT(tm
)*);
377 MSVCRT(size_t) wcsftime(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm
)*);
378 MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
379 MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
380 MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
381 #endif /* MSVCRT_WTIME_DEFINED */
383 MSVCRT(wchar_t) btowc(int);
384 MSVCRT(size_t) mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
385 MSVCRT(size_t) mbrtowc(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
386 MSVCRT(size_t) mbsrtowcs(MSVCRT(wchar_t)*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
387 MSVCRT(size_t) wcrtomb(char*,MSVCRT(wchar_t),MSVCRT(mbstate_t)*);
388 MSVCRT(size_t) wcsrtombs(char*,const MSVCRT(wchar_t)**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
389 int wctob(MSVCRT(wint_t));
395 #endif /* __WINE_WCHAR_H */