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