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
21 * - Symbols are prefixed with MSVCRT_ if they conflict
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.
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
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)
50 typedef unsigned short MSVCRT_wchar_t
;
51 typedef unsigned short MSVCRT_wint_t
;
52 typedef unsigned short MSVCRT_wctype_t
;
53 typedef unsigned short MSVCRT__ino_t
;
54 typedef unsigned int MSVCRT__fsize_t
;
55 typedef int MSVCRT_long
;
56 typedef unsigned int MSVCRT_ulong
;
58 typedef unsigned __int64 MSVCRT_size_t
;
59 typedef __int64 MSVCRT_intptr_t
;
60 typedef unsigned __int64 MSVCRT_uintptr_t
;
62 typedef unsigned long MSVCRT_size_t
;
63 typedef long MSVCRT_intptr_t
;
64 typedef unsigned long MSVCRT_uintptr_t
;
66 typedef unsigned int MSVCRT__dev_t
;
67 typedef int MSVCRT__off_t
;
68 typedef int MSVCRT_clock_t
;
69 typedef int MSVCRT___time32_t
;
70 typedef __int64
DECLSPEC_ALIGN(8) MSVCRT___time64_t
;
71 typedef __int64
DECLSPEC_ALIGN(8) MSVCRT_fpos_t
;
73 typedef void (*__cdecl MSVCRT_terminate_handler
)(void);
74 typedef void (*__cdecl MSVCRT_terminate_function
)(void);
75 typedef void (*__cdecl MSVCRT_unexpected_handler
)(void);
76 typedef void (*__cdecl MSVCRT_unexpected_function
)(void);
77 typedef void (*__cdecl MSVCRT__se_translator_function
)(unsigned int code
, struct _EXCEPTION_POINTERS
*info
);
78 typedef void (*__cdecl MSVCRT__beginthread_start_routine_t
)(void *);
79 typedef unsigned int (__stdcall
*MSVCRT__beginthreadex_start_routine_t
)(void *);
80 typedef int (*__cdecl MSVCRT__onexit_t
)(void);
81 typedef void (__cdecl
*MSVCRT_invalid_parameter_handler
)(const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, unsigned, MSVCRT_uintptr_t
);
82 typedef void (__cdecl
*MSVCRT_purecall_handler
)(void);
84 typedef struct {long double x
;} MSVCRT__LDOUBLE
;
100 extern DWORD msvcrt_tls_index
;
102 struct __thread_data
{
104 MSVCRT_ulong thread_doserrno
;
105 unsigned int random_seed
; /* seed for rand() */
106 char *strtok_next
; /* next ptr for strtok() */
107 unsigned char *mbstok_next
; /* next ptr for mbstok() */
108 MSVCRT_wchar_t
*wcstok_next
; /* next ptr for wcstok() */
109 char *efcvt_buffer
; /* buffer for ecvt/fcvt */
110 char *asctime_buffer
; /* buffer for asctime */
111 MSVCRT_wchar_t
*wasctime_buffer
; /* buffer for wasctime */
112 struct MSVCRT_tm time_buffer
; /* buffer for localtime/gmtime */
113 char *strerror_buffer
; /* buffer for strerror */
115 MSVCRT_terminate_function terminate_handler
;
116 MSVCRT_unexpected_function unexpected_handler
;
117 MSVCRT__se_translator_function se_translator
;
118 EXCEPTION_RECORD
*exc_record
;
119 struct MSVCRT_localeinfo_struct
*locale
;
122 typedef struct __thread_data thread_data_t
;
124 extern thread_data_t
*msvcrt_get_thread_data(void);
126 extern int MSVCRT___lc_codepage
;
127 extern int MSVCRT___lc_collate_cp
;
128 extern int MSVCRT___mb_cur_max
;
129 extern WORD MSVCRT__ctype
[257];
130 extern WORD
* MSVCRT__pctype
;
132 void msvcrt_set_errno(int);
134 void __cdecl
_purecall(void);
135 void __cdecl
_amsg_exit(int errnum
);
137 extern char **MSVCRT__environ
;
138 extern MSVCRT_wchar_t
**MSVCRT__wenviron
;
140 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
141 extern MSVCRT_wchar_t
** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t
**);
143 MSVCRT_wchar_t
*msvcrt_wstrdupa(const char *);
145 /* FIXME: This should be declared in new.h but it's not an extern "C" so
146 * it would not be much use anyway. Even for Winelib applications.
148 int __cdecl
MSVCRT__set_new_mode(int mode
);
150 void* __cdecl
MSVCRT_operator_new(MSVCRT_size_t
);
151 void __cdecl
MSVCRT_operator_delete(void*);
153 typedef void* (*__cdecl malloc_func_t
)(MSVCRT_size_t
);
154 typedef void (*__cdecl free_func_t
)(void*);
156 extern char* __cdecl
__unDName(char *,const char*,int,malloc_func_t
,free_func_t
,unsigned short int);
157 extern char* __cdecl
__unDNameEx(char *,const char*,int,malloc_func_t
,free_func_t
,void *,unsigned short int);
159 /* Setup and teardown multi threaded locks */
160 extern void msvcrt_init_mt_locks(void);
161 extern void msvcrt_free_mt_locks(void);
163 extern void msvcrt_init_io(void);
164 extern void msvcrt_free_io(void);
165 extern void msvcrt_init_console(void);
166 extern void msvcrt_free_console(void);
167 extern void msvcrt_init_args(void);
168 extern void msvcrt_free_args(void);
169 extern void msvcrt_init_signals(void);
170 extern void msvcrt_free_signals(void);
172 extern unsigned msvcrt_create_io_inherit_block(WORD
*, BYTE
**);
174 extern unsigned int __cdecl
_control87(unsigned int, unsigned int);
176 /* run-time error codes */
178 #define _RT_NULLPTR 1
181 #define _RT_EXECMEM 5
182 #define _RT_EXECFORM 6
183 #define _RT_EXECENV 7
184 #define _RT_SPACEARG 8
185 #define _RT_SPACEENV 9
191 #define _RT_THREAD 16
194 #define _RT_OPENCON 19
196 #define _RT_NOMAIN 21
197 #define _RT_NONCONT 22
198 #define _RT_INVALDISP 23
199 #define _RT_ONEXIT 24
200 #define _RT_PUREVIRT 25
201 #define _RT_STDIOINIT 26
202 #define _RT_LOWIOINIT 27
203 #define _RT_HEAPINIT 28
204 #define _RT_DOMAIN 120
206 #define _RT_TLOSS 122
208 #define _RT_BANNER 255
210 struct MSVCRT___timeb32
{
211 MSVCRT___time32_t time
;
212 unsigned short millitm
;
217 struct MSVCRT___timeb64
{
218 MSVCRT___time64_t time
;
219 unsigned short millitm
;
224 struct MSVCRT__iobuf
{
235 typedef struct MSVCRT__iobuf MSVCRT_FILE
;
237 struct MSVCRT_lconv
{
241 char* int_curr_symbol
;
242 char* currency_symbol
;
243 char* mon_decimal_point
;
244 char* mon_thousands_sep
;
248 char int_frac_digits
;
258 struct MSVCRT__exception
{
266 struct MSVCRT__complex
{
267 double x
; /* Real part */
268 double y
; /* Imaginary part */
271 typedef struct MSVCRT__div_t
{
272 int quot
; /* quotient */
273 int rem
; /* remainder */
276 typedef struct MSVCRT__ldiv_t
{
277 MSVCRT_long quot
; /* quotient */
278 MSVCRT_long rem
; /* remainder */
281 struct MSVCRT__heapinfo
{
288 struct MSVCRT___JUMP_BUFFER
{
295 unsigned long Registration
;
296 unsigned long TryLevel
;
297 /* Start of new struct members */
298 unsigned long Cookie
;
299 unsigned long UnwindFunc
;
300 unsigned long UnwindData
[6];
302 #endif /* __i386__ */
304 struct MSVCRT__diskfree_t
{
305 unsigned int total_clusters
;
306 unsigned int avail_clusters
;
307 unsigned int sectors_per_cluster
;
308 unsigned int bytes_per_sector
;
311 struct MSVCRT__finddata32_t
{
313 MSVCRT___time32_t time_create
;
314 MSVCRT___time32_t time_access
;
315 MSVCRT___time32_t time_write
;
316 MSVCRT__fsize_t size
;
320 struct MSVCRT__finddata32i64_t
{
322 MSVCRT___time32_t time_create
;
323 MSVCRT___time32_t time_access
;
324 MSVCRT___time32_t time_write
;
325 __int64
DECLSPEC_ALIGN(8) size
;
329 struct MSVCRT__finddata64i32_t
{
331 MSVCRT___time64_t time_create
;
332 MSVCRT___time64_t time_access
;
333 MSVCRT___time64_t time_write
;
334 MSVCRT__fsize_t size
;
338 struct MSVCRT__finddata64_t
{
340 MSVCRT___time64_t time_create
;
341 MSVCRT___time64_t time_access
;
342 MSVCRT___time64_t time_write
;
343 __int64
DECLSPEC_ALIGN(8) size
;
347 struct MSVCRT__wfinddata32_t
{
349 MSVCRT___time32_t time_create
;
350 MSVCRT___time32_t time_access
;
351 MSVCRT___time32_t time_write
;
352 MSVCRT__fsize_t size
;
353 MSVCRT_wchar_t name
[260];
356 struct MSVCRT__wfinddata32i64_t
{
358 MSVCRT___time32_t time_create
;
359 MSVCRT___time32_t time_access
;
360 MSVCRT___time32_t time_write
;
361 __int64
DECLSPEC_ALIGN(8) size
;
362 MSVCRT_wchar_t name
[260];
365 struct MSVCRT__wfinddata64i32_t
{
367 MSVCRT___time64_t time_create
;
368 MSVCRT___time64_t time_access
;
369 MSVCRT___time64_t time_write
;
370 MSVCRT__fsize_t size
;
371 MSVCRT_wchar_t name
[260];
374 struct MSVCRT__wfinddata64_t
{
376 MSVCRT___time64_t time_create
;
377 MSVCRT___time64_t time_access
;
378 MSVCRT___time64_t time_write
;
379 __int64
DECLSPEC_ALIGN(8) size
;
380 MSVCRT_wchar_t name
[260];
383 struct MSVCRT___utimbuf32
385 MSVCRT___time32_t actime
;
386 MSVCRT___time32_t modtime
;
389 struct MSVCRT___utimbuf64
391 MSVCRT___time64_t actime
;
392 MSVCRT___time64_t modtime
;
400 struct MSVCRT__stat32
{
401 MSVCRT__dev_t st_dev
;
402 MSVCRT__ino_t st_ino
;
403 unsigned short st_mode
;
407 MSVCRT__dev_t st_rdev
;
408 MSVCRT__off_t st_size
;
409 MSVCRT___time32_t st_atime
;
410 MSVCRT___time32_t st_mtime
;
411 MSVCRT___time32_t st_ctime
;
414 struct MSVCRT__stat32i64
{
415 MSVCRT__dev_t st_dev
;
416 MSVCRT__ino_t st_ino
;
417 unsigned short st_mode
;
421 MSVCRT__dev_t st_rdev
;
422 __int64
DECLSPEC_ALIGN(8) st_size
;
423 MSVCRT___time32_t st_atime
;
424 MSVCRT___time32_t st_mtime
;
425 MSVCRT___time32_t st_ctime
;
428 struct MSVCRT__stat64i32
{
429 MSVCRT__dev_t st_dev
;
430 MSVCRT__ino_t st_ino
;
431 unsigned short st_mode
;
435 MSVCRT__dev_t st_rdev
;
436 MSVCRT__off_t st_size
;
437 MSVCRT___time64_t st_atime
;
438 MSVCRT___time64_t st_mtime
;
439 MSVCRT___time64_t st_ctime
;
442 struct MSVCRT__stat64
{
443 MSVCRT__dev_t st_dev
;
444 MSVCRT__ino_t st_ino
;
445 unsigned short st_mode
;
449 MSVCRT__dev_t st_rdev
;
450 __int64
DECLSPEC_ALIGN(8) st_size
;
451 MSVCRT___time64_t st_atime
;
452 MSVCRT___time64_t st_mtime
;
453 MSVCRT___time64_t st_ctime
;
457 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
458 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
459 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
460 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
461 #define MSVCRT__stat MSVCRT__stat64i32
462 #define MSVCRT__stati64 MSVCRT__stat64
464 #define MSVCRT__finddata_t MSVCRT__finddata32_t
465 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
466 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
467 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
468 #define MSVCRT__stat MSVCRT__stat32
469 #define MSVCRT__stati64 MSVCRT__stat32i64
472 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
473 #define MSVCRT_EOF (-1)
474 #define MSVCRT_TMP_MAX 0x7fff
475 #define MSVCRT_RAND_MAX 0x7fff
476 #define MSVCRT_BUFSIZ 512
478 #define MSVCRT_STDIN_FILENO 0
479 #define MSVCRT_STDOUT_FILENO 1
480 #define MSVCRT_STDERR_FILENO 2
482 /* more file._flag flags, but these conflict with Unix */
483 #define MSVCRT__IOFBF 0x0000
484 #define MSVCRT__IONBF 0x0004
485 #define MSVCRT__IOLBF 0x0040
487 #define MSVCRT_FILENAME_MAX 260
488 #define MSVCRT_DRIVE_MAX 3
489 #define MSVCRT_FNAME_MAX 256
490 #define MSVCRT_DIR_MAX 256
491 #define MSVCRT_EXT_MAX 256
492 #define MSVCRT_PATH_MAX 260
493 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
494 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
495 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
497 #define MSVCRT__P_WAIT 0
498 #define MSVCRT__P_NOWAIT 1
499 #define MSVCRT__P_OVERLAY 2
500 #define MSVCRT__P_NOWAITO 3
501 #define MSVCRT__P_DETACH 4
503 #define MSVCRT_EPERM 1
504 #define MSVCRT_ENOENT 2
505 #define MSVCRT_ESRCH 3
506 #define MSVCRT_EINTR 4
508 #define MSVCRT_ENXIO 6
509 #define MSVCRT_E2BIG 7
510 #define MSVCRT_ENOEXEC 8
511 #define MSVCRT_EBADF 9
512 #define MSVCRT_ECHILD 10
513 #define MSVCRT_EAGAIN 11
514 #define MSVCRT_ENOMEM 12
515 #define MSVCRT_EACCES 13
516 #define MSVCRT_EFAULT 14
517 #define MSVCRT_EBUSY 16
518 #define MSVCRT_EEXIST 17
519 #define MSVCRT_EXDEV 18
520 #define MSVCRT_ENODEV 19
521 #define MSVCRT_ENOTDIR 20
522 #define MSVCRT_EISDIR 21
523 #define MSVCRT_EINVAL 22
524 #define MSVCRT_ENFILE 23
525 #define MSVCRT_EMFILE 24
526 #define MSVCRT_ENOTTY 25
527 #define MSVCRT_EFBIG 27
528 #define MSVCRT_ENOSPC 28
529 #define MSVCRT_ESPIPE 29
530 #define MSVCRT_EROFS 30
531 #define MSVCRT_EMLINK 31
532 #define MSVCRT_EPIPE 32
533 #define MSVCRT_EDOM 33
534 #define MSVCRT_ERANGE 34
535 #define MSVCRT_EDEADLK 36
536 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
537 #define MSVCRT_ENAMETOOLONG 38
538 #define MSVCRT_ENOLCK 39
539 #define MSVCRT_ENOSYS 40
540 #define MSVCRT_ENOTEMPTY 41
541 #define MSVCRT_EILSEQ 42
543 #define MSVCRT_LC_ALL 0
544 #define MSVCRT_LC_COLLATE 1
545 #define MSVCRT_LC_CTYPE 2
546 #define MSVCRT_LC_MONETARY 3
547 #define MSVCRT_LC_NUMERIC 4
548 #define MSVCRT_LC_TIME 5
549 #define MSVCRT_LC_MIN MSVCRT_LC_ALL
550 #define MSVCRT_LC_MAX MSVCRT_LC_TIME
552 #define MSVCRT__HEAPEMPTY -1
553 #define MSVCRT__HEAPOK -2
554 #define MSVCRT__HEAPBADBEGIN -3
555 #define MSVCRT__HEAPBADNODE -4
556 #define MSVCRT__HEAPEND -5
557 #define MSVCRT__HEAPBADPTR -6
559 #define MSVCRT__FREEENTRY 0
560 #define MSVCRT__USEDENTRY 1
562 #define MSVCRT__OUT_TO_DEFAULT 0
563 #define MSVCRT__REPORT_ERRMODE 3
565 /* ASCII char classification table - binary compatible */
566 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */
567 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */
568 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
569 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */
570 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
571 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
572 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */
573 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
574 #define MSVCRT__LEADBYTE 0x8000
575 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
577 #define MSVCRT__IOREAD 0x0001
578 #define MSVCRT__IOWRT 0x0002
579 #define MSVCRT__IOMYBUF 0x0008
580 #define MSVCRT__IOEOF 0x0010
581 #define MSVCRT__IOERR 0x0020
582 #define MSVCRT__IOSTRG 0x0040
583 #define MSVCRT__IORW 0x0080
585 #define MSVCRT__S_IEXEC 0x0040
586 #define MSVCRT__S_IWRITE 0x0080
587 #define MSVCRT__S_IREAD 0x0100
588 #define MSVCRT__S_IFIFO 0x1000
589 #define MSVCRT__S_IFCHR 0x2000
590 #define MSVCRT__S_IFDIR 0x4000
591 #define MSVCRT__S_IFREG 0x8000
592 #define MSVCRT__S_IFMT 0xF000
594 #define MSVCRT__LK_UNLCK 0
595 #define MSVCRT__LK_LOCK 1
596 #define MSVCRT__LK_NBLCK 2
597 #define MSVCRT__LK_RLCK 3
598 #define MSVCRT__LK_NBRLCK 4
600 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
601 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
602 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
603 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
604 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
606 #define MSVCRT__O_RDONLY 0
607 #define MSVCRT__O_WRONLY 1
608 #define MSVCRT__O_RDWR 2
609 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
610 #define MSVCRT__O_APPEND 0x0008
611 #define MSVCRT__O_RANDOM 0x0010
612 #define MSVCRT__O_SEQUENTIAL 0x0020
613 #define MSVCRT__O_TEMPORARY 0x0040
614 #define MSVCRT__O_NOINHERIT 0x0080
615 #define MSVCRT__O_CREAT 0x0100
616 #define MSVCRT__O_TRUNC 0x0200
617 #define MSVCRT__O_EXCL 0x0400
618 #define MSVCRT__O_SHORT_LIVED 0x1000
619 #define MSVCRT__O_TEXT 0x4000
620 #define MSVCRT__O_BINARY 0x8000
621 #define MSVCRT__O_RAW MSVCRT__O_BINARY
623 /* _statusfp bit flags */
624 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
625 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
626 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
627 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
628 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */
630 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
631 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
632 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
633 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
635 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
637 /* fpclass constants */
638 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
639 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
640 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
641 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
642 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
643 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
644 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
645 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
646 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
647 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
649 #define MSVCRT__EM_INVALID 0x00000010
650 #define MSVCRT__EM_DENORMAL 0x00080000
651 #define MSVCRT__EM_ZERODIVIDE 0x00000008
652 #define MSVCRT__EM_OVERFLOW 0x00000004
653 #define MSVCRT__EM_UNDERFLOW 0x00000002
654 #define MSVCRT__EM_INEXACT 0x00000001
655 #define MSVCRT__IC_AFFINE 0x00040000
656 #define MSVCRT__IC_PROJECTIVE 0x00000000
657 #define MSVCRT__RC_CHOP 0x00000300
658 #define MSVCRT__RC_UP 0x00000200
659 #define MSVCRT__RC_DOWN 0x00000100
660 #define MSVCRT__RC_NEAR 0x00000000
661 #define MSVCRT__PC_24 0x00020000
662 #define MSVCRT__PC_53 0x00010000
663 #define MSVCRT__PC_64 0x00000000
665 #define MSVCRT_CLOCKS_PER_SEC 1000
668 #define MSVCRT_SIGINT 2
669 #define MSVCRT_SIGILL 4
670 #define MSVCRT_SIGFPE 8
671 #define MSVCRT_SIGSEGV 11
672 #define MSVCRT_SIGTERM 15
673 #define MSVCRT_SIGBREAK 21
674 #define MSVCRT_SIGABRT 22
675 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
677 typedef void (__cdecl
*MSVCRT___sighandler_t
)(int);
679 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
680 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
681 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
683 #define MSVCRT__FPE_INVALID 0x81
684 #define MSVCRT__FPE_DENORMAL 0x82
685 #define MSVCRT__FPE_ZERODIVIDE 0x83
686 #define MSVCRT__FPE_OVERFLOW 0x84
687 #define MSVCRT__FPE_UNDERFLOW 0x85
688 #define MSVCRT__FPE_INEXACT 0x86
689 #define MSVCRT__FPE_UNEMULATED 0x87
690 #define MSVCRT__FPE_SQRTNEG 0x88
691 #define MSVCRT__FPE_STACKOVERFLOW 0x8a
692 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b
693 #define MSVCRT__FPE_EXPLICITGEN 0x8c
703 #define _MBC_SINGLE 0
706 #define _MBC_ILLEGAL -1
708 #define _MB_CP_SBCS 0
709 #define _MB_CP_OEM -2
710 #define _MB_CP_ANSI -3
711 #define _MB_CP_LOCALE -4
713 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1)
715 void __cdecl
MSVCRT_free(void*);
716 void* __cdecl
MSVCRT_malloc(MSVCRT_size_t
);
717 void* __cdecl
MSVCRT_calloc(MSVCRT_size_t
,MSVCRT_size_t
);
718 void* __cdecl
MSVCRT_realloc(void*,MSVCRT_size_t
);
720 int __cdecl
MSVCRT_iswalpha(MSVCRT_wint_t
);
721 int __cdecl
MSVCRT_iswspace(MSVCRT_wint_t
);
722 int __cdecl
MSVCRT_iswdigit(MSVCRT_wint_t
);
723 int __cdecl
MSVCRT_isleadbyte(int);
725 int __cdecl
MSVCRT_fgetc(MSVCRT_FILE
*);
726 int __cdecl
MSVCRT_ungetc(int,MSVCRT_FILE
*);
727 MSVCRT_wint_t __cdecl
MSVCRT_fgetwc(MSVCRT_FILE
*);
728 MSVCRT_wint_t __cdecl
MSVCRT_ungetwc(MSVCRT_wint_t
,MSVCRT_FILE
*);
729 void __cdecl
MSVCRT__exit(int);
730 void __cdecl
MSVCRT_abort(void);
731 MSVCRT_ulong
* __cdecl
MSVCRT___doserrno(void);
732 int* __cdecl
MSVCRT__errno(void);
733 char* __cdecl
MSVCRT_getenv(const char*);
734 char* __cdecl
MSVCRT_setlocale(int,const char*);
735 int __cdecl
MSVCRT_fclose(MSVCRT_FILE
*);
736 void __cdecl
MSVCRT_terminate(void);
737 MSVCRT_FILE
* __cdecl
MSVCRT__iob_func(void);
738 MSVCRT_clock_t __cdecl
MSVCRT_clock(void);
739 MSVCRT___time32_t __cdecl
MSVCRT__time32(MSVCRT___time32_t
*);
740 MSVCRT___time64_t __cdecl
MSVCRT__time64(MSVCRT___time64_t
*);
741 MSVCRT_FILE
* __cdecl
MSVCRT__fdopen(int, const char *);
742 MSVCRT_FILE
* __cdecl
MSVCRT__wfdopen(int, const MSVCRT_wchar_t
*);
743 int __cdecl
MSVCRT_vsnprintf(char *str
, MSVCRT_size_t len
, const char *format
, __ms_va_list valist
);
744 int __cdecl
MSVCRT_vsnwprintf(MSVCRT_wchar_t
*str
, MSVCRT_size_t len
,
745 const MSVCRT_wchar_t
*format
, __ms_va_list valist
);
746 int __cdecl
MSVCRT_sprintf(char*,const char*,...);
747 int __cdecl
MSVCRT__scprintf(const char*,...);
748 int __cdecl
MSVCRT_raise(int sig
);
750 typedef struct MSVCRT_tagLC_ID
{
751 unsigned short wLanguage
;
752 unsigned short wCountry
;
753 unsigned short wCodePage
;
754 } MSVCRT_LC_ID
, *MSVCRT_LPLC_ID
;
756 typedef struct MSVCRT_threadlocaleinfostruct
{
758 unsigned int lc_codepage
;
759 unsigned int lc_collate_cp
;
760 unsigned long lc_handle
[6];
761 MSVCRT_LC_ID lc_id
[6];
770 int *lconv_intl_refcount
;
771 int *lconv_num_refcount
;
772 int *lconv_mon_refcount
;
773 struct MSVCRT_lconv
*lconv
;
774 int *ctype1_refcount
;
775 unsigned short *ctype1
;
776 unsigned short *pctype
;
777 unsigned char *pclmap
;
778 unsigned char *pcumap
;
779 struct MSVCRT___lc_time_data
*lc_time_curr
;
780 } MSVCRT_threadlocinfo
;
782 typedef struct MSVCRT_threadmbcinfostruct
{
787 unsigned short mbulinfo
[6];
790 } MSVCRT_threadmbcinfo
;
792 typedef struct MSVCRT_threadlocaleinfostruct
*MSVCRT_pthreadlocinfo
;
793 typedef struct MSVCRT_threadmbcinfostruct
*MSVCRT_pthreadmbcinfo
;
795 typedef struct MSVCRT_localeinfo_struct
797 MSVCRT_pthreadlocinfo locinfo
;
798 MSVCRT_pthreadmbcinfo mbcinfo
;
799 } MSVCRT__locale_tstruct
, *MSVCRT__locale_t
;
801 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
802 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
804 extern MSVCRT__locale_t MSVCRT_locale
;
805 MSVCRT__locale_t
get_locale(void);
806 void __cdecl
MSVCRT__free_locale(MSVCRT__locale_t
);
808 #ifndef __WINE_MSVCRT_TEST
809 int __cdecl
MSVCRT__write(int,const void*,unsigned int);
810 int __cdecl
_getch(void);
811 int __cdecl
_ismbblead(unsigned int);
812 int __cdecl
_ismbstrail(const unsigned char* start
, const unsigned char* str
);
813 MSVCRT_intptr_t __cdecl
MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
814 MSVCRT_intptr_t __cdecl
MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
815 MSVCRT_intptr_t __cdecl
_wspawnve(int,const MSVCRT_wchar_t
*,const MSVCRT_wchar_t
* const *,const MSVCRT_wchar_t
* const *);
816 MSVCRT_intptr_t __cdecl
_wspawnvpe(int,const MSVCRT_wchar_t
*,const MSVCRT_wchar_t
* const *,const MSVCRT_wchar_t
* const *);
817 void __cdecl
_searchenv(const char*,const char*,char*);
818 int __cdecl
_getdrive(void);
819 char* __cdecl
_strdup(const char*);
820 char* __cdecl
MSVCRT__strnset(char*,int,MSVCRT_size_t
);
821 char* __cdecl
_strset(char*,int);
822 int __cdecl
_ungetch(int);
823 int __cdecl
_cputs(const char*);
824 int __cdecl
_cprintf(const char*,...);
825 char*** __cdecl
__p__environ(void);
826 int* __cdecl
__p___mb_cur_max(void);
827 unsigned int* __cdecl
__p__fmode(void);
828 MSVCRT_wchar_t
* __cdecl
_wcsdup(const MSVCRT_wchar_t
*);
829 MSVCRT_wchar_t
*** __cdecl
__p__wenviron(void);
830 char* __cdecl
_strdate(char* date
);
831 char* __cdecl
_strtime(char* date
);
832 int __cdecl
_setmbcp(int);
833 int __cdecl
MSVCRT__close(int);
834 int __cdecl
MSVCRT__dup(int);
835 int __cdecl
MSVCRT__dup2(int, int);
836 int __cdecl
MSVCRT__pipe(int *, unsigned int, int);
837 MSVCRT_wchar_t
* __cdecl
_wgetenv(const MSVCRT_wchar_t
*);
838 void __cdecl
_wsearchenv(const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, MSVCRT_wchar_t
*);
839 MSVCRT_intptr_t __cdecl
MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
840 void __cdecl
MSVCRT__invalid_parameter(const MSVCRT_wchar_t
*expr
, const MSVCRT_wchar_t
*func
,
841 const MSVCRT_wchar_t
*file
, unsigned int line
, MSVCRT_uintptr_t arg
);
844 #endif /* __WINE_MSVCRT_H */