better -Mre=debugcolor
[p5sagit/p5-mst-13.2.git] / thrdvar.h
CommitLineData
cb68f92d 1/***********************************************/
2/* Global only to current thread */
3/***********************************************/
4
8b3be1d1 5/* Don't forget to re-run embed.pl to propagate changes! */
6
cb68f92d 7/* The 'T' prefix is only needed for vars that need appropriate #defines
8 * generated when built with or without USE_THREADS. It is also used
9 * to generate the appropriate export list for win32.
10 *
11 * When building without USE_THREADS, these variables will be truly global.
12 * When building without USE_THREADS but with MULTIPLICITY, these variables
13 * will be global per-interpreter.
14 *
15 * Avoid build-specific #ifdefs here, like DEBUGGING. That way,
16 * we can keep binary compatibility of the curinterp structure */
8b3be1d1 17
49f531da 18/* Important ones in the first cache line (if alignment is done right) */
d4cce5f1 19
cb68f92d 20PERLVAR(Tstack_sp, SV **) /* top of the stack */
49f531da 21#ifdef OP_IN_REGISTER
cb68f92d 22PERLVAR(Topsave, OP *)
49f531da 23#else
cb68f92d 24PERLVAR(Top, OP *) /* currently executing op */
49f531da 25#endif
cb68f92d 26PERLVAR(Tcurpad, SV **) /* active pad (lexicals+tmps) */
27
28PERLVAR(Tstack_base, SV **)
29PERLVAR(Tstack_max, SV **)
30
31PERLVAR(Tscopestack, I32 *) /* scopes we've ENTERed */
32PERLVAR(Tscopestack_ix, I32)
33PERLVAR(Tscopestack_max,I32)
49f531da 34
cb68f92d 35PERLVAR(Tsavestack, ANY *) /* items that need to be restored
36 when LEAVEing scopes we've ENTERed */
37PERLVAR(Tsavestack_ix, I32)
38PERLVAR(Tsavestack_max, I32)
49f531da 39
cb68f92d 40PERLVAR(Ttmps_stack, SV **) /* mortals we've made */
41PERLVARI(Ttmps_ix, I32, -1)
42PERLVARI(Ttmps_floor, I32, -1)
43PERLVAR(Ttmps_max, I32)
49f531da 44
cb68f92d 45PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */
46PERLVAR(Tmarkstack_ptr, I32 *)
47PERLVAR(Tmarkstack_max, I32 *)
49f531da 48
cb68f92d 49PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */
50PERLVAR(Tretstack_ix, I32)
51PERLVAR(Tretstack_max, I32)
49f531da 52
cb68f92d 53PERLVAR(TSv, SV *) /* used to hold temporary values */
54PERLVAR(TXpv, XPV *) /* used to hold temporary values */
49f531da 55
5c0ca799 56/* stat stuff */
cb68f92d 57PERLVAR(Tstatbuf, Stat_t)
5c0ca799 58PERLVAR(Tstatcache, Stat_t) /* _ */
59PERLVAR(Tstatgv, GV *)
60PERLVARI(Tstatname, SV *, Nullsv)
61
49f531da 62#ifdef HAS_TIMES
cb68f92d 63PERLVAR(Ttimesbuf, struct tms)
49f531da 64#endif
49f531da 65
66/* Fields used by magic variables such as $@, $/ and so on */
d4cce5f1 67PERLVAR(Ttainted, bool) /* using variables controlled by $< */
cb68f92d 68PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */
69PERLVAR(Tnrs, SV *)
70PERLVAR(Trs, SV *) /* input record separator $/ */
71PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */
72PERLVAR(Tofs, char *) /* output field separator $, */
73PERLVAR(Tofslen, STRLEN)
74PERLVAR(Tdefoutgv, GV *) /* default FH for output */
d4cce5f1 75PERLVARI(Tchopset, char *, " \n-") /* $: */
cb68f92d 76PERLVAR(Tformtarget, SV *)
77PERLVAR(Tbodytarget, SV *)
78PERLVAR(Ttoptarget, SV *)
49f531da 79
d4cce5f1 80/* Stashes */
81PERLVAR(Tdefstash, HV *) /* main symbol table */
82PERLVAR(Tcurstash, HV *) /* symbol table for current package */
49f531da 83
cb68f92d 84PERLVAR(Trestartop, OP *) /* propagating an error from croak? */
3280af22 85PERLVARI(Tcurcop, COP * VOL, &PL_compiling)
d4cce5f1 86PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */
87PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */
24d3c518 88PERLVARI(Tdirty, bool, FALSE) /* in the middle of tearing things down? */
61bb5906 89PERLVAR(Tlocalizing, int) /* are we processing a local() list? */
49f531da 90
cb68f92d 91PERLVAR(Tcurstack, AV *) /* THE STACK */
92PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */
93PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */
94PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */
95PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */
49f531da 96
4e4c362e 97/* statics "owned" by various functions */
cb68f92d 98PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */
99PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */
100PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */
101
102PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */
4e4c362e 103
5c0ca799 104PERLVAR(Tlastgotoprobe, OP*) /* from pp_ctl.c */
3967c732 105PERLVARI(Tdumpindent, I32, 4) /* # of blanks per dump indentation level */
5c0ca799 106
107/* sort stuff */
108PERLVAR(Tsortcop, OP *) /* user defined sort routine */
109PERLVAR(Tsortstash, HV *) /* which is in some package or other */
110PERLVAR(Tfirstgv, GV *) /* $a */
111PERLVAR(Tsecondgv, GV *) /* $b */
112PERLVAR(Tsortcxix, I32) /* from pp_ctl.c */
113
114/* regex stuff */
115
116PERLVAR(Tscreamfirst, I32 *)
117PERLVAR(Tscreamnext, I32 *)
118PERLVARI(Tmaxscream, I32, -1)
119PERLVAR(Tlastscream, SV *)
120
121PERLVAR(Tregdummy, regnode) /* from regcomp.c */
122PERLVAR(Tregcomp_parse, char*) /* Input-scan pointer. */
123PERLVAR(Tregxend, char*) /* End of input for compile */
124PERLVAR(Tregcode, regnode*) /* Code-emit pointer; &regdummy = don't */
125PERLVAR(Tregnaughty, I32) /* How bad is this pattern? */
126PERLVAR(Tregsawback, I32) /* Did we see \1, ...? */
127PERLVAR(Tregprecomp, char *) /* uncompiled string. */
128PERLVAR(Tregnpar, I32) /* () count. */
129PERLVAR(Tregsize, I32) /* Code size. */
130PERLVAR(Tregflags, U16) /* are we folding, multilining? */
131PERLVAR(Tregseen, U32) /* from regcomp.c */
132PERLVAR(Tseen_zerolen, I32) /* from regcomp.c */
133PERLVAR(Tseen_evals, I32) /* from regcomp.c */
134PERLVAR(Tregcomp_rx, regexp *) /* from regcomp.c */
135PERLVAR(Textralen, I32) /* from regcomp.c */
136PERLVAR(Tcolorset, int) /* from regcomp.c */
8d300b32 137PERLVAR(Tcolors[6], char *) /* from regcomp.c */
5c0ca799 138PERLVAR(Treginput, char *) /* String-input pointer. */
139PERLVAR(Tregbol, char *) /* Beginning of input, for ^ check. */
140PERLVAR(Tregeol, char *) /* End of input, for $ check. */
141PERLVAR(Tregstartp, char **) /* Pointer to startp array. */
142PERLVAR(Tregendp, char **) /* Ditto for endp. */
143PERLVAR(Treglastparen, U32 *) /* Similarly for lastparen. */
144PERLVAR(Tregtill, char *) /* How far we are required to go. */
145PERLVAR(Tregprev, char) /* char before regbol, \n if none */
146PERLVAR(Treg_start_tmp, char **) /* from regexec.c */
147PERLVAR(Treg_start_tmpl,U32) /* from regexec.c */
148PERLVAR(Tregdata, struct reg_data *)
149 /* from regexec.c renamed was data */
150PERLVAR(Tbostr, char *) /* from regexec.c */
151PERLVAR(Treg_flags, U32) /* from regexec.c */
152PERLVAR(Treg_eval_set, I32) /* from regexec.c */
153PERLVAR(Tregnarrate, I32) /* from regexec.c */
154PERLVAR(Tregprogram, regnode *) /* from regexec.c */
155PERLVARI(Tregindent, int, 0) /* from regexec.c */
156PERLVAR(Tregcc, CURCUR *) /* from regexec.c */
0f5d15d6 157PERLVAR(Treg_call_cc, struct re_cc_state *) /* from regexec.c */
158PERLVAR(Treg_re, regexp *) /* from regexec.c */
22e551b9 159PERLVAR(Treg_ganch, char *) /* position of \G */
160PERLVAR(Treg_sv, SV *) /* what we match against */
9661b544 161PERLVAR(Treg_magic, MAGIC *) /* pos-magic of what we match */
162PERLVAR(Treg_oldpos, I32) /* old pos of what we match */
5c0ca799 163
164PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp))
165 /* Pointer to RE compiler */
166PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags))
167 /* Pointer to RE executer */
60ad88b8 168PERLVARI(Treginterp_cnt,int, 0) /* Whether `re'
5c0ca799 169 was interpolated. */
364723c2 170PERLVARI(Treg_starttry, char *, 0) /* -Dr: where regtry was called. */
22c35a8c 171#ifdef DEBUGGING
172PERLVARI(Twatchaddr, char **, 0)
173PERLVAR(Twatchok, char *)
174#endif
d4cce5f1 175
8b3be1d1 176/* Note that the variables below are all explicitly referenced in the code
cb68f92d 177 * as thr->whatever and therefore don't need the 'T' prefix. */
8b3be1d1 178
d4cce5f1 179#ifdef USE_THREADS
49f531da 180
cb68f92d 181PERLVAR(oursv, SV *)
182PERLVAR(cvcache, HV *)
183PERLVAR(self, perl_os_thread) /* Underlying thread object */
184PERLVAR(flags, U32)
185PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */
186PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */
187PERLVAR(specific, AV *) /* Thread-specific user data */
188PERLVAR(errsv, SV *) /* Backing SV for $@ */
189PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */
190PERLVAR(mutex, perl_mutex) /* For the fields others can change */
191PERLVAR(tid, U32)
49f531da 192PERLVAR(prev, struct perl_thread *)
cb68f92d 193PERLVAR(next, struct perl_thread *)
194 /* Circular linked list of threads */
49f531da 195
196#ifdef HAVE_THREAD_INTERN
cb68f92d 197PERLVAR(i, struct thread_intern)
198 /* Platform-dependent internals */
49f531da 199#endif
200
cb68f92d 201PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
49f531da 202
d4cce5f1 203#endif /* USE_THREADS */