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/eh.h"
34 extern DWORD MSVCRT_tls_index
;
36 typedef struct __MSVCRT_thread_data
39 unsigned long doserrno
;
40 terminate_function terminate_handler
;
41 unexpected_function unexpected_handler
;
42 _se_translator_function se_translator
;
45 extern MSVCRT_thread_data
*msvcrt_get_thread_data(void);
47 extern int MSVCRT_current_lc_all_cp
;
50 void MSVCRT__set_errno(int);
51 char* msvcrt_strndup(const char*,unsigned int);
52 LPWSTR
msvcrt_wstrndup(LPCWSTR
, unsigned int);
54 void MSVCRT__amsg_exit(int errnum
);
56 extern char **MSVCRT__environ
;
57 extern WCHAR
**MSVCRT__wenviron
;
59 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
60 extern WCHAR
** msvcrt_SnapshotOfEnvironmentW(WCHAR
**);
62 /* FIXME: This should be declared in new.h but it's not an extern "C" so
63 * it would not be much use anyway. Even for Winelib applications.
65 int MSVCRT__set_new_mode(int mode
);
67 /* Setup and teardown multi threaded locks */
68 extern void msvcrt_init_mt_locks(void);
69 extern void msvcrt_free_mt_locks(void);
71 extern void msvcrt_init_io(void);
72 extern void msvcrt_free_io(void);
73 extern void msvcrt_init_console(void);
74 extern void msvcrt_free_console(void);
75 extern void msvcrt_init_args(void);
76 extern void msvcrt_free_args(void);
77 extern void msvcrt_init_vtables(void);
79 /* run-time error codes */
85 #define _RT_EXECFORM 6
87 #define _RT_SPACEARG 8
88 #define _RT_SPACEENV 9
97 #define _RT_OPENCON 19
100 #define _RT_NONCONT 22
101 #define _RT_INVALDISP 23
102 #define _RT_ONEXIT 24
103 #define _RT_PUREVIRT 25
104 #define _RT_STDIOINIT 26
105 #define _RT_LOWIOINIT 27
106 #define _RT_HEAPINIT 28
107 #define _RT_DOMAIN 120
109 #define _RT_TLOSS 122
111 #define _RT_BANNER 255
113 #endif /* __WINE_MSVCRT_H */