79ad295618eeb4f44e566cb70f203a0bb640e49b
[reactos.git] / reactos / lib / crt / include / internal / tls.h
1 /* tls.h */
2
3 #ifndef __CRT_INTERNAL_TLS_H
4 #define __CRT_INTERNAL_TLS_H
5
6 #ifndef _CRT_PRECOMP_H
7 #error DO NOT INCLUDE THIS HEADER DIRECTLY
8 #endif
9
10 #include <stdarg.h>
11
12 #include <windef.h>
13 #include <winbase.h>
14 #include <winnt.h>
15
16 #include <stddef.h>
17
18 typedef struct _ThreadData
19 {
20 HANDLE hThread; /* handle to the current thread */
21 void (__cdecl *start_address)(void*); /* the start address supplied by _beginthread() */
22 void* arglist; /* the argument list supplied by _beginthread() */
23
24 int terrno; /* *nix error code */
25 unsigned long tdoserrno; /* Win32 error code (for I/O only) */
26 unsigned __int64 tnext; /* used by rand/srand */
27
28 char *lasttoken; /* used by strtok */
29 wchar_t *wlasttoken; /* used by wcstok */
30
31
32 int fpecode; /* fp exception code */
33
34 /* qsort variables */
35 int (*qcmp)(const void *, const void *); /* the comparison routine */
36 int qsz; /* size of each record */
37 int thresh; /* THRESHold in chars */
38 int mthresh; /* MTHRESHold in chars */
39
40 EXCEPTION_RECORD *exc_record; /* Head of exception record list */
41
42 } THREADDATA, *PTHREADDATA;
43
44
45 int CreateThreadData(void);
46 void DestroyThreadData(void);
47
48 int SetThreadData(PTHREADDATA ThreadData);
49 void FreeThreadData(PTHREADDATA ThreadData);
50 PTHREADDATA GetThreadData(void);
51
52 #endif /* __MSVCRT_INTERNAL_TLS_H */
53
54 /* EOF */
55