This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Object destruction order testing.
[perl5.git] / intrpvar.h
CommitLineData
49f531da
NIS
1/***********************************************/
2/* Global only to current interpreter instance */
3/***********************************************/
4
cb68f92d
GS
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
GS
17PERLVAR(Iorigargc, int)
18PERLVAR(Iorigargv, char **)
19PERLVAR(Ienvgv, GV *)
20PERLVAR(Isiggv, GV *)
21PERLVAR(Iincgv, GV *)
b3ac6de7 22PERLVAR(Ihintgv, GV *)
cb68f92d
GS
23PERLVAR(Iorigfilename, char *)
24PERLVAR(Idiehook, SV *)
25PERLVAR(Iwarnhook, SV *)
26PERLVAR(Iparsehook, SV *)
d4cce5f1 27PERLVAR(Icddir, char *) /* switches */
cb68f92d
GS
28PERLVAR(Iminus_c, bool)
29PERLVAR(Ipatchlevel[10],char)
30PERLVAR(Ilocalpatches, char **)
31PERLVARI(Isplitstr, char *, " ")
32PERLVAR(Ipreprocess, bool)
33PERLVAR(Iminus_n, bool)
34PERLVAR(Iminus_p, bool)
35PERLVAR(Iminus_l, bool)
36PERLVAR(Iminus_a, bool)
37PERLVAR(Iminus_F, bool)
38PERLVAR(Idoswitches, bool)
39PERLVAR(Idowarn, bool)
40PERLVAR(Idoextract, bool)
49f531da
NIS
41PERLVAR(Isawampersand, bool) /* must save all match strings */
42PERLVAR(Isawstudy, bool) /* do fbm_instr on all strings */
cb68f92d
GS
43PERLVAR(Isawvec, bool)
44PERLVAR(Iunsafe, bool)
45PERLVAR(Iinplace, char *)
46PERLVAR(Ie_script, SV *)
47PERLVAR(Iperldb, U32)
d4cce5f1
NIS
48
49/* This value may be raised by extensions for testing purposes */
50/* 0=none, 1=full, 2=full with checks */
cb68f92d 51PERLVARI(Iperl_destruct_level, int, 0)
49f531da
NIS
52
53/* magical thingies */
54PERLVAR(Ibasetime, Time_t) /* $^T */
55PERLVAR(Iformfeed, SV *) /* $^L */
d4cce5f1
NIS
56
57
cb68f92d
GS
58PERLVARI(Imaxsysfd, I32, MAXSYSFD)
59 /* top fd to pass to subprocesses */
49f531da
NIS
60PERLVAR(Imultiline, int) /* $*--do strings hold >1 line? */
61PERLVAR(Istatusvalue, I32) /* $? */
62#ifdef VMS
cb68f92d 63PERLVAR(Istatusvalue_vms,U32)
49f531da
NIS
64#endif
65
49f531da 66/* shortcuts to various I/O objects */
cb68f92d
GS
67PERLVAR(Istdingv, GV *)
68PERLVAR(Idefgv, GV *)
69PERLVAR(Iargvgv, GV *)
70PERLVAR(Iargvoutgv, GV *)
49f531da
NIS
71
72/* shortcuts to regexp stuff */
5c0ca799 73/* XXX these three aren't used anywhere */
cb68f92d
GS
74PERLVAR(Ileftgv, GV *)
75PERLVAR(Iampergv, GV *)
76PERLVAR(Irightgv, GV *)
5c0ca799
GS
77
78/* this one needs to be moved to thrdvar.h and accessed via
79 * find_threadsv() when USE_THREADS */
cb68f92d 80PERLVAR(Ireplgv, GV *)
49f531da
NIS
81
82/* shortcuts to misc objects */
cb68f92d 83PERLVAR(Ierrgv, GV *)
49f531da
NIS
84
85/* shortcuts to debugging objects */
cb68f92d
GS
86PERLVAR(IDBgv, GV *)
87PERLVAR(IDBline, GV *)
88PERLVAR(IDBsub, GV *)
89PERLVAR(IDBsingle, SV *)
90PERLVAR(IDBtrace, SV *)
91PERLVAR(IDBsignal, SV *)
49f531da
NIS
92PERLVAR(Ilineary, AV *) /* lines of script for debugger */
93PERLVAR(Idbargs, AV *) /* args to call listed by caller function */
94
95/* symbol tables */
49f531da
NIS
96PERLVAR(Idebstash, HV *) /* symbol table for perldb package */
97PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */
98PERLVAR(Icurstname, SV *) /* name of current package */
99PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */
d4cce5f1 100PERLVAR(Iendav, AV *) /* names of END subroutines */
49f531da
NIS
101PERLVAR(Iinitav, AV *) /* names of INIT subroutines */
102PERLVAR(Istrtab, HV *) /* shared string table */
005a453c 103PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */
49f531da
NIS
104
105/* memory management */
49f531da
NIS
106PERLVAR(Isv_count, I32) /* how many SV* are currently allocated */
107PERLVAR(Isv_objcount, I32) /* how many objects are currently allocated */
108PERLVAR(Isv_root, SV*) /* storage for SVs belonging to interp */
109PERLVAR(Isv_arenaroot, SV*) /* list of areas for garbage collection */
110
111/* funky return mechanisms */
cb68f92d
GS
112PERLVAR(Ilastspbase, I32)
113PERLVAR(Ilastsize, I32)
49f531da
NIS
114PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */
115
116/* subprocess state */
d4cce5f1 117PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */
49f531da
NIS
118
119/* internal state */
49f531da
NIS
120PERLVAR(Itainting, bool) /* doing taint checks */
121PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */
2a841d13 122PERLVAR(Ilast_proto, char *) /* Prototype of last sub seen. */
49f531da
NIS
123
124/* trace state */
cb68f92d
GS
125PERLVAR(Idlevel, I32)
126PERLVARI(Idlmax, I32, 128)
127PERLVAR(Idebname, char *)
128PERLVAR(Idebdelim, char *)
49f531da
NIS
129
130/* current interpreter roots */
cb68f92d
GS
131PERLVAR(Imain_cv, CV *)
132PERLVAR(Imain_root, OP *)
133PERLVAR(Imain_start, OP *)
134PERLVAR(Ieval_root, OP *)
135PERLVAR(Ieval_start, OP *)
49f531da
NIS
136
137/* runtime control stuff */
cb68f92d
GS
138PERLVARI(Icurcopdb, COP *, NULL)
139PERLVARI(Icopline, line_t, NOLINE)
49f531da
NIS
140
141/* statics moved here for shared library purposes */
142PERLVAR(Istrchop, SV) /* return value from chop */
143PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */
144PERLVAR(Ilastfd, int) /* what to preserve mode on */
145PERLVAR(Ioldname, char *) /* what to preserve mode on */
d4cce5f1
NIS
146PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
147PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
49f531da 148PERLVAR(Imystrk, SV *) /* temp key string for do_each() */
cb68f92d 149PERLVAR(Ioldlastpm, PMOP *) /* for saving regexp context in debugger */
49f531da 150PERLVAR(Igensym, I32) /* next symbol for getsym() to define */
cb68f92d
GS
151PERLVAR(Ipreambled, bool)
152PERLVAR(Ipreambleav, AV *)
153PERLVARI(Ilaststatval, int, -1)
154PERLVARI(Ilaststype, I32, OP_STAT)
155PERLVAR(Imess_sv, SV *)
49f531da 156
cb68f92d
GS
157/* XXX shouldn't these be per-thread? --GSAR */
158PERLVAR(Iors, char *) /* output record separator $\ */
159PERLVAR(Iorslen, STRLEN)
160PERLVAR(Iofmt, char *) /* output format for numbers $# */
d4cce5f1 161
4b556e6c 162/* interpreter atexit processing */
cb68f92d
GS
163PERLVARI(Iexitlist, PerlExitListEntry *, NULL)
164 /* list of exit functions */
165PERLVARI(Iexitlistlen, I32, 0) /* length of same */
166PERLVAR(Imodglobal, HV *) /* per-interp module data */
167
168/* these used to be in global before 5.004_68 */
169PERLVARI(Iprofiledata, U32 *, NULL) /* table of ops, counts */
170PERLVARI(Irsfp, PerlIO * VOL, Nullfp) /* current source file pointer */
171PERLVARI(Irsfp_filters, AV *, Nullav) /* keeps active source filters */
172
173PERLVAR(Icompiling, COP) /* compiling/done executing marker */
174
175PERLVAR(Icompcv, CV *) /* currently compiling subroutine */
176PERLVAR(Icomppad, AV *) /* storage for lexically scoped temporaries */
177PERLVAR(Icomppad_name, AV *) /* variable names for "my" variables */
178PERLVAR(Icomppad_name_fill, I32) /* last "introduced" variable offset */
179PERLVAR(Icomppad_name_floor, I32) /* start of vars in innermost block */
4b556e6c
JD
180
181#ifdef HAVE_INTERP_INTERN
cb68f92d
GS
182PERLVAR(Isys_intern, struct interp_intern)
183 /* platform internals */
4b556e6c
JD
184#endif
185
7fae4e64 186/* more statics moved here */
7fae4e64
GS
187PERLVARI(Igeneration, int, 100) /* from op.c */
188PERLVAR(IDBcv, CV *) /* from perl.c */
189PERLVAR(Iarchpat_auto, char*) /* from perl.c */
56953603 190
cb68f92d
GS
191PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */
192PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */
7fae4e64
GS
193
194PERLVAR(Ilinestart, char *) /* beg. of most recently read line */
195PERLVAR(Ipending_ident, char) /* pending identifier lookup */
196PERLVAR(Isublex_info, SUBLEXINFO) /* from toke.c */
197
49f531da 198#ifdef USE_THREADS
cb68f92d 199PERLVAR(Ithrsv, SV *) /* struct perl_thread for main thread */
940cb80d 200PERLVARI(Ithreadnum, U32, 0) /* incremented each thread creation */
5f08fbcd 201PERLVAR(Istrtab_mutex, perl_mutex) /* Mutex for string table access */
49f531da 202#endif /* USE_THREADS */
76e3520e 203
92742e37
GS
204PERLVARI(Ibytecode_iv_overflows,int, 0) /* from bytecode.h */
205PERLVAR(Ibytecode_sv, SV *)
206PERLVAR(Ibytecode_pv, XPV)
207PERLVAR(Ibytecode_obj_list, void **)
208PERLVARI(Ibytecode_obj_list_fill, I32, -1)
9f53fe7d 209
76e3520e 210#ifdef PERL_OBJECT
7fae4e64
GS
211PERLVARI(piMem, IPerlMem*, NULL)
212PERLVARI(piENV, IPerlEnv*, NULL)
213PERLVARI(piStdIO, IPerlStdIO*, NULL)
214PERLVARI(piLIO, IPerlLIO*, NULL)
215PERLVARI(piDir, IPerlDir*, NULL)
216PERLVARI(piSock, IPerlSock*, NULL)
217PERLVARI(piProc, IPerlProc*, NULL)
76e3520e 218#endif