bringing SDL 1.2.14 from vendor into the main branch
[AROS-Contrib.git] / regina / mt.h
blob37bc9481455bb84a278d8140edd72f9499e311ef
1 #ifndef MT_H_INCLUDED
2 #define MT_H_INCLUDED
4 #include <setjmp.h>
6 struct extlib_funcbox; /* private type in extlib.c */
8 /* tsd_t holds all global vars which may change between threads as expected.*/
9 typedef struct _tsd_t {
10 void * mem_tsd ; /* local variables of memory.c */
11 void * var_tsd ; /* local variables of variable.c */
12 void * stk_tsd ; /* local variables of stack.c */
13 void * fil_tsd ; /* local variables of files.c */
14 void * itp_tsd ; /* local variables of interprt.c */
15 void * tra_tsd ; /* local variables of tracing.c */
16 void * err_tsd ; /* local variables of error.c */
17 void * vms_tsd ; /* local variables of vmscmd.c */
18 void * bui_tsd ; /* local variables of builtin.c */
19 void * vmf_tsd ; /* local variables of vmsfuncs.c */
20 void * lib_tsd ; /* local variables of library.c */
21 void * rex_tsd ; /* local variables of rexxsaa.c */
22 void * shl_tsd ; /* local variables of shell.c */
23 void * mat_tsd ; /* local variables of strmath.c */
24 void * cli_tsd ; /* local variables of client.c */
25 void * arx_tsd ; /* local variables of arexxfuncs.c */
26 void * ami_tsd ; /* local variables of amigafuncs.c */
27 void * mt_tsd ; /* local variables of mt_???.c */
29 void * CH; /* only rexxsaa.c */
30 int stemidx; /* only get_next_variable() */
31 int tailidx ; /* only get_next_variable() */
32 int indentsize; /* only in r2perl.c */
33 int loopcnt; /* only in r2perl.c */
34 paramboxptr listleaked_params ; /* only in funcs.c */
35 paramboxptr par_stack ; /* only in funcs.c */
36 int traceparse ; /* only in parsing.c */
37 num_descr rdes; /* only in expr.c */
38 num_descr ldes; /* only in expr.c */
39 void * firstenvir; /* only in envir.c */
40 void * last_alloca_header; /* only in alloca.c */
41 void * stkaddr; /* only in alloca.c */
42 volatile char * tmp_strs[8]; /* only tmpstr_of() */
43 int next_tmp_str; /* only tmpstr_of() */
44 struct extlib_funcbox * extfuncs[133]; /* only in extlib.c */
45 paramboxptr bif_first ; /* only builtinfunc() */
46 void * firstmacro ; /* only in macros.c */
48 sysinfo systeminfo ;
49 proclevel currlevel ;
50 int listleakedmemory ;
51 int var_indicator ;
52 int isclient ;
53 nodeptr currentnode ;
54 sigtype * nextsig;
55 FILE * stddump;
56 unsigned long thread_id;
57 int instore_is_errorfree;
58 char trace_stat;
59 int called_from_saa;
60 int restricted;
61 /* Stuff for a delayed exit()/setjmp(): */
62 int in_protected;
63 jmp_buf protect_return;
64 volatile enum { PROTECTED_DelayedExit,
65 PROTECTED_DelayedSetjmpPanic,
66 PROTECTED_DelayedSetjmpBuf} delayed_error_type;
67 volatile int expected_exit_error;
68 /* call exit() with this value if
69 * delayed_error_type is PROTECTED_DelayedExit
71 void * (*MTMalloc)(const struct _tsd_t *TSD,size_t size);
72 void (*MTFree)(const struct _tsd_t *TSD,void *chunk);
73 void (*MTExit)(int code);
74 } tsd_t;
77 #if defined(POSIX) && (defined(_REENTRANT) || defined(REENTRANT))
78 # include "mt_posix.h"
79 #elif defined(_WIN32) && defined(_MT)
80 # include "mt_win32.h"
81 #elif defined(OS2) && defined(__EMX__) && defined(__MT__) && defined(REGINA_MULTI)
82 # include "mt_os2.h"
83 #elif (defined(__AROS__) || defined(_AMIGA)) && defined(RXLIB)
84 # include "mt_amigalib.h"
85 #else
86 # include "mt_notmt.h"
87 # if !defined(SINGLE_THREADED) && !defined(MULTI_THREADED)
88 # define SINGLE_THREADED
89 # endif
90 #endif
92 /* SINGLE_THREAD is defined explicitely, thus: */
93 #if !defined(SINGLE_THREADED) && !defined(MULTI_THREADED)
94 # define MULTI_THREADED
95 #endif
97 #endif /* MT_H_INCLUDED */