msvcrt: Use WINAPIV calling convention for variadic functions.
[wine.git] / dlls / msvcrt / msvcrt.h
blob1b117c8392937780b0f9cf080ce7b9e22a178683
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];
269 #if _MSVCR_VER >= 140
270 MSVCRT_invalid_parameter_handler invalid_parameter_handler;
271 #endif
274 typedef struct __thread_data thread_data_t;
276 extern thread_data_t *msvcrt_get_thread_data(void) DECLSPEC_HIDDEN;
278 LCID MSVCRT_locale_to_LCID(const char*, unsigned short*) DECLSPEC_HIDDEN;
279 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN;
280 extern unsigned int MSVCRT___lc_codepage;
281 extern int MSVCRT___lc_collate_cp;
282 extern WORD MSVCRT__ctype [257];
284 void msvcrt_set_errno(int) DECLSPEC_HIDDEN;
285 #if _MSVCR_VER >= 80
286 typedef enum {
287 EXCEPTION_BAD_ALLOC,
288 #if _MSVCR_VER >= 100
289 EXCEPTION_SCHEDULER_RESOURCE_ALLOCATION_ERROR,
290 EXCEPTION_IMPROPER_LOCK,
291 EXCEPTION_INVALID_SCHEDULER_POLICY_KEY,
292 EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE,
293 EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION,
294 EXCEPTION_IMPROPER_SCHEDULER_ATTACH,
295 EXCEPTION_IMPROPER_SCHEDULER_DETACH,
296 #endif
297 } exception_type;
298 void throw_exception(exception_type, HRESULT, const char*) DECLSPEC_HIDDEN;
299 #endif
301 void __cdecl _purecall(void);
302 void __cdecl _amsg_exit(int errnum);
304 extern char **MSVCRT__environ;
305 extern MSVCRT_wchar_t **MSVCRT__wenviron;
307 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN;
308 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **) DECLSPEC_HIDDEN;
310 MSVCRT_wchar_t *msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN;
312 extern unsigned int MSVCRT__commode;
314 /* FIXME: This should be declared in new.h but it's not an extern "C" so
315 * it would not be much use anyway. Even for Winelib applications.
317 int __cdecl MSVCRT__set_new_mode(int mode);
319 void* __cdecl MSVCRT_operator_new(MSVCRT_size_t);
320 void __cdecl MSVCRT_operator_delete(void*);
322 typedef void* (__cdecl *malloc_func_t)(MSVCRT_size_t);
323 typedef void (__cdecl *free_func_t)(void*);
325 /* Setup and teardown multi threaded locks */
326 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN;
327 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN;
329 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN;
330 extern BOOL msvcrt_init_locale(void) DECLSPEC_HIDDEN;
331 extern void msvcrt_init_math(void) DECLSPEC_HIDDEN;
332 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN;
333 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN;
334 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN;
335 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN;
336 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN;
337 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN;
338 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN;
339 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN;
340 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN;
341 extern BOOL msvcrt_init_heap(void) DECLSPEC_HIDDEN;
342 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN;
344 #if _MSVCR_VER >= 100
345 extern void msvcrt_init_scheduler(void*) DECLSPEC_HIDDEN;
346 extern void msvcrt_free_scheduler(void) DECLSPEC_HIDDEN;
347 extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN;
348 #endif
350 extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
352 extern unsigned int __cdecl _control87(unsigned int, unsigned int);
354 /* run-time error codes */
355 #define _RT_STACK 0
356 #define _RT_NULLPTR 1
357 #define _RT_FLOAT 2
358 #define _RT_INTDIV 3
359 #define _RT_EXECMEM 5
360 #define _RT_EXECFORM 6
361 #define _RT_EXECENV 7
362 #define _RT_SPACEARG 8
363 #define _RT_SPACEENV 9
364 #define _RT_ABORT 10
365 #define _RT_NPTR 12
366 #define _RT_FPTR 13
367 #define _RT_BREAK 14
368 #define _RT_INT 15
369 #define _RT_THREAD 16
370 #define _RT_LOCK 17
371 #define _RT_HEAP 18
372 #define _RT_OPENCON 19
373 #define _RT_QWIN 20
374 #define _RT_NOMAIN 21
375 #define _RT_NONCONT 22
376 #define _RT_INVALDISP 23
377 #define _RT_ONEXIT 24
378 #define _RT_PUREVIRT 25
379 #define _RT_STDIOINIT 26
380 #define _RT_LOWIOINIT 27
381 #define _RT_HEAPINIT 28
382 #define _RT_DOMAIN 120
383 #define _RT_SING 121
384 #define _RT_TLOSS 122
385 #define _RT_CRNL 252
386 #define _RT_BANNER 255
388 struct MSVCRT___timeb32 {
389 MSVCRT___time32_t time;
390 unsigned short millitm;
391 short timezone;
392 short dstflag;
395 struct MSVCRT___timeb64 {
396 MSVCRT___time64_t time;
397 unsigned short millitm;
398 short timezone;
399 short dstflag;
402 struct MSVCRT__iobuf {
403 char* _ptr;
404 int _cnt;
405 char* _base;
406 int _flag;
407 int _file;
408 int _charbuf;
409 int _bufsiz;
410 char* _tmpfname;
413 typedef struct MSVCRT__iobuf MSVCRT_FILE;
415 struct MSVCRT_lconv {
416 char* decimal_point;
417 char* thousands_sep;
418 char* grouping;
419 char* int_curr_symbol;
420 char* currency_symbol;
421 char* mon_decimal_point;
422 char* mon_thousands_sep;
423 char* mon_grouping;
424 char* positive_sign;
425 char* negative_sign;
426 char int_frac_digits;
427 char frac_digits;
428 char p_cs_precedes;
429 char p_sep_by_space;
430 char n_cs_precedes;
431 char n_sep_by_space;
432 char p_sign_posn;
433 char n_sign_posn;
434 #if _MSVCR_VER >= 100
435 MSVCRT_wchar_t* _W_decimal_point;
436 MSVCRT_wchar_t* _W_thousands_sep;
437 MSVCRT_wchar_t* _W_int_curr_symbol;
438 MSVCRT_wchar_t* _W_currency_symbol;
439 MSVCRT_wchar_t* _W_mon_decimal_point;
440 MSVCRT_wchar_t* _W_mon_thousands_sep;
441 MSVCRT_wchar_t* _W_positive_sign;
442 MSVCRT_wchar_t* _W_negative_sign;
443 #endif
446 struct MSVCRT__exception {
447 int type;
448 char* name;
449 double arg1;
450 double arg2;
451 double retval;
454 struct MSVCRT__complex {
455 double x; /* Real part */
456 double y; /* Imaginary part */
459 typedef struct MSVCRT__div_t {
460 int quot; /* quotient */
461 int rem; /* remainder */
462 } MSVCRT_div_t;
464 typedef struct MSVCRT__ldiv_t {
465 MSVCRT_long quot; /* quotient */
466 MSVCRT_long rem; /* remainder */
467 } MSVCRT_ldiv_t;
469 typedef struct MSVCRT__lldiv_t {
470 MSVCRT_longlong quot; /* quotient */
471 MSVCRT_longlong rem; /* remainder */
472 } MSVCRT_lldiv_t;
474 struct MSVCRT__heapinfo {
475 int* _pentry;
476 MSVCRT_size_t _size;
477 int _useflag;
480 #ifdef __i386__
481 struct MSVCRT___JUMP_BUFFER {
482 unsigned long Ebp;
483 unsigned long Ebx;
484 unsigned long Edi;
485 unsigned long Esi;
486 unsigned long Esp;
487 unsigned long Eip;
488 unsigned long Registration;
489 unsigned long TryLevel;
490 /* Start of new struct members */
491 unsigned long Cookie;
492 unsigned long UnwindFunc;
493 unsigned long UnwindData[6];
495 #elif defined(__x86_64__)
496 struct MSVCRT__SETJMP_FLOAT128
498 unsigned __int64 DECLSPEC_ALIGN(16) Part[2];
500 struct MSVCRT___JUMP_BUFFER
502 unsigned __int64 Frame;
503 unsigned __int64 Rbx;
504 unsigned __int64 Rsp;
505 unsigned __int64 Rbp;
506 unsigned __int64 Rsi;
507 unsigned __int64 Rdi;
508 unsigned __int64 R12;
509 unsigned __int64 R13;
510 unsigned __int64 R14;
511 unsigned __int64 R15;
512 unsigned __int64 Rip;
513 unsigned __int64 Spare;
514 struct MSVCRT__SETJMP_FLOAT128 Xmm6;
515 struct MSVCRT__SETJMP_FLOAT128 Xmm7;
516 struct MSVCRT__SETJMP_FLOAT128 Xmm8;
517 struct MSVCRT__SETJMP_FLOAT128 Xmm9;
518 struct MSVCRT__SETJMP_FLOAT128 Xmm10;
519 struct MSVCRT__SETJMP_FLOAT128 Xmm11;
520 struct MSVCRT__SETJMP_FLOAT128 Xmm12;
521 struct MSVCRT__SETJMP_FLOAT128 Xmm13;
522 struct MSVCRT__SETJMP_FLOAT128 Xmm14;
523 struct MSVCRT__SETJMP_FLOAT128 Xmm15;
525 #elif defined(__arm__)
526 struct MSVCRT___JUMP_BUFFER
528 unsigned long Frame;
529 unsigned long R4;
530 unsigned long R5;
531 unsigned long R6;
532 unsigned long R7;
533 unsigned long R8;
534 unsigned long R9;
535 unsigned long R10;
536 unsigned long R11;
537 unsigned long Sp;
538 unsigned long Pc;
539 unsigned long Fpscr;
540 unsigned long long D[8];
542 #elif defined(__aarch64__)
543 struct MSVCRT___JUMP_BUFFER
545 unsigned __int64 Frame;
546 unsigned __int64 Reserved;
547 unsigned __int64 X19;
548 unsigned __int64 X20;
549 unsigned __int64 X21;
550 unsigned __int64 X22;
551 unsigned __int64 X23;
552 unsigned __int64 X24;
553 unsigned __int64 X25;
554 unsigned __int64 X26;
555 unsigned __int64 X27;
556 unsigned __int64 X28;
557 unsigned __int64 Fp;
558 unsigned __int64 Lr;
559 unsigned __int64 Sp;
560 unsigned long Fpcr;
561 unsigned long Fpsr;
562 double D[8];
564 #endif /* __i386__ */
566 struct MSVCRT__diskfree_t {
567 unsigned int total_clusters;
568 unsigned int avail_clusters;
569 unsigned int sectors_per_cluster;
570 unsigned int bytes_per_sector;
573 struct MSVCRT__finddata32_t {
574 unsigned int attrib;
575 MSVCRT___time32_t time_create;
576 MSVCRT___time32_t time_access;
577 MSVCRT___time32_t time_write;
578 MSVCRT__fsize_t size;
579 char name[260];
582 struct MSVCRT__finddata32i64_t {
583 unsigned int attrib;
584 MSVCRT___time32_t time_create;
585 MSVCRT___time32_t time_access;
586 MSVCRT___time32_t time_write;
587 __int64 DECLSPEC_ALIGN(8) size;
588 char name[260];
591 struct MSVCRT__finddata64i32_t {
592 unsigned int attrib;
593 MSVCRT___time64_t time_create;
594 MSVCRT___time64_t time_access;
595 MSVCRT___time64_t time_write;
596 MSVCRT__fsize_t size;
597 char name[260];
600 struct MSVCRT__finddata64_t {
601 unsigned int attrib;
602 MSVCRT___time64_t time_create;
603 MSVCRT___time64_t time_access;
604 MSVCRT___time64_t time_write;
605 __int64 DECLSPEC_ALIGN(8) size;
606 char name[260];
609 struct MSVCRT__wfinddata32_t {
610 unsigned int attrib;
611 MSVCRT___time32_t time_create;
612 MSVCRT___time32_t time_access;
613 MSVCRT___time32_t time_write;
614 MSVCRT__fsize_t size;
615 MSVCRT_wchar_t name[260];
618 struct MSVCRT__wfinddata32i64_t {
619 unsigned int attrib;
620 MSVCRT___time32_t time_create;
621 MSVCRT___time32_t time_access;
622 MSVCRT___time32_t time_write;
623 __int64 DECLSPEC_ALIGN(8) size;
624 MSVCRT_wchar_t name[260];
627 struct MSVCRT__wfinddata64i32_t {
628 unsigned int attrib;
629 MSVCRT___time64_t time_create;
630 MSVCRT___time64_t time_access;
631 MSVCRT___time64_t time_write;
632 MSVCRT__fsize_t size;
633 MSVCRT_wchar_t name[260];
636 struct MSVCRT__wfinddata64_t {
637 unsigned int attrib;
638 MSVCRT___time64_t time_create;
639 MSVCRT___time64_t time_access;
640 MSVCRT___time64_t time_write;
641 __int64 DECLSPEC_ALIGN(8) size;
642 MSVCRT_wchar_t name[260];
645 struct MSVCRT___utimbuf32
647 MSVCRT___time32_t actime;
648 MSVCRT___time32_t modtime;
651 struct MSVCRT___utimbuf64
653 MSVCRT___time64_t actime;
654 MSVCRT___time64_t modtime;
657 /* for FreeBSD */
658 #undef st_atime
659 #undef st_ctime
660 #undef st_mtime
662 struct MSVCRT__stat32 {
663 MSVCRT__dev_t st_dev;
664 MSVCRT__ino_t st_ino;
665 unsigned short st_mode;
666 short st_nlink;
667 short st_uid;
668 short st_gid;
669 MSVCRT__dev_t st_rdev;
670 MSVCRT__off_t st_size;
671 MSVCRT___time32_t st_atime;
672 MSVCRT___time32_t st_mtime;
673 MSVCRT___time32_t st_ctime;
676 struct MSVCRT__stat32i64 {
677 MSVCRT__dev_t st_dev;
678 MSVCRT__ino_t st_ino;
679 unsigned short st_mode;
680 short st_nlink;
681 short st_uid;
682 short st_gid;
683 MSVCRT__dev_t st_rdev;
684 __int64 DECLSPEC_ALIGN(8) st_size;
685 MSVCRT___time32_t st_atime;
686 MSVCRT___time32_t st_mtime;
687 MSVCRT___time32_t st_ctime;
690 struct MSVCRT__stat64i32 {
691 MSVCRT__dev_t st_dev;
692 MSVCRT__ino_t st_ino;
693 unsigned short st_mode;
694 short st_nlink;
695 short st_uid;
696 short st_gid;
697 MSVCRT__dev_t st_rdev;
698 MSVCRT__off_t st_size;
699 MSVCRT___time64_t st_atime;
700 MSVCRT___time64_t st_mtime;
701 MSVCRT___time64_t st_ctime;
704 struct MSVCRT__stat64 {
705 MSVCRT__dev_t st_dev;
706 MSVCRT__ino_t st_ino;
707 unsigned short st_mode;
708 short st_nlink;
709 short st_uid;
710 short st_gid;
711 MSVCRT__dev_t st_rdev;
712 __int64 DECLSPEC_ALIGN(8) st_size;
713 MSVCRT___time64_t st_atime;
714 MSVCRT___time64_t st_mtime;
715 MSVCRT___time64_t st_ctime;
718 #ifdef _WIN64
719 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
720 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
721 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
722 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
723 #define MSVCRT__stat MSVCRT__stat64i32
724 #define MSVCRT__stati64 MSVCRT__stat64
725 #else
726 #define MSVCRT__finddata_t MSVCRT__finddata32_t
727 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
728 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
729 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
730 #define MSVCRT__stat MSVCRT__stat32
731 #define MSVCRT__stati64 MSVCRT__stat32i64
732 #endif
734 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
735 #define MSVCRT_EOF (-1)
736 #define MSVCRT_TMP_MAX 0x7fff
737 #define MSVCRT_TMP_MAX_S 0x7fffffff
738 #define MSVCRT_RAND_MAX 0x7fff
739 #define MSVCRT_BUFSIZ 512
741 #define MSVCRT_SEEK_SET 0
742 #define MSVCRT_SEEK_CUR 1
743 #define MSVCRT_SEEK_END 2
745 #define MSVCRT_STDIN_FILENO 0
746 #define MSVCRT_STDOUT_FILENO 1
747 #define MSVCRT_STDERR_FILENO 2
749 /* more file._flag flags, but these conflict with Unix */
750 #define MSVCRT__IOFBF 0x0000
751 #define MSVCRT__IONBF 0x0004
752 #define MSVCRT__IOLBF 0x0040
754 #define MSVCRT_FILENAME_MAX 260
755 #define MSVCRT_DRIVE_MAX 3
756 #define MSVCRT_FNAME_MAX 256
757 #define MSVCRT_DIR_MAX 256
758 #define MSVCRT_EXT_MAX 256
759 #define MSVCRT_PATH_MAX 260
760 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
761 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
762 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
764 #define MSVCRT__P_WAIT 0
765 #define MSVCRT__P_NOWAIT 1
766 #define MSVCRT__P_OVERLAY 2
767 #define MSVCRT__P_NOWAITO 3
768 #define MSVCRT__P_DETACH 4
770 #define MSVCRT_EPERM 1
771 #define MSVCRT_ENOENT 2
772 #define MSVCRT_ESRCH 3
773 #define MSVCRT_EINTR 4
774 #define MSVCRT_EIO 5
775 #define MSVCRT_ENXIO 6
776 #define MSVCRT_E2BIG 7
777 #define MSVCRT_ENOEXEC 8
778 #define MSVCRT_EBADF 9
779 #define MSVCRT_ECHILD 10
780 #define MSVCRT_EAGAIN 11
781 #define MSVCRT_ENOMEM 12
782 #define MSVCRT_EACCES 13
783 #define MSVCRT_EFAULT 14
784 #define MSVCRT_EBUSY 16
785 #define MSVCRT_EEXIST 17
786 #define MSVCRT_EXDEV 18
787 #define MSVCRT_ENODEV 19
788 #define MSVCRT_ENOTDIR 20
789 #define MSVCRT_EISDIR 21
790 #define MSVCRT_EINVAL 22
791 #define MSVCRT_ENFILE 23
792 #define MSVCRT_EMFILE 24
793 #define MSVCRT_ENOTTY 25
794 #define MSVCRT_EFBIG 27
795 #define MSVCRT_ENOSPC 28
796 #define MSVCRT_ESPIPE 29
797 #define MSVCRT_EROFS 30
798 #define MSVCRT_EMLINK 31
799 #define MSVCRT_EPIPE 32
800 #define MSVCRT_EDOM 33
801 #define MSVCRT_ERANGE 34
802 #define MSVCRT_EDEADLK 36
803 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
804 #define MSVCRT_ENAMETOOLONG 38
805 #define MSVCRT_ENOLCK 39
806 #define MSVCRT_ENOSYS 40
807 #define MSVCRT_ENOTEMPTY 41
808 #define MSVCRT_EILSEQ 42
809 #define MSVCRT_STRUNCATE 80
811 #define MSVCRT_LC_ALL 0
812 #define MSVCRT_LC_COLLATE 1
813 #define MSVCRT_LC_CTYPE 2
814 #define MSVCRT_LC_MONETARY 3
815 #define MSVCRT_LC_NUMERIC 4
816 #define MSVCRT_LC_TIME 5
817 #define MSVCRT_LC_MIN MSVCRT_LC_ALL
818 #define MSVCRT_LC_MAX MSVCRT_LC_TIME
820 #define MSVCRT__HEAPEMPTY -1
821 #define MSVCRT__HEAPOK -2
822 #define MSVCRT__HEAPBADBEGIN -3
823 #define MSVCRT__HEAPBADNODE -4
824 #define MSVCRT__HEAPEND -5
825 #define MSVCRT__HEAPBADPTR -6
827 #define MSVCRT__FREEENTRY 0
828 #define MSVCRT__USEDENTRY 1
830 #define MSVCRT__OUT_TO_DEFAULT 0
831 #define MSVCRT__OUT_TO_STDERR 1
832 #define MSVCRT__OUT_TO_MSGBOX 2
833 #define MSVCRT__REPORT_ERRMODE 3
835 /* ASCII char classification table - binary compatible */
836 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */
837 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */
838 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
839 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */
840 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
841 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
842 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */
843 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
844 #define MSVCRT__LEADBYTE 0x8000
845 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
847 #define MSVCRT__IOREAD 0x0001
848 #define MSVCRT__IOWRT 0x0002
849 #define MSVCRT__IOMYBUF 0x0008
850 #define MSVCRT__IOEOF 0x0010
851 #define MSVCRT__IOERR 0x0020
852 #define MSVCRT__IOSTRG 0x0040
853 #define MSVCRT__IORW 0x0080
854 #define MSVCRT__USERBUF 0x0100
855 #define MSVCRT__IOCOMMIT 0x4000
857 #define MSVCRT__S_IEXEC 0x0040
858 #define MSVCRT__S_IWRITE 0x0080
859 #define MSVCRT__S_IREAD 0x0100
860 #define MSVCRT__S_IFIFO 0x1000
861 #define MSVCRT__S_IFCHR 0x2000
862 #define MSVCRT__S_IFDIR 0x4000
863 #define MSVCRT__S_IFREG 0x8000
864 #define MSVCRT__S_IFMT 0xF000
866 #define MSVCRT__LK_UNLCK 0
867 #define MSVCRT__LK_LOCK 1
868 #define MSVCRT__LK_NBLCK 2
869 #define MSVCRT__LK_RLCK 3
870 #define MSVCRT__LK_NBRLCK 4
872 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
873 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
874 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
875 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
876 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
878 #define MSVCRT__O_RDONLY 0
879 #define MSVCRT__O_WRONLY 1
880 #define MSVCRT__O_RDWR 2
881 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
882 #define MSVCRT__O_APPEND 0x0008
883 #define MSVCRT__O_RANDOM 0x0010
884 #define MSVCRT__O_SEQUENTIAL 0x0020
885 #define MSVCRT__O_TEMPORARY 0x0040
886 #define MSVCRT__O_NOINHERIT 0x0080
887 #define MSVCRT__O_CREAT 0x0100
888 #define MSVCRT__O_TRUNC 0x0200
889 #define MSVCRT__O_EXCL 0x0400
890 #define MSVCRT__O_SHORT_LIVED 0x1000
891 #define MSVCRT__O_TEXT 0x4000
892 #define MSVCRT__O_BINARY 0x8000
893 #define MSVCRT__O_RAW MSVCRT__O_BINARY
894 #define MSVCRT__O_WTEXT 0x10000
895 #define MSVCRT__O_U16TEXT 0x20000
896 #define MSVCRT__O_U8TEXT 0x40000
898 /* _statusfp bit flags */
899 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
900 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
901 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
902 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
903 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */
905 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
906 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
907 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
908 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
910 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
912 /* fpclass constants */
913 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
914 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
915 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
916 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
917 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
918 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
919 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
920 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
921 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
922 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
924 /* fpclassify constants */
925 #define MSVCRT_FP_INFINITE 1
926 #define MSVCRT_FP_NAN 2
927 #define MSVCRT_FP_NORMAL -1
928 #define MSVCRT_FP_SUBNORMAL -2
929 #define MSVCRT_FP_ZERO 0
931 #define MSVCRT__MCW_EM 0x0008001f
932 #define MSVCRT__MCW_IC 0x00040000
933 #define MSVCRT__MCW_RC 0x00000300
934 #define MSVCRT__MCW_PC 0x00030000
935 #define MSVCRT__MCW_DN 0x03000000
937 #define MSVCRT__EM_INVALID 0x00000010
938 #define MSVCRT__EM_DENORMAL 0x00080000
939 #define MSVCRT__EM_ZERODIVIDE 0x00000008
940 #define MSVCRT__EM_OVERFLOW 0x00000004
941 #define MSVCRT__EM_UNDERFLOW 0x00000002
942 #define MSVCRT__EM_INEXACT 0x00000001
943 #define MSVCRT__IC_AFFINE 0x00040000
944 #define MSVCRT__IC_PROJECTIVE 0x00000000
945 #define MSVCRT__RC_CHOP 0x00000300
946 #define MSVCRT__RC_UP 0x00000200
947 #define MSVCRT__RC_DOWN 0x00000100
948 #define MSVCRT__RC_NEAR 0x00000000
949 #define MSVCRT__PC_24 0x00020000
950 #define MSVCRT__PC_53 0x00010000
951 #define MSVCRT__PC_64 0x00000000
952 #define MSVCRT__DN_SAVE 0x00000000
953 #define MSVCRT__DN_FLUSH 0x01000000
954 #define MSVCRT__DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000
955 #define MSVCRT__DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000
956 #define MSVCRT__EM_AMBIGUOUS 0x80000000
958 typedef struct
960 unsigned int control;
961 unsigned int status;
962 } MSVCRT_fenv_t;
964 #define MSVCRT_CLOCKS_PER_SEC 1000
966 /* signals */
967 #define MSVCRT_SIGINT 2
968 #define MSVCRT_SIGILL 4
969 #define MSVCRT_SIGFPE 8
970 #define MSVCRT_SIGSEGV 11
971 #define MSVCRT_SIGTERM 15
972 #define MSVCRT_SIGBREAK 21
973 #define MSVCRT_SIGABRT 22
974 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
976 typedef void (__cdecl *MSVCRT___sighandler_t)(int);
978 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
979 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
980 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
982 #define MSVCRT__FPE_INVALID 0x81
983 #define MSVCRT__FPE_DENORMAL 0x82
984 #define MSVCRT__FPE_ZERODIVIDE 0x83
985 #define MSVCRT__FPE_OVERFLOW 0x84
986 #define MSVCRT__FPE_UNDERFLOW 0x85
987 #define MSVCRT__FPE_INEXACT 0x86
988 #define MSVCRT__FPE_UNEMULATED 0x87
989 #define MSVCRT__FPE_SQRTNEG 0x88
990 #define MSVCRT__FPE_STACKOVERFLOW 0x8a
991 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b
992 #define MSVCRT__FPE_EXPLICITGEN 0x8c
994 #define _MS 0x01
995 #define _MP 0x02
996 #define _M1 0x04
997 #define _M2 0x08
999 #define _SBUP 0x10
1000 #define _SBLOW 0x20
1002 #define _MBC_SINGLE 0
1003 #define _MBC_LEAD 1
1004 #define _MBC_TRAIL 2
1005 #define _MBC_ILLEGAL -1
1007 #define _MB_CP_SBCS 0
1008 #define _MB_CP_OEM -2
1009 #define _MB_CP_ANSI -3
1010 #define _MB_CP_LOCALE -4
1012 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1)
1014 #define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF)
1016 /* _set_abort_behavior codes */
1017 #define MSVCRT__WRITE_ABORT_MSG 1
1018 #define MSVCRT__CALL_REPORTFAULT 2
1020 /* _get_output_format return code */
1021 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1
1023 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
1025 void __cdecl MSVCRT_free(void*);
1026 void* __cdecl MSVCRT_malloc(MSVCRT_size_t);
1027 void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
1028 void* __cdecl MSVCRT_realloc(void*,MSVCRT_size_t);
1030 int __cdecl MSVCRT_iswalpha(MSVCRT_wint_t);
1031 int __cdecl MSVCRT_iswspace(MSVCRT_wint_t);
1032 int __cdecl MSVCRT_iswdigit(MSVCRT_wint_t);
1033 int __cdecl MSVCRT_isleadbyte(int);
1034 int __cdecl MSVCRT__isleadbyte_l(int, MSVCRT__locale_t);
1036 void __cdecl MSVCRT__lock_file(MSVCRT_FILE*);
1037 void __cdecl MSVCRT__unlock_file(MSVCRT_FILE*);
1038 int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
1039 int __cdecl MSVCRT__fgetc_nolock(MSVCRT_FILE*);
1040 int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
1041 int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
1042 int __cdecl MSVCRT__ungetc_nolock(int,MSVCRT_FILE*);
1043 MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
1044 MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*);
1045 MSVCRT_wint_t __cdecl MSVCRT__fputwc_nolock(MSVCRT_wint_t,MSVCRT_FILE*);
1046 MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
1047 MSVCRT_wint_t __cdecl MSVCRT__ungetwc_nolock(MSVCRT_wint_t, MSVCRT_FILE*);
1048 int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
1049 __int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
1050 __int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*);
1051 void __cdecl MSVCRT__exit(int);
1052 void __cdecl MSVCRT_abort(void);
1053 MSVCRT_ulong* __cdecl MSVCRT___doserrno(void);
1054 int* __cdecl MSVCRT__errno(void);
1055 char* __cdecl MSVCRT_getenv(const char*);
1056 MSVCRT_size_t __cdecl MSVCRT__fread_nolock(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1057 MSVCRT_size_t __cdecl MSVCRT__fread_nolock_s(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1058 MSVCRT_size_t __cdecl MSVCRT__fwrite_nolock(const void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1059 int __cdecl MSVCRT_fclose(MSVCRT_FILE*);
1060 int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*);
1061 int __cdecl MSVCRT__fflush_nolock(MSVCRT_FILE*);
1062 void __cdecl MSVCRT_terminate(void);
1063 MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
1064 MSVCRT_clock_t __cdecl MSVCRT_clock(void);
1065 MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
1066 MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
1067 MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
1068 MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
1069 int __cdecl MSVCRT_vsnprintf(char *str, MSVCRT_size_t len, const char *format, __ms_va_list valist);
1070 int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, MSVCRT_size_t len,
1071 const MSVCRT_wchar_t *format, __ms_va_list valist );
1072 int WINAPIV MSVCRT__snwprintf(MSVCRT_wchar_t*, unsigned int, const MSVCRT_wchar_t*, ...);
1073 int WINAPIV MSVCRT_sprintf(char*,const char*,...);
1074 int WINAPIV MSVCRT__snprintf(char*,unsigned int,const char*,...);
1075 int WINAPIV MSVCRT__scprintf(const char*,...);
1076 int __cdecl MSVCRT_raise(int sig);
1077 int __cdecl MSVCRT__set_printf_count_output(int);
1079 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
1080 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
1082 extern MSVCRT__locale_t MSVCRT_locale;
1083 MSVCRT_pthreadlocinfo get_locinfo(void) DECLSPEC_HIDDEN;
1084 MSVCRT_pthreadmbcinfo get_mbcinfo(void) DECLSPEC_HIDDEN;
1085 void __cdecl MSVCRT__free_locale(MSVCRT__locale_t);
1086 void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN;
1087 void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1088 int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1090 #ifndef __WINE_MSVCRT_TEST
1091 int __cdecl MSVCRT__write(int,const void*,unsigned int);
1092 int __cdecl _getch(void);
1093 int __cdecl _ismbblead(unsigned int);
1094 int __cdecl _ismbblead_l(unsigned int, MSVCRT__locale_t);
1095 int __cdecl _ismbclegal(unsigned int c);
1096 int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
1097 int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1098 MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1099 MSVCRT_size_t __cdecl MSVCRT__mbstowcs_l(MSVCRT_wchar_t*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1100 MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t);
1101 MSVCRT_size_t __cdecl MSVCRT__wcstombs_l(char*, const MSVCRT_wchar_t*, MSVCRT_size_t, MSVCRT__locale_t);
1102 MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
1103 MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
1104 MSVCRT_intptr_t __cdecl MSVCRT__wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1105 MSVCRT_intptr_t __cdecl MSVCRT__wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1106 void __cdecl MSVCRT__searchenv(const char*,const char*,char*);
1107 int __cdecl MSVCRT__getdrive(void);
1108 char* __cdecl MSVCRT__strdup(const char*);
1109 char* __cdecl MSVCRT__strnset(char*,int,MSVCRT_size_t);
1110 char* __cdecl _strset(char*,int);
1111 int __cdecl _ungetch(int);
1112 int __cdecl _cputs(const char*);
1113 int WINAPIV _cprintf(const char*,...);
1114 int WINAPIV _cwprintf(const MSVCRT_wchar_t*,...);
1115 char*** __cdecl MSVCRT___p__environ(void);
1116 int* __cdecl __p___mb_cur_max(void);
1117 unsigned int* __cdecl __p__fmode(void);
1118 MSVCRT_wchar_t* __cdecl MSVCRT__wcsdup(const MSVCRT_wchar_t*);
1119 MSVCRT_size_t __cdecl MSVCRT_strnlen(const char *,MSVCRT_size_t);
1120 MSVCRT_size_t __cdecl MSVCRT_wcsnlen(const MSVCRT_wchar_t*,MSVCRT_size_t);
1121 MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void);
1122 INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t);
1123 char* __cdecl MSVCRT__strdate(char* date);
1124 char* __cdecl MSVCRT__strtime(char* date);
1125 int __cdecl _setmbcp(int);
1126 int __cdecl MSVCRT__close(int);
1127 int __cdecl MSVCRT__dup(int);
1128 int __cdecl MSVCRT__dup2(int, int);
1129 int __cdecl MSVCRT__pipe(int *, unsigned int, int);
1130 MSVCRT_wchar_t* __cdecl MSVCRT__wgetenv(const MSVCRT_wchar_t*);
1131 void __cdecl MSVCRT__wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*);
1132 MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
1133 void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
1134 const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
1135 int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t);
1136 int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t);
1137 int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1138 int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1139 unsigned int __cdecl MSVCRT__get_output_format(void);
1140 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
1142 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
1143 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
1144 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE)
1145 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending
1146 * any information
1147 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around MSVCRT__invalid_parameter in order
1148 * to do the Ansi to Unicode transformation
1150 #define MSVCRT_INVALID_PMT(x,err) (*MSVCRT__errno() = (err), MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0))
1151 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
1152 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), MSVCRT_EINVAL)
1153 #endif
1155 #define MSVCRT__ARGMAX 100
1156 typedef int (*puts_clbk_a)(void*, int, const char*);
1157 typedef int (*puts_clbk_w)(void*, int, const MSVCRT_wchar_t*);
1158 typedef union _printf_arg
1160 void *get_ptr;
1161 int get_int;
1162 LONGLONG get_longlong;
1163 double get_double;
1164 } printf_arg;
1165 typedef printf_arg (*args_clbk)(void*, int, int, __ms_va_list*);
1166 int pf_printf_a(puts_clbk_a, void*, const char*, MSVCRT__locale_t,
1167 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1168 int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t,
1169 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1170 int create_positional_ctx_a(void*, const char*, __ms_va_list) DECLSPEC_HIDDEN;
1171 int create_positional_ctx_w(void*, const MSVCRT_wchar_t*, __ms_va_list) DECLSPEC_HIDDEN;
1172 printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
1173 printf_arg arg_clbk_positional(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
1175 #define MSVCRT_FLT_MIN 1.175494351e-38F
1176 #define MSVCRT_DBL_MIN 2.2250738585072014e-308
1177 #define MSVCRT__OVERFLOW 3
1178 #define MSVCRT__UNDERFLOW 4
1180 typedef struct
1182 float f;
1183 } MSVCRT__CRT_FLOAT;
1185 typedef struct
1187 double x;
1188 } MSVCRT__CRT_DOUBLE;
1190 extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
1192 /* __unDName/__unDNameEx flags */
1193 #define UNDNAME_COMPLETE (0x0000)
1194 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
1195 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
1196 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
1197 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1198 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1199 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1200 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1201 #define UNDNAME_NO_THISTYPE (0x0060)
1202 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
1203 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1204 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
1205 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1206 #define UNDNAME_32_BIT_DECODE (0x0800)
1207 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
1208 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
1209 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1210 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
1212 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
1213 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
1214 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004)
1215 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
1216 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
1218 #define UCRTBASE_PRINTF_MASK (0x001F)
1220 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100)
1221 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200)
1223 #define UCRTBASE_SCANF_SECURECRT (0x0001)
1224 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002)
1225 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004)
1227 #define UCRTBASE_SCANF_MASK (0x0007)
1229 #define COOPERATIVE_TIMEOUT_INFINITE ((unsigned int)-1)
1230 #define COOPERATIVE_WAIT_TIMEOUT ~0
1232 typedef enum {
1233 _FpCodeUnspecified,
1234 _FpCodeAdd,
1235 _FpCodeSubtract,
1236 _FpCodeMultiply,
1237 _FpCodeDivide,
1238 _FpCodeSquareRoot,
1239 _FpCodeRemainder,
1240 _FpCodeCompare,
1241 _FpCodeConvert,
1242 _FpCodeRound,
1243 _FpCodeTruncate,
1244 _FpCodeFloor,
1245 _FpCodeCeil,
1246 _FpCodeAcos,
1247 _FpCodeAsin,
1248 _FpCodeAtan,
1249 _FpCodeAtan2,
1250 _FpCodeCabs,
1251 _FpCodeCos,
1252 _FpCodeCosh,
1253 _FpCodeExp,
1254 _FpCodeFabs,
1255 _FpCodeFmod,
1256 _FpCodeFrexp,
1257 _FpCodeHypot,
1258 _FpCodeLdexp,
1259 _FpCodeLog,
1260 _FpCodeLog10,
1261 _FpCodeModf,
1262 _FpCodePow,
1263 _FpCodeSin,
1264 _FpCodeSinh,
1265 _FpCodeTan,
1266 _FpCodeTanh,
1267 _FpCodeY0,
1268 _FpCodeY1,
1269 _FpCodeYn,
1270 _FpCodeLogb,
1271 _FpCodeNextafter,
1272 _FpCodeNegate,
1273 _FpCodeFmin,
1274 _FpCodeFmax,
1275 _FpCodeConvertTrunc,
1276 _XMMIAddps,
1277 _XMMIAddss,
1278 _XMMISubps,
1279 _XMMISubss,
1280 _XMMIMulps,
1281 _XMMIMulss,
1282 _XMMIDivps,
1283 _XMMIDivss,
1284 _XMMISqrtps,
1285 _XMMISqrtss,
1286 _XMMIMaxps,
1287 _XMMIMaxss,
1288 _XMMIMinps,
1289 _XMMIMinss,
1290 _XMMICmpps,
1291 _XMMICmpss,
1292 _XMMIComiss,
1293 _XMMIUComiss,
1294 _XMMICvtpi2ps,
1295 _XMMICvtsi2ss,
1296 _XMMICvtps2pi,
1297 _XMMICvtss2si,
1298 _XMMICvttps2pi,
1299 _XMMICvttss2si,
1300 _XMMIAddsubps,
1301 _XMMIHaddps,
1302 _XMMIHsubps,
1303 _XMMI2Addpd,
1304 _XMMI2Addsd,
1305 _XMMI2Subpd,
1306 _XMMI2Subsd,
1307 _XMMI2Mulpd,
1308 _XMMI2Mulsd,
1309 _XMMI2Divpd,
1310 _XMMI2Divsd,
1311 _XMMI2Sqrtpd,
1312 _XMMI2Sqrtsd,
1313 _XMMI2Maxpd,
1314 _XMMI2Maxsd,
1315 _XMMI2Minpd,
1316 _XMMI2Minsd,
1317 _XMMI2Cmppd,
1318 _XMMI2Cmpsd,
1319 _XMMI2Comisd,
1320 _XMMI2UComisd,
1321 _XMMI2Cvtpd2pi,
1322 _XMMI2Cvtsd2si,
1323 _XMMI2Cvttpd2pi,
1324 _XMMI2Cvttsd2si,
1325 _XMMI2Cvtps2pd,
1326 _XMMI2Cvtss2sd,
1327 _XMMI2Cvtpd2ps,
1328 _XMMI2Cvtsd2ss,
1329 _XMMI2Cvtdq2ps,
1330 _XMMI2Cvttps2dq,
1331 _XMMI2Cvtps2dq,
1332 _XMMI2Cvttpd2dq,
1333 _XMMI2Cvtpd2dq,
1334 _XMMI2Addsubpd,
1335 _XMMI2Haddpd,
1336 _XMMI2Hsubpd,
1337 } _FP_OPERATION_CODE;
1339 typedef enum {
1340 _FpFormatFp32,
1341 _FpFormatFp64,
1342 _FpFormatFp80,
1343 _FpFormatFp128,
1344 _FpFormatI16,
1345 _FpFormatI32,
1346 _FpFormatI64,
1347 _FpFormatU16,
1348 _FpFormatU32,
1349 _FpFormatU64,
1350 _FpFormatBcd80,
1351 _FpFormatCompare,
1352 _FpFormatString,
1353 } _FPIEEE_FORMAT;
1355 typedef float _FP32;
1356 typedef double _FP64;
1357 typedef short _I16;
1358 typedef int _I32;
1359 typedef unsigned short _U16;
1360 typedef unsigned int _U32;
1361 typedef __int64 _Q64;
1363 typedef struct {
1364 unsigned short W[5];
1365 } _FP80;
1367 typedef struct DECLSPEC_ALIGN(16) {
1368 MSVCRT_ulong W[4];
1369 } _FP128;
1371 typedef struct DECLSPEC_ALIGN(8) {
1372 MSVCRT_ulong W[2];
1373 } _I64;
1375 typedef struct DECLSPEC_ALIGN(8) {
1376 MSVCRT_ulong W[2];
1377 } _U64;
1379 typedef struct {
1380 unsigned short W[5];
1381 } _BCD80;
1383 typedef struct DECLSPEC_ALIGN(16) {
1384 _Q64 W[2];
1385 } _FPQ64;
1387 typedef struct {
1388 union {
1389 _FP32 Fp32Value;
1390 _FP64 Fp64Value;
1391 _FP80 Fp80Value;
1392 _FP128 Fp128Value;
1393 _I16 I16Value;
1394 _I32 I32Value;
1395 _I64 I64Value;
1396 _U16 U16Value;
1397 _U32 U32Value;
1398 _U64 U64Value;
1399 _BCD80 Bcd80Value;
1400 char *StringValue;
1401 int CompareValue;
1402 _Q64 Q64Value;
1403 _FPQ64 Fpq64Value;
1404 } Value;
1405 unsigned int OperandValid : 1;
1406 unsigned int Format : 4;
1407 } _FPIEEE_VALUE;
1409 typedef struct {
1410 unsigned int Inexact : 1;
1411 unsigned int Underflow : 1;
1412 unsigned int Overflow : 1;
1413 unsigned int ZeroDivide : 1;
1414 unsigned int InvalidOperation : 1;
1415 } _FPIEEE_EXCEPTION_FLAGS;
1417 typedef struct {
1418 unsigned int RoundingMode : 2;
1419 unsigned int Precision : 3;
1420 unsigned int Operation :12;
1421 _FPIEEE_EXCEPTION_FLAGS Cause;
1422 _FPIEEE_EXCEPTION_FLAGS Enable;
1423 _FPIEEE_EXCEPTION_FLAGS Status;
1424 _FPIEEE_VALUE Operand1;
1425 _FPIEEE_VALUE Operand2;
1426 _FPIEEE_VALUE Result;
1427 } _FPIEEE_RECORD, *_PFPIEEE_RECORD;
1429 static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
1431 return HeapAlloc(GetProcessHeap(), 0, len);
1434 static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
1436 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
1439 static inline BOOL heap_free(void *mem)
1441 return HeapFree(GetProcessHeap(), 0, mem);
1444 #define INHERIT_THREAD_PRIORITY 0xF000
1445 #endif /* __WINE_MSVCRT_H */