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