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
20 #ifndef __WINE_MSVCRT_H
21 #define __WINE_MSVCRT_H
26 #define _NO_CRT_STDIO_INLINE
35 #define DBL80_MAX_10_EXP 4932
36 #define DBL80_MIN_10_EXP -4951
38 typedef void (__cdecl
*terminate_function
)(void);
39 typedef void (__cdecl
*unexpected_function
)(void);
40 typedef void (__cdecl
*_se_translator_function
)(unsigned int code
, struct _EXCEPTION_POINTERS
*info
);
41 void __cdecl
terminate(void);
43 typedef void (__cdecl
*MSVCRT_invalid_parameter_handler
)(const wchar_t*, const wchar_t*, const wchar_t*, unsigned, uintptr_t);
44 typedef void (__cdecl
*MSVCRT_purecall_handler
)(void);
45 typedef void (__cdecl
*MSVCRT_security_error_handler
)(int, void *);
47 typedef struct {ULONG x80
[3];} MSVCRT__LDOUBLE
; /* Intel 80 bit FP format has sizeof() 12 */
49 typedef struct __lc_time_data
{
53 const char *short_wday
[7];
55 const char *short_mon
[12];
59 const char *short_date
;
70 const wchar_t *wstr
[43];
72 const wchar_t *short_wday
[7];
73 const wchar_t *wday
[7];
74 const wchar_t *short_mon
[12];
75 const wchar_t *mon
[12];
78 const wchar_t *short_date
;
84 const wchar_t *locname
;
89 typedef struct threadmbcinfostruct
{
94 unsigned short mbulinfo
[6];
95 unsigned char mbctype
[257];
96 unsigned char mbcasemap
[256];
99 typedef struct _frame_info
102 struct _frame_info
*next
;
107 frame_info frame_info
;
108 EXCEPTION_RECORD
*rec
;
112 frame_info
* __cdecl
_CreateFrameInfo(frame_info
*fi
, void *obj
);
113 BOOL __cdecl
__CxxRegisterExceptionObject(EXCEPTION_POINTERS
*, cxx_frame_info
*);
114 void __cdecl
__CxxUnregisterExceptionObject(cxx_frame_info
*, BOOL
);
115 void CDECL
__DestructExceptionObject(EXCEPTION_RECORD
*);
118 extern DWORD msvcrt_tls_index DECLSPEC_HIDDEN
;
120 #define LOCALE_FREE 0x1
121 #define LOCALE_THREAD 0x2
123 /* Keep in sync with msvcr90/tests/msvcr90.c */
124 struct __thread_data
{
128 __msvcrt_ulong thread_doserrno
;
130 unsigned int random_seed
; /* seed for rand() */
131 char *strtok_next
; /* next ptr for strtok() */
132 wchar_t *wcstok_next
; /* next ptr for wcstok() */
133 unsigned char *mbstok_next
; /* next ptr for mbstok() */
134 char *strerror_buffer
; /* buffer for strerror */
135 wchar_t *wcserror_buffer
; /* buffer for wcserror */
136 char *tmpnam_buffer
; /* buffer for tmpname() */
137 wchar_t *wtmpnam_buffer
; /* buffer for wtmpname() */
139 char *asctime_buffer
; /* buffer for asctime */
140 wchar_t *wasctime_buffer
; /* buffer for wasctime */
141 struct tm
*time_buffer
; /* buffer for localtime/gmtime */
142 char *efcvt_buffer
; /* buffer for ecvt/fcvt */
145 EXCEPTION_POINTERS
*xcptinfo
;
147 pthreadmbcinfo mbcinfo
;
148 pthreadlocinfo locinfo
;
151 terminate_function terminate_handler
;
152 unexpected_function unexpected_handler
;
153 _se_translator_function se_translator
; /* preserve offset to exc_record and processing_throw */
155 EXCEPTION_RECORD
*exc_record
;
157 int processing_throw
;
158 frame_info
*frame_info_head
;
164 char cached_locale
[131];
166 #if _MSVCR_VER >= 140
167 MSVCRT_invalid_parameter_handler invalid_parameter_handler
;
171 typedef struct __thread_data thread_data_t
;
173 extern thread_data_t
*CDECL
msvcrt_get_thread_data(void) DECLSPEC_HIDDEN
;
175 LCID
locale_to_LCID(const char*, unsigned short*, BOOL
*) DECLSPEC_HIDDEN
;
176 extern _locale_t MSVCRT_locale DECLSPEC_HIDDEN
;
177 extern __lc_time_data cloc_time_data DECLSPEC_HIDDEN
;
178 extern unsigned int MSVCRT___lc_codepage
;
179 extern int MSVCRT___lc_collate_cp
;
180 extern WORD MSVCRT__ctype
[257];
181 extern BOOL initial_locale DECLSPEC_HIDDEN
;
182 extern WORD
*MSVCRT__pwctype
;
184 void msvcrt_set_errno(int) DECLSPEC_HIDDEN
;
188 #if _MSVCR_VER >= 100
189 EXCEPTION_SCHEDULER_RESOURCE_ALLOCATION_ERROR
,
190 EXCEPTION_IMPROPER_LOCK
,
191 EXCEPTION_INVALID_SCHEDULER_POLICY_KEY
,
192 EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE
,
193 EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION
,
194 EXCEPTION_IMPROPER_SCHEDULER_ATTACH
,
195 EXCEPTION_IMPROPER_SCHEDULER_DETACH
,
198 void throw_exception(exception_type
, HRESULT
, const char*) DECLSPEC_HIDDEN
;
201 void __cdecl
_purecall(void);
202 void __cdecl
_amsg_exit(int errnum
);
204 extern char **MSVCRT__environ
;
205 extern wchar_t **MSVCRT__wenviron
;
207 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN
;
208 extern wchar_t ** msvcrt_SnapshotOfEnvironmentW(wchar_t **) DECLSPEC_HIDDEN
;
210 wchar_t *msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN
;
212 extern unsigned int MSVCRT__commode
;
214 /* FIXME: This should be declared in new.h but it's not an extern "C" so
215 * it would not be much use anyway. Even for Winelib applications.
217 void* __cdecl
operator_new(size_t);
218 void __cdecl
operator_delete(void*);
219 int __cdecl
_set_new_mode(int mode
);
221 typedef void* (__cdecl
*malloc_func_t
)(size_t);
222 typedef void (__cdecl
*free_func_t
)(void*);
224 /* Setup and teardown multi threaded locks */
225 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN
;
226 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN
;
228 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN
;
229 extern BOOL
msvcrt_init_locale(void) DECLSPEC_HIDDEN
;
230 extern void msvcrt_init_math(void*) DECLSPEC_HIDDEN
;
231 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN
;
232 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN
;
233 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN
;
234 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN
;
235 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN
;
236 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN
;
237 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN
;
238 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN
;
239 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN
;
240 extern BOOL
msvcrt_init_heap(void) DECLSPEC_HIDDEN
;
241 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN
;
242 extern void msvcrt_init_clock(void) DECLSPEC_HIDDEN
;
244 #if _MSVCR_VER >= 100
245 extern void msvcrt_init_scheduler(void*) DECLSPEC_HIDDEN
;
246 extern void msvcrt_free_scheduler(void) DECLSPEC_HIDDEN
;
247 extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN
;
250 extern unsigned msvcrt_create_io_inherit_block(WORD
*, BYTE
**) DECLSPEC_HIDDEN
;
252 /* run-time error codes */
254 #define _RT_NULLPTR 1
257 #define _RT_EXECMEM 5
258 #define _RT_EXECFORM 6
259 #define _RT_EXECENV 7
260 #define _RT_SPACEARG 8
261 #define _RT_SPACEENV 9
267 #define _RT_THREAD 16
270 #define _RT_OPENCON 19
272 #define _RT_NOMAIN 21
273 #define _RT_NONCONT 22
274 #define _RT_INVALDISP 23
275 #define _RT_ONEXIT 24
276 #define _RT_PUREVIRT 25
277 #define _RT_STDIOINIT 26
278 #define _RT_LOWIOINIT 27
279 #define _RT_HEAPINIT 28
280 #define _RT_DOMAIN 120
282 #define _RT_TLOSS 122
284 #define _RT_BANNER 255
286 extern FILE MSVCRT__iob
[];
288 typedef struct _complex _Dcomplex
;
291 struct MSVCRT___JUMP_BUFFER
{
298 unsigned long Registration
;
299 unsigned long TryLevel
;
300 /* Start of new struct members */
301 unsigned long Cookie
;
302 unsigned long UnwindFunc
;
303 unsigned long UnwindData
[6];
305 #elif defined(__x86_64__)
306 struct MSVCRT__SETJMP_FLOAT128
308 unsigned __int64
DECLSPEC_ALIGN(16) Part
[2];
310 struct MSVCRT___JUMP_BUFFER
312 unsigned __int64 Frame
;
313 unsigned __int64 Rbx
;
314 unsigned __int64 Rsp
;
315 unsigned __int64 Rbp
;
316 unsigned __int64 Rsi
;
317 unsigned __int64 Rdi
;
318 unsigned __int64 R12
;
319 unsigned __int64 R13
;
320 unsigned __int64 R14
;
321 unsigned __int64 R15
;
322 unsigned __int64 Rip
;
323 unsigned __int64 Spare
;
324 struct MSVCRT__SETJMP_FLOAT128 Xmm6
;
325 struct MSVCRT__SETJMP_FLOAT128 Xmm7
;
326 struct MSVCRT__SETJMP_FLOAT128 Xmm8
;
327 struct MSVCRT__SETJMP_FLOAT128 Xmm9
;
328 struct MSVCRT__SETJMP_FLOAT128 Xmm10
;
329 struct MSVCRT__SETJMP_FLOAT128 Xmm11
;
330 struct MSVCRT__SETJMP_FLOAT128 Xmm12
;
331 struct MSVCRT__SETJMP_FLOAT128 Xmm13
;
332 struct MSVCRT__SETJMP_FLOAT128 Xmm14
;
333 struct MSVCRT__SETJMP_FLOAT128 Xmm15
;
335 #elif defined(__arm__)
336 struct MSVCRT___JUMP_BUFFER
350 unsigned long long D
[8];
352 #elif defined(__aarch64__)
353 struct MSVCRT___JUMP_BUFFER
355 unsigned __int64 Frame
;
356 unsigned __int64 Reserved
;
357 unsigned __int64 X19
;
358 unsigned __int64 X20
;
359 unsigned __int64 X21
;
360 unsigned __int64 X22
;
361 unsigned __int64 X23
;
362 unsigned __int64 X24
;
363 unsigned __int64 X25
;
364 unsigned __int64 X26
;
365 unsigned __int64 X27
;
366 unsigned __int64 X28
;
374 #endif /* __i386__ */
376 struct MSVCRT__finddata32_t
{
378 __time32_t time_create
;
379 __time32_t time_access
;
380 __time32_t time_write
;
385 struct MSVCRT__finddata32i64_t
{
387 __time32_t time_create
;
388 __time32_t time_access
;
389 __time32_t time_write
;
390 __int64
DECLSPEC_ALIGN(8) size
;
394 struct MSVCRT__finddata64i32_t
{
396 __time64_t time_create
;
397 __time64_t time_access
;
398 __time64_t time_write
;
403 struct MSVCRT__finddata64_t
{
405 __time64_t time_create
;
406 __time64_t time_access
;
407 __time64_t time_write
;
408 __int64
DECLSPEC_ALIGN(8) size
;
412 struct MSVCRT__wfinddata32_t
{
414 __time32_t time_create
;
415 __time32_t time_access
;
416 __time32_t time_write
;
421 struct MSVCRT__wfinddata32i64_t
{
423 __time32_t time_create
;
424 __time32_t time_access
;
425 __time32_t time_write
;
426 __int64
DECLSPEC_ALIGN(8) size
;
430 struct MSVCRT__wfinddata64i32_t
{
432 __time64_t time_create
;
433 __time64_t time_access
;
434 __time64_t time_write
;
439 struct MSVCRT__wfinddata64_t
{
441 __time64_t time_create
;
442 __time64_t time_access
;
443 __time64_t time_write
;
444 __int64
DECLSPEC_ALIGN(8) size
;
448 struct MSVCRT__stat32
{
451 unsigned short st_mode
;
462 struct MSVCRT__stat32i64
{
465 unsigned short st_mode
;
470 __int64
DECLSPEC_ALIGN(8) st_size
;
476 struct MSVCRT__stat64i32
{
479 unsigned short st_mode
;
490 struct MSVCRT__stat64
{
493 unsigned short st_mode
;
498 __int64
DECLSPEC_ALIGN(8) st_size
;
505 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
506 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
507 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
508 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
509 #define MSVCRT__stat MSVCRT__stat64i32
510 #define MSVCRT__stati64 MSVCRT__stat64
512 #define MSVCRT__finddata_t MSVCRT__finddata32_t
513 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
514 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
515 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
516 #define MSVCRT__stat MSVCRT__stat32
517 #define MSVCRT__stati64 MSVCRT__stat32i64
520 #define MSVCRT_RAND_MAX 0x7fff
522 #define MSVCRT_NO_CONSOLE_FD (-2)
523 #define MSVCRT_NO_CONSOLE ((HANDLE)MSVCRT_NO_CONSOLE_FD)
525 #define MSVCRT_DRIVE_MAX 3
526 #define MSVCRT_FNAME_MAX 256
527 #define MSVCRT_DIR_MAX 256
528 #define MSVCRT_EXT_MAX 256
529 #define MSVCRT_PATH_MAX 260
530 #define MSVCRT_stdin (MSVCRT__iob+STDIN_FILENO)
531 #define MSVCRT_stdout (MSVCRT__iob+STDOUT_FILENO)
532 #define MSVCRT_stderr (MSVCRT__iob+STDERR_FILENO)
534 #define MSVCRT__P_WAIT 0
535 #define MSVCRT__P_NOWAIT 1
536 #define MSVCRT__P_OVERLAY 2
537 #define MSVCRT__P_NOWAITO 3
538 #define MSVCRT__P_DETACH 4
540 #define MSVCRT__OUT_TO_DEFAULT 0
541 #define MSVCRT__OUT_TO_STDERR 1
542 #define MSVCRT__OUT_TO_MSGBOX 2
543 #define MSVCRT__REPORT_ERRMODE 3
545 /* internal file._flag flags */
546 #define MSVCRT__USERBUF 0x0100
547 #define MSVCRT__IOCOMMIT 0x4000
549 #define MSVCRT__S_IEXEC 0x0040
550 #define MSVCRT__S_IWRITE 0x0080
551 #define MSVCRT__S_IREAD 0x0100
552 #define MSVCRT__S_IFIFO 0x1000
553 #define MSVCRT__S_IFCHR 0x2000
554 #define MSVCRT__S_IFDIR 0x4000
555 #define MSVCRT__S_IFREG 0x8000
556 #define MSVCRT__S_IFMT 0xF000
558 #define MSVCRT__LK_UNLCK 0
559 #define MSVCRT__LK_LOCK 1
560 #define MSVCRT__LK_NBLCK 2
561 #define MSVCRT__LK_RLCK 3
562 #define MSVCRT__LK_NBRLCK 4
564 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
565 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
566 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
567 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
568 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
570 #define MSVCRT__O_RDONLY 0
571 #define MSVCRT__O_WRONLY 1
572 #define MSVCRT__O_RDWR 2
573 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
574 #define MSVCRT__O_APPEND 0x0008
575 #define MSVCRT__O_RANDOM 0x0010
576 #define MSVCRT__O_SEQUENTIAL 0x0020
577 #define MSVCRT__O_TEMPORARY 0x0040
578 #define MSVCRT__O_NOINHERIT 0x0080
579 #define MSVCRT__O_CREAT 0x0100
580 #define MSVCRT__O_TRUNC 0x0200
581 #define MSVCRT__O_EXCL 0x0400
582 #define MSVCRT__O_SHORT_LIVED 0x1000
583 #define MSVCRT__O_TEXT 0x4000
584 #define MSVCRT__O_BINARY 0x8000
585 #define MSVCRT__O_RAW MSVCRT__O_BINARY
586 #define MSVCRT__O_WTEXT 0x10000
587 #define MSVCRT__O_U16TEXT 0x20000
588 #define MSVCRT__O_U8TEXT 0x40000
590 #define MSVCRT_CLOCKS_PER_SEC 1000
592 #define MSVCRT__TRUNCATE ((size_t)-1)
594 #define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF)
596 /* _set_abort_behavior codes */
597 #define MSVCRT__WRITE_ABORT_MSG 1
598 #define MSVCRT__CALL_REPORTFAULT 2
600 /* _get_output_format return code */
601 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1
603 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
605 int __cdecl
MSVCRT_iswalpha(wint_t);
606 int __cdecl
MSVCRT_iswspace(wint_t);
607 int __cdecl
MSVCRT_iswdigit(wint_t);
608 int __cdecl
MSVCRT__iswspace_l(wchar_t, _locale_t
);
610 void __cdecl
MSVCRT__lock_file(FILE*);
611 void __cdecl
MSVCRT__unlock_file(FILE*);
612 int __cdecl
MSVCRT_fgetc(FILE*);
613 int __cdecl
MSVCRT__fgetc_nolock(FILE*);
614 int __cdecl
MSVCRT__fputc_nolock(int,FILE*);
615 int __cdecl
MSVCRT_ungetc(int,FILE*);
616 int __cdecl
MSVCRT__ungetc_nolock(int,FILE*);
617 wint_t __cdecl
MSVCRT_fgetwc(FILE*);
618 wint_t __cdecl
MSVCRT__fgetwc_nolock(FILE*);
619 wint_t __cdecl
MSVCRT__fputwc_nolock(wint_t,FILE*);
620 wint_t __cdecl
MSVCRT_ungetwc(wint_t,FILE*);
621 wint_t __cdecl
MSVCRT__ungetwc_nolock(wint_t, FILE*);
622 int __cdecl
MSVCRT__fseeki64_nolock(FILE*,__int64
,int);
623 __int64 __cdecl
MSVCRT__ftelli64(FILE* file
);
624 __int64 __cdecl
MSVCRT__ftelli64_nolock(FILE*);
625 size_t __cdecl
MSVCRT__fread_nolock(void*,size_t,size_t,FILE*);
626 size_t __cdecl
MSVCRT__fread_nolock_s(void*,size_t,size_t,size_t,FILE*);
627 size_t __cdecl
MSVCRT__fwrite_nolock(const void*,size_t,size_t,FILE*);
628 int __cdecl
MSVCRT_fclose(FILE*);
629 int __cdecl
MSVCRT__fclose_nolock(FILE*);
630 int __cdecl
MSVCRT__fflush_nolock(FILE*);
631 FILE* __cdecl
MSVCRT__iob_func(void);
632 __time32_t __cdecl
MSVCRT__time32(__time32_t
*);
633 __time64_t __cdecl
MSVCRT__time64(__time64_t
*);
634 FILE* __cdecl
MSVCRT__fdopen(int, const char *);
635 FILE* __cdecl
MSVCRT__wfdopen(int, const wchar_t *);
636 int WINAPIV
MSVCRT_fwprintf(FILE *file
, const wchar_t *format
, ...);
637 int __cdecl
MSVCRT_vsnwprintf(wchar_t *str
, size_t len
,
638 const wchar_t *format
, __ms_va_list valist
);
639 int WINAPIV
MSVCRT__snwprintf(wchar_t*, size_t, const wchar_t*, ...);
640 int WINAPIV
MSVCRT_sprintf(char*,const char*,...);
641 int WINAPIV
MSVCRT__snprintf(char*,size_t,const char*,...);
642 int WINAPIV
MSVCRT__scprintf(const char*,...);
643 int __cdecl
MSVCRT__set_printf_count_output(int);
645 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
646 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
648 _locale_t CDECL
get_current_locale_noalloc(_locale_t locale
) DECLSPEC_HIDDEN
;
649 void CDECL
free_locale_noalloc(_locale_t locale
) DECLSPEC_HIDDEN
;
650 pthreadlocinfo CDECL
get_locinfo(void) DECLSPEC_HIDDEN
;
651 pthreadmbcinfo CDECL
get_mbcinfo(void) DECLSPEC_HIDDEN
;
652 threadmbcinfo
* create_mbcinfo(int, LCID
, threadmbcinfo
*) DECLSPEC_HIDDEN
;
653 void free_locinfo(pthreadlocinfo
) DECLSPEC_HIDDEN
;
654 void free_mbcinfo(pthreadmbcinfo
) DECLSPEC_HIDDEN
;
655 int __cdecl
__crtLCMapStringA(LCID
, DWORD
, const char*, int, char*, int, unsigned int, int) DECLSPEC_HIDDEN
;
657 int __cdecl
MSVCRT__write(int,const void*,unsigned int);
658 int __cdecl
_getch(void);
659 int __cdecl
_ismbblead(unsigned int);
660 int __cdecl
_ismbblead_l(unsigned int, _locale_t
);
661 int __cdecl
_ismbclegal(unsigned int c
);
662 int __cdecl
_ismbstrail(const unsigned char* start
, const unsigned char* str
);
663 size_t __cdecl
MSVCRT_wcstombs(char*,const wchar_t*,size_t);
664 size_t __cdecl
MSVCRT__wcstombs_l(char*, const wchar_t*, size_t, _locale_t
);
665 void __cdecl
MSVCRT__searchenv(const char*,const char*,char*);
666 int __cdecl
MSVCRT__getdrive(void);
667 char* __cdecl
_strset(char*,int);
668 int __cdecl
_ungetch(int);
669 int __cdecl
_cputs(const char*);
670 int WINAPIV
_cprintf(const char*,...);
671 int WINAPIV
_cwprintf(const wchar_t*,...);
672 char*** __cdecl
MSVCRT___p__environ(void);
673 int* __cdecl
__p___mb_cur_max(void);
674 wchar_t* __cdecl
MSVCRT__wcsdup(const wchar_t*);
675 size_t __cdecl
MSVCRT_wcsnlen(const wchar_t*,size_t);
676 wchar_t*** __cdecl
MSVCRT___p__wenviron(void);
677 INT __cdecl
MSVCRT_wctomb(char*,wchar_t);
678 int __cdecl
MSVCRT__wctomb_l(char*, wchar_t, _locale_t
);
679 char* __cdecl
MSVCRT__strdate(char* date
);
680 char* __cdecl
MSVCRT__strtime(char* date
);
681 int __cdecl
_setmbcp(int);
682 int __cdecl
MSVCRT__close(int);
683 int __cdecl
MSVCRT__dup(int);
684 int __cdecl
MSVCRT__dup2(int, int);
685 int __cdecl
MSVCRT__pipe(int *, unsigned int, int);
686 void __cdecl
MSVCRT__wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
687 int __cdecl
MSVCRT__towupper_l(wint_t,_locale_t
);
688 int __cdecl
MSVCRT__towlower_l(wint_t,_locale_t
);
689 int __cdecl
MSVCRT_strcmp(const char*, const char*);
690 char* __cdecl
MSVCRT__itoa(int, char*, int);
691 int __cdecl
MSVCRT_wcsncmp(const wchar_t*, const wchar_t*, size_t);
692 int __cdecl
MSVCRT__wcsnicmp(const wchar_t*, const wchar_t*, size_t);
693 int __cdecl
MSVCRT_towlower(wint_t);
694 int __cdecl
MSVCRT_towupper(wint_t);
695 int __cdecl
MSVCRT__iswalnum_l(wchar_t, _locale_t
);
696 int __cdecl
MSVCRT__iswdigit_l(wchar_t, _locale_t
);
697 int __cdecl
MSVCRT__iswgraph_l(wchar_t, _locale_t
);
698 int __cdecl
MSVCRT__iswalpha_l(wchar_t, _locale_t
);
699 int __cdecl
MSVCRT__iswlower_l(wchar_t, _locale_t
);
700 int __cdecl
MSVCRT__iswupper_l(wchar_t, _locale_t
);
701 int __cdecl
MSVCRT__iswprint_l(wchar_t, _locale_t
);
702 int __cdecl
MSVCRT__iswpunct_l(wchar_t, _locale_t
);
703 size_t __cdecl
MSVCRT_wcslen(const wchar_t*);
704 wchar_t* __cdecl
MSVCRT_wcscpy(wchar_t*, const wchar_t*);
705 wchar_t* __cdecl
MSVCRT_wcschr(const wchar_t*, wchar_t);
706 wchar_t* __cdecl
MSVCRT_wcscat(wchar_t*, const wchar_t*);
708 double __cdecl
MSVCRT_floor( double x
);
709 float __cdecl
MSVCRT_floorf( float x
);
710 double __cdecl
MSVCRT_frexp( double x
, int *exp
);
711 double __cdecl
MSVCRT_log10( double x
);
712 double __cdecl
MSVCRT_sqrt( double x
);
713 float __cdecl
MSVCRT_sqrtf( float x
);
716 FP_ROUND_ZERO
, /* only used when dropped part contains only zeros */
730 struct fpnum
fpnum_parse(wchar_t (*)(void*), void (*)(void*),
731 void*, pthreadlocinfo
, BOOL
) DECLSPEC_HIDDEN
;
732 int fpnum_double(struct fpnum
*, double*) DECLSPEC_HIDDEN
;
733 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
734 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
735 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE)
736 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending
738 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around _invalid_parameter in order
739 * to do the Ansi to Unicode transformation
741 #define MSVCRT_INVALID_PMT(x,err) (*_errno() = (err), _invalid_parameter(NULL, NULL, NULL, 0, 0))
742 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
743 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), EINVAL)
745 typedef int (*puts_clbk_a
)(void*, int, const char*);
746 typedef int (*puts_clbk_w
)(void*, int, const wchar_t*);
747 typedef union _printf_arg
751 LONGLONG get_longlong
;
754 typedef printf_arg (*args_clbk
)(void*, int, int, __ms_va_list
*);
755 int pf_printf_a(puts_clbk_a
, void*, const char*, _locale_t
,
756 DWORD
, args_clbk
, void*, __ms_va_list
*) DECLSPEC_HIDDEN
;
757 int pf_printf_w(puts_clbk_w
, void*, const wchar_t*, _locale_t
,
758 DWORD
, args_clbk
, void*, __ms_va_list
*) DECLSPEC_HIDDEN
;
759 int create_positional_ctx_a(void*, const char*, __ms_va_list
) DECLSPEC_HIDDEN
;
760 int create_positional_ctx_w(void*, const wchar_t*, __ms_va_list
) DECLSPEC_HIDDEN
;
761 printf_arg
arg_clbk_valist(void*, int, int, __ms_va_list
*) DECLSPEC_HIDDEN
;
762 printf_arg
arg_clbk_positional(void*, int, int, __ms_va_list
*) DECLSPEC_HIDDEN
;
764 extern char* __cdecl
__unDName(char *,const char*,int,malloc_func_t
,free_func_t
,unsigned short int);
766 /* __unDName/__unDNameEx flags */
767 #define UNDNAME_COMPLETE (0x0000)
768 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
769 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
770 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
771 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
772 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
773 #define UNDNAME_NO_MS_THISTYPE (0x0020)
774 #define UNDNAME_NO_CV_THISTYPE (0x0040)
775 #define UNDNAME_NO_THISTYPE (0x0060)
776 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
777 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
778 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
779 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
780 #define UNDNAME_32_BIT_DECODE (0x0800)
781 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
782 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
783 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
784 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
786 #define UCRTBASE_PRINTF_MASK ( \
787 _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION | \
788 _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR | \
789 _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS | \
790 _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY | \
791 _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS | \
792 _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING )
794 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100)
795 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200)
797 #define UCRTBASE_SCANF_MASK ( \
798 _CRT_INTERNAL_SCANF_SECURECRT | \
799 _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS | \
800 _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY )
802 #define COOPERATIVE_TIMEOUT_INFINITE ((unsigned int)-1)
803 #define COOPERATIVE_WAIT_TIMEOUT ~0
805 #define INHERIT_THREAD_PRIORITY 0xF000
807 #endif /* __WINE_MSVCRT_H */