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