This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
added patch to generate PPDEF(pp_foo)
[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
cb68f92d
GS
66PERLVAR(Istatcache, Stat_t) /* _ */
67PERLVAR(Istatgv, GV *)
68PERLVARI(Istatname, SV *, Nullsv)
49f531da
NIS
69
70/* shortcuts to various I/O objects */
cb68f92d
GS
71PERLVAR(Istdingv, GV *)
72PERLVAR(Idefgv, GV *)
73PERLVAR(Iargvgv, GV *)
74PERLVAR(Iargvoutgv, GV *)
49f531da
NIS
75
76/* shortcuts to regexp stuff */
cb68f92d
GS
77PERLVAR(Ileftgv, GV *)
78PERLVAR(Iampergv, GV *)
79PERLVAR(Irightgv, GV *)
80PERLVAR(Iscreamfirst, I32 *)
81PERLVAR(Iscreamnext, I32 *)
82PERLVARI(Imaxscream, I32, -1)
83PERLVAR(Ilastscream, SV *)
84PERLVAR(Ireplgv, GV *)
49f531da
NIS
85
86/* shortcuts to misc objects */
cb68f92d 87PERLVAR(Ierrgv, GV *)
49f531da
NIS
88
89/* shortcuts to debugging objects */
cb68f92d
GS
90PERLVAR(IDBgv, GV *)
91PERLVAR(IDBline, GV *)
92PERLVAR(IDBsub, GV *)
93PERLVAR(IDBsingle, SV *)
94PERLVAR(IDBtrace, SV *)
95PERLVAR(IDBsignal, SV *)
49f531da
NIS
96PERLVAR(Ilineary, AV *) /* lines of script for debugger */
97PERLVAR(Idbargs, AV *) /* args to call listed by caller function */
98
99/* symbol tables */
49f531da
NIS
100PERLVAR(Idebstash, HV *) /* symbol table for perldb package */
101PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */
102PERLVAR(Icurstname, SV *) /* name of current package */
103PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */
d4cce5f1 104PERLVAR(Iendav, AV *) /* names of END subroutines */
49f531da
NIS
105PERLVAR(Iinitav, AV *) /* names of INIT subroutines */
106PERLVAR(Istrtab, HV *) /* shared string table */
a4bb2597 107PERLVARI(Isub_generation,U32,1) /* incr to invalidate method cache */
49f531da
NIS
108
109/* memory management */
49f531da
NIS
110PERLVAR(Isv_count, I32) /* how many SV* are currently allocated */
111PERLVAR(Isv_objcount, I32) /* how many objects are currently allocated */
112PERLVAR(Isv_root, SV*) /* storage for SVs belonging to interp */
113PERLVAR(Isv_arenaroot, SV*) /* list of areas for garbage collection */
114
115/* funky return mechanisms */
cb68f92d
GS
116PERLVAR(Ilastspbase, I32)
117PERLVAR(Ilastsize, I32)
49f531da
NIS
118PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */
119
120/* subprocess state */
d4cce5f1 121PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */
49f531da
NIS
122
123/* internal state */
49f531da
NIS
124PERLVAR(Itainting, bool) /* doing taint checks */
125PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */
2a841d13 126PERLVAR(Ilast_proto, char *) /* Prototype of last sub seen. */
49f531da
NIS
127
128/* trace state */
cb68f92d
GS
129PERLVAR(Idlevel, I32)
130PERLVARI(Idlmax, I32, 128)
131PERLVAR(Idebname, char *)
132PERLVAR(Idebdelim, char *)
49f531da
NIS
133
134/* current interpreter roots */
cb68f92d
GS
135PERLVAR(Imain_cv, CV *)
136PERLVAR(Imain_root, OP *)
137PERLVAR(Imain_start, OP *)
138PERLVAR(Ieval_root, OP *)
139PERLVAR(Ieval_start, OP *)
49f531da
NIS
140
141/* runtime control stuff */
cb68f92d
GS
142PERLVARI(Icurcopdb, COP *, NULL)
143PERLVARI(Icopline, line_t, NOLINE)
49f531da
NIS
144
145/* statics moved here for shared library purposes */
146PERLVAR(Istrchop, SV) /* return value from chop */
147PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */
148PERLVAR(Ilastfd, int) /* what to preserve mode on */
149PERLVAR(Ioldname, char *) /* what to preserve mode on */
d4cce5f1
NIS
150PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
151PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
49f531da
NIS
152PERLVAR(Isortcop, OP *) /* user defined sort routine */
153PERLVAR(Isortstash, HV *) /* which is in some package or other */
154PERLVAR(Ifirstgv, GV *) /* $a */
155PERLVAR(Isecondgv, GV *) /* $b */
49f531da
NIS
156PERLVAR(Imystrk, SV *) /* temp key string for do_each() */
157PERLVAR(Idumplvl, I32) /* indentation level on syntax tree dump */
cb68f92d 158PERLVAR(Ioldlastpm, PMOP *) /* for saving regexp context in debugger */
49f531da 159PERLVAR(Igensym, I32) /* next symbol for getsym() to define */
cb68f92d
GS
160PERLVAR(Ipreambled, bool)
161PERLVAR(Ipreambleav, AV *)
162PERLVARI(Ilaststatval, int, -1)
163PERLVARI(Ilaststype, I32, OP_STAT)
164PERLVAR(Imess_sv, SV *)
49f531da 165
cb68f92d
GS
166/* XXX shouldn't these be per-thread? --GSAR */
167PERLVAR(Iors, char *) /* output record separator $\ */
168PERLVAR(Iorslen, STRLEN)
169PERLVAR(Iofmt, char *) /* output format for numbers $# */
d4cce5f1 170
4b556e6c 171/* interpreter atexit processing */
cb68f92d
GS
172PERLVARI(Iexitlist, PerlExitListEntry *, NULL)
173 /* list of exit functions */
174PERLVARI(Iexitlistlen, I32, 0) /* length of same */
175PERLVAR(Imodglobal, HV *) /* per-interp module data */
176
177/* these used to be in global before 5.004_68 */
178PERLVARI(Iprofiledata, U32 *, NULL) /* table of ops, counts */
179PERLVARI(Irsfp, PerlIO * VOL, Nullfp) /* current source file pointer */
180PERLVARI(Irsfp_filters, AV *, Nullav) /* keeps active source filters */
181
182PERLVAR(Icompiling, COP) /* compiling/done executing marker */
183
184PERLVAR(Icompcv, CV *) /* currently compiling subroutine */
185PERLVAR(Icomppad, AV *) /* storage for lexically scoped temporaries */
186PERLVAR(Icomppad_name, AV *) /* variable names for "my" variables */
187PERLVAR(Icomppad_name_fill, I32) /* last "introduced" variable offset */
188PERLVAR(Icomppad_name_floor, I32) /* start of vars in innermost block */
4b556e6c
JD
189
190#ifdef HAVE_INTERP_INTERN
cb68f92d
GS
191PERLVAR(Isys_intern, struct interp_intern)
192 /* platform internals */
4b556e6c
JD
193#endif
194
7fae4e64 195/* more statics moved here */
7fae4e64
GS
196PERLVARI(Igeneration, int, 100) /* from op.c */
197PERLVAR(IDBcv, CV *) /* from perl.c */
198PERLVAR(Iarchpat_auto, char*) /* from perl.c */
199PERLVAR(Isortcxix, I32) /* from pp_ctl.c */
200PERLVAR(Ilastgotoprobe, OP*) /* from pp_ctl.c */
201PERLVAR(Iregdummy, regnode) /* from regcomp.c */
77d41b28 202PERLVAR(Iregcomp_parse, char*) /* Input-scan pointer. */
7fae4e64 203PERLVAR(Iregxend, char*) /* End of input for compile */
cb68f92d 204PERLVAR(Iregcode, regnode*) /* Code-emit pointer; &regdummy = don't */
7fae4e64
GS
205PERLVAR(Iregnaughty, I32) /* How bad is this pattern? */
206PERLVAR(Iregsawback, I32) /* Did we see \1, ...? */
207
208/* This guys appear both in regcomp.c and regexec.c, */
209PERLVAR(Iregprecomp, char *) /* uncompiled string. */
210PERLVAR(Iregnpar, I32) /* () count. */
211PERLVAR(Iregsize, I32) /* Code size. */
212PERLVAR(Iregflags, U16) /* are we folding, multilining? */
213
214PERLVAR(Iregseen, U32) /* from regcomp.c */
215PERLVAR(Iseen_zerolen, I32) /* from regcomp.c */
77d41b28 216PERLVAR(Iregcomp_rx, regexp *) /* from regcomp.c */
7fae4e64 217PERLVAR(Iextralen, I32) /* from regcomp.c */
7fae4e64
GS
218PERLVAR(Icolorset, int) /* from regcomp.c */
219PERLVAR(Icolors[4], char *) /* from regcomp.c */
7fae4e64
GS
220
221PERLVAR(Ireginput, char *) /* String-input pointer. */
222PERLVAR(Iregbol, char *) /* Beginning of input, for ^ check. */
223PERLVAR(Iregeol, char *) /* End of input, for $ check. */
224PERLVAR(Iregstartp, char **) /* Pointer to startp array. */
225PERLVAR(Iregendp, char **) /* Ditto for endp. */
226PERLVAR(Ireglastparen, U32 *) /* Similarly for lastparen. */
227PERLVAR(Iregtill, char *) /* How far we are required to go. */
228PERLVAR(Iregprev, char) /* char before regbol, \n if none */
229
230PERLVAR(Ireg_start_tmp, char **) /* from regexec.c */
231PERLVAR(Ireg_start_tmpl,U32) /* from regexec.c */
cb68f92d
GS
232PERLVAR(Iregdata, struct reg_data *)
233 /* from regexec.c renamed was data */
7fae4e64
GS
234PERLVAR(Ibostr, char *) /* from regexec.c */
235PERLVAR(Ireg_flags, U32) /* from regexec.c */
236PERLVAR(Ireg_eval_set, I32) /* from regexec.c */
237
7fae4e64
GS
238PERLVAR(Iregnarrate, I32) /* from regexec.c */
239PERLVAR(Iregprogram, regnode *) /* from regexec.c */
240PERLVARI(Iregindent, int, 0) /* from regexec.c */
7fae4e64
GS
241
242PERLVAR(Iregcc, CURCUR *) /* from regexec.c */
cb68f92d
GS
243PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */
244PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */
7fae4e64
GS
245
246PERLVAR(Ilinestart, char *) /* beg. of most recently read line */
247PERLVAR(Ipending_ident, char) /* pending identifier lookup */
248PERLVAR(Isublex_info, SUBLEXINFO) /* from toke.c */
249
49f531da 250#ifdef USE_THREADS
cb68f92d 251PERLVAR(Ithrsv, SV *) /* struct perl_thread for main thread */
940cb80d 252PERLVARI(Ithreadnum, U32, 0) /* incremented each thread creation */
49f531da 253#endif /* USE_THREADS */
76e3520e
GS
254
255#ifdef PERL_OBJECT
7fae4e64
GS
256PERLVARI(piMem, IPerlMem*, NULL)
257PERLVARI(piENV, IPerlEnv*, NULL)
258PERLVARI(piStdIO, IPerlStdIO*, NULL)
259PERLVARI(piLIO, IPerlLIO*, NULL)
260PERLVARI(piDir, IPerlDir*, NULL)
261PERLVARI(piSock, IPerlSock*, NULL)
262PERLVARI(piProc, IPerlProc*, NULL)
76e3520e 263#endif