Commit | Line | Data |
49f531da |
1 | /* This file describes the "global" variables used by perl */ |
2 | /* This used to be in perl.h directly but we want to */ |
3 | /* abstract out which are per-thread per-interpreter really */ |
4 | /* global and how initialized into one file */ |
5 | |
6 | /****************/ |
7 | /* Truly global */ |
8 | /****************/ |
9 | |
10 | /* global state */ |
11 | PERLVAR(curinterp, PerlInterpreter *) /* currently running interpreter */ |
12 | #ifdef USE_THREADS |
13 | PERLVAR(thr_key, perl_key) /* For per-thread struct perl_thread* */ |
14 | PERLVAR(sv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */ |
15 | PERLVAR(malloc_mutex, perl_mutex) /* Mutex for malloc */ |
16 | PERLVAR(eval_mutex, perl_mutex) /* Mutex for doeval */ |
17 | PERLVAR(eval_cond, perl_cond) /* Condition variable for doeval */ |
18 | PERLVAR(eval_owner, struct perl_thread *) /* Owner thread for doeval */ |
19 | PERLVAR(nthreads, int) /* Number of threads currently */ |
20 | PERLVAR(threads_mutex, perl_mutex) /* Mutex for nthreads and thread list */ |
21 | PERLVAR(nthreads_cond, perl_cond) /* Condition variable for nthreads */ |
22 | PERLVARI(threadsv_names, char *, THREADSV_NAMES) |
23 | #ifdef FAKE_THREADS |
24 | PERLVAR(thr, struct perl_thread *) /* Currently executing (fake) thread */ |
25 | #endif |
26 | #endif /* USE_THREADS */ |
27 | |
28 | PERLVAR(uid, int) /* current real user id */ |
29 | PERLVAR(euid, int) /* current effective user id */ |
30 | PERLVAR(gid, int) /* current real group id */ |
31 | PERLVAR(egid, int) /* current effective group id */ |
32 | PERLVAR(nomemok, bool) /* let malloc context handle nomem */ |
33 | PERLVAR(an, U32) /* malloc sequence number */ |
34 | PERLVAR(cop_seqmax, U32) /* statement sequence number */ |
35 | PERLVAR(op_seqmax, U16) /* op sequence number */ |
36 | PERLVAR(evalseq, U32) /* eval sequence number */ |
37 | PERLVAR(sub_generation, U32) /* inc to force methods to be looked up again */ |
38 | PERLVAR(origenviron, char **) |
39 | PERLVAR(origalen, U32) |
40 | PERLVAR(pidstatus, HV *) /* pid-to-status mappings for waitpid */ |
41 | PERLVAR(profiledata, U32 *) |
42 | PERLVARI(maxo, int, MAXO) /* Number of ops */ |
43 | PERLVAR(osname, char *) /* operating system */ |
44 | PERLVARI(sh_path, char *, SH_PATH) /* full path of shell */ |
45 | PERLVAR(sighandlerp, Sighandler_t) |
46 | |
47 | PERLVAR(xiv_arenaroot, XPV*) /* list of allocated xiv areas */ |
48 | PERLVAR(xiv_root, IV **) /* free xiv list--shared by interpreters */ |
49 | PERLVAR(xnv_root, double *) /* free xnv list--shared by interpreters */ |
50 | PERLVAR(xrv_root, XRV *) /* free xrv list--shared by interpreters */ |
51 | PERLVAR(xpv_root, XPV *) /* free xpv list--shared by interpreters */ |
52 | PERLVAR(he_root, HE *) /* free he list--shared by interpreters */ |
53 | PERLVAR(nice_chunk, char *) /* a nice chunk of memory to reuse */ |
54 | PERLVAR(nice_chunk_size, U32) /* how nice the chunk of memory is */ |
55 | |
d4cce5f1 |
56 | PERLVARI(runops, runops_proc_t *, RUNOPS_DEFAULT) |
57 | |
58 | #ifndef USE_THREADS |
49f531da |
59 | /* Stack for currently executing thread--context switch must handle this. */ |
60 | PERLVAR(stack_base, SV **) /* stack->array_ary */ |
61 | PERLVAR(stack_sp, SV **) /* stack pointer now */ |
62 | PERLVAR(stack_max, SV **) /* stack->array_ary + stack->array_max */ |
63 | |
64 | /* likewise for these */ |
65 | |
66 | #ifdef OP_IN_REGISTER |
67 | PERLVAR(opsave, OP *) /* save current op register across longjmps */ |
68 | #else |
69 | PERLVAR(op, OP *) /* current op--when not in a global register */ |
70 | #endif |
d4cce5f1 |
71 | |
49f531da |
72 | PERLVAR(scopestack, I32 *) /* blocks we've entered */ |
73 | PERLVAR(scopestack_ix, I32) |
74 | PERLVAR(scopestack_max, I32) |
75 | |
76 | PERLVAR(savestack, ANY*) /* to save non-local values on */ |
77 | PERLVAR(savestack_ix, I32) |
78 | PERLVAR(savestack_max, I32) |
79 | |
80 | PERLVAR(retstack, OP **) /* returns we've pushed */ |
81 | PERLVAR(retstack_ix, I32) |
82 | PERLVAR(retstack_max, I32) |
83 | |
84 | PERLVAR(markstack, I32 *) /* stackmarks we're remembering */ |
85 | PERLVAR(markstack_ptr, I32 *) /* stackmarks we're remembering */ |
86 | PERLVAR(markstack_max, I32 *) /* stackmarks we're remembering */ |
87 | |
d4cce5f1 |
88 | |
89 | |
49f531da |
90 | PERLVAR(curpad, SV **) |
91 | |
92 | /* temp space */ |
93 | PERLVAR(Sv, SV *) |
94 | PERLVAR(Xpv, XPV *) |
d4cce5f1 |
95 | |
49f531da |
96 | PERLVAR(statbuf, struct stat) |
97 | #ifdef HAS_TIMES |
98 | PERLVAR(timesbuf, struct tms) |
99 | #endif |
d4cce5f1 |
100 | |
101 | #endif /* USE_THREADS */ |
102 | |
103 | PERLVAR(tokenbuf[256], char) |
49f531da |
104 | #if defined(WIN32) && defined(__GNUC__) |
105 | PERLVAR(na, static STRLEN) |
106 | #else |
107 | PERLVAR(na, STRLEN) /* for use in SvPV when length is Not Applicable */ |
108 | #endif |
109 | |
110 | PERLVAR(sv_undef, SV) |
111 | PERLVAR(sv_no, SV) |
112 | PERLVAR(sv_yes, SV) |
113 | #ifdef CSH |
114 | PERLVARI(cshname, char *, CSH) |
115 | PERLVAR(cshlen, I32) |
116 | #endif |
117 | |
118 | PERLVAR(lex_state, U32) /* next token is determined */ |
119 | PERLVAR(lex_defer, U32) /* state after determined token */ |
120 | PERLVAR(lex_expect, expectation) /* expect after determined token */ |
121 | PERLVAR(lex_brackets, I32) /* bracket count */ |
122 | PERLVAR(lex_formbrack, I32) /* bracket count at outer format level */ |
123 | PERLVAR(lex_fakebrack, I32) /* outer bracket is mere delimiter */ |
124 | PERLVAR(lex_casemods, I32) /* casemod count */ |
125 | PERLVAR(lex_dojoin, I32) /* doing an array interpolation */ |
126 | PERLVAR(lex_starts, I32) /* how many interps done on level */ |
127 | PERLVAR(lex_stuff, SV *) /* runtime pattern from m// or s/// */ |
128 | PERLVAR(lex_repl, SV *) /* runtime replacement from s/// */ |
129 | PERLVAR(lex_op, OP *) /* extra info to pass back on op */ |
130 | PERLVAR(lex_inpat, OP *) /* in pattern $) and $| are special */ |
131 | PERLVAR(lex_inwhat, I32) /* what kind of quoting are we in */ |
132 | PERLVAR(lex_brackstack, char *) /* what kind of brackets to pop */ |
133 | PERLVAR(lex_casestack, char *) /* what kind of case mods in effect */ |
134 | |
135 | /* What we know when we're in LEX_KNOWNEXT state. */ |
136 | PERLVAR(nextval[5], YYSTYPE) /* value of next token, if any */ |
137 | PERLVAR(nexttype[5], I32) /* type of next token */ |
138 | PERLVAR(nexttoke, I32) |
139 | |
140 | PERLVARI(rsfp, PerlIO * VOL, Nullfp) |
141 | PERLVAR(linestr, SV *) |
142 | PERLVAR(bufptr, char *) |
143 | PERLVAR(oldbufptr, char *) |
144 | PERLVAR(oldoldbufptr, char *) |
145 | PERLVAR(bufend, char *) |
146 | PERLVARI(expect, expectation, XSTATE) /* how to interpret ambiguous tokens */ |
147 | PERLVAR(rsfp_filters, AV *) |
148 | |
149 | PERLVAR(multi_start, I32) /* 1st line of multi-line string */ |
150 | PERLVAR(multi_end, I32) /* last line of multi-line string */ |
151 | PERLVAR(multi_open, I32) /* delimiter of said string */ |
152 | PERLVAR(multi_close, I32) /* delimiter of said string */ |
153 | |
154 | PERLVAR(scrgv, GV *) |
155 | PERLVAR(error_count, I32) /* how many errors so far, max 10 */ |
156 | PERLVAR(subline, I32) /* line this subroutine began on */ |
157 | PERLVAR(subname, SV *) /* name of current subroutine */ |
158 | |
159 | PERLVAR(compcv, CV *) /* currently compiling subroutine */ |
160 | PERLVAR(comppad, AV *) /* storage for lexically scoped temporaries */ |
161 | PERLVAR(comppad_name, AV *) /* variable names for "my" variables */ |
162 | PERLVAR(comppad_name_fill, I32) /* last "introduced" variable offset */ |
163 | PERLVAR(comppad_name_floor, I32) /* start of vars in innermost block */ |
164 | PERLVAR(min_intro_pending, I32) /* start of vars to introduce */ |
165 | PERLVAR(max_intro_pending, I32) /* end of vars to introduce */ |
166 | PERLVAR(padix, I32) /* max used index in current "register" pad */ |
167 | PERLVAR(padix_floor, I32) /* how low may inner block reset padix */ |
168 | PERLVAR(pad_reset_pending, I32) /* reset pad on next attempted alloc */ |
169 | PERLVAR(compiling, COP) |
170 | |
171 | PERLVAR(thisexpr, I32) /* name id for nothing_in_common() */ |
172 | PERLVAR(last_uni, char *) /* position of last named-unary operator */ |
173 | PERLVAR(last_lop, char *) /* position of last list operator */ |
174 | PERLVAR(last_lop_op, OPCODE) /* last list operator */ |
175 | PERLVAR(in_my, bool) /* we're compiling a "my" declaration */ |
176 | PERLVAR(in_my_stash, HV *) /* declared class of this "my" declaration */ |
177 | #ifdef FCRYPT |
178 | PERLVAR(cryptseen, I32) /* has fast crypt() been initialized? */ |
179 | #endif |
180 | |
181 | PERLVAR(hints, U32) /* various compilation flags */ |
182 | |
183 | PERLVAR(do_undump, bool) /* -u or dump seen? */ |
184 | PERLVAR(debug, VOL U32) |
185 | |
186 | |
187 | #ifdef OVERLOAD |
188 | |
189 | PERLVAR(amagic_generation, long) |
190 | |
191 | #endif |
192 | |
193 | #ifdef USE_LOCALE_COLLATE |
194 | PERLVAR(collation_ix, U32) /* Collation generation index */ |
195 | PERLVAR(collation_name, char *) /* Name of current collation */ |
196 | PERLVARI(collation_standard, bool, TRUE) /* Assume simple collation */ |
197 | PERLVAR(collxfrm_base, Size_t) /* Basic overhead in *xfrm() */ |
198 | PERLVARI(collxfrm_mult, Size_t, 2) /* Expansion factor in *xfrm() */ |
199 | #endif /* USE_LOCALE_COLLATE */ |
200 | |
201 | #ifdef USE_LOCALE_NUMERIC |
202 | |
203 | PERLVAR(numeric_name, char *) /* Name of current numeric locale */ |
204 | PERLVARI(numeric_standard, bool, TRUE) /* Assume simple numerics */ |
205 | PERLVARI(numeric_local, bool, TRUE) /* Assume local numerics */ |
206 | |
207 | #endif /* !USE_LOCALE_NUMERIC */ |
208 | |