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