Commit | Line | Data |
---|---|---|
907b3e23 DM |
1 | /* intrpvar.h |
2 | * | |
3 | * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, | |
1129b882 | 4 | * 2006, 2007, 2008 by Larry Wall and others |
907b3e23 DM |
5 | * |
6 | * You may distribute under the terms of either the GNU General Public | |
7 | * License or the Artistic License, as specified in the README file. | |
8 | * | |
9 | */ | |
10 | ||
11 | /* | |
12 | =head1 Per-Interpreter Variables | |
13 | */ | |
49f531da | 14 | |
907b3e23 DM |
15 | /* These variables are per-interpreter in threaded/multiplicity builds, |
16 | * global otherwise. | |
17 | ||
d7cb65f2 | 18 | * Don't forget to re-run regen/embed.pl to propagate changes! */ |
cb68f92d | 19 | |
6537fe72 MS |
20 | /* New variables must be added to the very end for binary compatibility. |
21 | * XSUB.h provides wrapper functions via perlapi.h that make this | |
22 | * irrelevant, but not all code may be expected to #include XSUB.h. */ | |
23 | ||
02506efe JH |
24 | /* Don't forget to add your variable also to perl_clone()! */ |
25 | ||
cb68f92d GS |
26 | /* The 'I' prefix is only needed for vars that need appropriate #defines |
27 | * generated when built with or without MULTIPLICITY. It is also used | |
97df044c KW |
28 | * to generate the appropriate export list for win32. If the variable |
29 | * needs to be initialized, use PERLVARI. | |
cb68f92d | 30 | * |
907b3e23 DM |
31 | * When building without MULTIPLICITY, these variables will be truly global. |
32 | * | |
33 | * Important ones in the first cache line (if alignment is done right) */ | |
34 | ||
35 | PERLVAR(Istack_sp, SV **) /* top of the stack */ | |
36 | #ifdef OP_IN_REGISTER | |
37 | PERLVAR(Iopsave, OP *) | |
38 | #else | |
39 | PERLVAR(Iop, OP *) /* currently executing op */ | |
40 | #endif | |
41 | PERLVAR(Icurpad, SV **) /* active pad (lexicals+tmps) */ | |
42 | ||
43 | PERLVAR(Istack_base, SV **) | |
44 | PERLVAR(Istack_max, SV **) | |
45 | ||
46 | PERLVAR(Iscopestack, I32 *) /* scopes we've ENTERed */ | |
f2b88940 NC |
47 | /* name of the scopes we've ENTERed. Only used with -DDEBUGGING, but needs to be |
48 | present always, as -DDEUBGGING must be binary compatible with non. */ | |
49 | PERLVARI(Iscopestack_name, const char * *, NULL) | |
907b3e23 DM |
50 | PERLVAR(Iscopestack_ix, I32) |
51 | PERLVAR(Iscopestack_max,I32) | |
52 | ||
53 | PERLVAR(Isavestack, ANY *) /* items that need to be restored when | |
54 | LEAVEing scopes we've ENTERed */ | |
55 | PERLVAR(Isavestack_ix, I32) | |
56 | PERLVAR(Isavestack_max, I32) | |
57 | ||
58 | PERLVAR(Itmps_stack, SV **) /* mortals we've made */ | |
59 | PERLVARI(Itmps_ix, I32, -1) | |
60 | PERLVARI(Itmps_floor, I32, -1) | |
61 | PERLVAR(Itmps_max, I32) | |
3ad73efd | 62 | PERLVAR(Imodcount, I32) /* how much op_lvalue()ification in |
907b3e23 DM |
63 | assignment? */ |
64 | ||
65 | PERLVAR(Imarkstack, I32 *) /* stack_sp locations we're | |
66 | remembering */ | |
67 | PERLVAR(Imarkstack_ptr, I32 *) | |
68 | PERLVAR(Imarkstack_max, I32 *) | |
69 | ||
70 | PERLVAR(ISv, SV *) /* used to hold temporary values */ | |
71 | PERLVAR(IXpv, XPV *) /* used to hold temporary values */ | |
72 | ||
73 | /* | |
74 | =for apidoc Amn|STRLEN|PL_na | |
75 | ||
76 | A convenience variable which is typically used with C<SvPV> when one | |
77 | doesn't care about the length of the string. It is usually more efficient | |
78 | to either declare a local variable and use that instead or to use the | |
79 | C<SvPV_nolen> macro. | |
80 | ||
81 | =cut | |
82 | */ | |
83 | ||
84 | PERLVAR(Ina, STRLEN) /* for use in SvPV when length is | |
85 | Not Applicable */ | |
86 | ||
87 | /* stat stuff */ | |
88 | PERLVAR(Istatbuf, Stat_t) | |
89 | PERLVAR(Istatcache, Stat_t) /* _ */ | |
90 | PERLVAR(Istatgv, GV *) | |
91 | PERLVARI(Istatname, SV *, NULL) | |
92 | ||
93 | #ifdef HAS_TIMES | |
94 | PERLVAR(Itimesbuf, struct tms) | |
95 | #endif | |
96 | ||
97 | /* Fields used by magic variables such as $@, $/ and so on */ | |
98 | PERLVAR(Icurpm, PMOP *) /* what to do \ interps in REs from */ | |
99 | ||
100 | /* | |
101 | =for apidoc mn|SV*|PL_rs | |
102 | ||
103 | The input record separator - C<$/> in Perl space. | |
104 | ||
105 | =for apidoc mn|GV*|PL_last_in_gv | |
106 | ||
107 | The GV which was last used for a filehandle input operation. (C<< <FH> >>) | |
108 | ||
e23d9e2f | 109 | =for apidoc mn|GV*|PL_ofsgv |
907b3e23 | 110 | |
e23d9e2f | 111 | The glob containing the output field separator - C<*,> in Perl space. |
907b3e23 DM |
112 | |
113 | =cut | |
114 | */ | |
115 | ||
116 | PERLVAR(Irs, SV *) /* input record separator $/ */ | |
117 | PERLVAR(Ilast_in_gv, GV *) /* GV used in last <FH> */ | |
e23d9e2f | 118 | PERLVAR(Iofsgv, GV *) /* GV of output field separator *, */ |
907b3e23 DM |
119 | PERLVAR(Idefoutgv, GV *) /* default FH for output */ |
120 | PERLVARI(Ichopset, const char *, " \n-") /* $: */ | |
121 | PERLVAR(Iformtarget, SV *) | |
122 | PERLVAR(Ibodytarget, SV *) | |
123 | PERLVAR(Itoptarget, SV *) | |
124 | ||
125 | /* Stashes */ | |
126 | PERLVAR(Idefstash, HV *) /* main symbol table */ | |
127 | PERLVAR(Icurstash, HV *) /* symbol table for current package */ | |
128 | ||
129 | PERLVAR(Irestartop, OP *) /* propagating an error from croak? */ | |
febb3a6d | 130 | PERLVAR(Irestartjmpenv, JMPENV *) /* target frame for longjmp in die */ |
910e0671 | 131 | PERLVAR(Icurcop, COP *) |
907b3e23 DM |
132 | PERLVAR(Icurstack, AV *) /* THE STACK */ |
133 | PERLVAR(Icurstackinfo, PERL_SI *) /* current stack + context */ | |
134 | PERLVAR(Imainstack, AV *) /* the stack when nothing funny is | |
135 | happening */ | |
136 | ||
137 | PERLVAR(Itop_env, JMPENV *) /* ptr to current sigjmp environment */ | |
138 | PERLVAR(Istart_env, JMPENV) /* empty startup sigjmp environment */ | |
139 | PERLVARI(Ierrors, SV *, NULL) /* outstanding queued errors */ | |
140 | ||
141 | /* statics "owned" by various functions */ | |
907b3e23 DM |
142 | PERLVAR(Ihv_fetch_ent_mh, HE*) /* owned by hv_fetch_ent() */ |
143 | ||
907b3e23 DM |
144 | PERLVAR(Ilastgotoprobe, OP*) /* from pp_ctl.c */ |
145 | ||
146 | /* sort stuff */ | |
147 | PERLVAR(Isortcop, OP *) /* user defined sort routine */ | |
148 | PERLVAR(Isortstash, HV *) /* which is in some package or other */ | |
149 | PERLVAR(Ifirstgv, GV *) /* $a */ | |
150 | PERLVAR(Isecondgv, GV *) /* $b */ | |
151 | ||
152 | /* float buffer */ | |
153 | PERLVAR(Iefloatbuf, char *) | |
154 | PERLVAR(Iefloatsize, STRLEN) | |
155 | ||
156 | /* regex stuff */ | |
157 | ||
907b3e23 DM |
158 | PERLVAR(Ireg_state, struct re_save_state) |
159 | ||
160 | PERLVAR(Iregdummy, regnode) /* from regcomp.c */ | |
161 | ||
162 | PERLVARI(Idumpindent, U16, 4) /* number of blanks per dump | |
163 | indentation level */ | |
164 | ||
157b3822 NC |
165 | |
166 | PERLVAR(Iutf8locale, bool) /* utf8 locale detected */ | |
167 | PERLVARI(Irehash_seed_set, bool, FALSE) /* 582 hash initialized? */ | |
907b3e23 DM |
168 | |
169 | PERLVARA(Icolors,6, char *) /* from regcomp.c */ | |
170 | ||
9ea12537 Z |
171 | /* |
172 | =for apidoc Amn|peep_t|PL_peepp | |
173 | ||
174 | Pointer to the per-subroutine peephole optimiser. This is a function | |
175 | that gets called at the end of compilation of a Perl subroutine (or | |
176 | equivalently independent piece of Perl code) to perform fixups of | |
177 | some ops and to perform small-scale optimisations. The function is | |
178 | called once for each subroutine that is compiled, and is passed, as sole | |
179 | parameter, a pointer to the op that is the entry point to the subroutine. | |
180 | It modifies the op tree in place. | |
181 | ||
182 | The peephole optimiser should never be completely replaced. Rather, | |
183 | add code to it by wrapping the existing optimiser. The basic way to do | |
184 | this can be seen in L<perlguts/Compile pass 3: peephole optimization>. | |
185 | If the new code wishes to operate on ops throughout the subroutine's | |
186 | structure, rather than just at the top level, it is likely to be more | |
187 | convenient to wrap the L</PL_rpeepp> hook. | |
188 | ||
189 | =cut | |
190 | */ | |
191 | ||
ef69c8fc | 192 | PERLVARI(Ipeepp, peep_t, Perl_peep) |
9ea12537 Z |
193 | |
194 | /* | |
195 | =for apidoc Amn|peep_t|PL_rpeepp | |
196 | ||
197 | Pointer to the recursive peephole optimiser. This is a function | |
198 | that gets called at the end of compilation of a Perl subroutine (or | |
199 | equivalently independent piece of Perl code) to perform fixups of some | |
200 | ops and to perform small-scale optimisations. The function is called | |
201 | once for each chain of ops linked through their C<op_next> fields; | |
202 | it is recursively called to handle each side chain. It is passed, as | |
203 | sole parameter, a pointer to the op that is at the head of the chain. | |
204 | It modifies the op tree in place. | |
205 | ||
206 | The peephole optimiser should never be completely replaced. Rather, | |
207 | add code to it by wrapping the existing optimiser. The basic way to do | |
208 | this can be seen in L<perlguts/Compile pass 3: peephole optimization>. | |
209 | If the new code wishes to operate only on ops at a subroutine's top level, | |
210 | rather than throughout the structure, it is likely to be more convenient | |
211 | to wrap the L</PL_peepp> hook. | |
212 | ||
213 | =cut | |
214 | */ | |
215 | ||
ef69c8fc | 216 | PERLVARI(Irpeepp, peep_t, Perl_rpeep) |
907b3e23 | 217 | |
2f175318 VP |
218 | /* |
219 | =for apidoc Amn|Perl_ophook_t|PL_opfreehook | |
220 | ||
221 | When non-C<NULL>, the function pointed by this variable will be called each time an OP is freed with the corresponding OP as the argument. | |
222 | This allows extensions to free any extra attribute they have locally attached to an OP. | |
223 | It is also assured to first fire for the parent OP and then for its kids. | |
224 | ||
225 | When you replace this variable, it is considered a good practice to store the possibly previously installed hook and that you recall it inside your own. | |
226 | ||
227 | =cut | |
228 | */ | |
229 | ||
799dfa8f | 230 | PERLVARI(Iopfreehook, Perl_ophook_t, 0) /* op_free() hook */ |
f37b8c3f | 231 | |
4185c919 | 232 | /* Space for U32 */ |
907b3e23 DM |
233 | PERLVARI(Ireginterp_cnt,I32, 0) /* Whether "Regexp" was interpolated. */ |
234 | PERLVARI(Iwatchaddr, char **, 0) | |
235 | PERLVAR(Iwatchok, char *) | |
236 | ||
237 | /* the currently active slab in a chain of slabs of regmatch states, | |
238 | * and the currently active state within that slab */ | |
239 | ||
240 | PERLVARI(Iregmatch_slab, regmatch_slab *, NULL) | |
241 | PERLVAR(Iregmatch_state, regmatch_state *) | |
242 | ||
907b3e23 | 243 | /* Put anything new that is pointer aligned here. */ |
d95e864f | 244 | |
907b3e23 DM |
245 | PERLVAR(Idelaymagic, U16) /* ($<,$>) = ... */ |
246 | PERLVAR(Ilocalizing, U8) /* are we processing a local() list? */ | |
247 | PERLVAR(Icolorset, bool) /* from regcomp.c */ | |
910e0671 | 248 | PERLVAR(Iin_eval, U8) /* trap "fatal" errors? */ |
907b3e23 | 249 | PERLVAR(Itainted, bool) /* using variables controlled by $< */ |
30b0736d | 250 | PERLVAR(Itainting, bool) /* doing taint checks */ |
9ebf26ad | 251 | |
d95e864f NC |
252 | /* This value may be set when embedding for full cleanup */ |
253 | /* 0=none, 1=full, 2=full with checks */ | |
801627e8 NC |
254 | /* mod_perl is special, and also assigns a meaning -1 */ |
255 | PERLVARI(Iperl_destruct_level, signed char, 0) | |
d95e864f | 256 | |
30b0736d NC |
257 | /* current phase the interpreter is in */ |
258 | PERLVARI(Iphase, enum perl_phase, PERL_PHASE_CONSTRUCT) | |
259 | ||
d95e864f NC |
260 | PERLVAR(Iperldb, U32) |
261 | ||
30b0736d NC |
262 | PERLVAR(Isignals, U32) /* Using which pre-5.8 signals */ |
263 | ||
49f531da | 264 | /* pseudo environmental stuff */ |
d95e864f | 265 | PERLVAR(Iorigargc, int) |
cb68f92d GS |
266 | PERLVAR(Iorigargv, char **) |
267 | PERLVAR(Ienvgv, GV *) | |
cb68f92d | 268 | PERLVAR(Iincgv, GV *) |
b3ac6de7 | 269 | PERLVAR(Ihintgv, GV *) |
cb68f92d GS |
270 | PERLVAR(Iorigfilename, char *) |
271 | PERLVAR(Idiehook, SV *) | |
272 | PERLVAR(Iwarnhook, SV *) | |
1d7c1841 GS |
273 | |
274 | /* switches */ | |
a7cb1f99 | 275 | PERLVAR(Ipatchlevel, SV *) |
1e8125c6 | 276 | PERLVAR(Iapiversion, SV *) |
27da23d5 | 277 | PERLVAR(Ilocalpatches, const char * const *) |
dd374669 | 278 | PERLVARI(Isplitstr, const char *, " ") |
9f7da6d5 NC |
279 | |
280 | PERLVAR(Iminus_c, bool) | |
cb68f92d GS |
281 | PERLVAR(Iminus_n, bool) |
282 | PERLVAR(Iminus_p, bool) | |
283 | PERLVAR(Iminus_l, bool) | |
284 | PERLVAR(Iminus_a, bool) | |
285 | PERLVAR(Iminus_F, bool) | |
286 | PERLVAR(Idoswitches, bool) | |
bc9b29db | 287 | PERLVAR(Iminus_E, bool) |
954c1994 GS |
288 | |
289 | /* | |
ccfc67b7 | 290 | |
2eb25c99 | 291 | =for apidoc mn|bool|PL_dowarn |
954c1994 GS |
292 | |
293 | The C variable which corresponds to Perl's $^W warning variable. | |
294 | ||
295 | =cut | |
296 | */ | |
297 | ||
d41ff1b8 | 298 | PERLVAR(Idowarn, U8) |
49f531da | 299 | PERLVAR(Isawampersand, bool) /* must save all match strings */ |
cb68f92d | 300 | PERLVAR(Iunsafe, bool) |
9f7da6d5 NC |
301 | PERLVAR(Iexit_flags, U8) /* was exit() unexpected, etc. */ |
302 | PERLVAR(Isrand_called, bool) | |
4fa7c2bf | 303 | PERLVARI(Iin_load_module, bool, FALSE) /* to prevent recursions in PerlIO_find_layer */ |
30b0736d | 304 | /* Space for a U16 */ |
cb68f92d GS |
305 | PERLVAR(Iinplace, char *) |
306 | PERLVAR(Ie_script, SV *) | |
49f531da NIS |
307 | |
308 | /* magical thingies */ | |
309 | PERLVAR(Ibasetime, Time_t) /* $^T */ | |
310 | PERLVAR(Iformfeed, SV *) /* $^L */ | |
d4cce5f1 NIS |
311 | |
312 | ||
cb68f92d GS |
313 | PERLVARI(Imaxsysfd, I32, MAXSYSFD) |
314 | /* top fd to pass to subprocesses */ | |
49f531da NIS |
315 | PERLVAR(Istatusvalue, I32) /* $? */ |
316 | #ifdef VMS | |
cb68f92d | 317 | PERLVAR(Istatusvalue_vms,U32) |
e5218da5 GA |
318 | #else |
319 | PERLVAR(Istatusvalue_posix,I32) | |
49f531da NIS |
320 | #endif |
321 | ||
157b3822 NC |
322 | PERLVARI(Isig_pending, int,0) /* Number if highest signal pending */ |
323 | PERLVAR(Ipsig_pend, int *) /* per-signal "count" of pending */ | |
324 | ||
49f531da | 325 | /* shortcuts to various I/O objects */ |
16d811d4 DM |
326 | PERLVAR(Istdingv, GV *) /* *STDIN */ |
327 | PERLVAR(Istderrgv, GV *) /* *STDERR */ | |
cb68f92d | 328 | PERLVAR(Idefgv, GV *) |
16d811d4 DM |
329 | PERLVAR(Iargvgv, GV *) /* *ARGV */ |
330 | PERLVAR(Iargvoutgv, GV *) /* *ARGVOUT */ | |
1d7c1841 | 331 | PERLVAR(Iargvout_stack, AV *) |
49f531da NIS |
332 | |
333 | /* shortcuts to regexp stuff */ | |
16d811d4 | 334 | PERLVAR(Ireplgv, GV *) /* *^R */ |
49f531da NIS |
335 | |
336 | /* shortcuts to misc objects */ | |
16d811d4 | 337 | PERLVAR(Ierrgv, GV *) /* *@ */ |
49f531da NIS |
338 | |
339 | /* shortcuts to debugging objects */ | |
16d811d4 DM |
340 | PERLVAR(IDBgv, GV *) /* *DB::DB */ |
341 | PERLVAR(IDBline, GV *) /* *DB::line */ | |
954c1994 GS |
342 | |
343 | /* | |
2eb25c99 | 344 | =for apidoc mn|GV *|PL_DBsub |
954c1994 GS |
345 | When Perl is run in debugging mode, with the B<-d> switch, this GV contains |
346 | the SV which holds the name of the sub being debugged. This is the C | |
347 | variable which corresponds to Perl's $DB::sub variable. See | |
348 | C<PL_DBsingle>. | |
349 | ||
2eb25c99 | 350 | =for apidoc mn|SV *|PL_DBsingle |
954c1994 | 351 | When Perl is run in debugging mode, with the B<-d> switch, this SV is a |
7889fe52 | 352 | boolean which indicates whether subs are being single-stepped. |
954c1994 GS |
353 | Single-stepping is automatically turned on after every step. This is the C |
354 | variable which corresponds to Perl's $DB::single variable. See | |
355 | C<PL_DBsub>. | |
356 | ||
2eb25c99 | 357 | =for apidoc mn|SV *|PL_DBtrace |
954c1994 GS |
358 | Trace variable used when Perl is run in debugging mode, with the B<-d> |
359 | switch. This is the C variable which corresponds to Perl's $DB::trace | |
360 | variable. See C<PL_DBsingle>. | |
361 | ||
362 | =cut | |
363 | */ | |
364 | ||
16d811d4 DM |
365 | PERLVAR(IDBsub, GV *) /* *DB::sub */ |
366 | PERLVAR(IDBsingle, SV *) /* $DB::single */ | |
367 | PERLVAR(IDBtrace, SV *) /* $DB::trace */ | |
368 | PERLVAR(IDBsignal, SV *) /* $DB::signal */ | |
49f531da NIS |
369 | PERLVAR(Idbargs, AV *) /* args to call listed by caller function */ |
370 | ||
371 | /* symbol tables */ | |
49f531da NIS |
372 | PERLVAR(Idebstash, HV *) /* symbol table for perldb package */ |
373 | PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */ | |
374 | PERLVAR(Icurstname, SV *) /* name of current package */ | |
375 | PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */ | |
d4cce5f1 | 376 | PERLVAR(Iendav, AV *) /* names of END subroutines */ |
3c10abe3 | 377 | PERLVAR(Iunitcheckav, AV *) /* names of UNITCHECK subroutines */ |
7d30b5c4 | 378 | PERLVAR(Icheckav, AV *) /* names of CHECK subroutines */ |
49f531da NIS |
379 | PERLVAR(Iinitav, AV *) /* names of INIT subroutines */ |
380 | PERLVAR(Istrtab, HV *) /* shared string table */ | |
005a453c | 381 | PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */ |
49f531da | 382 | |
9f7da6d5 NC |
383 | /* funky return mechanisms */ |
384 | PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */ | |
385 | ||
49f531da | 386 | /* memory management */ |
49f531da NIS |
387 | PERLVAR(Isv_count, I32) /* how many SV* are currently allocated */ |
388 | PERLVAR(Isv_objcount, I32) /* how many objects are currently allocated */ | |
389 | PERLVAR(Isv_root, SV*) /* storage for SVs belonging to interp */ | |
390 | PERLVAR(Isv_arenaroot, SV*) /* list of areas for garbage collection */ | |
391 | ||
49f531da | 392 | /* subprocess state */ |
d4cce5f1 | 393 | PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */ |
49f531da NIS |
394 | |
395 | /* internal state */ | |
49f531da NIS |
396 | PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */ |
397 | ||
49f531da | 398 | /* current interpreter roots */ |
cb68f92d GS |
399 | PERLVAR(Imain_cv, CV *) |
400 | PERLVAR(Imain_root, OP *) | |
401 | PERLVAR(Imain_start, OP *) | |
402 | PERLVAR(Ieval_root, OP *) | |
403 | PERLVAR(Ieval_start, OP *) | |
49f531da NIS |
404 | |
405 | /* runtime control stuff */ | |
cb68f92d | 406 | PERLVARI(Icurcopdb, COP *, NULL) |
49f531da | 407 | |
49f531da NIS |
408 | PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */ |
409 | PERLVAR(Ilastfd, int) /* what to preserve mode on */ | |
410 | PERLVAR(Ioldname, char *) /* what to preserve mode on */ | |
360ea906 | 411 | PERLVAR(IArgv, const char **) /* stuff to free from do_aexec, vfork safe */ |
d4cce5f1 | 412 | PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */ |
00accf8d NC |
413 | /* Elements in this array have ';' appended and are injected as a single line |
414 | into the tokeniser. You can't put any (literal) newlines into any program | |
415 | you stuff in into this array, as the point where it's injected is expecting | |
416 | a single physical line. */ | |
cb68f92d | 417 | PERLVAR(Ipreambleav, AV *) |
cb68f92d | 418 | PERLVAR(Imess_sv, SV *) |
7889fe52 | 419 | PERLVAR(Iors_sv, SV *) /* output record separator $\ */ |
71eebe1e NC |
420 | /* statics moved here for shared library purposes */ |
421 | PERLVARI(Igensym, I32, 0) /* next symbol for getsym() to define */ | |
a4021b77 | 422 | PERLVARI(Icv_has_eval, bool, FALSE) /* PL_compcv includes an entereval or similar */ |
157b3822 | 423 | PERLVAR(Itaint_warn, bool) /* taint warns instead of dying */ |
d95e864f NC |
424 | PERLVARI(Ilaststype, U16, OP_STAT) |
425 | PERLVARI(Ilaststatval, int, -1) | |
d4cce5f1 | 426 | |
4b556e6c | 427 | /* interpreter atexit processing */ |
d95e864f | 428 | PERLVARI(Iexitlistlen, I32, 0) /* length of same */ |
cb68f92d GS |
429 | PERLVARI(Iexitlist, PerlExitListEntry *, NULL) |
430 | /* list of exit functions */ | |
954c1994 GS |
431 | |
432 | /* | |
433 | =for apidoc Amn|HV*|PL_modglobal | |
434 | ||
7889fe52 | 435 | C<PL_modglobal> is a general purpose, interpreter global HV for use by |
954c1994 | 436 | extensions that need to keep information on a per-interpreter basis. |
7889fe52 NIS |
437 | In a pinch, it can also be used as a symbol table for extensions |
438 | to share data among each other. It is a good idea to use keys | |
954c1994 GS |
439 | prefixed by the package name of the extension that owns the data. |
440 | ||
441 | =cut | |
442 | */ | |
443 | ||
cb68f92d GS |
444 | PERLVAR(Imodglobal, HV *) /* per-interp module data */ |
445 | ||
446 | /* these used to be in global before 5.004_68 */ | |
447 | PERLVARI(Iprofiledata, U32 *, NULL) /* table of ops, counts */ | |
cb68f92d GS |
448 | |
449 | PERLVAR(Icompiling, COP) /* compiling/done executing marker */ | |
450 | ||
451 | PERLVAR(Icompcv, CV *) /* currently compiling subroutine */ | |
452 | PERLVAR(Icomppad, AV *) /* storage for lexically scoped temporaries */ | |
453 | PERLVAR(Icomppad_name, AV *) /* variable names for "my" variables */ | |
454 | PERLVAR(Icomppad_name_fill, I32) /* last "introduced" variable offset */ | |
455 | PERLVAR(Icomppad_name_floor, I32) /* start of vars in innermost block */ | |
4b556e6c JD |
456 | |
457 | #ifdef HAVE_INTERP_INTERN | |
cb68f92d GS |
458 | PERLVAR(Isys_intern, struct interp_intern) |
459 | /* platform internals */ | |
4b556e6c JD |
460 | #endif |
461 | ||
7fae4e64 | 462 | /* more statics moved here */ |
7fae4e64 | 463 | PERLVAR(IDBcv, CV *) /* from perl.c */ |
9f7da6d5 | 464 | PERLVARI(Igeneration, int, 100) /* from op.c */ |
56953603 | 465 | |
cb68f92d | 466 | PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */ |
57ef47cc | 467 | PERLVARI(Iin_clean_all, bool, FALSE) /* ptrs to freed SVs now legal */ |
9f7da6d5 NC |
468 | PERLVAR(Inomemok, bool) /* let malloc context handle nomem */ |
469 | PERLVARI(Isavebegin, bool, FALSE) /* save BEGINs for compiler */ | |
7fae4e64 | 470 | |
d8eceb89 JH |
471 | PERLVAR(Iuid, Uid_t) /* current real user id */ |
472 | PERLVAR(Ieuid, Uid_t) /* current effective user id */ | |
473 | PERLVAR(Igid, Gid_t) /* current real group id */ | |
474 | PERLVAR(Iegid, Gid_t) /* current effective group id */ | |
bf9cdc68 | 475 | PERLVARI(Ian, U32, 0) /* malloc sequence number */ |
be2b6a89 DM |
476 | |
477 | #ifdef DEBUGGING | |
478 | /* exercise wrap-around */ | |
479 | #define PERL_COP_SEQMAX (U32_MAX-50) | |
480 | #else | |
481 | #define PERL_COP_SEQMAX 0 | |
482 | #endif | |
483 | PERLVARI(Icop_seqmax, U32, PERL_COP_SEQMAX) /* statement sequence number */ | |
484 | #undef PERL_COP_SEQMAX | |
485 | ||
bf9cdc68 | 486 | PERLVARI(Ievalseq, U32, 0) /* eval sequence number */ |
0672f40e | 487 | PERLVAR(Iorigalen, U32) |
9f7da6d5 | 488 | PERLVAR(Iorigenviron, char **) |
ca0c25f6 | 489 | #ifdef PERL_USES_PL_PIDSTATUS |
0672f40e | 490 | PERLVAR(Ipidstatus, HV *) /* pid-to-status mappings for waitpid */ |
ca0c25f6 | 491 | #endif |
0672f40e | 492 | PERLVAR(Iosname, char *) /* operating system */ |
5c728af0 | 493 | |
0672f40e GS |
494 | PERLVAR(Isighandlerp, Sighandler_t) |
495 | ||
232d1c15 | 496 | PERLVARA(Ibody_roots, PERL_ARENA_ROOTS_SIZE, void*) /* array of body roots */ |
93e68bfb | 497 | |
ed29bbba | 498 | PERLVAR(Iunicode, U32) /* Unicode features: $ENV{PERL_UNICODE} or -C */ |
0672f40e | 499 | |
9f7da6d5 NC |
500 | PERLVARI(Imaxo, int, MAXO) /* maximum number of ops */ |
501 | ||
ef69c8fc | 502 | PERLVARI(Irunops, runops_proc_t, RUNOPS_DEFAULT) |
0672f40e | 503 | |
954c1994 GS |
504 | /* |
505 | =for apidoc Amn|SV|PL_sv_undef | |
506 | This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. | |
507 | ||
508 | =for apidoc Amn|SV|PL_sv_no | |
509 | This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as | |
510 | C<&PL_sv_no>. | |
511 | ||
512 | =for apidoc Amn|SV|PL_sv_yes | |
513 | This is the C<true> SV. See C<PL_sv_no>. Always refer to this as | |
514 | C<&PL_sv_yes>. | |
515 | ||
516 | =cut | |
517 | */ | |
518 | ||
0672f40e GS |
519 | PERLVAR(Isv_undef, SV) |
520 | PERLVAR(Isv_no, SV) | |
521 | PERLVAR(Isv_yes, SV) | |
522 | ||
0672f40e GS |
523 | PERLVAR(Isubname, SV *) /* name of current subroutine */ |
524 | ||
d95e864f | 525 | PERLVAR(Isubline, I32) /* line this subroutine began on */ |
0672f40e | 526 | PERLVAR(Imin_intro_pending, I32) /* start of vars to introduce */ |
d95e864f | 527 | |
0672f40e GS |
528 | PERLVAR(Imax_intro_pending, I32) /* end of vars to introduce */ |
529 | PERLVAR(Ipadix, I32) /* max used index in current "register" pad */ | |
d95e864f | 530 | |
0672f40e | 531 | PERLVAR(Ipadix_floor, I32) /* how low may inner block reset padix */ |
0672f40e | 532 | |
1d7c1841 | 533 | PERLVAR(Ihints, U32) /* pragma-tic compile-time flags */ |
0672f40e GS |
534 | |
535 | PERLVAR(Idebug, VOL U32) /* flags given to -D switch */ | |
536 | ||
f0cb02e3 NC |
537 | /* Perl_Ibreakable_sub_generation_ptr was too long for VMS, hence "gen" */ |
538 | PERLVARI(Ibreakable_sub_gen, U32, 0) | |
539 | ||
bf9cdc68 | 540 | PERLVARI(Iamagic_generation, long, 0) |
0672f40e GS |
541 | |
542 | #ifdef USE_LOCALE_COLLATE | |
0672f40e | 543 | PERLVAR(Icollation_name,char *) /* Name of current collation */ |
0672f40e GS |
544 | PERLVAR(Icollxfrm_base, Size_t) /* Basic overhead in *xfrm() */ |
545 | PERLVARI(Icollxfrm_mult,Size_t, 2) /* Expansion factor in *xfrm() */ | |
9f7da6d5 NC |
546 | PERLVARI(Icollation_ix, U32, 0) /* Collation generation index */ |
547 | PERLVARI(Icollation_standard, bool, TRUE) | |
548 | /* Assume simple collation */ | |
0672f40e GS |
549 | #endif /* USE_LOCALE_COLLATE */ |
550 | ||
9f7da6d5 | 551 | |
edd11d75 | 552 | #if defined (PERL_UTF8_CACHE_ASSERT) || defined (DEBUGGING) |
95ca8690 | 553 | # define PERL___I -1 |
9f7da6d5 | 554 | #else |
7cd91da4 | 555 | # define PERL___I 1 |
9f7da6d5 | 556 | #endif |
95ca8690 DM |
557 | PERLVARI(Iutf8cache, I8, PERL___I) /* Is the utf8 caching code enabled? */ |
558 | #undef PERL___I | |
559 | ||
9f7da6d5 | 560 | |
0672f40e GS |
561 | #ifdef USE_LOCALE_NUMERIC |
562 | ||
0672f40e GS |
563 | PERLVARI(Inumeric_standard, bool, TRUE) |
564 | /* Assume simple numerics */ | |
565 | PERLVARI(Inumeric_local, bool, TRUE) | |
566 | /* Assume local numerics */ | |
9f7da6d5 | 567 | PERLVAR(Inumeric_name, char *) /* Name of current numeric locale */ |
0672f40e GS |
568 | #endif /* !USE_LOCALE_NUMERIC */ |
569 | ||
570 | /* utf8 character classes */ | |
571 | PERLVAR(Iutf8_alnum, SV *) | |
b8c5462f | 572 | PERLVAR(Iutf8_ascii, SV *) |
0672f40e GS |
573 | PERLVAR(Iutf8_alpha, SV *) |
574 | PERLVAR(Iutf8_space, SV *) | |
d1eb3177 YO |
575 | PERLVAR(Iutf8_perl_space, SV *) |
576 | PERLVAR(Iutf8_perl_word, SV *) | |
577 | PERLVAR(Iutf8_posix_digit, SV *) | |
b8c5462f JH |
578 | PERLVAR(Iutf8_cntrl, SV *) |
579 | PERLVAR(Iutf8_graph, SV *) | |
0672f40e GS |
580 | PERLVAR(Iutf8_digit, SV *) |
581 | PERLVAR(Iutf8_upper, SV *) | |
582 | PERLVAR(Iutf8_lower, SV *) | |
583 | PERLVAR(Iutf8_print, SV *) | |
b8c5462f JH |
584 | PERLVAR(Iutf8_punct, SV *) |
585 | PERLVAR(Iutf8_xdigit, SV *) | |
0672f40e | 586 | PERLVAR(Iutf8_mark, SV *) |
37e2e78e KW |
587 | PERLVAR(Iutf8_X_begin, SV *) |
588 | PERLVAR(Iutf8_X_extend, SV *) | |
589 | PERLVAR(Iutf8_X_prepend, SV *) | |
590 | PERLVAR(Iutf8_X_non_hangul, SV *) | |
591 | PERLVAR(Iutf8_X_L, SV *) | |
592 | PERLVAR(Iutf8_X_LV, SV *) | |
593 | PERLVAR(Iutf8_X_LVT, SV *) | |
594 | PERLVAR(Iutf8_X_T, SV *) | |
595 | PERLVAR(Iutf8_X_V, SV *) | |
596 | PERLVAR(Iutf8_X_LV_LVT_V, SV *) | |
0672f40e GS |
597 | PERLVAR(Iutf8_toupper, SV *) |
598 | PERLVAR(Iutf8_totitle, SV *) | |
599 | PERLVAR(Iutf8_tolower, SV *) | |
b4e400f9 | 600 | PERLVAR(Iutf8_tofold, SV *) |
0672f40e | 601 | PERLVAR(Ilast_swash_hv, HV *) |
0672f40e GS |
602 | PERLVAR(Ilast_swash_tmps, U8 *) |
603 | PERLVAR(Ilast_swash_slen, STRLEN) | |
9f7da6d5 | 604 | PERLVARA(Ilast_swash_key,10, U8) |
d95e864f NC |
605 | PERLVAR(Ilast_swash_klen, U8) /* Only needs to store 0-10 */ |
606 | ||
607 | #ifdef FCRYPT | |
608 | PERLVARI(Icryptseen, bool, FALSE) /* has fast crypt() been initialized? */ | |
609 | #endif | |
610 | ||
f0cb02e3 | 611 | PERLVAR(Ipad_reset_pending, bool) /* reset pad on next attempted alloc */ |
49947b44 | 612 | |
d95e864f NC |
613 | PERLVARI(Iglob_index, int, 0) |
614 | ||
0672f40e | 615 | |
5912531f | 616 | PERLVAR(Iparser, yy_parser *) /* current parser state */ |
12fbd33b | 617 | |
c4a30c8c NC |
618 | /* Array of signal handlers, indexed by signal number, through which the C |
619 | signal handler dispatches. */ | |
1d7c1841 | 620 | PERLVAR(Ipsig_ptr, SV**) |
c4a30c8c | 621 | /* Array of names of signals, indexed by signal number, for (re)use as the first |
d525a7b2 NC |
622 | argument to a signal handler. Only one block of memory is allocated for |
623 | both psig_name and psig_ptr. */ | |
c4a30c8c | 624 | PERLVAR(Ipsig_name, SV**) |
1d7c1841 | 625 | |
c5be433b | 626 | #if defined(PERL_IMPLICIT_SYS) |
32e30700 | 627 | PERLVAR(IMem, struct IPerlMem*) |
1d7c1841 GS |
628 | PERLVAR(IMemShared, struct IPerlMem*) |
629 | PERLVAR(IMemParse, struct IPerlMem*) | |
32e30700 GS |
630 | PERLVAR(IEnv, struct IPerlEnv*) |
631 | PERLVAR(IStdIO, struct IPerlStdIO*) | |
632 | PERLVAR(ILIO, struct IPerlLIO*) | |
633 | PERLVAR(IDir, struct IPerlDir*) | |
634 | PERLVAR(ISock, struct IPerlSock*) | |
635 | PERLVAR(IProc, struct IPerlProc*) | |
76e3520e | 636 | #endif |
1d7c1841 | 637 | |
1d7c1841 | 638 | PERLVAR(Iptr_table, PTR_TBL_t*) |
7d49f689 | 639 | PERLVARI(Ibeginav_save, AV*, NULL) /* save BEGIN{}s when compiling */ |
f180df80 | 640 | |
fdda85ca | 641 | PERLVAR(Ibody_arenas, void*) /* pointer to list of body-arenas */ |
93e68bfb | 642 | |
d95e864f | 643 | |
a453c169 JH |
644 | #ifdef USE_LOCALE_NUMERIC |
645 | ||
646 | PERLVAR(Inumeric_radix_sv, SV *) /* The radix separator if not '.' */ | |
647 | ||
648 | #endif | |
ce08f86c | 649 | |
1fcf4c12 | 650 | #if defined(USE_ITHREADS) |
e6853197 NC |
651 | PERLVAR(Iregex_pad, SV**) /* Shortcut into the array of |
652 | regex_padav */ | |
653 | PERLVAR(Iregex_padav, AV*) /* All regex objects, indexed via the | |
654 | values in op_pmoffset of pmop. | |
402d2eb1 NC |
655 | Entry 0 is an SV whose PV is a |
656 | "packed" list of IVs listing | |
e6853197 | 657 | the now-free slots in the array */ |
1fcf4c12 AB |
658 | #endif |
659 | ||
ea68fd67 NC |
660 | #ifdef USE_REENTRANT_API |
661 | PERLVAR(Ireentrant_buffer, REENTR*) /* here we store the _r buffers */ | |
f5a82810 JH |
662 | #endif |
663 | ||
53e06cf0 SC |
664 | PERLVAR(Icustom_op_names, HV*) /* Names of user defined ops */ |
665 | PERLVAR(Icustom_op_descs, HV*) /* Descriptions of user defined ops */ | |
19e8ce8e | 666 | |
a1ea730d | 667 | #ifdef PERLIO_LAYERS |
303f2dc3 | 668 | PERLVARI(Iperlio, PerlIOl *,NULL) |
3a1ee7e8 NIS |
669 | PERLVARI(Iknown_layers, PerlIO_list_t *,NULL) |
670 | PERLVARI(Idef_layerlist, PerlIO_list_t *,NULL) | |
a1ea730d NIS |
671 | #endif |
672 | ||
a0714e2c | 673 | PERLVARI(Iencoding, SV*, NULL) /* character encoding */ |
0a378802 | 674 | |
128e8167 | 675 | PERLVAR(Idebug_pad, struct perl_debug_pad) /* always needed because of the re extension */ |
ce333219 | 676 | |
82686b01 JH |
677 | PERLVAR(Iutf8_idstart, SV *) |
678 | PERLVAR(Iutf8_idcont, SV *) | |
c11ff943 KW |
679 | PERLVAR(Iutf8_xidstart, SV *) |
680 | PERLVAR(Iutf8_xidcont, SV *) | |
82686b01 | 681 | |
147f47de AB |
682 | PERLVAR(Isort_RealCmp, SVCOMPARE_t) |
683 | ||
7d49f689 | 684 | PERLVARI(Icheckav_save, AV*, NULL) /* save CHECK{}s when compiling */ |
3c10abe3 | 685 | PERLVARI(Iunitcheckav_save, AV*, NULL) /* save UNITCHECK{}s when compiling */ |
ece599bd | 686 | |
5311654c JH |
687 | PERLVARI(Iclocktick, long, 0) /* this many times() ticks in a second */ |
688 | ||
9f7da6d5 NC |
689 | PERLVAR(Istashcache, HV *) /* Cache to speed up S_method_common */ |
690 | ||
15a5279a | 691 | /* Hooks to shared SVs and locks. */ |
ef69c8fc BM |
692 | PERLVARI(Isharehook, share_proc_t, Perl_sv_nosharing) |
693 | PERLVARI(Ilockhook, share_proc_t, Perl_sv_nosharing) | |
d0647d4e NC |
694 | #ifdef NO_MATHOMS |
695 | # define PERL_UNLOCK_HOOK Perl_sv_nosharing | |
696 | #else | |
697 | /* This reference ensures that the mathoms are linked with perl */ | |
698 | # define PERL_UNLOCK_HOOK Perl_sv_nounlocking | |
699 | #endif | |
ef69c8fc | 700 | PERLVARI(Iunlockhook, share_proc_t, PERL_UNLOCK_HOOK) |
d0647d4e | 701 | |
ef69c8fc | 702 | PERLVARI(Ithreadhook, thrhook_proc_t, Perl_nothreadhook) |
15a5279a | 703 | |
9e08d3a4 NC |
704 | /* Can shared object be destroyed */ |
705 | PERLVARI(Idestroyhook, destroyable_proc_t, Perl_sv_destroyable) | |
706 | ||
01d65469 | 707 | #ifndef PERL_MICRO |
ef69c8fc | 708 | PERLVARI(Isignalhook, despatch_signals_proc_t, Perl_despatch_signals) |
01d65469 | 709 | #endif |
92f022bb | 710 | |
504f80c1 JH |
711 | PERLVARI(Ihash_seed, UV, 0) /* Hash initializer */ |
712 | ||
008fb0c0 | 713 | PERLVARI(Irehash_seed, UV, 0) /* 582 hash initializer */ |
4b5190b5 | 714 | |
ba6d381e | 715 | PERLVARI(Iisarev, HV*, NULL) /* Reverse map of @ISA dependencies */ |
f16dd614 | 716 | |
9e08d3a4 NC |
717 | /* Register of known Method Resolution Orders. |
718 | What this actually points to is an implementation detail (it may change to | |
719 | a structure incorporating a reference count - use mro_get_from_name to | |
720 | retrieve a C<struct mro_alg *> */ | |
721 | PERLVAR(Iregistered_mros, HV *) | |
722 | ||
723 | /* Compile-time block start/end hooks */ | |
724 | PERLVAR(Iblockhooks, AV *) | |
725 | ||
726 | /* Everything that folds to a given character, for case insensitivity regex | |
727 | * matching */ | |
728 | PERLVARI(Iutf8_foldclosures, HV *, NULL) | |
729 | ||
730 | /* List of characters that participate in folds (except marks, etc in | |
731 | * multi-char folds) */ | |
a25abddc | 732 | PERLVARI(Iutf8_foldable, SV *, NULL) |
9e08d3a4 NC |
733 | |
734 | PERLVAR(Icustom_ops, HV *) /* custom op registrations */ | |
735 | ||
30b0736d NC |
736 | PERLVAR(Ireentrant_retint, int) /* Integer return value from reentrant functions */ |
737 | ||
ffee3ff6 NC |
738 | /* The last unconditional member of the interpreter structure when 5.10.0 was |
739 | released. The offset of the end of this is baked into a global variable in | |
740 | any shared perl library which will allow a sanity test in future perl | |
741 | releases. */ | |
30b0736d | 742 | #define PERL_LAST_5_16_0_INTERP_MEMBER Ireentrant_retint |
ffee3ff6 | 743 | |
f16dd614 | 744 | #ifdef PERL_IMPLICIT_CONTEXT |
4c901e72 | 745 | PERLVARI(Imy_cxt_size, int, 0) /* size of PL_my_cxt_list */ |
f16dd614 | 746 | PERLVARI(Imy_cxt_list, void **, NULL) /* per-module array of MY_CXT pointers */ |
ba6d381e | 747 | # ifdef PERL_GLOBAL_STRUCT_PRIVATE |
53d44271 | 748 | PERLVARI(Imy_cxt_keys, const char **, NULL) /* per-module array of pointers to MY_CXT_KEY constants */ |
ba6d381e | 749 | # endif |
f16dd614 DM |
750 | #endif |
751 | ||
7cb608b5 NC |
752 | #ifdef PERL_TRACK_MEMPOOL |
753 | /* For use with the memory debugging code in util.c */ | |
754 | PERLVAR(Imemory_debug_header, struct perl_memory_debug_header) | |
755 | #endif | |
756 | ||
ba6d381e NC |
757 | #ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP |
758 | /* File descriptor to talk to the child which dumps scalars. */ | |
759 | PERLVARI(Idumper_fd, int, -1) | |
760 | #endif | |
761 | ||
762 | /* Stores the PPID */ | |
763 | #ifdef THREADS_HAVE_PIDS | |
764 | PERLVARI(Ippid, IV, 0) | |
765 | #endif | |
766 | ||
767 | #ifdef PERL_MAD | |
768 | PERLVARI(Imadskills, bool, FALSE) /* preserve all syntactic info */ | |
769 | /* (MAD = Misc Attribute Decoration) */ | |
770 | PERLVARI(Ixmlfp, PerlIO *,NULL) | |
771 | #endif | |
772 | ||
773 | #ifdef PL_OP_SLAB_ALLOC | |
774 | PERLVAR(IOpPtr,I32 **) | |
775 | PERLVARI(IOpSpace,I32,0) | |
776 | PERLVAR(IOpSlab,I32 *) | |
777 | #endif | |
778 | ||
f1fac472 NC |
779 | #ifdef PERL_DEBUG_READONLY_OPS |
780 | PERLVARI(Islabs, I32**, NULL) /* Array of slabs that have been allocated */ | |
781 | PERLVARI(Islab_count, U32, 0) /* Size of the array */ | |
782 | #endif | |
783 | ||
d7a2c63c MHM |
784 | #ifdef DEBUG_LEAKING_SCALARS |
785 | PERLVARI(Isv_serial, U32, 0) /* SV serial number, used in sv.c */ | |
786 | #endif | |
787 | ||
157b3822 NC |
788 | /* If you are adding a U8 or U16, check to see if there are 'Space' comments |
789 | * above on where there are gaps which currently will be structure padding. */ | |
d95e864f NC |
790 | |
791 | /* Within a stable branch, new variables must be added to the very end, before | |
792 | * this comment, for binary compatibility (the offsets of the old members must | |
793 | * not change). | |
b83cd129 | 794 | * (Don't forget to add your variable also to perl_clone()!) |
e3acbfda | 795 | * XSUB.h provides wrapper functions via perlapi.h that make this |
b83cd129 JH |
796 | * irrelevant, but not all code may be expected to #include XSUB.h. |
797 | */ |