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