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
32 extern DWORD MSVCRT_tls_index
;
34 typedef struct __MSVCRT_thread_data
37 unsigned long doserrno
;
40 #define GET_THREAD_DATA(x) \
41 x = TlsGetValue(MSVCRT_tls_index)
42 #define GET_THREAD_VAR(x) \
43 ((MSVCRT_thread_data*)TlsGetValue(MSVCRT_tls_index))->x
44 #define GET_THREAD_VAR_PTR(x) \
45 (&((MSVCRT_thread_data*)TlsGetValue(MSVCRT_tls_index))->x)
46 #define SET_THREAD_VAR(x,y) \
47 ((MSVCRT_thread_data*)TlsGetValue(MSVCRT_tls_index))->x = y
49 extern int MSVCRT_current_lc_all_cp
;
52 void MSVCRT__set_errno(int);
53 char* msvcrt_strndup(const char*,unsigned int);
54 LPWSTR
msvcrt_wstrndup(LPCWSTR
, unsigned int);
56 /* FIXME: This should be declared in new.h but it's not an extern "C" so
57 * it would not be much use anyway. Even for Winelib applications.
59 int MSVCRT__set_new_mode(int mode
);
61 /* Setup and teardown multi threaded locks */
62 void msvcrt_init_mt_locks(void);
63 void msvcrt_free_mt_locks(void);
65 #endif /* __WINE_MSVCRT_H */