3 #ifndef __CRT_INTERNAL_TLS_H
4 #define __CRT_INTERNAL_TLS_H
7 #error DO NOT INCLUDE THIS HEADER DIRECTLY
17 #include <internal/wine/eh.h>
19 typedef struct MSVCRT_threadlocaleinfostruct
{
21 unsigned int lc_codepage
;
22 unsigned int lc_collate_cp
;
23 unsigned long lc_handle
[6];
33 int *lconv_intl_refcount
;
34 int *lconv_num_refcount
;
35 int *lconv_mon_refcount
;
36 struct MSVCRT_lconv
*lconv
;
38 unsigned short *ctype1
;
39 unsigned short *pctype
;
40 unsigned char *pclmap
;
41 unsigned char *pcumap
;
42 struct __lc_time_data
*lc_time_curr
;
43 } MSVCRT_threadlocinfo
;
45 typedef struct MSVCRT_threadmbcinfostruct
{
50 unsigned short mbulinfo
[6];
53 } MSVCRT_threadmbcinfo
;
59 char* int_curr_symbol
;
60 char* currency_symbol
;
61 char* mon_decimal_point
;
62 char* mon_thousands_sep
;
76 typedef struct MSVCRT_threadlocaleinfostruct
*MSVCRT_pthreadlocinfo
;
77 typedef struct MSVCRT_threadmbcinfostruct
*MSVCRT_pthreadmbcinfo
;
79 typedef struct MSVCRT_localeinfo_struct
81 MSVCRT_pthreadlocinfo locinfo
;
82 MSVCRT_pthreadmbcinfo mbcinfo
;
83 } MSVCRT__locale_tstruct
, *MSVCRT__locale_t
;
86 extern DWORD tls_index
;
88 struct __thread_data
{
92 unsigned long thread_doserrno
;
94 unsigned int random_seed
; /* seed for rand() */
95 char *strtok_next
; /* next ptr for strtok() */
96 wchar_t *wcstok_next
; /* next ptr for wcstok() */
97 unsigned char *mbstok_next
; /* next ptr for mbstok() */
98 char *strerror_buffer
; /* buffer for strerror */
99 wchar_t *wcserror_buffer
; /* buffer for wcserror */
100 char *tmpnam_buffer
; /* buffer for tmpname() */
101 wchar_t *wtmpnam_buffer
; /* buffer for wtmpname() */
103 char *asctime_buffer
; /* buffer for asctime */
104 wchar_t *wasctime_buffer
; /* buffer for wasctime */
105 struct tm
*time_buffer
; /* buffer for localtime/gmtime */
106 char *efcvt_buffer
; /* buffer for ecvt/fcvt */
110 MSVCRT_pthreadmbcinfo mbcinfo
;
111 MSVCRT_pthreadlocinfo locinfo
;
114 terminate_function terminate_handler
;
115 unexpected_function unexpected_handler
;
116 _se_translator_function se_translator
;
119 EXCEPTION_RECORD
*exc_record
;
123 typedef struct __thread_data thread_data_t
;
125 extern inline BOOL
msvcrt_init_tls(void);
126 extern inline BOOL
msvcrt_free_tls(void);
127 extern thread_data_t
*msvcrt_get_thread_data(void);
128 extern inline void msvcrt_free_tls_mem(void);
130 #define MSVCRT_ENABLE_PER_THREAD_LOCALE 1
131 #define MSVCRT_DISABLE_PER_THREAD_LOCALE 2
133 extern MSVCRT__locale_t MSVCRT_locale
;
134 MSVCRT_pthreadlocinfo
get_locinfo(void);
135 void __cdecl
MSVCRT__free_locale(MSVCRT__locale_t
);
136 void free_locinfo(MSVCRT_pthreadlocinfo
);
137 void free_mbcinfo(MSVCRT_pthreadmbcinfo
);
139 #endif /* __MSVCRT_INTERNAL_TLS_H */