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