This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Globals and structs via macros - part 1 of N
[perl5.git] / intrpvar.h
CommitLineData
49f531da
NIS
1/***********************************************/
2/* Global only to current interpreter instance */
3/***********************************************/
4
5/* pseudo environmental stuff */
6PERLVAR(Iorigargc, int)
7PERLVAR(Iorigargv, char **)
8PERLVAR(Ienvgv, GV *)
9PERLVAR(Isiggv, GV *)
10PERLVAR(Iincgv, GV *)
11PERLVAR(Iorigfilename, char *)
12PERLVAR(Idiehook, SV *)
13PERLVAR(Iwarnhook, SV *)
14PERLVAR(Iparsehook, SV *)
15/* switches */
16PERLVAR(Icddir, char *)
17PERLVAR(Iminus_c, bool)
18PERLVAR(Ipatchlevel[10], char)
19PERLVAR(Ilocalpatches, char **)
20PERLVAR(Inrs, SV *)
21PERLVARI(Isplitstr, char *, " ")
22PERLVAR(Ipreprocess, bool)
23PERLVAR(Iminus_n, bool)
24PERLVAR(Iminus_p, bool)
25PERLVAR(Iminus_l, bool)
26PERLVAR(Iminus_a, bool)
27PERLVAR(Iminus_F, bool)
28PERLVAR(Idoswitches, bool)
29PERLVAR(Idowarn, bool)
30PERLVAR(Idoextract, bool)
31PERLVAR(Isawampersand, bool) /* must save all match strings */
32PERLVAR(Isawstudy, bool) /* do fbm_instr on all strings */
33PERLVAR(Isawvec, bool)
34PERLVAR(Iunsafe, bool)
35PERLVAR(Iinplace, char *)
36PERLVAR(Ie_tmpname, char *)
37PERLVAR(Ie_fp, PerlIO *)
38PERLVAR(Iperldb, U32)
39 /* This value may be raised by extensions for testing purposes */
40PERLVARI(Iperl_destruct_level, int, 0) /* 0=none, 1=full, 2=full with checks */
41
42/* magical thingies */
43PERLVAR(Ibasetime, Time_t) /* $^T */
44PERLVAR(Iformfeed, SV *) /* $^L */
45PERLVARI(Ichopset, char *, " \n-") /* $: */
46PERLVAR(Irs, SV *) /* $/ */
47PERLVAR(Iofs, char *) /* $, */
48PERLVAR(Iofslen, STRLEN)
49PERLVAR(Iors, char *) /* $\ */
50PERLVAR(Iorslen, STRLEN)
51PERLVAR(Iofmt, char *) /* $# */
52PERLVARI(Imaxsysfd, I32, MAXSYSFD) /* top fd to pass to subprocesses */
53PERLVAR(Imultiline, int) /* $*--do strings hold >1 line? */
54PERLVAR(Istatusvalue, I32) /* $? */
55#ifdef VMS
56PERLVAR(Istatusvalue_vms, U32)
57#endif
58
59PERLVAR(Istatcache, struct stat) /* _ */
60PERLVAR(Istatgv, GV *)
61PERLVARI(Istatname, SV *, Nullsv)
62
63/* shortcuts to various I/O objects */
64PERLVAR(Istdingv, GV *)
65PERLVAR(Ilast_in_gv, GV *)
66PERLVAR(Idefgv, GV *)
67PERLVAR(Iargvgv, GV *)
68PERLVAR(Idefoutgv, GV *)
69PERLVAR(Iargvoutgv, GV *)
70
71/* shortcuts to regexp stuff */
72PERLVAR(Ileftgv, GV *)
73PERLVAR(Iampergv, GV *)
74PERLVAR(Irightgv, GV *)
75PERLVAR(Icurpm, PMOP *) /* what to do \ interps from */
76PERLVAR(Iscreamfirst, I32 *)
77PERLVAR(Iscreamnext, I32 *)
78PERLVARI(Imaxscream, I32, -1)
79PERLVAR(Ilastscream, SV *)
80
81/* shortcuts to misc objects */
82PERLVAR(Ierrgv, GV *)
83
84/* shortcuts to debugging objects */
85PERLVAR(IDBgv, GV *)
86PERLVAR(IDBline, GV *)
87PERLVAR(IDBsub, GV *)
88PERLVAR(IDBsingle, SV *)
89PERLVAR(IDBtrace, SV *)
90PERLVAR(IDBsignal, SV *)
91PERLVAR(Ilineary, AV *) /* lines of script for debugger */
92PERLVAR(Idbargs, AV *) /* args to call listed by caller function */
93
94/* symbol tables */
95PERLVAR(Idefstash, HV *) /* main symbol table */
96PERLVAR(Icurstash, HV *) /* symbol table for current package */
97PERLVAR(Idebstash, HV *) /* symbol table for perldb package */
98PERLVAR(Iglobalstash, HV *) /* global keyword overrides imported here */
99PERLVAR(Icurstname, SV *) /* name of current package */
100PERLVAR(Ibeginav, AV *) /* names of BEGIN subroutines */
101PERLVAR(Iendav, AV *) /* names of END subroutines */
102PERLVAR(Iinitav, AV *) /* names of INIT subroutines */
103PERLVAR(Istrtab, HV *) /* shared string table */
104
105/* memory management */
106PERLVAR(Itmps_stack, SV **)
107PERLVARI(Itmps_ix, I32, -1)
108PERLVARI(Itmps_floor, I32, -1)
109PERLVAR(Itmps_max, I32)
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 */
116PERLVAR(Ilastspbase, I32)
117PERLVAR(Ilastsize, I32)
118PERLVAR(Iforkprocess, int) /* so do_open |- can return proc# */
119
120/* subprocess state */
121PERLVAR(Ifdpid, AV *) /* keep fd-to-pid mappings for my_popen */
122
123/* internal state */
124PERLVAR(Iin_eval, VOL int) /* trap "fatal" errors? */
125PERLVAR(Irestartop, OP *) /* Are we propagating an error from croak? */
126PERLVAR(Idelaymagic, int) /* ($<,$>) = ... */
127PERLVAR(Idirty, bool) /* In the middle of tearing things down? */
128PERLVAR(Ilocalizing, U8) /* are we processing a local() list? */
129PERLVAR(Itainted, bool) /* using variables controlled by $< */
130PERLVAR(Itainting, bool) /* doing taint checks */
131PERLVARI(Iop_mask, char *, NULL) /* masked operations for safe evals */
132
133/* trace state */
134PERLVAR(Idlevel, I32)
135PERLVARI(Idlmax, I32, 128)
136PERLVAR(Idebname, char *)
137PERLVAR(Idebdelim, char *)
138
139/* current interpreter roots */
140PERLVAR(Imain_cv, CV *)
141PERLVAR(Imain_root, OP *)
142PERLVAR(Imain_start, OP *)
143PERLVAR(Ieval_root, OP *)
144PERLVAR(Ieval_start, OP *)
145
146/* runtime control stuff */
147PERLVARI(Icurcop, COP * VOL, &compiling)
148PERLVARI(Icurcopdb, COP *, NULL)
149PERLVARI(Icopline, line_t, NOLINE)
150PERLVAR(Icxstack, PERL_CONTEXT *)
151PERLVARI(Icxstack_ix, I32, -1)
152PERLVARI(Icxstack_max, I32, 128)
153PERLVAR(Istart_env, JMPENV) /* empty startup sigjmp() environment */
154PERLVAR(Itop_env, JMPENV *) /* ptr. to current sigjmp() environment */
155
156/* stack stuff */
157PERLVAR(Icurstack, AV *) /* THE STACK */
158PERLVAR(Imainstack, AV *) /* the stack when nothing funny is happening */
159
160/* format accumulators */
161PERLVAR(Iformtarget, SV *)
162PERLVAR(Ibodytarget, SV *)
163PERLVAR(Itoptarget, SV *)
164
165/* statics moved here for shared library purposes */
166PERLVAR(Istrchop, SV) /* return value from chop */
167PERLVAR(Ifilemode, int) /* so nextargv() can preserve mode */
168PERLVAR(Ilastfd, int) /* what to preserve mode on */
169PERLVAR(Ioldname, char *) /* what to preserve mode on */
170PERLVAR(IArgv, char **) /* stuff to free from do_aexec, vfork safe */
171PERLVAR(ICmd, char *) /* stuff to free from do_aexec, vfork safe */
172PERLVAR(Isortcop, OP *) /* user defined sort routine */
173PERLVAR(Isortstash, HV *) /* which is in some package or other */
174PERLVAR(Ifirstgv, GV *) /* $a */
175PERLVAR(Isecondgv, GV *) /* $b */
176PERLVAR(Isortstack, AV *) /* temp stack during pp_sort() */
177PERLVAR(Isignalstack, AV *) /* temp stack during sighandler() */
178PERLVAR(Imystrk, SV *) /* temp key string for do_each() */
179PERLVAR(Idumplvl, I32) /* indentation level on syntax tree dump */
180PERLVAR(Ioldlastpm, PMOP *) /* for saving regexp context during debugger */
181PERLVAR(Igensym, I32) /* next symbol for getsym() to define */
182PERLVAR(Ipreambled, bool)
183PERLVAR(Ipreambleav, AV *)
184PERLVARI(Ilaststatval, int, -1)
185PERLVARI(Ilaststype, I32, OP_STAT)
186PERLVAR(Imess_sv, SV *)
187
188#ifdef USE_THREADS
189/* threads stuff */
190PERLVAR(Ithrsv, SV *) /* holds struct perl_thread for main thread */
191#endif /* USE_THREADS */
192
193