2 * Copyright 2001 Jon Griffiths
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_MSVCRT_H
20 #define __WINE_MSVCRT_H
31 //#include "msvcrt/string.h"
35 extern DWORD MSVCRT_tls_index
;
37 typedef struct __MSVCRT_thread_data
40 unsigned long doserrno
;
41 char *mbstok_next
; /* next ptr for mbstok() */
42 char *efcvt_buffer
; /* buffer for ecvt/fcvt */
43 terminate_function terminate_handler
;
44 unexpected_function unexpected_handler
;
45 _se_translator_function se_translator
;
46 EXCEPTION_RECORD
*exc_record
;
49 extern MSVCRT_thread_data
*msvcrt_get_thread_data(void);
51 extern int MSVCRT_current_lc_all_cp
;
54 void MSVCRT__set_errno(int);
55 char* msvcrt_strndup(const char*,unsigned int);
57 MSVCRT_wchar_t
*msvcrt_wstrndup(const MSVCRT_wchar_t
*, unsigned int);
59 void MSVCRT__amsg_exit(int errnum
);
61 extern char **MSVCRT__environ
;
63 extern MSVCRT_wchar_t
**MSVCRT__wenviron
;
64 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
65 extern MSVCRT_wchar_t
** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t
**);
68 /* FIXME: This should be declared in new.h but it's not an extern "C" so
69 * it would not be much use anyway. Even for Winelib applications.
71 int MSVCRT__set_new_mode(int mode
);
73 void* MSVCRT_operator_new(unsigned long size
);
74 void MSVCRT_operator_delete(void*);
76 typedef void* (*MSVCRT_malloc_func
)(MSVCRT_size_t
);
78 typedef void (*MSVCRT_free_func
)(void*);
80 extern char* MSVCRT___unDName(int,const char*,int,MSVCRT_malloc_func
,MSVCRT_free_func
,unsigned int);
83 /* Setup and teardown multi threaded locks */
84 extern void msvcrt_init_mt_locks(void);
85 extern void msvcrt_free_mt_locks(void);
87 extern void msvcrt_init_io(void);
88 extern void msvcrt_free_io(void);
89 extern void msvcrt_init_console(void);
90 extern void msvcrt_free_console(void);
91 extern void msvcrt_init_args(void);
92 extern void msvcrt_free_args(void);
94 /* run-time error codes */
100 #define _RT_EXECFORM 6
101 #define _RT_EXECENV 7
102 #define _RT_SPACEARG 8
103 #define _RT_SPACEENV 9
109 #define _RT_THREAD 16
112 #define _RT_OPENCON 19
114 #define _RT_NOMAIN 21
115 #define _RT_NONCONT 22
116 #define _RT_INVALDISP 23
117 #define _RT_ONEXIT 24
118 #define _RT_PUREVIRT 25
119 #define _RT_STDIOINIT 26
120 #define _RT_LOWIOINIT 27
121 #define _RT_HEAPINIT 28
122 #define _RT_DOMAIN 120
124 #define _RT_TLOSS 122
126 #define _RT_BANNER 255
128 typedef void* (*malloc_func_t
)(size_t);
129 typedef void (*free_func_t
)(void*);
130 #define MSVCRT_malloc malloc
131 #define MSVCRT_free free
132 NTSYSAPI VOID NTAPI
RtlAssert(PVOID FailedAssertion
,PVOID FileName
,ULONG LineNumber
,PCHAR Message
);
133 extern char* __unDName(char *,const char*,int,malloc_func_t
,free_func_t
,unsigned short int);
135 #endif /* __WINE_MSVCRT_H */