Commit | Line | Data |
---|---|---|
8b09643d NC |
1 | /* -*- buffer-read-only: t -*- |
2 | * | |
3 | * mg_vtable.h | |
4 | * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! | |
5 | * This file is built by regen/mg_vtable.pl. | |
6 | * Any changes made here will be lost! | |
7 | */ | |
8 | ||
abf9aa7a NC |
9 | /* These constants should be used in preference to raw characters |
10 | * when using magic. Note that some perl guts still assume | |
11 | * certain character properties of these constants, namely that | |
12 | * isUPPER() and toLOWER() may do useful mappings. | |
13 | */ | |
14 | ||
15 | #define PERL_MAGIC_sv '\0' /* Special scalar variable */ | |
23cfd2fc | 16 | #define PERL_MAGIC_arylen '#' /* Array length ($#ary) */ |
e5e1ee61 | 17 | #define PERL_MAGIC_rhash '%' /* Extra data for restricted hashes */ |
a6d69523 | 18 | #define PERL_MAGIC_debugvar '*' /* $DB::single, signal, trace vars */ |
23cfd2fc | 19 | #define PERL_MAGIC_pos '.' /* pos() lvalue */ |
e5e1ee61 FC |
20 | #define PERL_MAGIC_symtab ':' /* Extra data for symbol tables */ |
21 | #define PERL_MAGIC_backref '<' /* For weak ref data */ | |
22 | #define PERL_MAGIC_arylen_p '@' /* To move arylen out of XPVAV */ | |
abf9aa7a | 23 | #define PERL_MAGIC_bm 'B' /* Boyer-Moore (fast string search) */ |
23cfd2fc | 24 | #define PERL_MAGIC_overload_table 'c' /* Holds overload table (AMT) on stash */ |
abf9aa7a NC |
25 | #define PERL_MAGIC_regdata 'D' /* Regex match position data |
26 | (@+ and @- vars) */ | |
27 | #define PERL_MAGIC_regdatum 'd' /* Regex match position data element */ | |
28 | #define PERL_MAGIC_env 'E' /* %ENV hash */ | |
29 | #define PERL_MAGIC_envelem 'e' /* %ENV hash element */ | |
30 | #define PERL_MAGIC_fm 'f' /* Formline ('compiled' format) */ | |
0177730e | 31 | #define PERL_MAGIC_regex_global 'g' /* m//g target */ |
abf9aa7a NC |
32 | #define PERL_MAGIC_hints 'H' /* %^H hash */ |
33 | #define PERL_MAGIC_hintselem 'h' /* %^H hash element */ | |
34 | #define PERL_MAGIC_isa 'I' /* @ISA array */ | |
35 | #define PERL_MAGIC_isaelem 'i' /* @ISA array element */ | |
36 | #define PERL_MAGIC_nkeys 'k' /* scalar(keys()) lvalue */ | |
37 | #define PERL_MAGIC_dbfile 'L' /* Debugger %_<filename */ | |
38 | #define PERL_MAGIC_dbline 'l' /* Debugger %_<filename element */ | |
39 | #define PERL_MAGIC_shared 'N' /* Shared between threads */ | |
40 | #define PERL_MAGIC_shared_scalar 'n' /* Shared between threads */ | |
41 | #define PERL_MAGIC_collxfrm 'o' /* Locale transformation */ | |
42 | #define PERL_MAGIC_tied 'P' /* Tied array or hash */ | |
43 | #define PERL_MAGIC_tiedelem 'p' /* Tied array or hash element */ | |
44 | #define PERL_MAGIC_tiedscalar 'q' /* Tied scalar or handle */ | |
e5e1ee61 | 45 | #define PERL_MAGIC_qr 'r' /* Precompiled qr// regex */ |
abf9aa7a NC |
46 | #define PERL_MAGIC_sig 'S' /* %SIG hash */ |
47 | #define PERL_MAGIC_sigelem 's' /* %SIG hash element */ | |
48 | #define PERL_MAGIC_taint 't' /* Taintedness */ | |
49 | #define PERL_MAGIC_uvar 'U' /* Available for use by extensions */ | |
50 | #define PERL_MAGIC_uvar_elem 'u' /* Reserved for use by extensions */ | |
abf9aa7a | 51 | #define PERL_MAGIC_vstring 'V' /* SV was vstring literal */ |
23cfd2fc | 52 | #define PERL_MAGIC_vec 'v' /* vec() lvalue */ |
abf9aa7a NC |
53 | #define PERL_MAGIC_utf8 'w' /* Cached UTF-8 information */ |
54 | #define PERL_MAGIC_substr 'x' /* substr() lvalue */ | |
1f1dcfb5 | 55 | #define PERL_MAGIC_nonelem 'Y' /* Array element that does not exist */ |
abf9aa7a NC |
56 | #define PERL_MAGIC_defelem 'y' /* Shadow "foreach" iterator variable / |
57 | smart parameter vivification */ | |
baabe3fb | 58 | #define PERL_MAGIC_lvref '\\' /* Lvalue reference constructor */ |
e5e1ee61 | 59 | #define PERL_MAGIC_checkcall ']' /* Inlining/mutation of call to this CV */ |
23cfd2fc | 60 | #define PERL_MAGIC_ext '~' /* Available for use by extensions */ |
abf9aa7a | 61 | |
ca298f7d | 62 | enum { /* pass one of these to get_vtbl */ |
23cfd2fc NC |
63 | want_vtbl_arylen, |
64 | want_vtbl_arylen_p, | |
65 | want_vtbl_backref, | |
09fb282d | 66 | want_vtbl_checkcall, |
23cfd2fc NC |
67 | want_vtbl_collxfrm, |
68 | want_vtbl_dbline, | |
a6d69523 | 69 | want_vtbl_debugvar, |
23cfd2fc | 70 | want_vtbl_defelem, |
ca298f7d NC |
71 | want_vtbl_env, |
72 | want_vtbl_envelem, | |
23cfd2fc NC |
73 | want_vtbl_hints, |
74 | want_vtbl_hintselem, | |
ca298f7d NC |
75 | want_vtbl_isa, |
76 | want_vtbl_isaelem, | |
9cce4f9a | 77 | want_vtbl_lvref, |
ca298f7d NC |
78 | want_vtbl_mglob, |
79 | want_vtbl_nkeys, | |
1f1dcfb5 | 80 | want_vtbl_nonelem, |
23cfd2fc NC |
81 | want_vtbl_ovrld, |
82 | want_vtbl_pack, | |
83 | want_vtbl_packelem, | |
ca298f7d | 84 | want_vtbl_pos, |
ca298f7d NC |
85 | want_vtbl_regdata, |
86 | want_vtbl_regdatum, | |
23cfd2fc NC |
87 | want_vtbl_regexp, |
88 | want_vtbl_sigelem, | |
89 | want_vtbl_substr, | |
90 | want_vtbl_sv, | |
91 | want_vtbl_taint, | |
ca298f7d | 92 | want_vtbl_utf8, |
23cfd2fc NC |
93 | want_vtbl_uvar, |
94 | want_vtbl_vec, | |
c7fdacb9 | 95 | magic_vtable_max |
ca298f7d NC |
96 | }; |
97 | ||
2d1f1fe5 | 98 | #ifdef DOINIT |
bfd14e52 | 99 | EXTCONST char * const PL_magic_vtable_names[magic_vtable_max] = { |
23cfd2fc NC |
100 | "arylen", |
101 | "arylen_p", | |
102 | "backref", | |
09fb282d | 103 | "checkcall", |
23cfd2fc NC |
104 | "collxfrm", |
105 | "dbline", | |
a6d69523 | 106 | "debugvar", |
23cfd2fc | 107 | "defelem", |
2d1f1fe5 NC |
108 | "env", |
109 | "envelem", | |
23cfd2fc NC |
110 | "hints", |
111 | "hintselem", | |
2d1f1fe5 NC |
112 | "isa", |
113 | "isaelem", | |
9cce4f9a | 114 | "lvref", |
2d1f1fe5 NC |
115 | "mglob", |
116 | "nkeys", | |
1f1dcfb5 | 117 | "nonelem", |
23cfd2fc NC |
118 | "ovrld", |
119 | "pack", | |
120 | "packelem", | |
2d1f1fe5 | 121 | "pos", |
2d1f1fe5 NC |
122 | "regdata", |
123 | "regdatum", | |
23cfd2fc NC |
124 | "regexp", |
125 | "sigelem", | |
126 | "substr", | |
127 | "sv", | |
128 | "taint", | |
2d1f1fe5 | 129 | "utf8", |
23cfd2fc | 130 | "uvar", |
4499db73 | 131 | "vec" |
2d1f1fe5 NC |
132 | }; |
133 | #else | |
bfd14e52 | 134 | EXTCONST char * const PL_magic_vtable_names[magic_vtable_max]; |
2d1f1fe5 NC |
135 | #endif |
136 | ||
8b09643d NC |
137 | /* These all need to be 0, not NULL, as NULL can be (void*)0, which is a |
138 | * pointer to data, whereas we're assigning pointers to functions, which are | |
139 | * not the same beast. ANSI doesn't allow the assignment from one to the other. | |
140 | * (although most, but not all, compilers are prepared to do it) | |
141 | */ | |
142 | ||
0ffb5b03 | 143 | /* order is: |
8b09643d NC |
144 | get |
145 | set | |
146 | len | |
147 | clear | |
148 | free | |
149 | copy | |
150 | dup | |
151 | local | |
152 | */ | |
153 | ||
0ffb5b03 | 154 | #ifdef DOINIT |
c7fdacb9 | 155 | EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = { |
23cfd2fc | 156 | { (int (*)(pTHX_ SV *, MAGIC *))Perl_magic_getarylen, Perl_magic_setarylen, 0, 0, 0, 0, 0, 0 }, |
83f29afa | 157 | { 0, 0, 0, Perl_magic_cleararylen_p, Perl_magic_freearylen_p, 0, 0, 0 }, |
23cfd2fc | 158 | { 0, 0, 0, 0, Perl_magic_killbackrefs, 0, 0, 0 }, |
09fb282d | 159 | { 0, 0, 0, 0, 0, Perl_magic_copycallchecker, 0, 0 }, |
23cfd2fc NC |
160 | #ifdef USE_LOCALE_COLLATE |
161 | { 0, Perl_magic_setcollxfrm, 0, 0, 0, 0, 0, 0 }, | |
b7b5e578 NC |
162 | #else |
163 | { 0, 0, 0, 0, 0, 0, 0, 0 }, | |
164 | #endif | |
b7b5e578 | 165 | { 0, Perl_magic_setdbline, 0, 0, 0, 0, 0, 0 }, |
a6d69523 | 166 | { Perl_magic_getdebugvar, Perl_magic_setdebugvar, 0, 0, 0, 0, 0, 0 }, |
23cfd2fc NC |
167 | { Perl_magic_getdefelem, Perl_magic_setdefelem, 0, 0, 0, 0, 0, 0 }, |
168 | { 0, Perl_magic_set_all_env, 0, Perl_magic_clear_all_env, 0, 0, 0, 0 }, | |
169 | { 0, Perl_magic_setenv, 0, Perl_magic_clearenv, 0, 0, 0, 0 }, | |
170 | { 0, 0, 0, Perl_magic_clearhints, 0, 0, 0, 0 }, | |
171 | { 0, Perl_magic_sethint, 0, Perl_magic_clearhint, 0, 0, 0, 0 }, | |
b7b5e578 NC |
172 | { 0, Perl_magic_setisa, 0, Perl_magic_clearisa, 0, 0, 0, 0 }, |
173 | { 0, Perl_magic_setisa, 0, 0, 0, 0, 0, 0 }, | |
9cce4f9a | 174 | { 0, Perl_magic_setlvref, 0, 0, 0, 0, 0, 0 }, |
b7b5e578 NC |
175 | { 0, Perl_magic_setmglob, 0, 0, 0, 0, 0, 0 }, |
176 | { Perl_magic_getnkeys, Perl_magic_setnkeys, 0, 0, 0, 0, 0, 0 }, | |
1f1dcfb5 | 177 | { 0, Perl_magic_setnonelem, 0, 0, 0, 0, 0, 0 }, |
23cfd2fc NC |
178 | { 0, 0, 0, 0, Perl_magic_freeovrld, 0, 0, 0 }, |
179 | { 0, 0, Perl_magic_sizepack, Perl_magic_wipepack, 0, 0, 0, 0 }, | |
180 | { Perl_magic_getpack, Perl_magic_setpack, 0, Perl_magic_clearpack, 0, 0, 0, 0 }, | |
b7b5e578 | 181 | { Perl_magic_getpos, Perl_magic_setpos, 0, 0, 0, 0, 0, 0 }, |
b7b5e578 NC |
182 | { 0, 0, Perl_magic_regdata_cnt, 0, 0, 0, 0, 0 }, |
183 | { Perl_magic_regdatum_get, Perl_magic_regdatum_set, 0, 0, 0, 0, 0, 0 }, | |
23cfd2fc NC |
184 | { 0, Perl_magic_setregexp, 0, 0, 0, 0, 0, 0 }, |
185 | #ifndef PERL_MICRO | |
186 | { Perl_magic_getsig, Perl_magic_setsig, 0, Perl_magic_clearsig, 0, 0, 0, 0 }, | |
0ffb5b03 | 187 | #else |
b7b5e578 | 188 | { 0, 0, 0, 0, 0, 0, 0, 0 }, |
0ffb5b03 | 189 | #endif |
23cfd2fc | 190 | { Perl_magic_getsubstr, Perl_magic_setsubstr, 0, 0, 0, 0, 0, 0 }, |
9bb29b68 | 191 | { Perl_magic_get, Perl_magic_set, 0, 0, 0, 0, 0, 0 }, |
23cfd2fc NC |
192 | { Perl_magic_gettaint, Perl_magic_settaint, 0, 0, 0, 0, 0, 0 }, |
193 | { 0, Perl_magic_setutf8, 0, 0, 0, 0, 0, 0 }, | |
194 | { Perl_magic_getuvar, Perl_magic_setuvar, 0, 0, 0, 0, 0, 0 }, | |
4499db73 | 195 | { Perl_magic_getvec, Perl_magic_setvec, 0, 0, 0, 0, 0, 0 } |
b7b5e578 | 196 | }; |
0ffb5b03 | 197 | #else |
c7fdacb9 | 198 | EXT_MGVTBL PL_magic_vtables[magic_vtable_max]; |
b7b5e578 NC |
199 | #endif |
200 | ||
b2e9fc6f NC |
201 | #define want_vtbl_bm want_vtbl_regexp |
202 | #define want_vtbl_fm want_vtbl_regexp | |
203 | ||
b7b5e578 NC |
204 | #define PL_vtbl_arylen PL_magic_vtables[want_vtbl_arylen] |
205 | #define PL_vtbl_arylen_p PL_magic_vtables[want_vtbl_arylen_p] | |
206 | #define PL_vtbl_backref PL_magic_vtables[want_vtbl_backref] | |
207 | #define PL_vtbl_bm PL_magic_vtables[want_vtbl_bm] | |
09fb282d | 208 | #define PL_vtbl_checkcall PL_magic_vtables[want_vtbl_checkcall] |
b7b5e578 NC |
209 | #define PL_vtbl_collxfrm PL_magic_vtables[want_vtbl_collxfrm] |
210 | #define PL_vtbl_dbline PL_magic_vtables[want_vtbl_dbline] | |
a6d69523 | 211 | #define PL_vtbl_debugvar PL_magic_vtables[want_vtbl_debugvar] |
b7b5e578 NC |
212 | #define PL_vtbl_defelem PL_magic_vtables[want_vtbl_defelem] |
213 | #define PL_vtbl_env PL_magic_vtables[want_vtbl_env] | |
214 | #define PL_vtbl_envelem PL_magic_vtables[want_vtbl_envelem] | |
215 | #define PL_vtbl_fm PL_magic_vtables[want_vtbl_fm] | |
216 | #define PL_vtbl_hints PL_magic_vtables[want_vtbl_hints] | |
217 | #define PL_vtbl_hintselem PL_magic_vtables[want_vtbl_hintselem] | |
218 | #define PL_vtbl_isa PL_magic_vtables[want_vtbl_isa] | |
219 | #define PL_vtbl_isaelem PL_magic_vtables[want_vtbl_isaelem] | |
9cce4f9a | 220 | #define PL_vtbl_lvref PL_magic_vtables[want_vtbl_lvref] |
b7b5e578 NC |
221 | #define PL_vtbl_mglob PL_magic_vtables[want_vtbl_mglob] |
222 | #define PL_vtbl_nkeys PL_magic_vtables[want_vtbl_nkeys] | |
1f1dcfb5 | 223 | #define PL_vtbl_nonelem PL_magic_vtables[want_vtbl_nonelem] |
b7b5e578 NC |
224 | #define PL_vtbl_ovrld PL_magic_vtables[want_vtbl_ovrld] |
225 | #define PL_vtbl_pack PL_magic_vtables[want_vtbl_pack] | |
226 | #define PL_vtbl_packelem PL_magic_vtables[want_vtbl_packelem] | |
227 | #define PL_vtbl_pos PL_magic_vtables[want_vtbl_pos] | |
228 | #define PL_vtbl_regdata PL_magic_vtables[want_vtbl_regdata] | |
229 | #define PL_vtbl_regdatum PL_magic_vtables[want_vtbl_regdatum] | |
230 | #define PL_vtbl_regexp PL_magic_vtables[want_vtbl_regexp] | |
231 | #define PL_vtbl_sigelem PL_magic_vtables[want_vtbl_sigelem] | |
232 | #define PL_vtbl_substr PL_magic_vtables[want_vtbl_substr] | |
233 | #define PL_vtbl_sv PL_magic_vtables[want_vtbl_sv] | |
234 | #define PL_vtbl_taint PL_magic_vtables[want_vtbl_taint] | |
235 | #define PL_vtbl_utf8 PL_magic_vtables[want_vtbl_utf8] | |
236 | #define PL_vtbl_uvar PL_magic_vtables[want_vtbl_uvar] | |
237 | #define PL_vtbl_vec PL_magic_vtables[want_vtbl_vec] | |
8b09643d NC |
238 | |
239 | /* ex: set ro: */ |