msvcrt: Share ctype tables between threadlocinfo instances.
[wine.git] / dlls / msvcrt / msvcrt.h
blobcf1caea67296973b0d7207c605a69817e6b5355d
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_INT_MAX 0x7fffffff
45 #define MSVCRT_LONG_MAX 0x7fffffff
46 #define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
47 #define MSVCRT_ULONG_MAX 0xffffffff
48 #define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
49 #define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
50 #define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
51 #define MSVCRT_MB_LEN_MAX 5
52 #define MSVCRT_FLT_MAX_10_EXP 38
53 #define MSVCRT_FLT_MIN_10_EXP (-37)
54 #define MSVCRT_DBL_MAX_10_EXP 308
55 #define MSVCRT_DBL_MIN_10_EXP (-307)
56 #define DBL80_MAX_10_EXP 4932
57 #define DBL80_MIN_10_EXP -4951
58 #define MSVCRT_DBL_DIG 15
59 #ifdef _WIN64
60 #define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
61 #else
62 #define MSVCRT_SIZE_MAX MSVCRT_ULONG_MAX
63 #endif
65 #define MSVCRT__MAX_DRIVE 3
66 #define MSVCRT__MAX_DIR 256
67 #define MSVCRT__MAX_FNAME 256
68 #define MSVCRT__MAX_EXT 256
70 typedef unsigned char MSVCRT_bool;
71 typedef unsigned short MSVCRT_wchar_t;
72 typedef unsigned short MSVCRT_wint_t;
73 typedef unsigned short MSVCRT_wctrans_t;
74 typedef unsigned short MSVCRT_wctype_t;
75 typedef unsigned short MSVCRT__ino_t;
76 typedef unsigned int MSVCRT__fsize_t;
77 typedef int MSVCRT_long;
78 typedef unsigned int MSVCRT_ulong;
79 typedef __int64 MSVCRT_longlong;
80 typedef long long MSVCRT_intmax_t;
81 #ifdef _WIN64
82 typedef unsigned __int64 MSVCRT_size_t;
83 typedef __int64 MSVCRT_intptr_t;
84 typedef unsigned __int64 MSVCRT_uintptr_t;
85 #else
86 typedef unsigned long MSVCRT_size_t;
87 typedef long MSVCRT_intptr_t;
88 typedef unsigned long MSVCRT_uintptr_t;
89 #endif
90 #ifdef _CRTDLL
91 typedef short MSVCRT__dev_t;
92 #else
93 typedef unsigned int MSVCRT__dev_t;
94 #endif
95 typedef int MSVCRT__off_t;
96 typedef int MSVCRT_clock_t;
97 typedef int MSVCRT___time32_t;
98 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT___time64_t;
99 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT_fpos_t;
100 typedef int MSVCRT_mbstate_t;
102 typedef void (__cdecl *MSVCRT_terminate_handler)(void);
103 typedef void (__cdecl *MSVCRT_terminate_function)(void);
104 typedef void (__cdecl *MSVCRT_unexpected_handler)(void);
105 typedef void (__cdecl *MSVCRT_unexpected_function)(void);
106 typedef void (__cdecl *MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
107 typedef void (__cdecl *MSVCRT__beginthread_start_routine_t)(void *);
108 typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
109 typedef int (__cdecl *MSVCRT__onexit_t)(void);
110 typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t);
111 typedef void (__cdecl *MSVCRT_purecall_handler)(void);
112 typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *);
114 typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */
116 struct MSVCRT_tm {
117 int tm_sec;
118 int tm_min;
119 int tm_hour;
120 int tm_mday;
121 int tm_mon;
122 int tm_year;
123 int tm_wday;
124 int tm_yday;
125 int tm_isdst;
128 typedef struct MSVCRT_tagLC_ID {
129 unsigned short wLanguage;
130 unsigned short wCountry;
131 unsigned short wCodePage;
132 } MSVCRT_LC_ID, *MSVCRT_LPLC_ID;
134 typedef struct {
135 union {
136 const char *str[43];
137 struct {
138 const char *short_wday[7];
139 const char *wday[7];
140 const char *short_mon[12];
141 const char *mon[12];
142 const char *am;
143 const char *pm;
144 const char *short_date;
145 const char *date;
146 const char *time;
147 } names;
148 } str;
149 #if _MSVCR_VER < 110
150 LCID lcid;
151 #endif
152 int unk[2];
153 union {
154 const MSVCRT_wchar_t *wstr[43];
155 struct {
156 const MSVCRT_wchar_t *short_wday[7];
157 const MSVCRT_wchar_t *wday[7];
158 const MSVCRT_wchar_t *short_mon[12];
159 const MSVCRT_wchar_t *mon[12];
160 const MSVCRT_wchar_t *am;
161 const MSVCRT_wchar_t *pm;
162 const MSVCRT_wchar_t *short_date;
163 const MSVCRT_wchar_t *date;
164 const MSVCRT_wchar_t *time;
165 } names;
166 } wstr;
167 #if _MSVCR_VER >= 110
168 const MSVCRT_wchar_t *locname;
169 #endif
170 char data[1];
171 } MSVCRT___lc_time_data;
173 typedef struct MSVCRT_threadlocaleinfostruct {
174 #if _MSVCR_VER >= 140
175 unsigned short *pctype;
176 int mb_cur_max;
177 unsigned int lc_codepage;
178 #endif
180 int refcount;
181 #if _MSVCR_VER < 140
182 unsigned int lc_codepage;
183 #endif
184 unsigned int lc_collate_cp;
185 MSVCRT_ulong lc_handle[6];
186 MSVCRT_LC_ID lc_id[6];
187 struct {
188 char *locale;
189 MSVCRT_wchar_t *wlocale;
190 int *refcount;
191 int *wrefcount;
192 } lc_category[6];
193 int lc_clike;
194 #if _MSVCR_VER < 140
195 int mb_cur_max;
196 #endif
197 int *lconv_intl_refcount;
198 int *lconv_num_refcount;
199 int *lconv_mon_refcount;
200 struct MSVCRT_lconv *lconv;
201 int *ctype1_refcount;
202 unsigned short *ctype1;
203 #if _MSVCR_VER < 140
204 unsigned short *pctype;
205 #endif
206 const unsigned char *pclmap;
207 const unsigned char *pcumap;
208 MSVCRT___lc_time_data *lc_time_curr;
209 #if _MSVCR_VER >= 110
210 MSVCRT_wchar_t *lc_name[6];
211 #endif
212 } MSVCRT_threadlocinfo;
214 typedef struct MSVCRT_threadmbcinfostruct {
215 int refcount;
216 int mbcodepage;
217 int ismbcodepage;
218 int mblcid;
219 unsigned short mbulinfo[6];
220 unsigned char mbctype[257];
221 unsigned char mbcasemap[256];
222 } MSVCRT_threadmbcinfo;
224 typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo;
225 typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo;
227 typedef struct MSVCRT_localeinfo_struct
229 MSVCRT_pthreadlocinfo locinfo;
230 MSVCRT_pthreadmbcinfo mbcinfo;
231 } MSVCRT__locale_tstruct, *MSVCRT__locale_t;
233 typedef struct MSVCRT__onexit_table_t
235 MSVCRT__onexit_t *_first;
236 MSVCRT__onexit_t *_last;
237 MSVCRT__onexit_t *_end;
238 } MSVCRT__onexit_table_t;
240 typedef struct _frame_info
242 void *object;
243 struct _frame_info *next;
244 } frame_info;
246 typedef struct
248 frame_info frame_info;
249 EXCEPTION_RECORD *rec;
250 CONTEXT *context;
251 } cxx_frame_info;
253 frame_info* __cdecl _CreateFrameInfo(frame_info *fi, void *obj);
254 BOOL __cdecl __CxxRegisterExceptionObject(EXCEPTION_POINTERS*, cxx_frame_info*);
255 void __cdecl __CxxUnregisterExceptionObject(cxx_frame_info*, BOOL);
256 void CDECL __DestructExceptionObject(EXCEPTION_RECORD*);
258 /* TLS data */
259 extern DWORD msvcrt_tls_index DECLSPEC_HIDDEN;
261 /* Keep in sync with msvcr90/tests/msvcr90.c */
262 struct __thread_data {
263 DWORD tid;
264 HANDLE handle;
265 int thread_errno;
266 MSVCRT_ulong thread_doserrno;
267 int unk1;
268 unsigned int random_seed; /* seed for rand() */
269 char *strtok_next; /* next ptr for strtok() */
270 MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */
271 unsigned char *mbstok_next; /* next ptr for mbstok() */
272 char *strerror_buffer; /* buffer for strerror */
273 MSVCRT_wchar_t *wcserror_buffer; /* buffer for wcserror */
274 char *tmpnam_buffer; /* buffer for tmpname() */
275 MSVCRT_wchar_t *wtmpnam_buffer; /* buffer for wtmpname() */
276 void *unk2[2];
277 char *asctime_buffer; /* buffer for asctime */
278 MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */
279 struct MSVCRT_tm *time_buffer; /* buffer for localtime/gmtime */
280 char *efcvt_buffer; /* buffer for ecvt/fcvt */
281 int unk3[2];
282 void *unk4[3];
283 EXCEPTION_POINTERS *xcptinfo;
284 int fpecode;
285 MSVCRT_pthreadmbcinfo mbcinfo;
286 MSVCRT_pthreadlocinfo locinfo;
287 BOOL have_locale;
288 int unk5[1];
289 MSVCRT_terminate_function terminate_handler;
290 MSVCRT_unexpected_function unexpected_handler;
291 MSVCRT__se_translator_function se_translator; /* preserve offset to exc_record and processing_throw */
292 void *unk6;
293 EXCEPTION_RECORD *exc_record;
294 CONTEXT *ctx_record;
295 int processing_throw;
296 frame_info *frame_info_head;
297 void *unk8[6];
298 LCID cached_lcid;
299 BOOL cached_sname;
300 int unk9[2];
301 DWORD cached_cp;
302 char cached_locale[131];
303 void *unk10[100];
304 #if _MSVCR_VER >= 140
305 MSVCRT_invalid_parameter_handler invalid_parameter_handler;
306 #endif
309 typedef struct __thread_data thread_data_t;
311 extern thread_data_t *CDECL msvcrt_get_thread_data(void) DECLSPEC_HIDDEN;
313 LCID MSVCRT_locale_to_LCID(const char*, unsigned short*, BOOL*) DECLSPEC_HIDDEN;
314 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN;
315 extern MSVCRT___lc_time_data cloc_time_data DECLSPEC_HIDDEN;
316 extern unsigned int MSVCRT___lc_codepage;
317 extern int MSVCRT___lc_collate_cp;
318 extern WORD MSVCRT__ctype [257];
319 extern BOOL initial_locale DECLSPEC_HIDDEN;
320 extern WORD *MSVCRT__pwctype;
322 void msvcrt_set_errno(int) DECLSPEC_HIDDEN;
323 #if _MSVCR_VER >= 80
324 typedef enum {
325 EXCEPTION_BAD_ALLOC,
326 #if _MSVCR_VER >= 100
327 EXCEPTION_SCHEDULER_RESOURCE_ALLOCATION_ERROR,
328 EXCEPTION_IMPROPER_LOCK,
329 EXCEPTION_INVALID_SCHEDULER_POLICY_KEY,
330 EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE,
331 EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION,
332 EXCEPTION_IMPROPER_SCHEDULER_ATTACH,
333 EXCEPTION_IMPROPER_SCHEDULER_DETACH,
334 #endif
335 } exception_type;
336 void throw_exception(exception_type, HRESULT, const char*) DECLSPEC_HIDDEN;
337 #endif
339 void __cdecl _purecall(void);
340 void __cdecl _amsg_exit(int errnum);
342 extern char **MSVCRT__environ;
343 extern MSVCRT_wchar_t **MSVCRT__wenviron;
345 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN;
346 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **) DECLSPEC_HIDDEN;
348 MSVCRT_wchar_t *msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN;
350 extern unsigned int MSVCRT__commode;
352 /* FIXME: This should be declared in new.h but it's not an extern "C" so
353 * it would not be much use anyway. Even for Winelib applications.
355 int __cdecl MSVCRT__set_new_mode(int mode);
357 void* __cdecl MSVCRT_operator_new(MSVCRT_size_t);
358 void __cdecl MSVCRT_operator_delete(void*);
360 typedef void* (__cdecl *malloc_func_t)(MSVCRT_size_t);
361 typedef void (__cdecl *free_func_t)(void*);
363 /* Setup and teardown multi threaded locks */
364 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN;
365 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN;
367 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN;
368 extern BOOL msvcrt_init_locale(void) DECLSPEC_HIDDEN;
369 extern void msvcrt_init_math(void*) DECLSPEC_HIDDEN;
370 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN;
371 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN;
372 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN;
373 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN;
374 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN;
375 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN;
376 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN;
377 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN;
378 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN;
379 extern BOOL msvcrt_init_heap(void) DECLSPEC_HIDDEN;
380 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN;
381 extern void msvcrt_init_clock(void) DECLSPEC_HIDDEN;
383 #if _MSVCR_VER >= 100
384 extern void msvcrt_init_scheduler(void*) DECLSPEC_HIDDEN;
385 extern void msvcrt_free_scheduler(void) DECLSPEC_HIDDEN;
386 extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN;
387 #endif
389 extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN;
391 extern unsigned int __cdecl _control87(unsigned int, unsigned int);
393 /* run-time error codes */
394 #define _RT_STACK 0
395 #define _RT_NULLPTR 1
396 #define _RT_FLOAT 2
397 #define _RT_INTDIV 3
398 #define _RT_EXECMEM 5
399 #define _RT_EXECFORM 6
400 #define _RT_EXECENV 7
401 #define _RT_SPACEARG 8
402 #define _RT_SPACEENV 9
403 #define _RT_ABORT 10
404 #define _RT_NPTR 12
405 #define _RT_FPTR 13
406 #define _RT_BREAK 14
407 #define _RT_INT 15
408 #define _RT_THREAD 16
409 #define _RT_LOCK 17
410 #define _RT_HEAP 18
411 #define _RT_OPENCON 19
412 #define _RT_QWIN 20
413 #define _RT_NOMAIN 21
414 #define _RT_NONCONT 22
415 #define _RT_INVALDISP 23
416 #define _RT_ONEXIT 24
417 #define _RT_PUREVIRT 25
418 #define _RT_STDIOINIT 26
419 #define _RT_LOWIOINIT 27
420 #define _RT_HEAPINIT 28
421 #define _RT_DOMAIN 120
422 #define _RT_SING 121
423 #define _RT_TLOSS 122
424 #define _RT_CRNL 252
425 #define _RT_BANNER 255
427 struct MSVCRT___timeb32 {
428 MSVCRT___time32_t time;
429 unsigned short millitm;
430 short timezone;
431 short dstflag;
434 struct MSVCRT___timeb64 {
435 MSVCRT___time64_t time;
436 unsigned short millitm;
437 short timezone;
438 short dstflag;
441 struct MSVCRT__iobuf {
442 char* _ptr;
443 int _cnt;
444 char* _base;
445 int _flag;
446 int _file;
447 int _charbuf;
448 int _bufsiz;
449 char* _tmpfname;
452 typedef struct MSVCRT__iobuf MSVCRT_FILE;
454 extern MSVCRT_FILE MSVCRT__iob[];
456 struct MSVCRT_lconv {
457 char* decimal_point;
458 char* thousands_sep;
459 char* grouping;
460 char* int_curr_symbol;
461 char* currency_symbol;
462 char* mon_decimal_point;
463 char* mon_thousands_sep;
464 char* mon_grouping;
465 char* positive_sign;
466 char* negative_sign;
467 char int_frac_digits;
468 char frac_digits;
469 char p_cs_precedes;
470 char p_sep_by_space;
471 char n_cs_precedes;
472 char n_sep_by_space;
473 char p_sign_posn;
474 char n_sign_posn;
475 #if _MSVCR_VER >= 100
476 MSVCRT_wchar_t* _W_decimal_point;
477 MSVCRT_wchar_t* _W_thousands_sep;
478 MSVCRT_wchar_t* _W_int_curr_symbol;
479 MSVCRT_wchar_t* _W_currency_symbol;
480 MSVCRT_wchar_t* _W_mon_decimal_point;
481 MSVCRT_wchar_t* _W_mon_thousands_sep;
482 MSVCRT_wchar_t* _W_positive_sign;
483 MSVCRT_wchar_t* _W_negative_sign;
484 #endif
487 struct MSVCRT__exception {
488 int type;
489 char* name;
490 double arg1;
491 double arg2;
492 double retval;
495 struct MSVCRT__complex {
496 double x; /* Real part */
497 double y; /* Imaginary part */
499 typedef struct MSVCRT__complex _Dcomplex;
501 typedef struct MSVCRT__div_t {
502 int quot; /* quotient */
503 int rem; /* remainder */
504 } MSVCRT_div_t;
506 typedef struct MSVCRT__ldiv_t {
507 MSVCRT_long quot; /* quotient */
508 MSVCRT_long rem; /* remainder */
509 } MSVCRT_ldiv_t;
511 typedef struct MSVCRT__lldiv_t {
512 MSVCRT_longlong quot; /* quotient */
513 MSVCRT_longlong rem; /* remainder */
514 } MSVCRT_lldiv_t;
516 struct MSVCRT__heapinfo {
517 int* _pentry;
518 MSVCRT_size_t _size;
519 int _useflag;
522 #ifdef __i386__
523 struct MSVCRT___JUMP_BUFFER {
524 unsigned long Ebp;
525 unsigned long Ebx;
526 unsigned long Edi;
527 unsigned long Esi;
528 unsigned long Esp;
529 unsigned long Eip;
530 unsigned long Registration;
531 unsigned long TryLevel;
532 /* Start of new struct members */
533 unsigned long Cookie;
534 unsigned long UnwindFunc;
535 unsigned long UnwindData[6];
537 #elif defined(__x86_64__)
538 struct MSVCRT__SETJMP_FLOAT128
540 unsigned __int64 DECLSPEC_ALIGN(16) Part[2];
542 struct MSVCRT___JUMP_BUFFER
544 unsigned __int64 Frame;
545 unsigned __int64 Rbx;
546 unsigned __int64 Rsp;
547 unsigned __int64 Rbp;
548 unsigned __int64 Rsi;
549 unsigned __int64 Rdi;
550 unsigned __int64 R12;
551 unsigned __int64 R13;
552 unsigned __int64 R14;
553 unsigned __int64 R15;
554 unsigned __int64 Rip;
555 unsigned __int64 Spare;
556 struct MSVCRT__SETJMP_FLOAT128 Xmm6;
557 struct MSVCRT__SETJMP_FLOAT128 Xmm7;
558 struct MSVCRT__SETJMP_FLOAT128 Xmm8;
559 struct MSVCRT__SETJMP_FLOAT128 Xmm9;
560 struct MSVCRT__SETJMP_FLOAT128 Xmm10;
561 struct MSVCRT__SETJMP_FLOAT128 Xmm11;
562 struct MSVCRT__SETJMP_FLOAT128 Xmm12;
563 struct MSVCRT__SETJMP_FLOAT128 Xmm13;
564 struct MSVCRT__SETJMP_FLOAT128 Xmm14;
565 struct MSVCRT__SETJMP_FLOAT128 Xmm15;
567 #elif defined(__arm__)
568 struct MSVCRT___JUMP_BUFFER
570 unsigned long Frame;
571 unsigned long R4;
572 unsigned long R5;
573 unsigned long R6;
574 unsigned long R7;
575 unsigned long R8;
576 unsigned long R9;
577 unsigned long R10;
578 unsigned long R11;
579 unsigned long Sp;
580 unsigned long Pc;
581 unsigned long Fpscr;
582 unsigned long long D[8];
584 #elif defined(__aarch64__)
585 struct MSVCRT___JUMP_BUFFER
587 unsigned __int64 Frame;
588 unsigned __int64 Reserved;
589 unsigned __int64 X19;
590 unsigned __int64 X20;
591 unsigned __int64 X21;
592 unsigned __int64 X22;
593 unsigned __int64 X23;
594 unsigned __int64 X24;
595 unsigned __int64 X25;
596 unsigned __int64 X26;
597 unsigned __int64 X27;
598 unsigned __int64 X28;
599 unsigned __int64 Fp;
600 unsigned __int64 Lr;
601 unsigned __int64 Sp;
602 unsigned long Fpcr;
603 unsigned long Fpsr;
604 double D[8];
606 #endif /* __i386__ */
608 struct MSVCRT__diskfree_t {
609 unsigned int total_clusters;
610 unsigned int avail_clusters;
611 unsigned int sectors_per_cluster;
612 unsigned int bytes_per_sector;
615 struct MSVCRT__finddata32_t {
616 unsigned int attrib;
617 MSVCRT___time32_t time_create;
618 MSVCRT___time32_t time_access;
619 MSVCRT___time32_t time_write;
620 MSVCRT__fsize_t size;
621 char name[260];
624 struct MSVCRT__finddata32i64_t {
625 unsigned int attrib;
626 MSVCRT___time32_t time_create;
627 MSVCRT___time32_t time_access;
628 MSVCRT___time32_t time_write;
629 __int64 DECLSPEC_ALIGN(8) size;
630 char name[260];
633 struct MSVCRT__finddata64i32_t {
634 unsigned int attrib;
635 MSVCRT___time64_t time_create;
636 MSVCRT___time64_t time_access;
637 MSVCRT___time64_t time_write;
638 MSVCRT__fsize_t size;
639 char name[260];
642 struct MSVCRT__finddata64_t {
643 unsigned int attrib;
644 MSVCRT___time64_t time_create;
645 MSVCRT___time64_t time_access;
646 MSVCRT___time64_t time_write;
647 __int64 DECLSPEC_ALIGN(8) size;
648 char name[260];
651 struct MSVCRT__wfinddata32_t {
652 unsigned int attrib;
653 MSVCRT___time32_t time_create;
654 MSVCRT___time32_t time_access;
655 MSVCRT___time32_t time_write;
656 MSVCRT__fsize_t size;
657 MSVCRT_wchar_t name[260];
660 struct MSVCRT__wfinddata32i64_t {
661 unsigned int attrib;
662 MSVCRT___time32_t time_create;
663 MSVCRT___time32_t time_access;
664 MSVCRT___time32_t time_write;
665 __int64 DECLSPEC_ALIGN(8) size;
666 MSVCRT_wchar_t name[260];
669 struct MSVCRT__wfinddata64i32_t {
670 unsigned int attrib;
671 MSVCRT___time64_t time_create;
672 MSVCRT___time64_t time_access;
673 MSVCRT___time64_t time_write;
674 MSVCRT__fsize_t size;
675 MSVCRT_wchar_t name[260];
678 struct MSVCRT__wfinddata64_t {
679 unsigned int attrib;
680 MSVCRT___time64_t time_create;
681 MSVCRT___time64_t time_access;
682 MSVCRT___time64_t time_write;
683 __int64 DECLSPEC_ALIGN(8) size;
684 MSVCRT_wchar_t name[260];
687 struct MSVCRT___utimbuf32
689 MSVCRT___time32_t actime;
690 MSVCRT___time32_t modtime;
693 struct MSVCRT___utimbuf64
695 MSVCRT___time64_t actime;
696 MSVCRT___time64_t modtime;
699 /* for FreeBSD */
700 #undef st_atime
701 #undef st_ctime
702 #undef st_mtime
704 struct MSVCRT__stat32 {
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 MSVCRT__off_t st_size;
713 MSVCRT___time32_t st_atime;
714 MSVCRT___time32_t st_mtime;
715 MSVCRT___time32_t st_ctime;
718 struct MSVCRT__stat32i64 {
719 MSVCRT__dev_t st_dev;
720 MSVCRT__ino_t st_ino;
721 unsigned short st_mode;
722 short st_nlink;
723 short st_uid;
724 short st_gid;
725 MSVCRT__dev_t st_rdev;
726 __int64 DECLSPEC_ALIGN(8) st_size;
727 MSVCRT___time32_t st_atime;
728 MSVCRT___time32_t st_mtime;
729 MSVCRT___time32_t st_ctime;
732 struct MSVCRT__stat64i32 {
733 MSVCRT__dev_t st_dev;
734 MSVCRT__ino_t st_ino;
735 unsigned short st_mode;
736 short st_nlink;
737 short st_uid;
738 short st_gid;
739 MSVCRT__dev_t st_rdev;
740 MSVCRT__off_t st_size;
741 MSVCRT___time64_t st_atime;
742 MSVCRT___time64_t st_mtime;
743 MSVCRT___time64_t st_ctime;
746 struct MSVCRT__stat64 {
747 MSVCRT__dev_t st_dev;
748 MSVCRT__ino_t st_ino;
749 unsigned short st_mode;
750 short st_nlink;
751 short st_uid;
752 short st_gid;
753 MSVCRT__dev_t st_rdev;
754 __int64 DECLSPEC_ALIGN(8) st_size;
755 MSVCRT___time64_t st_atime;
756 MSVCRT___time64_t st_mtime;
757 MSVCRT___time64_t st_ctime;
760 #ifdef _WIN64
761 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
762 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
763 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
764 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
765 #define MSVCRT__stat MSVCRT__stat64i32
766 #define MSVCRT__stati64 MSVCRT__stat64
767 #else
768 #define MSVCRT__finddata_t MSVCRT__finddata32_t
769 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
770 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
771 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
772 #define MSVCRT__stat MSVCRT__stat32
773 #define MSVCRT__stati64 MSVCRT__stat32i64
774 #endif
776 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
777 #define MSVCRT_EOF (-1)
778 #define MSVCRT_TMP_MAX 0x7fff
779 #define MSVCRT_TMP_MAX_S 0x7fffffff
780 #define MSVCRT_RAND_MAX 0x7fff
781 #define MSVCRT_BUFSIZ 512
783 #define MSVCRT_SEEK_SET 0
784 #define MSVCRT_SEEK_CUR 1
785 #define MSVCRT_SEEK_END 2
787 #define MSVCRT_NO_CONSOLE_FD (-2)
788 #define MSVCRT_NO_CONSOLE ((HANDLE)MSVCRT_NO_CONSOLE_FD)
790 #define MSVCRT_STDIN_FILENO 0
791 #define MSVCRT_STDOUT_FILENO 1
792 #define MSVCRT_STDERR_FILENO 2
794 /* more file._flag flags, but these conflict with Unix */
795 #define MSVCRT__IOFBF 0x0000
796 #define MSVCRT__IONBF 0x0004
797 #define MSVCRT__IOLBF 0x0040
799 #define MSVCRT_FILENAME_MAX 260
800 #define MSVCRT_DRIVE_MAX 3
801 #define MSVCRT_FNAME_MAX 256
802 #define MSVCRT_DIR_MAX 256
803 #define MSVCRT_EXT_MAX 256
804 #define MSVCRT_PATH_MAX 260
805 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
806 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
807 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
809 #define MSVCRT__P_WAIT 0
810 #define MSVCRT__P_NOWAIT 1
811 #define MSVCRT__P_OVERLAY 2
812 #define MSVCRT__P_NOWAITO 3
813 #define MSVCRT__P_DETACH 4
815 #define MSVCRT_EPERM 1
816 #define MSVCRT_ENOENT 2
817 #define MSVCRT_ESRCH 3
818 #define MSVCRT_EINTR 4
819 #define MSVCRT_EIO 5
820 #define MSVCRT_ENXIO 6
821 #define MSVCRT_E2BIG 7
822 #define MSVCRT_ENOEXEC 8
823 #define MSVCRT_EBADF 9
824 #define MSVCRT_ECHILD 10
825 #define MSVCRT_EAGAIN 11
826 #define MSVCRT_ENOMEM 12
827 #define MSVCRT_EACCES 13
828 #define MSVCRT_EFAULT 14
829 #define MSVCRT_EBUSY 16
830 #define MSVCRT_EEXIST 17
831 #define MSVCRT_EXDEV 18
832 #define MSVCRT_ENODEV 19
833 #define MSVCRT_ENOTDIR 20
834 #define MSVCRT_EISDIR 21
835 #define MSVCRT_EINVAL 22
836 #define MSVCRT_ENFILE 23
837 #define MSVCRT_EMFILE 24
838 #define MSVCRT_ENOTTY 25
839 #define MSVCRT_EFBIG 27
840 #define MSVCRT_ENOSPC 28
841 #define MSVCRT_ESPIPE 29
842 #define MSVCRT_EROFS 30
843 #define MSVCRT_EMLINK 31
844 #define MSVCRT_EPIPE 32
845 #define MSVCRT_EDOM 33
846 #define MSVCRT_ERANGE 34
847 #define MSVCRT_EDEADLK 36
848 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
849 #define MSVCRT_ENAMETOOLONG 38
850 #define MSVCRT_ENOLCK 39
851 #define MSVCRT_ENOSYS 40
852 #define MSVCRT_ENOTEMPTY 41
853 #define MSVCRT_EILSEQ 42
854 #define MSVCRT_STRUNCATE 80
856 #define MSVCRT_LC_ALL 0
857 #define MSVCRT_LC_COLLATE 1
858 #define MSVCRT_LC_CTYPE 2
859 #define MSVCRT_LC_MONETARY 3
860 #define MSVCRT_LC_NUMERIC 4
861 #define MSVCRT_LC_TIME 5
862 #define MSVCRT_LC_MIN MSVCRT_LC_ALL
863 #define MSVCRT_LC_MAX MSVCRT_LC_TIME
865 #define MSVCRT__HEAPEMPTY -1
866 #define MSVCRT__HEAPOK -2
867 #define MSVCRT__HEAPBADBEGIN -3
868 #define MSVCRT__HEAPBADNODE -4
869 #define MSVCRT__HEAPEND -5
870 #define MSVCRT__HEAPBADPTR -6
872 #define MSVCRT__FREEENTRY 0
873 #define MSVCRT__USEDENTRY 1
875 #define MSVCRT__OUT_TO_DEFAULT 0
876 #define MSVCRT__OUT_TO_STDERR 1
877 #define MSVCRT__OUT_TO_MSGBOX 2
878 #define MSVCRT__REPORT_ERRMODE 3
880 /* ASCII char classification table - binary compatible */
881 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */
882 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */
883 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
884 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */
885 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
886 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
887 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */
888 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
889 #define MSVCRT__LEADBYTE 0x8000
890 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
892 #define MSVCRT__IOREAD 0x0001
893 #define MSVCRT__IOWRT 0x0002
894 #define MSVCRT__IOMYBUF 0x0008
895 #define MSVCRT__IOEOF 0x0010
896 #define MSVCRT__IOERR 0x0020
897 #define MSVCRT__IOSTRG 0x0040
898 #define MSVCRT__IORW 0x0080
899 #define MSVCRT__USERBUF 0x0100
900 #define MSVCRT__IOCOMMIT 0x4000
902 #define MSVCRT__S_IEXEC 0x0040
903 #define MSVCRT__S_IWRITE 0x0080
904 #define MSVCRT__S_IREAD 0x0100
905 #define MSVCRT__S_IFIFO 0x1000
906 #define MSVCRT__S_IFCHR 0x2000
907 #define MSVCRT__S_IFDIR 0x4000
908 #define MSVCRT__S_IFREG 0x8000
909 #define MSVCRT__S_IFMT 0xF000
911 #define MSVCRT__LK_UNLCK 0
912 #define MSVCRT__LK_LOCK 1
913 #define MSVCRT__LK_NBLCK 2
914 #define MSVCRT__LK_RLCK 3
915 #define MSVCRT__LK_NBRLCK 4
917 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
918 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
919 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
920 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
921 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
923 #define MSVCRT__O_RDONLY 0
924 #define MSVCRT__O_WRONLY 1
925 #define MSVCRT__O_RDWR 2
926 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
927 #define MSVCRT__O_APPEND 0x0008
928 #define MSVCRT__O_RANDOM 0x0010
929 #define MSVCRT__O_SEQUENTIAL 0x0020
930 #define MSVCRT__O_TEMPORARY 0x0040
931 #define MSVCRT__O_NOINHERIT 0x0080
932 #define MSVCRT__O_CREAT 0x0100
933 #define MSVCRT__O_TRUNC 0x0200
934 #define MSVCRT__O_EXCL 0x0400
935 #define MSVCRT__O_SHORT_LIVED 0x1000
936 #define MSVCRT__O_TEXT 0x4000
937 #define MSVCRT__O_BINARY 0x8000
938 #define MSVCRT__O_RAW MSVCRT__O_BINARY
939 #define MSVCRT__O_WTEXT 0x10000
940 #define MSVCRT__O_U16TEXT 0x20000
941 #define MSVCRT__O_U8TEXT 0x40000
943 /* _statusfp bit flags */
944 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
945 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
946 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
947 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
948 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */
950 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
951 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
952 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
953 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
955 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
957 /* fpclass constants */
958 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
959 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
960 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
961 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
962 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
963 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
964 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
965 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
966 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
967 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
969 /* fpclassify constants */
970 #define MSVCRT_FP_INFINITE 1
971 #define MSVCRT_FP_NAN 2
972 #define MSVCRT_FP_NORMAL -1
973 #define MSVCRT_FP_SUBNORMAL -2
974 #define MSVCRT_FP_ZERO 0
976 #define MSVCRT__MCW_EM 0x0008001f
977 #define MSVCRT__MCW_IC 0x00040000
978 #define MSVCRT__MCW_RC 0x00000300
979 #define MSVCRT__MCW_PC 0x00030000
980 #define MSVCRT__MCW_DN 0x03000000
982 #define MSVCRT__EM_INVALID 0x00000010
983 #define MSVCRT__EM_DENORMAL 0x00080000
984 #define MSVCRT__EM_ZERODIVIDE 0x00000008
985 #define MSVCRT__EM_OVERFLOW 0x00000004
986 #define MSVCRT__EM_UNDERFLOW 0x00000002
987 #define MSVCRT__EM_INEXACT 0x00000001
988 #define MSVCRT__IC_AFFINE 0x00040000
989 #define MSVCRT__IC_PROJECTIVE 0x00000000
990 #define MSVCRT__RC_CHOP 0x00000300
991 #define MSVCRT__RC_UP 0x00000200
992 #define MSVCRT__RC_DOWN 0x00000100
993 #define MSVCRT__RC_NEAR 0x00000000
994 #define MSVCRT__PC_24 0x00020000
995 #define MSVCRT__PC_53 0x00010000
996 #define MSVCRT__PC_64 0x00000000
997 #define MSVCRT__DN_SAVE 0x00000000
998 #define MSVCRT__DN_FLUSH 0x01000000
999 #define MSVCRT__DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000
1000 #define MSVCRT__DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000
1001 #define MSVCRT__EM_AMBIGUOUS 0x80000000
1003 typedef struct
1005 unsigned int control;
1006 unsigned int status;
1007 } MSVCRT_fenv_t;
1009 #define MSVCRT_CLOCKS_PER_SEC 1000
1011 /* signals */
1012 #define MSVCRT_SIGINT 2
1013 #define MSVCRT_SIGILL 4
1014 #define MSVCRT_SIGFPE 8
1015 #define MSVCRT_SIGSEGV 11
1016 #define MSVCRT_SIGTERM 15
1017 #define MSVCRT_SIGBREAK 21
1018 #define MSVCRT_SIGABRT 22
1019 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
1021 typedef void (__cdecl *MSVCRT___sighandler_t)(int);
1023 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
1024 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
1025 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
1027 #define MSVCRT__FPE_INVALID 0x81
1028 #define MSVCRT__FPE_DENORMAL 0x82
1029 #define MSVCRT__FPE_ZERODIVIDE 0x83
1030 #define MSVCRT__FPE_OVERFLOW 0x84
1031 #define MSVCRT__FPE_UNDERFLOW 0x85
1032 #define MSVCRT__FPE_INEXACT 0x86
1033 #define MSVCRT__FPE_UNEMULATED 0x87
1034 #define MSVCRT__FPE_SQRTNEG 0x88
1035 #define MSVCRT__FPE_STACKOVERFLOW 0x8a
1036 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b
1037 #define MSVCRT__FPE_EXPLICITGEN 0x8c
1039 #define _MS 0x01
1040 #define _MP 0x02
1041 #define _M1 0x04
1042 #define _M2 0x08
1044 #define _SBUP 0x10
1045 #define _SBLOW 0x20
1047 #define _MBC_SINGLE 0
1048 #define _MBC_LEAD 1
1049 #define _MBC_TRAIL 2
1050 #define _MBC_ILLEGAL -1
1052 #define _MB_CP_SBCS 0
1053 #define _MB_CP_OEM -2
1054 #define _MB_CP_ANSI -3
1055 #define _MB_CP_LOCALE -4
1057 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1)
1059 #define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF)
1061 /* _set_abort_behavior codes */
1062 #define MSVCRT__WRITE_ABORT_MSG 1
1063 #define MSVCRT__CALL_REPORTFAULT 2
1065 /* _get_output_format return code */
1066 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1
1068 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
1070 void __cdecl MSVCRT_free(void*);
1071 void* __cdecl MSVCRT_malloc(MSVCRT_size_t);
1072 void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
1073 void* __cdecl MSVCRT_realloc(void*,MSVCRT_size_t);
1075 int __cdecl MSVCRT_atoi(const char *str);
1076 int __cdecl MSVCRT_isalpha(int c);
1077 int __cdecl MSVCRT_isdigit(int c);
1078 int __cdecl MSVCRT_isspace(int c);
1079 int __cdecl MSVCRT_iswalpha(MSVCRT_wint_t);
1080 int __cdecl MSVCRT_iswspace(MSVCRT_wint_t);
1081 int __cdecl MSVCRT_iswdigit(MSVCRT_wint_t);
1082 int __cdecl MSVCRT_isleadbyte(int);
1083 int __cdecl MSVCRT__isleadbyte_l(int, MSVCRT__locale_t);
1084 int __cdecl MSVCRT__isspace_l(int, MSVCRT__locale_t);
1085 int __cdecl MSVCRT__iswspace_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1087 void __cdecl MSVCRT__lock_file(MSVCRT_FILE*);
1088 void __cdecl MSVCRT__unlock_file(MSVCRT_FILE*);
1089 int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
1090 int __cdecl MSVCRT__fgetc_nolock(MSVCRT_FILE*);
1091 int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*);
1092 int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
1093 int __cdecl MSVCRT__ungetc_nolock(int,MSVCRT_FILE*);
1094 MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
1095 MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*);
1096 MSVCRT_wint_t __cdecl MSVCRT__fputwc_nolock(MSVCRT_wint_t,MSVCRT_FILE*);
1097 MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
1098 MSVCRT_wint_t __cdecl MSVCRT__ungetwc_nolock(MSVCRT_wint_t, MSVCRT_FILE*);
1099 int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
1100 __int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
1101 __int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*);
1102 void __cdecl MSVCRT__exit(int);
1103 void __cdecl MSVCRT_abort(void);
1104 MSVCRT_ulong* __cdecl MSVCRT___doserrno(void);
1105 int* __cdecl MSVCRT__errno(void);
1106 char* __cdecl MSVCRT_getenv(const char*);
1107 MSVCRT_size_t __cdecl MSVCRT__fread_nolock(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1108 MSVCRT_size_t __cdecl MSVCRT__fread_nolock_s(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1109 MSVCRT_size_t __cdecl MSVCRT__fwrite_nolock(const void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*);
1110 int __cdecl MSVCRT_fclose(MSVCRT_FILE*);
1111 int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*);
1112 int __cdecl MSVCRT__fflush_nolock(MSVCRT_FILE*);
1113 void __cdecl MSVCRT_terminate(void);
1114 MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
1115 MSVCRT_clock_t __cdecl MSVCRT_clock(void);
1116 MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
1117 MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
1118 MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
1119 MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
1120 int WINAPIV MSVCRT_fwprintf(MSVCRT_FILE *file, const MSVCRT_wchar_t *format, ...);
1121 int __cdecl MSVCRT_vsnprintf(char *str, MSVCRT_size_t len, const char *format, __ms_va_list valist);
1122 int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, MSVCRT_size_t len,
1123 const MSVCRT_wchar_t *format, __ms_va_list valist );
1124 int WINAPIV MSVCRT__snwprintf(MSVCRT_wchar_t*, MSVCRT_size_t, const MSVCRT_wchar_t*, ...);
1125 int WINAPIV MSVCRT_sprintf(char*,const char*,...);
1126 int WINAPIV MSVCRT__snprintf(char*,MSVCRT_size_t,const char*,...);
1127 int WINAPIV MSVCRT__scprintf(const char*,...);
1128 int __cdecl MSVCRT_raise(int sig);
1129 int __cdecl MSVCRT__set_printf_count_output(int);
1131 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
1132 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
1134 extern MSVCRT__locale_t MSVCRT_locale;
1135 MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale) DECLSPEC_HIDDEN;
1136 void CDECL free_locale_noalloc(MSVCRT__locale_t locale) DECLSPEC_HIDDEN;
1137 MSVCRT_pthreadlocinfo CDECL get_locinfo(void) DECLSPEC_HIDDEN;
1138 MSVCRT_pthreadmbcinfo CDECL get_mbcinfo(void) DECLSPEC_HIDDEN;
1139 void __cdecl MSVCRT__free_locale(MSVCRT__locale_t);
1140 void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN;
1141 void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1142 int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN;
1143 int __cdecl __crtLCMapStringA(LCID, DWORD, const char*, int, char*, int, unsigned int, int) DECLSPEC_HIDDEN;
1145 #ifndef __WINE_MSVCRT_TEST
1146 int __cdecl MSVCRT__write(int,const void*,unsigned int);
1147 int __cdecl _getch(void);
1148 int __cdecl _ismbblead(unsigned int);
1149 int __cdecl _ismbblead_l(unsigned int, MSVCRT__locale_t);
1150 int __cdecl _ismbclegal(unsigned int c);
1151 int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
1152 int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1153 int __cdecl MSVCRT_mbtowc_l(MSVCRT_wchar_t*,const char*,MSVCRT_size_t,MSVCRT__locale_t);
1154 MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
1155 MSVCRT_size_t __cdecl MSVCRT__mbstowcs_l(MSVCRT_wchar_t*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1156 int __cdecl MSVCRT__mbstowcs_s_l(MSVCRT_size_t*, MSVCRT_wchar_t*,
1157 MSVCRT_size_t, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1158 MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t);
1159 MSVCRT_size_t __cdecl MSVCRT__wcstombs_l(char*, const MSVCRT_wchar_t*, MSVCRT_size_t, MSVCRT__locale_t);
1160 MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
1161 MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
1162 MSVCRT_intptr_t __cdecl MSVCRT__wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1163 MSVCRT_intptr_t __cdecl MSVCRT__wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
1164 void __cdecl MSVCRT__searchenv(const char*,const char*,char*);
1165 int __cdecl MSVCRT__getdrive(void);
1166 char* __cdecl MSVCRT__strdup(const char*);
1167 char* __cdecl MSVCRT__strnset(char*,int,MSVCRT_size_t);
1168 char* __cdecl _strset(char*,int);
1169 int __cdecl _ungetch(int);
1170 int __cdecl _cputs(const char*);
1171 int WINAPIV _cprintf(const char*,...);
1172 int WINAPIV _cwprintf(const MSVCRT_wchar_t*,...);
1173 int WINAPIV MSVCRT_sscanf(const char *, const char *, ...);
1174 char*** __cdecl MSVCRT___p__environ(void);
1175 int* __cdecl __p___mb_cur_max(void);
1176 int* __cdecl MSVCRT___p__fmode(void);
1177 MSVCRT_wchar_t* __cdecl MSVCRT__wcsdup(const MSVCRT_wchar_t*);
1178 MSVCRT_size_t __cdecl MSVCRT_strnlen(const char *,MSVCRT_size_t);
1179 MSVCRT_size_t __cdecl MSVCRT_wcsnlen(const MSVCRT_wchar_t*,MSVCRT_size_t);
1180 MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void);
1181 INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t);
1182 int __cdecl MSVCRT__wctomb_l(char*, MSVCRT_wchar_t, MSVCRT__locale_t);
1183 char* __cdecl MSVCRT__strdate(char* date);
1184 char* __cdecl MSVCRT__strtime(char* date);
1185 int __cdecl _setmbcp(int);
1186 int __cdecl MSVCRT__close(int);
1187 int __cdecl MSVCRT__dup(int);
1188 int __cdecl MSVCRT__dup2(int, int);
1189 int __cdecl MSVCRT__pipe(int *, unsigned int, int);
1190 MSVCRT_wchar_t* __cdecl MSVCRT__wgetenv(const MSVCRT_wchar_t*);
1191 void __cdecl MSVCRT__wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*);
1192 MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
1193 void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
1194 const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
1195 int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t);
1196 int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t);
1197 int __cdecl MSVCRT__towupper_l(MSVCRT_wint_t,MSVCRT__locale_t);
1198 int __cdecl MSVCRT__towlower_l(MSVCRT_wint_t,MSVCRT__locale_t);
1199 int __cdecl MSVCRT__toupper(int); /* only use on lower-case ASCII characters */
1200 int __cdecl MSVCRT__stricmp(const char*, const char*);
1201 int __cdecl MSVCRT__strnicmp(const char*, const char*, MSVCRT_size_t);
1202 int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1203 int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
1204 char* __cdecl MSVCRT_strncat(char*,const char *,MSVCRT_size_t);
1205 int __cdecl MSVCRT_strncmp(const char*, const char*, MSVCRT_size_t);
1206 int __cdecl MSVCRT_strcmp(const char*, const char*);
1207 char* __cdecl MSVCRT_strrchr(const char *, int);
1208 char* __cdecl MSVCRT_strstr(const char*, const char*);
1209 MSVCRT_long __cdecl MSVCRT_strtol(const char*, char**, int);
1210 unsigned int __cdecl MSVCRT__get_output_format(void);
1211 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**);
1212 char* __cdecl MSVCRT__itoa(int, char*, int);
1213 int __cdecl MSVCRT_wcsncmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t);
1214 int __cdecl MSVCRT__wcsnicmp(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_size_t);
1215 int __cdecl MSVCRT_towlower(MSVCRT_wint_t);
1216 int __cdecl MSVCRT_towupper(MSVCRT_wint_t);
1217 int __cdecl MSVCRT__isprint_l(int c, MSVCRT__locale_t locale);
1218 int __cdecl MSVCRT__iswalnum_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1219 int __cdecl MSVCRT__iswdigit_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1220 int __cdecl MSVCRT__iswgraph_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1221 int __cdecl MSVCRT__iswalpha_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1222 int __cdecl MSVCRT__iswlower_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1223 int __cdecl MSVCRT__iswupper_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1224 int __cdecl MSVCRT__iswprint_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1225 int __cdecl MSVCRT__iswpunct_l(MSVCRT_wchar_t, MSVCRT__locale_t);
1226 MSVCRT_size_t __cdecl MSVCRT_wcslen(const MSVCRT_wchar_t*);
1227 MSVCRT_wchar_t* __cdecl MSVCRT_wcscpy(MSVCRT_wchar_t*, const MSVCRT_wchar_t*);
1228 MSVCRT_wchar_t* __cdecl MSVCRT_wcschr(const MSVCRT_wchar_t*, MSVCRT_wchar_t);
1229 MSVCRT_wchar_t* __cdecl MSVCRT_wcscat(MSVCRT_wchar_t*, const MSVCRT_wchar_t*);
1231 double __cdecl MSVCRT_floor( double x );
1232 float __cdecl MSVCRT_floorf( float x );
1233 double __cdecl MSVCRT_frexp( double x, int *exp );
1234 double __cdecl MSVCRT_log10( double x );
1235 double __cdecl MSVCRT_sqrt( double x );
1236 float __cdecl MSVCRT_sqrtf( float x );
1238 enum fpmod {
1239 FP_ROUND_ZERO, /* only used when dropped part contains only zeros */
1240 FP_ROUND_DOWN,
1241 FP_ROUND_EVEN,
1242 FP_ROUND_UP,
1243 FP_VAL_INFINITY,
1244 FP_VAL_NAN
1247 struct fpnum {
1248 int sign;
1249 int exp;
1250 ULONGLONG m;
1251 enum fpmod mod;
1253 struct fpnum fpnum_parse(MSVCRT_wchar_t (*)(void*), void (*)(void*),
1254 void*, MSVCRT_pthreadlocinfo, BOOL) DECLSPEC_HIDDEN;
1255 int fpnum_double(struct fpnum*, double*) DECLSPEC_HIDDEN;
1256 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
1257 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
1258 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE)
1259 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending
1260 * any information
1261 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around MSVCRT__invalid_parameter in order
1262 * to do the Ansi to Unicode transformation
1264 #define MSVCRT_INVALID_PMT(x,err) (*MSVCRT__errno() = (err), MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0))
1265 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
1266 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), MSVCRT_EINVAL)
1267 #endif
1269 #define MSVCRT__ARGMAX 100
1270 typedef int (*puts_clbk_a)(void*, int, const char*);
1271 typedef int (*puts_clbk_w)(void*, int, const MSVCRT_wchar_t*);
1272 typedef union _printf_arg
1274 void *get_ptr;
1275 int get_int;
1276 LONGLONG get_longlong;
1277 double get_double;
1278 } printf_arg;
1279 typedef printf_arg (*args_clbk)(void*, int, int, __ms_va_list*);
1280 int pf_printf_a(puts_clbk_a, void*, const char*, MSVCRT__locale_t,
1281 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1282 int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t,
1283 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
1284 int create_positional_ctx_a(void*, const char*, __ms_va_list) DECLSPEC_HIDDEN;
1285 int create_positional_ctx_w(void*, const MSVCRT_wchar_t*, __ms_va_list) DECLSPEC_HIDDEN;
1286 printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
1287 printf_arg arg_clbk_positional(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
1289 #define MSVCRT_FLT_MIN 1.175494351e-38F
1290 #define MSVCRT_DBL_MIN 2.2250738585072014e-308
1291 #define MSVCRT__OVERFLOW 3
1292 #define MSVCRT__UNDERFLOW 4
1294 #define MSVCRT_FP_ILOGB0 (-MSVCRT_INT_MAX - 1)
1295 #define MSVCRT_FP_ILOGBNAN MSVCRT_INT_MAX
1297 typedef struct
1299 float f;
1300 } MSVCRT__CRT_FLOAT;
1302 typedef struct
1304 double x;
1305 } MSVCRT__CRT_DOUBLE;
1307 extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
1309 /* __unDName/__unDNameEx flags */
1310 #define UNDNAME_COMPLETE (0x0000)
1311 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
1312 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
1313 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
1314 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1315 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1316 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1317 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1318 #define UNDNAME_NO_THISTYPE (0x0060)
1319 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
1320 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1321 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
1322 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1323 #define UNDNAME_32_BIT_DECODE (0x0800)
1324 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
1325 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
1326 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1327 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
1329 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
1330 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
1331 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004)
1332 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
1333 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
1334 #define UCRTBASE_PRINTF_STANDARD_ROUNDING (0x0020)
1336 #define UCRTBASE_PRINTF_MASK (0x003F)
1338 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100)
1339 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200)
1341 #define UCRTBASE_SCANF_SECURECRT (0x0001)
1342 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002)
1343 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004)
1345 #define UCRTBASE_SCANF_MASK (0x0007)
1347 #define COOPERATIVE_TIMEOUT_INFINITE ((unsigned int)-1)
1348 #define COOPERATIVE_WAIT_TIMEOUT ~0
1350 static inline int __msvcrt_isnanf(float x)
1352 union { float x; unsigned int i; } u = { x };
1353 return (u.i & 0x7fffffff) > 0x7f800000;
1355 static inline int __msvcrt_isnan(double x)
1357 union { double x; unsigned __int64 i; } u = { x };
1358 return (u.i & ~0ull >> 1) > 0x7ffull << 52;
1360 static inline int __msvcrt_isinff(float x)
1362 union { float x; unsigned int i; } u = { x };
1363 return (u.i & 0x7fffffff) == 0x7f800000;
1365 static inline int __msvcrt_isinf(double x)
1367 union { double x; unsigned __int64 i; } u = { x };
1368 return (u.i & ~0ull >> 1) == 0x7ffull << 52;
1370 static inline int __msvcrt_isnormalf(float x)
1372 union { float x; unsigned int i; } u = { x };
1373 return ((u.i + 0x00800000) & 0x7fffffff) >= 0x01000000;
1375 static inline int __msvcrt_isnormal(double x)
1377 union { double x; unsigned __int64 i; } u = { x };
1378 return ((u.i + (1ull << 52)) & ~0ull >> 1) >= 1ull << 53;
1380 static inline int __msvcrt_signbitf(float x)
1382 union { float x; unsigned int i; } u = { x };
1383 return (int)(u.i >> 31);
1385 static inline int __msvcrt_signbit(double x)
1387 union { double x; unsigned __int64 i; } u = { x };
1388 return (int)(u.i >> 63);
1391 #undef isinf
1392 #undef isnan
1393 #undef isnormal
1394 #undef isfinite
1395 #undef signbit
1396 #define isinf(x) (sizeof(x) == sizeof(float) ? __msvcrt_isinff(x) : __msvcrt_isinf(x))
1397 #define isnan(x) (sizeof(x) == sizeof(float) ? __msvcrt_isnanf(x) : __msvcrt_isnan(x))
1398 #define isnormal(x) (sizeof(x) == sizeof(float) ? __msvcrt_isnormalf(x) : __msvcrt_isnormal(x))
1399 #define signbit(x) (sizeof(x) == sizeof(float) ? __msvcrt_signbitf(x) : __msvcrt_signbit(x))
1400 #define isfinite(x) (!isinf(x) && !isnan(x))
1402 typedef enum {
1403 _FpCodeUnspecified,
1404 _FpCodeAdd,
1405 _FpCodeSubtract,
1406 _FpCodeMultiply,
1407 _FpCodeDivide,
1408 _FpCodeSquareRoot,
1409 _FpCodeRemainder,
1410 _FpCodeCompare,
1411 _FpCodeConvert,
1412 _FpCodeRound,
1413 _FpCodeTruncate,
1414 _FpCodeFloor,
1415 _FpCodeCeil,
1416 _FpCodeAcos,
1417 _FpCodeAsin,
1418 _FpCodeAtan,
1419 _FpCodeAtan2,
1420 _FpCodeCabs,
1421 _FpCodeCos,
1422 _FpCodeCosh,
1423 _FpCodeExp,
1424 _FpCodeFabs,
1425 _FpCodeFmod,
1426 _FpCodeFrexp,
1427 _FpCodeHypot,
1428 _FpCodeLdexp,
1429 _FpCodeLog,
1430 _FpCodeLog10,
1431 _FpCodeModf,
1432 _FpCodePow,
1433 _FpCodeSin,
1434 _FpCodeSinh,
1435 _FpCodeTan,
1436 _FpCodeTanh,
1437 _FpCodeY0,
1438 _FpCodeY1,
1439 _FpCodeYn,
1440 _FpCodeLogb,
1441 _FpCodeNextafter,
1442 _FpCodeNegate,
1443 _FpCodeFmin,
1444 _FpCodeFmax,
1445 _FpCodeConvertTrunc,
1446 _XMMIAddps,
1447 _XMMIAddss,
1448 _XMMISubps,
1449 _XMMISubss,
1450 _XMMIMulps,
1451 _XMMIMulss,
1452 _XMMIDivps,
1453 _XMMIDivss,
1454 _XMMISqrtps,
1455 _XMMISqrtss,
1456 _XMMIMaxps,
1457 _XMMIMaxss,
1458 _XMMIMinps,
1459 _XMMIMinss,
1460 _XMMICmpps,
1461 _XMMICmpss,
1462 _XMMIComiss,
1463 _XMMIUComiss,
1464 _XMMICvtpi2ps,
1465 _XMMICvtsi2ss,
1466 _XMMICvtps2pi,
1467 _XMMICvtss2si,
1468 _XMMICvttps2pi,
1469 _XMMICvttss2si,
1470 _XMMIAddsubps,
1471 _XMMIHaddps,
1472 _XMMIHsubps,
1473 _XMMI2Addpd,
1474 _XMMI2Addsd,
1475 _XMMI2Subpd,
1476 _XMMI2Subsd,
1477 _XMMI2Mulpd,
1478 _XMMI2Mulsd,
1479 _XMMI2Divpd,
1480 _XMMI2Divsd,
1481 _XMMI2Sqrtpd,
1482 _XMMI2Sqrtsd,
1483 _XMMI2Maxpd,
1484 _XMMI2Maxsd,
1485 _XMMI2Minpd,
1486 _XMMI2Minsd,
1487 _XMMI2Cmppd,
1488 _XMMI2Cmpsd,
1489 _XMMI2Comisd,
1490 _XMMI2UComisd,
1491 _XMMI2Cvtpd2pi,
1492 _XMMI2Cvtsd2si,
1493 _XMMI2Cvttpd2pi,
1494 _XMMI2Cvttsd2si,
1495 _XMMI2Cvtps2pd,
1496 _XMMI2Cvtss2sd,
1497 _XMMI2Cvtpd2ps,
1498 _XMMI2Cvtsd2ss,
1499 _XMMI2Cvtdq2ps,
1500 _XMMI2Cvttps2dq,
1501 _XMMI2Cvtps2dq,
1502 _XMMI2Cvttpd2dq,
1503 _XMMI2Cvtpd2dq,
1504 _XMMI2Addsubpd,
1505 _XMMI2Haddpd,
1506 _XMMI2Hsubpd,
1507 } _FP_OPERATION_CODE;
1509 typedef enum {
1510 _FpFormatFp32,
1511 _FpFormatFp64,
1512 _FpFormatFp80,
1513 _FpFormatFp128,
1514 _FpFormatI16,
1515 _FpFormatI32,
1516 _FpFormatI64,
1517 _FpFormatU16,
1518 _FpFormatU32,
1519 _FpFormatU64,
1520 _FpFormatBcd80,
1521 _FpFormatCompare,
1522 _FpFormatString,
1523 } _FPIEEE_FORMAT;
1525 typedef float _FP32;
1526 typedef double _FP64;
1527 typedef short _I16;
1528 typedef int _I32;
1529 typedef unsigned short _U16;
1530 typedef unsigned int _U32;
1531 typedef __int64 _Q64;
1533 typedef struct {
1534 unsigned short W[5];
1535 } _FP80;
1537 typedef struct DECLSPEC_ALIGN(16) {
1538 MSVCRT_ulong W[4];
1539 } _FP128;
1541 typedef struct DECLSPEC_ALIGN(8) {
1542 MSVCRT_ulong W[2];
1543 } _I64;
1545 typedef struct DECLSPEC_ALIGN(8) {
1546 MSVCRT_ulong W[2];
1547 } _U64;
1549 typedef struct {
1550 unsigned short W[5];
1551 } _BCD80;
1553 typedef struct DECLSPEC_ALIGN(16) {
1554 _Q64 W[2];
1555 } _FPQ64;
1557 typedef struct {
1558 union {
1559 _FP32 Fp32Value;
1560 _FP64 Fp64Value;
1561 _FP80 Fp80Value;
1562 _FP128 Fp128Value;
1563 _I16 I16Value;
1564 _I32 I32Value;
1565 _I64 I64Value;
1566 _U16 U16Value;
1567 _U32 U32Value;
1568 _U64 U64Value;
1569 _BCD80 Bcd80Value;
1570 char *StringValue;
1571 int CompareValue;
1572 _Q64 Q64Value;
1573 _FPQ64 Fpq64Value;
1574 } Value;
1575 unsigned int OperandValid : 1;
1576 unsigned int Format : 4;
1577 } _FPIEEE_VALUE;
1579 typedef struct {
1580 unsigned int Inexact : 1;
1581 unsigned int Underflow : 1;
1582 unsigned int Overflow : 1;
1583 unsigned int ZeroDivide : 1;
1584 unsigned int InvalidOperation : 1;
1585 } _FPIEEE_EXCEPTION_FLAGS;
1587 typedef struct {
1588 unsigned int RoundingMode : 2;
1589 unsigned int Precision : 3;
1590 unsigned int Operation :12;
1591 _FPIEEE_EXCEPTION_FLAGS Cause;
1592 _FPIEEE_EXCEPTION_FLAGS Enable;
1593 _FPIEEE_EXCEPTION_FLAGS Status;
1594 _FPIEEE_VALUE Operand1;
1595 _FPIEEE_VALUE Operand2;
1596 _FPIEEE_VALUE Result;
1597 } _FPIEEE_RECORD, *_PFPIEEE_RECORD;
1599 #define INHERIT_THREAD_PRIORITY 0xF000
1600 #endif /* __WINE_MSVCRT_H */