1 /***********************************************/
2 /* Global only to current interpreter instance */
3 /***********************************************/
5 /* Don't forget to re-run embed.pl to propagate changes! */
7 /* The 'I' prefix is only needed for vars that need appropriate #defines
8 * generated when built with or without MULTIPLICITY. It is also used
9 * to generate the appropriate export list for win32.
11 * When building without MULTIPLICITY, these variables will be truly global.
13 * Avoid build-specific #ifdefs here, like DEBUGGING. That way,
14 * we can keep binary compatibility of the curinterp structure */
16 /* pseudo environmental stuff */
17 PERLVAR(Iorigargc, int)
18 PERLVAR(Iorigargv, char **)
21 PERLVAR(Ihintgv, GV *)
22 PERLVAR(Iorigfilename, char *)
23 PERLVAR(Idiehook, SV *)
24 PERLVAR(Iwarnhook, SV *)
27 PERLVAR(Iminus_c, bool)
28 PERLVARA(Ipatchlevel,10,char)
29 PERLVAR(Ilocalpatches, char **)
30 PERLVARI(Isplitstr, char *, " ")
31 PERLVAR(Ipreprocess, bool)
32 PERLVAR(Iminus_n, bool)
33 PERLVAR(Iminus_p, bool)
34 PERLVAR(Iminus_l, bool)
35 PERLVAR(Iminus_a, bool)
36 PERLVAR(Iminus_F, bool)
37 PERLVAR(Idoswitches, bool)
38 PERLVAR(Idowarn, bool)
39 PERLVAR(Idoextract, bool)
40 PERLVAR(Isawampersand, bool) /* must save all match strings */
41 PERLVAR(Iunsafe, bool)
42 PERLVAR(Iinplace, char *)
43 PERLVAR(Ie_script, SV *)
46 /* This value may be set when embedding for full cleanup */
47 /* 0=none, 1=full, 2=full with checks */
48 PERLVARI(Iperl_destruct_level, int, 0)
50 /* magical thingies */
51 PERLVAR(Ibasetime, Time_t) /* $^T */
52 PERLVAR(Iformfeed, SV *) /* $^L */
55 PERLVARI(Imaxsysfd, I32, MAXSYSFD)
56 /* top fd to pass to subprocesses */
57 PERLVAR(Imultiline, int) /* $*--do strings hold >1 line? */
58 PERLVAR(Istatusvalue, I32) /* $? */
60 PERLVAR(Istatusvalue_vms,U32)
63 /* shortcuts to various I/O objects */
64 PERLVAR(Istdingv, GV *)
65 PERLVAR(Istderrgv, GV *)
67 PERLVAR(Iargvgv, GV *)
68 PERLVAR(Iargvoutgv, GV *)
70 /* shortcuts to regexp stuff */
71 /* this one needs to be moved to thrdvar.h and accessed via
72 * find_threadsv() when USE_THREADS */
73 PERLVAR(Ireplgv, GV *)
75 /* shortcuts to misc objects */
78 /* shortcuts to debugging objects */
80 PERLVAR(IDBline, GV *)
82 PERLVAR(IDBsingle, SV *)
83 PERLVAR(IDBtrace, SV *)
84 PERLVAR(IDBsignal, SV *)
85 PERLVAR(Ilineary, AV *) /* lines of script for debugger */
86 PERLVAR(Idbargs, AV *) /* args to call listed by caller function */
89 PERLVAR(Idebstash, HV *) /* symbol table for perldb package */
90 PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */
91 PERLVAR(Icurstname, SV *) /* name of current package */
92 PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */
93 PERLVAR(Iendav, AV *) /* names of END subroutines */
94 PERLVAR(Iinitav, AV *) /* names of INIT subroutines */
95 PERLVAR(Istrtab, HV *) /* shared string table */
96 PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */
98 /* memory management */
99 PERLVAR(Isv_count, I32) /* how many SV* are currently allocated */
100 PERLVAR(Isv_objcount, I32) /* how many objects are currently allocated */
101 PERLVAR(Isv_root, SV*) /* storage for SVs belonging to interp */
102 PERLVAR(Isv_arenaroot, SV*) /* list of areas for garbage collection */
104 /* funky return mechanisms */
105 PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */
107 /* subprocess state */
108 PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */
111 PERLVAR(Itainting, bool) /* doing taint checks */
112 PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */
114 /* current interpreter roots */
115 PERLVAR(Imain_cv, CV *)
116 PERLVAR(Imain_root, OP *)
117 PERLVAR(Imain_start, OP *)
118 PERLVAR(Ieval_root, OP *)
119 PERLVAR(Ieval_start, OP *)
121 /* runtime control stuff */
122 PERLVARI(Icurcopdb, COP *, NULL)
123 PERLVARI(Icopline, line_t, NOLINE)
125 /* statics moved here for shared library purposes */
126 PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */
127 PERLVAR(Ilastfd, int) /* what to preserve mode on */
128 PERLVAR(Ioldname, char *) /* what to preserve mode on */
129 PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
130 PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
131 PERLVAR(Igensym, I32) /* next symbol for getsym() to define */
132 PERLVAR(Ipreambled, bool)
133 PERLVAR(Ipreambleav, AV *)
134 PERLVARI(Ilaststatval, int, -1)
135 PERLVARI(Ilaststype, I32, OP_STAT)
136 PERLVAR(Imess_sv, SV *)
138 /* XXX shouldn't these be per-thread? --GSAR */
139 PERLVAR(Iors, char *) /* output record separator $\ */
140 PERLVAR(Iorslen, STRLEN)
141 PERLVAR(Iofmt, char *) /* output format for numbers $# */
143 /* interpreter atexit processing */
144 PERLVARI(Iexitlist, PerlExitListEntry *, NULL)
145 /* list of exit functions */
146 PERLVARI(Iexitlistlen, I32, 0) /* length of same */
147 PERLVAR(Imodglobal, HV *) /* per-interp module data */
149 /* these used to be in global before 5.004_68 */
150 PERLVARI(Iprofiledata, U32 *, NULL) /* table of ops, counts */
151 PERLVARI(Irsfp, PerlIO * VOL, Nullfp) /* current source file pointer */
152 PERLVARI(Irsfp_filters, AV *, Nullav) /* keeps active source filters */
154 PERLVAR(Icompiling, COP) /* compiling/done executing marker */
156 PERLVAR(Icompcv, CV *) /* currently compiling subroutine */
157 PERLVAR(Icomppad, AV *) /* storage for lexically scoped temporaries */
158 PERLVAR(Icomppad_name, AV *) /* variable names for "my" variables */
159 PERLVAR(Icomppad_name_fill, I32) /* last "introduced" variable offset */
160 PERLVAR(Icomppad_name_floor, I32) /* start of vars in innermost block */
162 #ifdef HAVE_INTERP_INTERN
163 PERLVAR(Isys_intern, struct interp_intern)
164 /* platform internals */
167 /* more statics moved here */
168 PERLVARI(Igeneration, int, 100) /* from op.c */
169 PERLVAR(IDBcv, CV *) /* from perl.c */
170 PERLVAR(Iarchpat_auto, char*) /* from perl.c */
172 PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */
173 PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */
175 PERLVAR(Ilinestart, char *) /* beg. of most recently read line */
176 PERLVAR(Ipending_ident, char) /* pending identifier lookup */
177 PERLVAR(Isublex_info, SUBLEXINFO) /* from toke.c */
180 PERLVAR(Ithrsv, SV *) /* struct perl_thread for main thread */
181 PERLVARI(Ithreadnum, U32, 0) /* incremented each thread creation */
182 PERLVAR(Istrtab_mutex, perl_mutex) /* Mutex for string table access */
183 #endif /* USE_THREADS */
185 PERLVAR(Iuid, Uid_t) /* current real user id */
186 PERLVAR(Ieuid, Uid_t) /* current effective user id */
187 PERLVAR(Igid, Gid_t) /* current real group id */
188 PERLVAR(Iegid, Gid_t) /* current effective group id */
189 PERLVAR(Inomemok, bool) /* let malloc context handle nomem */
190 PERLVAR(Ian, U32) /* malloc sequence number */
191 PERLVAR(Icop_seqmax, U32) /* statement sequence number */
192 PERLVAR(Iop_seqmax, U16) /* op sequence number */
193 PERLVAR(Ievalseq, U32) /* eval sequence number */
194 PERLVAR(Iorigenviron, char **)
195 PERLVAR(Iorigalen, U32)
196 PERLVAR(Ipidstatus, HV *) /* pid-to-status mappings for waitpid */
197 PERLVARI(Imaxo, int, MAXO) /* maximum number of ops */
198 PERLVAR(Iosname, char *) /* operating system */
199 PERLVARI(Ish_path, char *, SH_PATH)/* full path of shell */
200 PERLVAR(Isighandlerp, Sighandler_t)
202 PERLVAR(Ixiv_arenaroot, XPV*) /* list of allocated xiv areas */
203 PERLVAR(Ixiv_root, IV *) /* free xiv list--shared by interpreters */
204 PERLVAR(Ixnv_root, NV *) /* free xnv list--shared by interpreters */
205 PERLVAR(Ixrv_root, XRV *) /* free xrv list--shared by interpreters */
206 PERLVAR(Ixpv_root, XPV *) /* free xpv list--shared by interpreters */
207 PERLVAR(Ixpviv_root, XPVIV *) /* free xpviv list--shared by interpreters */
208 PERLVAR(Ixpvnv_root, XPVNV *) /* free xpvnv list--shared by interpreters */
209 PERLVAR(Ixpvcv_root, XPVCV *) /* free xpvcv list--shared by interpreters */
210 PERLVAR(Ixpvav_root, XPVAV *) /* free xpvav list--shared by interpreters */
211 PERLVAR(Ixpvhv_root, XPVHV *) /* free xpvhv list--shared by interpreters */
212 PERLVAR(Ixpvmg_root, XPVMG *) /* free xpvmg list--shared by interpreters */
213 PERLVAR(Ixpvlv_root, XPVLV *) /* free xpvlv list--shared by interpreters */
214 PERLVAR(Ixpvbm_root, XPVBM *) /* free xpvbm list--shared by interpreters */
215 PERLVAR(Ihe_root, HE *) /* free he list--shared by interpreters */
216 PERLVAR(Inice_chunk, char *) /* a nice chunk of memory to reuse */
217 PERLVAR(Inice_chunk_size, U32) /* how nice the chunk of memory is */
219 PERLVARI(Irunops, runops_proc_t, MEMBER_TO_FPTR(RUNOPS_DEFAULT))
221 PERLVARA(Itokenbuf,256, char)
223 PERLVAR(Isv_undef, SV)
228 PERLVARI(Icshname, char *, CSH)
229 PERLVAR(Icshlen, I32)
232 PERLVAR(Ilex_state, U32) /* next token is determined */
233 PERLVAR(Ilex_defer, U32) /* state after determined token */
234 PERLVAR(Ilex_expect, expectation) /* expect after determined token */
235 PERLVAR(Ilex_brackets, I32) /* bracket count */
236 PERLVAR(Ilex_formbrack, I32) /* bracket count at outer format level */
237 PERLVAR(Ilex_fakebrack, I32) /* outer bracket is mere delimiter */
238 PERLVAR(Ilex_casemods, I32) /* casemod count */
239 PERLVAR(Ilex_dojoin, I32) /* doing an array interpolation */
240 PERLVAR(Ilex_starts, I32) /* how many interps done on level */
241 PERLVAR(Ilex_stuff, SV *) /* runtime pattern from m// or s/// */
242 PERLVAR(Ilex_repl, SV *) /* runtime replacement from s/// */
243 PERLVAR(Ilex_op, OP *) /* extra info to pass back on op */
244 PERLVAR(Ilex_inpat, OP *) /* in pattern $) and $| are special */
245 PERLVAR(Ilex_inwhat, I32) /* what kind of quoting are we in */
246 PERLVAR(Ilex_brackstack,char *) /* what kind of brackets to pop */
247 PERLVAR(Ilex_casestack, char *) /* what kind of case mods in effect */
249 /* What we know when we're in LEX_KNOWNEXT state. */
250 PERLVARA(Inextval,5, YYSTYPE) /* value of next token, if any */
251 PERLVARA(Inexttype,5, I32) /* type of next token */
252 PERLVAR(Inexttoke, I32)
254 PERLVAR(Ilinestr, SV *)
255 PERLVAR(Ibufptr, char *)
256 PERLVAR(Ioldbufptr, char *)
257 PERLVAR(Ioldoldbufptr, char *)
258 PERLVAR(Ibufend, char *)
259 PERLVARI(Iexpect,expectation, XSTATE) /* how to interpret ambiguous tokens */
261 PERLVAR(Imulti_start, I32) /* 1st line of multi-line string */
262 PERLVAR(Imulti_end, I32) /* last line of multi-line string */
263 PERLVAR(Imulti_open, I32) /* delimiter of said string */
264 PERLVAR(Imulti_close, I32) /* delimiter of said string */
266 PERLVAR(Ierror_count, I32) /* how many errors so far, max 10 */
267 PERLVAR(Isubline, I32) /* line this subroutine began on */
268 PERLVAR(Isubname, SV *) /* name of current subroutine */
270 PERLVAR(Imin_intro_pending, I32) /* start of vars to introduce */
271 PERLVAR(Imax_intro_pending, I32) /* end of vars to introduce */
272 PERLVAR(Ipadix, I32) /* max used index in current "register" pad */
273 PERLVAR(Ipadix_floor, I32) /* how low may inner block reset padix */
274 PERLVAR(Ipad_reset_pending, I32) /* reset pad on next attempted alloc */
276 PERLVAR(Ilast_uni, char *) /* position of last named-unary op */
277 PERLVAR(Ilast_lop, char *) /* position of last list operator */
278 PERLVAR(Ilast_lop_op, OPCODE) /* last list operator */
279 PERLVAR(Iin_my, I32) /* we're compiling a "my" (or "our") declaration */
280 PERLVAR(Iin_my_stash, HV *) /* declared class of this "my" declaration */
282 PERLVAR(Icryptseen, bool) /* has fast crypt() been initialized? */
285 PERLVAR(Ihints, U32) /* pragma-tic compile-time flags */
287 PERLVAR(Idebug, VOL U32) /* flags given to -D switch */
289 PERLVAR(Iamagic_generation, long)
291 #ifdef USE_LOCALE_COLLATE
292 PERLVAR(Icollation_ix, U32) /* Collation generation index */
293 PERLVAR(Icollation_name,char *) /* Name of current collation */
294 PERLVARI(Icollation_standard, bool, TRUE)
295 /* Assume simple collation */
296 PERLVAR(Icollxfrm_base, Size_t) /* Basic overhead in *xfrm() */
297 PERLVARI(Icollxfrm_mult,Size_t, 2) /* Expansion factor in *xfrm() */
298 #endif /* USE_LOCALE_COLLATE */
300 #ifdef USE_LOCALE_NUMERIC
302 PERLVAR(Inumeric_name, char *) /* Name of current numeric locale */
303 PERLVARI(Inumeric_standard, bool, TRUE)
304 /* Assume simple numerics */
305 PERLVARI(Inumeric_local, bool, TRUE)
306 /* Assume local numerics */
307 PERLVAR(Inumeric_radix, char)
308 /* The radix character if not '.' */
310 #endif /* !USE_LOCALE_NUMERIC */
312 /* utf8 character classes */
313 PERLVAR(Iutf8_alnum, SV *)
314 PERLVAR(Iutf8_alnumc, SV *)
315 PERLVAR(Iutf8_ascii, SV *)
316 PERLVAR(Iutf8_alpha, SV *)
317 PERLVAR(Iutf8_space, SV *)
318 PERLVAR(Iutf8_cntrl, SV *)
319 PERLVAR(Iutf8_graph, SV *)
320 PERLVAR(Iutf8_digit, SV *)
321 PERLVAR(Iutf8_upper, SV *)
322 PERLVAR(Iutf8_lower, SV *)
323 PERLVAR(Iutf8_print, SV *)
324 PERLVAR(Iutf8_punct, SV *)
325 PERLVAR(Iutf8_xdigit, SV *)
326 PERLVAR(Iutf8_mark, SV *)
327 PERLVAR(Iutf8_toupper, SV *)
328 PERLVAR(Iutf8_totitle, SV *)
329 PERLVAR(Iutf8_tolower, SV *)
330 PERLVAR(Ilast_swash_hv, HV *)
331 PERLVAR(Ilast_swash_klen, U32)
332 PERLVARA(Ilast_swash_key,10, U8)
333 PERLVAR(Ilast_swash_tmps, U8 *)
334 PERLVAR(Ilast_swash_slen, STRLEN)
336 /* perly.c globals */
337 PERLVAR(Iyydebug, int)
338 PERLVAR(Iyynerrs, int)
339 PERLVAR(Iyyerrflag, int)
340 PERLVAR(Iyychar, int)
341 PERLVAR(Iyyval, YYSTYPE)
342 PERLVAR(Iyylval, YYSTYPE)
344 PERLVAR(Iglob_index, int)
345 PERLVAR(Isrand_called, bool)
346 PERLVARA(Iuudmap,256, char)
347 PERLVAR(Ibitcount, char *)
350 PERLVAR(Ithr_key, perl_key) /* For per-thread struct perl_thread* */
351 PERLVAR(Isv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */
352 PERLVAR(Ieval_mutex, perl_mutex) /* Mutex for doeval */
353 PERLVAR(Ieval_cond, perl_cond) /* Condition variable for doeval */
354 PERLVAR(Ieval_owner, struct perl_thread *)
355 /* Owner thread for doeval */
356 PERLVAR(Inthreads, int) /* Number of threads currently */
357 PERLVAR(Ithreads_mutex, perl_mutex) /* Mutex for nthreads and thread list */
358 PERLVAR(Inthreads_cond, perl_cond) /* Condition variable for nthreads */
359 PERLVAR(Isvref_mutex, perl_mutex) /* Mutex for SvREFCNT_{inc,dec} */
360 PERLVARI(Ithreadsv_names,char *, THREADSV_NAMES)
362 PERLVAR(Icurthr, struct perl_thread *)
363 /* Currently executing (fake) thread */
366 PERLVAR(Icred_mutex, perl_mutex) /* altered credentials in effect */
368 #endif /* USE_THREADS */
370 #if defined(PERL_IMPLICIT_SYS)
371 PERLVAR(IMem, struct IPerlMem*)
372 PERLVAR(IEnv, struct IPerlEnv*)
373 PERLVAR(IStdIO, struct IPerlStdIO*)
374 PERLVAR(ILIO, struct IPerlLIO*)
375 PERLVAR(IDir, struct IPerlDir*)
376 PERLVAR(ISock, struct IPerlSock*)
377 PERLVAR(IProc, struct IPerlProc*)