msvcp90: Add codecvt<wchar_t>::do_encoding that returns 0.
[wine.git] / dlls / msvcrt / msvcrt.h
blob5c268666d112b102141aad82b0987acb23bb388c
1 /*
2 * Copyright 2001 Jon Griffiths
3 * Copyright 2004 Dimitrie O. Paun
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 * NOTES
20 * Naming conventions
21 * - Symbols are prefixed with MSVCRT_ if they conflict
22 * with libc symbols
23 * - Internal symbols are usually prefixed by msvcrt_.
24 * - Exported symbols that are not present in the public
25 * headers are usually kept the same as the original.
26 * Other conventions
27 * - To avoid conflicts with the standard C library,
28 * no msvcrt headers are included in the implementation.
29 * - Instead, symbols are duplicated here, prefixed with
30 * MSVCRT_, as explained above.
31 * - To avoid inconsistencies, a test for each symbol is
32 * added into tests/headers.c. Please always add a
33 * corresponding test when you add a new symbol!
36 #ifndef __WINE_MSVCRT_H
37 #define __WINE_MSVCRT_H
39 #include <stdarg.h>
41 #include "windef.h"
42 #include "winbase.h"
44 #define MSVCRT_LONG_MAX 0x7fffffff
45 #define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
46 #define MSVCRT_ULONG_MAX 0xffffffff
47 #define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
48 #define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
49 #define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
50 #define MSVCRT_MB_LEN_MAX 5
51 #ifdef _WIN64
52 #define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
53 #else
54 #define MSVCRT_SIZE_MAX MSVCRT_ULONG_MAX
55 #endif
57 #define MSVCRT__MAX_DRIVE 3
58 #define MSVCRT__MAX_DIR 256
59 #define MSVCRT__MAX_FNAME 256
60 #define MSVCRT__MAX_EXT 256
62 typedef unsigned char MSVCRT_bool;
63 typedef unsigned short MSVCRT_wchar_t;
64 typedef unsigned short MSVCRT_wint_t;
65 typedef unsigned short MSVCRT_wctype_t;
66 typedef unsigned short MSVCRT__ino_t;
67 typedef unsigned int MSVCRT__fsize_t;
68 typedef int MSVCRT_long;
69 typedef unsigned int MSVCRT_ulong;
70 typedef __int64 MSVCRT_longlong;
71 #ifdef _WIN64
72 typedef unsigned __int64 MSVCRT_size_t;
73 typedef __int64 MSVCRT_intptr_t;
74 typedef unsigned __int64 MSVCRT_uintptr_t;
75 #else
76 typedef unsigned long MSVCRT_size_t;
77 typedef long MSVCRT_intptr_t;
78 typedef unsigned long MSVCRT_uintptr_t;
79 #endif
80 typedef unsigned int MSVCRT__dev_t;
81 typedef int MSVCRT__off_t;
82 typedef int MSVCRT_clock_t;
83 typedef int MSVCRT___time32_t;
84 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT___time64_t;
85 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT_fpos_t;
86 typedef int MSVCRT_mbstate_t;
88 typedef void (__cdecl *MSVCRT_terminate_handler)(void);
89 typedef void (__cdecl *MSVCRT_terminate_function)(void);
90 typedef void (__cdecl *MSVCRT_unexpected_handler)(void);
91 typedef void (__cdecl *MSVCRT_unexpected_function)(void);
92 typedef void (__cdecl *MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
93 typedef void (__cdecl *MSVCRT__beginthread_start_routine_t)(void *);
94 typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
95 typedef int (__cdecl *MSVCRT__onexit_t)(void);
96 typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t);
97 typedef void (__cdecl *MSVCRT_purecall_handler)(void);
98 typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *);
100 typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */
102 struct MSVCRT_tm {
103 int tm_sec;
104 int tm_min;
105 int tm_hour;
106 int tm_mday;
107 int tm_mon;
108 int tm_year;
109 int tm_wday;
110 int tm_yday;
111 int tm_isdst;
114 typedef struct MSVCRT_tagLC_ID {
115 unsigned short wLanguage;
116 unsigned short wCountry;
117 unsigned short wCodePage;
118 } MSVCRT_LC_ID, *MSVCRT_LPLC_ID;
120 typedef struct {
121 union {
122 char *str[43];
123 struct {
124 char *short_wday[7];
125 char *wday[7];
126 char *short_mon[12];
127 char *mon[12];
128 char *am;
129 char *pm;
130 char *short_date;
131 char *date;
132 char *time;
133 } names;
134 } str;
135 #if _MSVCR_VER < 110
136 LCID lcid;
137 #endif
138 int unk[2];
139 union {
140 MSVCRT_wchar_t *wstr[43];
141 struct {
142 MSVCRT_wchar_t *short_wday[7];
143 MSVCRT_wchar_t *wday[7];
144 MSVCRT_wchar_t *short_mon[12];
145 MSVCRT_wchar_t *mon[12];
146 MSVCRT_wchar_t *am;
147 MSVCRT_wchar_t *pm;
148 MSVCRT_wchar_t *short_date;
149 MSVCRT_wchar_t *date;
150 MSVCRT_wchar_t *time;
151 } names;
152 } wstr;
153 #if _MSVCR_VER >= 110
154 MSVCRT_wchar_t *locname;
155 #endif
156 char data[1];
157 } MSVCRT___lc_time_data;
159 typedef struct MSVCRT_threadlocaleinfostruct {
160 int refcount;
161 unsigned int lc_codepage;
162 unsigned int lc_collate_cp;
163 MSVCRT_ulong lc_handle[6];
164 MSVCRT_LC_ID lc_id[6];
165 struct {
166 char *locale;
167 MSVCRT_wchar_t *wlocale;
168 int *refcount;
169 int *wrefcount;
170 } lc_category[6];
171 int lc_clike;
172 int mb_cur_max;
173 int *lconv_intl_refcount;
174 int *lconv_num_refcount;
175 int *lconv_mon_refcount;
176 struct MSVCRT_lconv *lconv;
177 int *ctype1_refcount;
178 unsigned short *ctype1;
179 unsigned short *pctype;
180 unsigned char *pclmap;
181 unsigned char *pcumap;
182 MSVCRT___lc_time_data *lc_time_curr;
183 #if _MSVCR_VER >= 110
184 MSVCRT_wchar_t *lc_name[6];
185 #endif
186 } MSVCRT_threadlocinfo;
188 typedef struct MSVCRT_threadmbcinfostruct {
189 int refcount;
190 int mbcodepage;
191 int ismbcodepage;
192 int mblcid;
193 unsigned short mbulinfo[6];
194 unsigned char mbctype[257];
195 unsigned char mbcasemap[256];
196 } MSVCRT_threadmbcinfo;
198 typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo;
199 typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo;
201 typedef struct MSVCRT_localeinfo_struct
203 MSVCRT_pthreadlocinfo locinfo;
204 MSVCRT_pthreadmbcinfo mbcinfo;
205 } MSVCRT__locale_tstruct, *MSVCRT__locale_t;
207 typedef struct _frame_info
209 void *object;
210 struct _frame_info *next;
211 } frame_info;
213 typedef struct
215 frame_info frame_info;
216 EXCEPTION_RECORD *rec;
217 void *unk;
218 } cxx_frame_info;
220 frame_info* __cdecl _CreateFrameInfo(frame_info *fi, void *obj);
221 BOOL __cdecl __CxxRegisterExceptionObject(EXCEPTION_RECORD**, cxx_frame_info*);
222 void __cdecl __CxxUnregisterExceptionObject(cxx_frame_info*, BOOL);
223 void CDECL __DestructExceptionObject(EXCEPTION_RECORD*);
225 /* TLS data */
226 extern DWORD msvcrt_tls_index DECLSPEC_HIDDEN;
228 /* Keep in sync with msvcr90/tests/msvcr90.c */
229 struct __thread_data {
230 DWORD tid;
231 HANDLE handle;
232 int thread_errno;
233 MSVCRT_ulong thread_doserrno;
234 int unk1;
235 unsigned int random_seed; /* seed for rand() */
236 char *strtok_next; /* next ptr for strtok() */
237 MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */
238 unsigned char *mbstok_next; /* next ptr for mbstok() */
239 char *strerror_buffer; /* buffer for strerror */
240 MSVCRT_wchar_t *wcserror_buffer; /* buffer for wcserror */
241 char *tmpnam_buffer; /* buffer for tmpname() */
242 MSVCRT_wchar_t *wtmpnam_buffer; /* buffer for wtmpname() */
243 void *unk2[2];
244 char *asctime_buffer; /* buffer for asctime */
245 MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */
246 struct MSVCRT_tm *time_buffer; /* buffer for localtime/gmtime */
247 char *efcvt_buffer; /* buffer for ecvt/fcvt */
248 int unk3[2];
249 void *unk4[3];
250 EXCEPTION_POINTERS *xcptinfo;
251 int fpecode;
252 MSVCRT_pthreadmbcinfo mbcinfo;
253 MSVCRT_pthreadlocinfo locinfo;
254 BOOL have_locale;
255 int unk5[1];
256 MSVCRT_terminate_function terminate_handler;
257 MSVCRT_unexpected_function unexpected_handler;
258 MSVCRT__se_translator_function se_translator;
259 void *unk6[3];
260 int unk7;
261 EXCEPTION_RECORD *exc_record;
262 frame_info *frame_info_head;
263 void *unk8[6];
264 LCID cached_lcid;
265 int unk9[3];
266 DWORD cached_cp;
267 char cached_locale[131];
268 void *unk10[100];
271 typedef struct __thread_data thread_data_t;
273 extern thread_data_t *msvcrt_get_thread_data(void) DECLSPEC_HIDDEN;
275 LCID MSVCRT_locale_to_LCID(const char*, unsigned short*) DECLSPEC_HIDDEN;
276 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN;
277 extern unsigned int MSVCRT___lc_codepage;
278 extern int MSVCRT___lc_collate_cp;
279 extern WORD MSVCRT__ctype [257];
281 void msvcrt_set_errno(int) DECLSPEC_HIDDEN;
282 #if _MSVCR_VER >= 80
283 void throw_bad_alloc(const char*) DECLSPEC_HIDDEN;
284 #endif
286 void __cdecl _purecall(void);
287 void __cdecl _amsg_exit(int errnum);
289 extern char **MSVCRT__environ;
290 extern MSVCRT_wchar_t **MSVCRT__wenviron;
292 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN;
293 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **) DECLSPEC_HIDDEN;
295 MSVCRT_wchar_t *msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN;
297 extern unsigned int MSVCRT__commode;
299 /* FIXME: This should be declared in new.h but it's not an extern "C" so
300 * it would not be much use anyway. Even for Winelib applications.
302 int __cdecl MSVCRT__set_new_mode(int mode);
304 void* __cdecl MSVCRT_operator_new(MSVCRT_size_t);
305 void __cdecl MSVCRT_operator_delete(void*);
307 typedef void* (__cdecl *malloc_func_t)(MSVCRT_size_t);
308 typedef void (__cdecl *free_func_t)(void*);
310 /* Setup and teardown multi threaded locks */
311 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN;
312 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN;
314 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN;
315 extern BOOL msvcrt_init_locale(void) DECLSPEC_HIDDEN;
316 extern void msvcrt_init_math(void) DECLSPEC_HIDDEN;
317 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN;
318 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN;
319 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN;
320 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN;
321 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN;
322 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN;
323 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN;
324 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN;
325 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN;
326 extern BOOL msvcrt_init_heap(void) DECLSPEC_HIDDEN;
327 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN;
329 extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
331 extern unsigned int __cdecl _control87(unsigned int, unsigned int);
333 /* run-time error codes */
334 #define _RT_STACK 0
335 #define _RT_NULLPTR 1
336 #define _RT_FLOAT 2
337 #define _RT_INTDIV 3
338 #define _RT_EXECMEM 5
339 #define _RT_EXECFORM 6
340 #define _RT_EXECENV 7
341 #define _RT_SPACEARG 8
342 #define _RT_SPACEENV 9
343 #define _RT_ABORT 10
344 #define _RT_NPTR 12
345 #define _RT_FPTR 13
346 #define _RT_BREAK 14
347 #define _RT_INT 15
348 #define _RT_THREAD 16
349 #define _RT_LOCK 17
350 #define _RT_HEAP 18
351 #define _RT_OPENCON 19
352 #define _RT_QWIN 20
353 #define _RT_NOMAIN 21
354 #define _RT_NONCONT 22
355 #define _RT_INVALDISP 23
356 #define _RT_ONEXIT 24
357 #define _RT_PUREVIRT 25
358 #define _RT_STDIOINIT 26
359 #define _RT_LOWIOINIT 27
360 #define _RT_HEAPINIT 28
361 #define _RT_DOMAIN 120
362 #define _RT_SING 121
363 #define _RT_TLOSS 122
364 #define _RT_CRNL 252
365 #define _RT_BANNER 255
367 struct MSVCRT___timeb32 {
368 MSVCRT___time32_t time;
369 unsigned short millitm;
370 short timezone;
371 short dstflag;
374 struct MSVCRT___timeb64 {
375 MSVCRT___time64_t time;
376 unsigned short millitm;
377 short timezone;
378 short dstflag;
381 struct MSVCRT__iobuf {
382 char* _ptr;
383 int _cnt;
384 char* _base;
385 int _flag;
386 int _file;
387 int _charbuf;
388 int _bufsiz;
389 char* _tmpfname;
392 typedef struct MSVCRT__iobuf MSVCRT_FILE;
394 struct MSVCRT_lconv {
395 char* decimal_point;
396 char* thousands_sep;
397 char* grouping;
398 char* int_curr_symbol;
399 char* currency_symbol;
400 char* mon_decimal_point;
401 char* mon_thousands_sep;
402 char* mon_grouping;
403 char* positive_sign;
404 char* negative_sign;
405 char int_frac_digits;
406 char frac_digits;
407 char p_cs_precedes;
408 char p_sep_by_space;
409 char n_cs_precedes;
410 char n_sep_by_space;
411 char p_sign_posn;
412 char n_sign_posn;
413 #if _MSVCR_VER >= 120
414 MSVCRT_wchar_t* _W_decimal_point;
415 MSVCRT_wchar_t* _W_thousands_sep;
416 MSVCRT_wchar_t* _W_int_curr_symbol;
417 MSVCRT_wchar_t* _W_currency_symbol;
418 MSVCRT_wchar_t* _W_mon_decimal_point;
419 MSVCRT_wchar_t* _W_mon_thousands_sep;
420 MSVCRT_wchar_t* _W_positive_sign;
421 MSVCRT_wchar_t* _W_negative_sign;
422 #endif
425 struct MSVCRT__exception {
426 int type;
427 char* name;
428 double arg1;
429 double arg2;
430 double retval;
433 struct MSVCRT__complex {
434 double x; /* Real part */
435 double y; /* Imaginary part */
438 typedef struct MSVCRT__div_t {
439 int quot; /* quotient */
440 int rem; /* remainder */
441 } MSVCRT_div_t;
443 typedef struct MSVCRT__ldiv_t {
444 MSVCRT_long quot; /* quotient */
445 MSVCRT_long rem; /* remainder */
446 } MSVCRT_ldiv_t;
448 struct MSVCRT__heapinfo {
449 int* _pentry;
450 MSVCRT_size_t _size;
451 int _useflag;
454 #ifdef __i386__
455 struct MSVCRT___JUMP_BUFFER {
456 unsigned long Ebp;
457 unsigned long Ebx;
458 unsigned long Edi;
459 unsigned long Esi;
460 unsigned long Esp;
461 unsigned long Eip;
462 unsigned long Registration;
463 unsigned long TryLevel;
464 /* Start of new struct members */
465 unsigned long Cookie;
466 unsigned long UnwindFunc;
467 unsigned long UnwindData[6];
469 #elif defined(__x86_64__)
470 struct MSVCRT__SETJMP_FLOAT128
472 unsigned __int64 DECLSPEC_ALIGN(16) Part[2];
474 struct MSVCRT___JUMP_BUFFER
476 unsigned __int64 Frame;
477 unsigned __int64 Rbx;
478 unsigned __int64 Rsp;
479 unsigned __int64 Rbp;
480 unsigned __int64 Rsi;
481 unsigned __int64 Rdi;
482 unsigned __int64 R12;
483 unsigned __int64 R13;
484 unsigned __int64 R14;
485 unsigned __int64 R15;
486 unsigned __int64 Rip;
487 unsigned __int64 Spare;
488 struct MSVCRT__SETJMP_FLOAT128 Xmm6;
489 struct MSVCRT__SETJMP_FLOAT128 Xmm7;
490 struct MSVCRT__SETJMP_FLOAT128 Xmm8;
491 struct MSVCRT__SETJMP_FLOAT128 Xmm9;
492 struct MSVCRT__SETJMP_FLOAT128 Xmm10;
493 struct MSVCRT__SETJMP_FLOAT128 Xmm11;
494 struct MSVCRT__SETJMP_FLOAT128 Xmm12;
495 struct MSVCRT__SETJMP_FLOAT128 Xmm13;
496 struct MSVCRT__SETJMP_FLOAT128 Xmm14;
497 struct MSVCRT__SETJMP_FLOAT128 Xmm15;
499 #elif defined(__arm__)
500 struct MSVCRT___JUMP_BUFFER
502 unsigned long Frame;
503 unsigned long R4;
504 unsigned long R5;
505 unsigned long R6;
506 unsigned long R7;
507 unsigned long R8;
508 unsigned long R9;
509 unsigned long R10;
510 unsigned long R11;
511 unsigned long Sp;
512 unsigned long Pc;
513 unsigned long Fpscr;
514 unsigned long long D[8];
516 #endif /* __i386__ */
518 struct MSVCRT__diskfree_t {
519 unsigned int total_clusters;
520 unsigned int avail_clusters;
521 unsigned int sectors_per_cluster;
522 unsigned int bytes_per_sector;
525 struct MSVCRT__finddata32_t {
526 unsigned int attrib;
527 MSVCRT___time32_t time_create;
528 MSVCRT___time32_t time_access;
529 MSVCRT___time32_t time_write;
530 MSVCRT__fsize_t size;
531 char name[260];
534 struct MSVCRT__finddata32i64_t {
535 unsigned int attrib;
536 MSVCRT___time32_t time_create;
537 MSVCRT___time32_t time_access;
538 MSVCRT___time32_t time_write;
539 __int64 DECLSPEC_ALIGN(8) size;
540 char name[260];
543 struct MSVCRT__finddata64i32_t {
544 unsigned int attrib;
545 MSVCRT___time64_t time_create;
546 MSVCRT___time64_t time_access;
547 MSVCRT___time64_t time_write;
548 MSVCRT__fsize_t size;
549 char name[260];
552 struct MSVCRT__finddata64_t {
553 unsigned int attrib;
554 MSVCRT___time64_t time_create;
555 MSVCRT___time64_t time_access;
556 MSVCRT___time64_t time_write;
557 __int64 DECLSPEC_ALIGN(8) size;
558 char name[260];
561 struct MSVCRT__wfinddata32_t {
562 unsigned int attrib;
563 MSVCRT___time32_t time_create;
564 MSVCRT___time32_t time_access;
565 MSVCRT___time32_t time_write;
566 MSVCRT__fsize_t size;
567 MSVCRT_wchar_t name[260];
570 struct MSVCRT__wfinddata32i64_t {
571 unsigned int attrib;
572 MSVCRT___time32_t time_create;
573 MSVCRT___time32_t time_access;
574 MSVCRT___time32_t time_write;
575 __int64 DECLSPEC_ALIGN(8) size;
576 MSVCRT_wchar_t name[260];
579 struct MSVCRT__wfinddata64i32_t {
580 unsigned int attrib;
581 MSVCRT___time64_t time_create;
582 MSVCRT___time64_t time_access;
583 MSVCRT___time64_t time_write;
584 MSVCRT__fsize_t size;
585 MSVCRT_wchar_t name[260];
588 struct MSVCRT__wfinddata64_t {
589 unsigned int attrib;
590 MSVCRT___time64_t time_create;
591 MSVCRT___time64_t time_access;
592 MSVCRT___time64_t time_write;
593 __int64 DECLSPEC_ALIGN(8) size;
594 MSVCRT_wchar_t name[260];
597 struct MSVCRT___utimbuf32
599 MSVCRT___time32_t actime;
600 MSVCRT___time32_t modtime;
603 struct MSVCRT___utimbuf64
605 MSVCRT___time64_t actime;
606 MSVCRT___time64_t modtime;
609 /* for FreeBSD */
610 #undef st_atime
611 #undef st_ctime
612 #undef st_mtime
614 struct MSVCRT__stat32 {
615 MSVCRT__dev_t st_dev;
616 MSVCRT__ino_t st_ino;
617 unsigned short st_mode;
618 short st_nlink;
619 short st_uid;
620 short st_gid;
621 MSVCRT__dev_t st_rdev;
622 MSVCRT__off_t st_size;
623 MSVCRT___time32_t st_atime;
624 MSVCRT___time32_t st_mtime;
625 MSVCRT___time32_t st_ctime;
628 struct MSVCRT__stat32i64 {
629 MSVCRT__dev_t st_dev;
630 MSVCRT__ino_t st_ino;
631 unsigned short st_mode;
632 short st_nlink;
633 short st_uid;
634 short st_gid;
635 MSVCRT__dev_t st_rdev;
636 __int64 DECLSPEC_ALIGN(8) st_size;
637 MSVCRT___time32_t st_atime;
638 MSVCRT___time32_t st_mtime;
639 MSVCRT___time32_t st_ctime;
642 struct MSVCRT__stat64i32 {
643 MSVCRT__dev_t st_dev;
644 MSVCRT__ino_t st_ino;
645 unsigned short st_mode;
646 short st_nlink;
647 short st_uid;
648 short st_gid;
649 MSVCRT__dev_t st_rdev;
650 MSVCRT__off_t st_size;
651 MSVCRT___time64_t st_atime;
652 MSVCRT___time64_t st_mtime;
653 MSVCRT___time64_t st_ctime;
656 struct MSVCRT__stat64 {
657 MSVCRT__dev_t st_dev;
658 MSVCRT__ino_t st_ino;
659 unsigned short st_mode;
660 short st_nlink;
661 short st_uid;
662 short st_gid;
663 MSVCRT__dev_t st_rdev;
664 __int64 DECLSPEC_ALIGN(8) st_size;
665 MSVCRT___time64_t st_atime;
666 MSVCRT___time64_t st_mtime;
667 MSVCRT___time64_t st_ctime;
670 #ifdef _WIN64
671 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
672 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
673 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
674 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
675 #define MSVCRT__stat MSVCRT__stat64i32
676 #define MSVCRT__stati64 MSVCRT__stat64
677 #else
678 #define MSVCRT__finddata_t MSVCRT__finddata32_t
679 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
680 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
681 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
682 #define MSVCRT__stat MSVCRT__stat32
683 #define MSVCRT__stati64 MSVCRT__stat32i64
684 #endif
686 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
687 #define MSVCRT_EOF (-1)
688 #define MSVCRT_TMP_MAX 0x7fff
689 #define MSVCRT_TMP_MAX_S 0x7fffffff
690 #define MSVCRT_RAND_MAX 0x7fff
691 #define MSVCRT_BUFSIZ 512
693 #define MSVCRT_SEEK_SET 0
694 #define MSVCRT_SEEK_CUR 1
695 #define MSVCRT_SEEK_END 2
697 #define MSVCRT_STDIN_FILENO 0
698 #define MSVCRT_STDOUT_FILENO 1
699 #define MSVCRT_STDERR_FILENO 2
701 /* more file._flag flags, but these conflict with Unix */
702 #define MSVCRT__IOFBF 0x0000
703 #define MSVCRT__IONBF 0x0004
704 #define MSVCRT__IOLBF 0x0040
706 #define MSVCRT_FILENAME_MAX 260
707 #define MSVCRT_DRIVE_MAX 3
708 #define MSVCRT_FNAME_MAX 256
709 #define MSVCRT_DIR_MAX 256
710 #define MSVCRT_EXT_MAX 256
711 #define MSVCRT_PATH_MAX 260
712 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
713 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
714 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
716 #define MSVCRT__P_WAIT 0
717 #define MSVCRT__P_NOWAIT 1
718 #define MSVCRT__P_OVERLAY 2
719 #define MSVCRT__P_NOWAITO 3
720 #define MSVCRT__P_DETACH 4
722 #define MSVCRT_EPERM 1
723 #define MSVCRT_ENOENT 2
724 #define MSVCRT_ESRCH 3
725 #define MSVCRT_EINTR 4
726 #define MSVCRT_EIO 5
727 #define MSVCRT_ENXIO 6
728 #define MSVCRT_E2BIG 7
729 #define MSVCRT_ENOEXEC 8
730 #define MSVCRT_EBADF 9
731 #define MSVCRT_ECHILD 10
732 #define MSVCRT_EAGAIN 11
733 #define MSVCRT_ENOMEM 12
734 #define MSVCRT_EACCES 13
735 #define MSVCRT_EFAULT 14
736 #define MSVCRT_EBUSY 16
737 #define MSVCRT_EEXIST 17
738 #define MSVCRT_EXDEV 18
739 #define MSVCRT_ENODEV 19
740 #define MSVCRT_ENOTDIR 20
741 #define MSVCRT_EISDIR 21
742 #define MSVCRT_EINVAL 22
743 #define MSVCRT_ENFILE 23
744 #define MSVCRT_EMFILE 24
745 #define MSVCRT_ENOTTY 25
746 #define MSVCRT_EFBIG 27
747 #define MSVCRT_ENOSPC 28
748 #define MSVCRT_ESPIPE 29
749 #define MSVCRT_EROFS 30
750 #define MSVCRT_EMLINK 31
751 #define MSVCRT_EPIPE 32
752 #define MSVCRT_EDOM 33
753 #define MSVCRT_ERANGE 34
754 #define MSVCRT_EDEADLK 36
755 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
756 #define MSVCRT_ENAMETOOLONG 38
757 #define MSVCRT_ENOLCK 39
758 #define MSVCRT_ENOSYS 40
759 #define MSVCRT_ENOTEMPTY 41
760 #define MSVCRT_EILSEQ 42
761 #define MSVCRT_STRUNCATE 80
763 #define MSVCRT_LC_ALL 0
764 #define MSVCRT_LC_COLLATE 1
765 #define MSVCRT_LC_CTYPE 2
766 #define MSVCRT_LC_MONETARY 3
767 #define MSVCRT_LC_NUMERIC 4
768 #define MSVCRT_LC_TIME 5
769 #define MSVCRT_LC_MIN MSVCRT_LC_ALL
770 #define MSVCRT_LC_MAX MSVCRT_LC_TIME
772 #define MSVCRT__HEAPEMPTY -1
773 #define MSVCRT__HEAPOK -2
774 #define MSVCRT__HEAPBADBEGIN -3
775 #define MSVCRT__HEAPBADNODE -4
776 #define MSVCRT__HEAPEND -5
777 #define MSVCRT__HEAPBADPTR -6
779 #define MSVCRT__FREEENTRY 0
780 #define MSVCRT__USEDENTRY 1
782 #define MSVCRT__OUT_TO_DEFAULT 0
783 #define MSVCRT__OUT_TO_STDERR 1
784 #define MSVCRT__OUT_TO_MSGBOX 2
785 #define MSVCRT__REPORT_ERRMODE 3
787 /* ASCII char classification table - binary compatible */
788 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */
789 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */
790 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
791 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */
792 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
793 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
794 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */
795 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
796 #define MSVCRT__LEADBYTE 0x8000
797 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
799 #define MSVCRT__IOREAD 0x0001
800 #define MSVCRT__IOWRT 0x0002
801 #define MSVCRT__IOMYBUF 0x0008
802 #define MSVCRT__IOEOF 0x0010
803 #define MSVCRT__IOERR 0x0020
804 #define MSVCRT__IOSTRG 0x0040
805 #define MSVCRT__IORW 0x0080
806 #define MSVCRT__USERBUF 0x0100
807 #define MSVCRT__IOCOMMIT 0x4000
809 #define MSVCRT__S_IEXEC 0x0040
810 #define MSVCRT__S_IWRITE 0x0080
811 #define MSVCRT__S_IREAD 0x0100
812 #define MSVCRT__S_IFIFO 0x1000
813 #define MSVCRT__S_IFCHR 0x2000
814 #define MSVCRT__S_IFDIR 0x4000
815 #define MSVCRT__S_IFREG 0x8000
816 #define MSVCRT__S_IFMT 0xF000
818 #define MSVCRT__LK_UNLCK 0
819 #define MSVCRT__LK_LOCK 1
820 #define MSVCRT__LK_NBLCK 2
821 #define MSVCRT__LK_RLCK 3
822 #define MSVCRT__LK_NBRLCK 4
824 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
825 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
826 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
827 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
828 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
830 #define MSVCRT__O_RDONLY 0
831 #define MSVCRT__O_WRONLY 1
832 #define MSVCRT__O_RDWR 2
833 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
834 #define MSVCRT__O_APPEND 0x0008
835 #define MSVCRT__O_RANDOM 0x0010
836 #define MSVCRT__O_SEQUENTIAL 0x0020
837 #define MSVCRT__O_TEMPORARY 0x0040
838 #define MSVCRT__O_NOINHERIT 0x0080
839 #define MSVCRT__O_CREAT 0x0100
840 #define MSVCRT__O_TRUNC 0x0200
841 #define MSVCRT__O_EXCL 0x0400
842 #define MSVCRT__O_SHORT_LIVED 0x1000
843 #define MSVCRT__O_TEXT 0x4000
844 #define MSVCRT__O_BINARY 0x8000
845 #define MSVCRT__O_RAW MSVCRT__O_BINARY
846 #define MSVCRT__O_WTEXT 0x10000
847 #define MSVCRT__O_U16TEXT 0x20000
848 #define MSVCRT__O_U8TEXT 0x40000
850 /* _statusfp bit flags */
851 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
852 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
853 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
854 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
855 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */
857 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
858 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
859 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
860 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
862 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
864 /* fpclass constants */
865 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
866 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
867 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
868 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
869 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
870 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
871 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
872 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
873 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
874 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
876 /* fpclassify constants */
877 #define MSVCRT_FP_INFINITE 1
878 #define MSVCRT_FP_NAN 2
879 #define MSVCRT_FP_NORMAL -1
880 #define MSVCRT_FP_SUBNORMAL -2
881 #define MSVCRT_FP_ZERO 0
883 #define MSVCRT__MCW_EM 0x0008001f
884 #define MSVCRT__MCW_IC 0x00040000
885 #define MSVCRT__MCW_RC 0x00000300
886 #define MSVCRT__MCW_PC 0x00030000
887 #define MSVCRT__MCW_DN 0x03000000
889 #define MSVCRT__EM_INVALID 0x00000010
890 #define MSVCRT__EM_DENORMAL 0x00080000
891 #define MSVCRT__EM_ZERODIVIDE 0x00000008
892 #define MSVCRT__EM_OVERFLOW 0x00000004
893 #define MSVCRT__EM_UNDERFLOW 0x00000002
894 #define MSVCRT__EM_INEXACT 0x00000001
895 #define MSVCRT__IC_AFFINE 0x00040000
896 #define MSVCRT__IC_PROJECTIVE 0x00000000
897 #define MSVCRT__RC_CHOP 0x00000300
898 #define MSVCRT__RC_UP 0x00000200
899 #define MSVCRT__RC_DOWN 0x00000100
900 #define MSVCRT__RC_NEAR 0x00000000
901 #define MSVCRT__PC_24 0x00020000
902 #define MSVCRT__PC_53 0x00010000
903 #define MSVCRT__PC_64 0x00000000
904 #define MSVCRT__DN_SAVE 0x00000000
905 #define MSVCRT__DN_FLUSH 0x01000000
906 #define MSVCRT__DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000
907 #define MSVCRT__DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000
908 #define MSVCRT__EM_AMBIGUOUS 0x80000000
910 #define MSVCRT_CLOCKS_PER_SEC 1000
912 /* signals */
913 #define MSVCRT_SIGINT 2
914 #define MSVCRT_SIGILL 4
915 #define MSVCRT_SIGFPE 8
916 #define MSVCRT_SIGSEGV 11
917 #define MSVCRT_SIGTERM 15
918 #define MSVCRT_SIGBREAK 21
919 #define MSVCRT_SIGABRT 22
920 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
922 typedef void (__cdecl *MSVCRT___sighandler_t)(int);
924 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
925 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
926 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
928 #define MSVCRT__FPE_INVALID 0x81
929 #define MSVCRT__FPE_DENORMAL 0x82
930 #define MSVCRT__FPE_ZERODIVIDE 0x83
931 #define MSVCRT__FPE_OVERFLOW 0x84
932 #define MSVCRT__FPE_UNDERFLOW 0x85
933 #define MSVCRT__FPE_INEXACT 0x86
934 #define MSVCRT__FPE_UNEMULATED 0x87
935 #define MSVCRT__FPE_SQRTNEG 0x88
936 #define MSVCRT__FPE_STACKOVERFLOW 0x8a
937 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b
938 #define MSVCRT__FPE_EXPLICITGEN 0x8c
940 #define _MS 0x01
941 #define _MP 0x02
942 #define _M1 0x04
943 #define _M2 0x08
945 #define _SBUP 0x10
946 #define _SBLOW 0x20
948 #define _MBC_SINGLE 0
949 #define _MBC_LEAD 1
950 #define _MBC_TRAIL 2
951 #define _MBC_ILLEGAL -1
953 #define _MB_CP_SBCS 0
954 #define _MB_CP_OEM -2
955 #define _MB_CP_ANSI -3
956 #define _MB_CP_LOCALE -4
958 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1)
960 #define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF)
962 /* _set_abort_behavior codes */
963 #define MSVCRT__WRITE_ABORT_MSG 1
964 #define MSVCRT__CALL_REPORTFAULT 2
966 /* _get_output_format return code */
967 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1
969 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
971 void __cdecl MSVCRT_free(void*);
972 void* __cdecl MSVCRT_malloc(MSVCRT_size_t);
973 void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
974 void* __cdecl MSVCRT_realloc(void*,MSVCRT_size_t);
976 int __cdecl MSVCRT_iswalpha(MSVCRT_wint_t);
977 int __cdecl MSVCRT_iswspace(MSVCRT_wint_t);
978 int __cdecl MSVCRT_iswdigit(MSVCRT_wint_t);
979 int __cdecl MSVCRT_isleadbyte(int);
980 int __cdecl MSVCRT__isleadbyte_l(int, MSVCRT__locale_t);
982 void __cdecl MSVCRT__lock_file(MSVCRT_FILE*);
983 void __cdecl MSVCRT__unlock_file(MSVCRT_FILE*);
984 int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
985 int __cdecl MSVCRT__fgetc_nolock(MSVCRT_FILE*);
986 int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
987 int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
988 int __cdecl MSVCRT__ungetc_nolock(int,MSVCRT_FILE*);
989 MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
990 MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*);
991 MSVCRT_wint_t __cdecl MSVCRT__fputwc_nolock(MSVCRT_wint_t,MSVCRT_FILE*);
992 MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
993 MSVCRT_wint_t __cdecl MSVCRT__ungetwc_nolock(MSVCRT_wint_t, MSVCRT_FILE*);
994 int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
995 __int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
996 __int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*);
997 void __cdecl MSVCRT__exit(int);
998 void __cdecl MSVCRT_abort(void);
999 MSVCRT_ulong* __cdecl MSVCRT___doserrno(void);
1000 int* __cdecl MSVCRT__errno(void);
1001 char* __cdecl MSVCRT_getenv(const char*);
1002 MSVCRT_size_t __cdecl MSVCRT__fread_nolock(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1003 MSVCRT_size_t __cdecl MSVCRT__fread_nolock_s(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1004 MSVCRT_size_t __cdecl MSVCRT__fwrite_nolock(const void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1005 int __cdecl MSVCRT_fclose(MSVCRT_FILE*);
1006 int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*);
1007 int __cdecl MSVCRT__fflush_nolock(MSVCRT_FILE*);
1008 void __cdecl MSVCRT_terminate(void);
1009 MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
1010 MSVCRT_clock_t __cdecl MSVCRT_clock(void);
1011 MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
1012 MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
1013 MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
1014 MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
1015 int __cdecl MSVCRT_vsnprintf(char *str, MSVCRT_size_t len, const char *format, __ms_va_list valist);
1016 int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, MSVCRT_size_t len,
1017 const MSVCRT_wchar_t *format, __ms_va_list valist );
1018 int __cdecl MSVCRT__snwprintf(MSVCRT_wchar_t*, unsigned int, const MSVCRT_wchar_t*, ...);
1019 int __cdecl MSVCRT_sprintf(char*,const char*,...);
1020 int __cdecl MSVCRT__snprintf(char*,unsigned int,const char*,...);
1021 int __cdecl MSVCRT__scprintf(const char*,...);
1022 int __cdecl MSVCRT_raise(int sig);
1023 int __cdecl MSVCRT__set_printf_count_output(int);
1025 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
1026 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
1028 extern MSVCRT__locale_t MSVCRT_locale;
1029 MSVCRT_pthreadlocinfo get_locinfo(void) DECLSPEC_HIDDEN;
1030 MSVCRT_pthreadmbcinfo get_mbcinfo(void) DECLSPEC_HIDDEN;
1031 void __cdecl MSVCRT__free_locale(MSVCRT__locale_t);
1032 void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN;
1033 void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1034 int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1036 #ifndef __WINE_MSVCRT_TEST
1037 int __cdecl MSVCRT__write(int,const void*,unsigned int);
1038 int __cdecl _getch(void);
1039 int __cdecl _ismbblead(unsigned int);
1040 int __cdecl _ismbblead_l(unsigned int, MSVCRT__locale_t);
1041 int __cdecl _ismbclegal(unsigned int c);
1042 int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
1043 int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1044 MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1045 MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t);
1046 MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
1047 MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
1048 MSVCRT_intptr_t __cdecl MSVCRT__wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1049 MSVCRT_intptr_t __cdecl MSVCRT__wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1050 void __cdecl MSVCRT__searchenv(const char*,const char*,char*);
1051 int __cdecl MSVCRT__getdrive(void);
1052 char* __cdecl MSVCRT__strdup(const char*);
1053 char* __cdecl MSVCRT__strnset(char*,int,MSVCRT_size_t);
1054 char* __cdecl _strset(char*,int);
1055 int __cdecl _ungetch(int);
1056 int __cdecl _cputs(const char*);
1057 int __cdecl _cprintf(const char*,...);
1058 int __cdecl _cwprintf(const MSVCRT_wchar_t*,...);
1059 char*** __cdecl MSVCRT___p__environ(void);
1060 int* __cdecl __p___mb_cur_max(void);
1061 unsigned int* __cdecl __p__fmode(void);
1062 MSVCRT_wchar_t* __cdecl MSVCRT__wcsdup(const MSVCRT_wchar_t*);
1063 MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void);
1064 INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t);
1065 char* __cdecl MSVCRT__strdate(char* date);
1066 char* __cdecl MSVCRT__strtime(char* date);
1067 int __cdecl _setmbcp(int);
1068 int __cdecl MSVCRT__close(int);
1069 int __cdecl MSVCRT__dup(int);
1070 int __cdecl MSVCRT__dup2(int, int);
1071 int __cdecl MSVCRT__pipe(int *, unsigned int, int);
1072 MSVCRT_wchar_t* __cdecl MSVCRT__wgetenv(const MSVCRT_wchar_t*);
1073 void __cdecl MSVCRT__wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*);
1074 MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
1075 void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
1076 const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
1077 int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t);
1078 int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t);
1079 int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1080 int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1081 unsigned int __cdecl MSVCRT__get_output_format(void);
1082 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
1084 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
1085 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
1086 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE)
1087 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending
1088 * any information
1089 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around MSVCRT__invalid_parameter in order
1090 * to do the Ansi to Unicode transformation
1092 #define MSVCRT_INVALID_PMT(x,err) (*MSVCRT__errno() = (err), MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0))
1093 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
1094 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), MSVCRT_EINVAL)
1095 #endif
1097 #define MSVCRT__ARGMAX 100
1098 typedef int (*puts_clbk_a)(void*, int, const char*);
1099 typedef int (*puts_clbk_w)(void*, int, const MSVCRT_wchar_t*);
1100 typedef union _printf_arg
1102 void *get_ptr;
1103 int get_int;
1104 LONGLONG get_longlong;
1105 double get_double;
1106 } printf_arg;
1107 typedef printf_arg (*args_clbk)(void*, int, int, __ms_va_list*);
1108 int pf_printf_a(puts_clbk_a, void*, const char*, MSVCRT__locale_t,
1109 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1110 int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t,
1111 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1112 printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
1114 #define MSVCRT_FLT_MIN 1.175494351e-38F
1115 #define MSVCRT_DBL_MIN 2.2250738585072014e-308
1116 #define MSVCRT__OVERFLOW 3
1117 #define MSVCRT__UNDERFLOW 4
1119 typedef struct
1121 float f;
1122 } MSVCRT__CRT_FLOAT;
1124 typedef struct
1126 double x;
1127 } MSVCRT__CRT_DOUBLE;
1129 extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
1131 /* __unDName/__unDNameEx flags */
1132 #define UNDNAME_COMPLETE (0x0000)
1133 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
1134 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
1135 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
1136 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1137 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1138 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1139 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1140 #define UNDNAME_NO_THISTYPE (0x0060)
1141 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
1142 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1143 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
1144 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1145 #define UNDNAME_32_BIT_DECODE (0x0800)
1146 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
1147 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
1148 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1149 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
1151 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
1152 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
1153 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004)
1154 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
1155 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
1157 #define UCRTBASE_PRINTF_MASK (0x001F)
1159 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100)
1160 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200)
1162 #define UCRTBASE_SCANF_SECURECRT (0x0001)
1163 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002)
1164 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004)
1166 #define UCRTBASE_SCANF_MASK (0x0007)
1168 #endif /* __WINE_MSVCRT_H */