Commit | Line | Data |
---|---|---|
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 */ | |
22239a37 | 11 | PERLVAR(Gcurinterp, PerlInterpreter *) /* currently running interpreter */ |
49f531da | 12 | #ifdef USE_THREADS |
22239a37 NIS |
13 | PERLVAR(Gthr_key, perl_key) /* For per-thread struct perl_thread* */ |
14 | PERLVAR(Gsv_mutex, perl_mutex) /* Mutex for allocating SVs in sv.c */ | |
15 | PERLVAR(Gmalloc_mutex, perl_mutex) /* Mutex for malloc */ | |
16 | PERLVAR(Geval_mutex, perl_mutex) /* Mutex for doeval */ | |
17 | PERLVAR(Geval_cond, perl_cond) /* Condition variable for doeval */ | |
18 | PERLVAR(Geval_owner, struct perl_thread *) /* Owner thread for doeval */ | |
19 | PERLVAR(Gnthreads, int) /* Number of threads currently */ | |
20 | PERLVAR(Gthreads_mutex, perl_mutex) /* Mutex for nthreads and thread list */ | |
21 | PERLVAR(Gnthreads_cond, perl_cond) /* Condition variable for nthreads */ | |
dce16143 | 22 | PERLVAR(Gsvref_mutex, perl_mutex) /* Mutex for SvREFCNT_{inc,dec} */ |
22239a37 | 23 | PERLVARI(Gthreadsv_names, char *, THREADSV_NAMES) |
49f531da | 24 | #ifdef FAKE_THREADS |
22239a37 | 25 | PERLVAR(Gcurthr, struct perl_thread *) /* Currently executing (fake) thread */ |
49f531da NIS |
26 | #endif |
27 | #endif /* USE_THREADS */ | |
28 | ||
22239a37 NIS |
29 | PERLVAR(Guid, int) /* current real user id */ |
30 | PERLVAR(Geuid, int) /* current effective user id */ | |
31 | PERLVAR(Ggid, int) /* current real group id */ | |
32 | PERLVAR(Gegid, int) /* current effective group id */ | |
33 | PERLVAR(Gnomemok, bool) /* let malloc context handle nomem */ | |
34 | PERLVAR(Gan, U32) /* malloc sequence number */ | |
35 | PERLVAR(Gcop_seqmax, U32) /* statement sequence number */ | |
36 | PERLVAR(Gop_seqmax, U16) /* op sequence number */ | |
37 | PERLVAR(Gevalseq, U32) /* eval sequence number */ | |
38 | PERLVAR(Gsub_generation, U32) /* inc to force methods to be looked up again */ | |
39 | PERLVAR(Gorigenviron, char **) | |
40 | PERLVAR(Gorigalen, U32) | |
41 | PERLVAR(Gpidstatus, HV *) /* pid-to-status mappings for waitpid */ | |
42 | PERLVAR(Gprofiledata, U32 *) | |
43 | PERLVARI(Gmaxo, int, MAXO) /* Number of ops */ | |
44 | PERLVAR(Gosname, char *) /* operating system */ | |
45 | PERLVARI(Gsh_path, char *, SH_PATH) /* full path of shell */ | |
46 | PERLVAR(Gsighandlerp, Sighandler_t) | |
47 | ||
48 | PERLVAR(Gxiv_arenaroot, XPV*) /* list of allocated xiv areas */ | |
49 | PERLVAR(Gxiv_root, IV **) /* free xiv list--shared by interpreters */ | |
50 | PERLVAR(Gxnv_root, double *) /* free xnv list--shared by interpreters */ | |
51 | PERLVAR(Gxrv_root, XRV *) /* free xrv list--shared by interpreters */ | |
52 | PERLVAR(Gxpv_root, XPV *) /* free xpv list--shared by interpreters */ | |
53 | PERLVAR(Ghe_root, HE *) /* free he list--shared by interpreters */ | |
54 | PERLVAR(Gnice_chunk, char *) /* a nice chunk of memory to reuse */ | |
55 | PERLVAR(Gnice_chunk_size, U32) /* how nice the chunk of memory is */ | |
56 | ||
57 | PERLVARI(Grunops, runops_proc_t *, RUNOPS_DEFAULT) | |
58 | ||
59 | PERLVAR(Gtokenbuf[256], char) | |
60 | PERLVAR(Gna, STRLEN) /* for use in SvPV when length is Not Applicable */ | |
61 | ||
62 | PERLVAR(Gsv_undef, SV) | |
63 | PERLVAR(Gsv_no, SV) | |
64 | PERLVAR(Gsv_yes, SV) | |
49f531da | 65 | #ifdef CSH |
22239a37 NIS |
66 | PERLVARI(Gcshname, char *, CSH) |
67 | PERLVAR(Gcshlen, I32) | |
49f531da NIS |
68 | #endif |
69 | ||
22239a37 NIS |
70 | PERLVAR(Glex_state, U32) /* next token is determined */ |
71 | PERLVAR(Glex_defer, U32) /* state after determined token */ | |
72 | PERLVAR(Glex_expect, expectation) /* expect after determined token */ | |
73 | PERLVAR(Glex_brackets, I32) /* bracket count */ | |
74 | PERLVAR(Glex_formbrack, I32) /* bracket count at outer format level */ | |
75 | PERLVAR(Glex_fakebrack, I32) /* outer bracket is mere delimiter */ | |
76 | PERLVAR(Glex_casemods, I32) /* casemod count */ | |
77 | PERLVAR(Glex_dojoin, I32) /* doing an array interpolation */ | |
78 | PERLVAR(Glex_starts, I32) /* how many interps done on level */ | |
79 | PERLVAR(Glex_stuff, SV *) /* runtime pattern from m// or s/// */ | |
80 | PERLVAR(Glex_repl, SV *) /* runtime replacement from s/// */ | |
81 | PERLVAR(Glex_op, OP *) /* extra info to pass back on op */ | |
82 | PERLVAR(Glex_inpat, OP *) /* in pattern $) and $| are special */ | |
83 | PERLVAR(Glex_inwhat, I32) /* what kind of quoting are we in */ | |
84 | PERLVAR(Glex_brackstack, char *) /* what kind of brackets to pop */ | |
85 | PERLVAR(Glex_casestack, char *) /* what kind of case mods in effect */ | |
49f531da NIS |
86 | |
87 | /* What we know when we're in LEX_KNOWNEXT state. */ | |
22239a37 NIS |
88 | PERLVAR(Gnextval[5], YYSTYPE) /* value of next token, if any */ |
89 | PERLVAR(Gnexttype[5], I32) /* type of next token */ | |
90 | PERLVAR(Gnexttoke, I32) | |
91 | ||
92 | PERLVARI(Grsfp, PerlIO * VOL, Nullfp) | |
93 | PERLVAR(Glinestr, SV *) | |
94 | PERLVAR(Gbufptr, char *) | |
95 | PERLVAR(Goldbufptr, char *) | |
96 | PERLVAR(Goldoldbufptr, char *) | |
97 | PERLVAR(Gbufend, char *) | |
98 | PERLVARI(Gexpect, expectation, XSTATE) /* how to interpret ambiguous tokens */ | |
99 | PERLVAR(Grsfp_filters, AV *) | |
100 | ||
101 | PERLVAR(Gmulti_start, I32) /* 1st line of multi-line string */ | |
102 | PERLVAR(Gmulti_end, I32) /* last line of multi-line string */ | |
103 | PERLVAR(Gmulti_open, I32) /* delimiter of said string */ | |
104 | PERLVAR(Gmulti_close, I32) /* delimiter of said string */ | |
105 | ||
106 | PERLVAR(Gscrgv, GV *) | |
107 | PERLVAR(Gerror_count, I32) /* how many errors so far, max 10 */ | |
108 | PERLVAR(Gsubline, I32) /* line this subroutine began on */ | |
109 | PERLVAR(Gsubname, SV *) /* name of current subroutine */ | |
110 | ||
111 | PERLVAR(Gcompcv, CV *) /* currently compiling subroutine */ | |
112 | PERLVAR(Gcomppad, AV *) /* storage for lexically scoped temporaries */ | |
113 | PERLVAR(Gcomppad_name, AV *) /* variable names for "my" variables */ | |
114 | PERLVAR(Gcomppad_name_fill, I32) /* last "introduced" variable offset */ | |
115 | PERLVAR(Gcomppad_name_floor, I32) /* start of vars in innermost block */ | |
116 | PERLVAR(Gmin_intro_pending, I32) /* start of vars to introduce */ | |
117 | PERLVAR(Gmax_intro_pending, I32) /* end of vars to introduce */ | |
118 | PERLVAR(Gpadix, I32) /* max used index in current "register" pad */ | |
119 | PERLVAR(Gpadix_floor, I32) /* how low may inner block reset padix */ | |
120 | PERLVAR(Gpad_reset_pending, I32) /* reset pad on next attempted alloc */ | |
121 | PERLVAR(Gcompiling, COP) | |
122 | ||
123 | PERLVAR(Gthisexpr, I32) /* name id for nothing_in_common() */ | |
124 | PERLVAR(Glast_uni, char *) /* position of last named-unary operator */ | |
125 | PERLVAR(Glast_lop, char *) /* position of last list operator */ | |
126 | PERLVAR(Glast_lop_op, OPCODE) /* last list operator */ | |
127 | PERLVAR(Gin_my, bool) /* we're compiling a "my" declaration */ | |
128 | PERLVAR(Gin_my_stash, HV *) /* declared class of this "my" declaration */ | |
49f531da | 129 | #ifdef FCRYPT |
22239a37 | 130 | PERLVAR(Gcryptseen, I32) /* has fast crypt() been initialized? */ |
49f531da NIS |
131 | #endif |
132 | ||
22239a37 | 133 | PERLVAR(Ghints, U32) /* various compilation flags */ |
49f531da | 134 | |
22239a37 NIS |
135 | PERLVAR(Gdo_undump, bool) /* -u or dump seen? */ |
136 | PERLVAR(Gdebug, VOL U32) | |
49f531da NIS |
137 | |
138 | ||
139 | #ifdef OVERLOAD | |
140 | ||
22239a37 | 141 | PERLVAR(Gamagic_generation, long) |
49f531da NIS |
142 | |
143 | #endif | |
144 | ||
145 | #ifdef USE_LOCALE_COLLATE | |
22239a37 NIS |
146 | PERLVAR(Gcollation_ix, U32) /* Collation generation index */ |
147 | PERLVAR(Gcollation_name, char *) /* Name of current collation */ | |
148 | PERLVARI(Gcollation_standard, bool, TRUE) /* Assume simple collation */ | |
149 | PERLVAR(Gcollxfrm_base, Size_t) /* Basic overhead in *xfrm() */ | |
150 | PERLVARI(Gcollxfrm_mult, Size_t, 2) /* Expansion factor in *xfrm() */ | |
49f531da NIS |
151 | #endif /* USE_LOCALE_COLLATE */ |
152 | ||
153 | #ifdef USE_LOCALE_NUMERIC | |
154 | ||
22239a37 NIS |
155 | PERLVAR(Gnumeric_name, char *) /* Name of current numeric locale */ |
156 | PERLVARI(Gnumeric_standard, bool, TRUE) /* Assume simple numerics */ | |
157 | PERLVARI(Gnumeric_local, bool, TRUE) /* Assume local numerics */ | |
49f531da NIS |
158 | |
159 | #endif /* !USE_LOCALE_NUMERIC */ | |
160 | ||
3fe35a81 | 161 | /* constants (these are not literals to facilitate pointer comparisons) */ |
3fe6f2dc MB |
162 | PERLVARIC(GYes, char *, "1") |
163 | PERLVARIC(GNo, char *, "") | |
164 | PERLVARIC(Ghexdigit, char *, "0123456789abcdef0123456789ABCDEFx") | |
165 | PERLVARIC(Gpatleave, char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}") | |
3fe35a81 | 166 |