This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Provide the names of the magic vtables in PL_magic_vtable_names[].
[perl5.git] / mg_vtable.h
CommitLineData
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
ca298f7d
NC
9enum { /* pass one of these to get_vtbl */
10 want_vtbl_sv,
11 want_vtbl_env,
12 want_vtbl_envelem,
13 want_vtbl_sigelem,
14 want_vtbl_pack,
15 want_vtbl_packelem,
16 want_vtbl_dbline,
17 want_vtbl_isa,
18 want_vtbl_isaelem,
19 want_vtbl_arylen,
20 want_vtbl_arylen_p,
21 want_vtbl_mglob,
22 want_vtbl_nkeys,
23 want_vtbl_taint,
24 want_vtbl_substr,
25 want_vtbl_vec,
26 want_vtbl_pos,
ca298f7d
NC
27 want_vtbl_uvar,
28 want_vtbl_defelem,
29 want_vtbl_regexp,
30 want_vtbl_regdata,
31 want_vtbl_regdatum,
32 want_vtbl_amagic,
33 want_vtbl_amagicelem,
34 want_vtbl_backref,
35 want_vtbl_ovrld,
36 want_vtbl_utf8,
37 want_vtbl_collxfrm,
38 want_vtbl_hintselem,
c7fdacb9
NC
39 want_vtbl_hints,
40 magic_vtable_max
ca298f7d
NC
41};
42
2d1f1fe5
NC
43#ifdef DOINIT
44EXTCONST char *PL_magic_vtable_names[magic_vtable_max] = {
45 "sv",
46 "env",
47 "envelem",
48 "sigelem",
49 "pack",
50 "packelem",
51 "dbline",
52 "isa",
53 "isaelem",
54 "arylen",
55 "arylen_p",
56 "mglob",
57 "nkeys",
58 "taint",
59 "substr",
60 "vec",
61 "pos",
62 "uvar",
63 "defelem",
64 "regexp",
65 "regdata",
66 "regdatum",
67 "amagic",
68 "amagicelem",
69 "backref",
70 "ovrld",
71 "utf8",
72 "collxfrm",
73 "hintselem",
74 "hints"
75};
76#else
77EXTCONST char *PL_magic_vtable_names[magic_vtable_max];
78#endif
79
8b09643d
NC
80/* These all need to be 0, not NULL, as NULL can be (void*)0, which is a
81 * pointer to data, whereas we're assigning pointers to functions, which are
82 * not the same beast. ANSI doesn't allow the assignment from one to the other.
83 * (although most, but not all, compilers are prepared to do it)
84 */
85
0ffb5b03 86/* order is:
8b09643d
NC
87 get
88 set
89 len
90 clear
91 free
92 copy
93 dup
94 local
95*/
96
0ffb5b03 97#ifdef DOINIT
c7fdacb9 98EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = {
b7b5e578
NC
99 { Perl_magic_get, Perl_magic_set, Perl_magic_len, 0, 0, 0, 0, 0 },
100 { 0, Perl_magic_set_all_env, 0, Perl_magic_clear_all_env, 0, 0, 0, 0 },
101 { 0, Perl_magic_setenv, 0, Perl_magic_clearenv, 0, 0, 0, 0 },
8b09643d 102#ifndef PERL_MICRO
b7b5e578
NC
103 { Perl_magic_getsig, Perl_magic_setsig, 0, Perl_magic_clearsig, 0, 0, 0, 0 },
104#else
105 { 0, 0, 0, 0, 0, 0, 0, 0 },
106#endif
107 { 0, 0, Perl_magic_sizepack, Perl_magic_wipepack, 0, 0, 0, 0 },
108 { Perl_magic_getpack, Perl_magic_setpack, 0, Perl_magic_clearpack, 0, 0, 0, 0 },
109 { 0, Perl_magic_setdbline, 0, 0, 0, 0, 0, 0 },
110 { 0, Perl_magic_setisa, 0, Perl_magic_clearisa, 0, 0, 0, 0 },
111 { 0, Perl_magic_setisa, 0, 0, 0, 0, 0, 0 },
112 { (int (*)(pTHX_ SV *, MAGIC *))Perl_magic_getarylen, Perl_magic_setarylen, 0, 0, 0, 0, 0, 0 },
113 { 0, 0, 0, 0, Perl_magic_freearylen_p, 0, 0, 0 },
114 { 0, Perl_magic_setmglob, 0, 0, 0, 0, 0, 0 },
115 { Perl_magic_getnkeys, Perl_magic_setnkeys, 0, 0, 0, 0, 0, 0 },
116 { Perl_magic_gettaint, Perl_magic_settaint, 0, 0, 0, 0, 0, 0 },
117 { Perl_magic_getsubstr, Perl_magic_setsubstr, 0, 0, 0, 0, 0, 0 },
118 { Perl_magic_getvec, Perl_magic_setvec, 0, 0, 0, 0, 0, 0 },
119 { Perl_magic_getpos, Perl_magic_setpos, 0, 0, 0, 0, 0, 0 },
b7b5e578
NC
120 { Perl_magic_getuvar, Perl_magic_setuvar, 0, 0, 0, 0, 0, 0 },
121 { Perl_magic_getdefelem, Perl_magic_setdefelem, 0, 0, 0, 0, 0, 0 },
122 { 0, Perl_magic_setregexp, 0, 0, 0, 0, 0, 0 },
123 { 0, 0, Perl_magic_regdata_cnt, 0, 0, 0, 0, 0 },
124 { Perl_magic_regdatum_get, Perl_magic_regdatum_set, 0, 0, 0, 0, 0, 0 },
125 { 0, Perl_magic_setamagic, 0, 0, Perl_magic_setamagic, 0, 0, 0 },
126 { 0, Perl_magic_setamagic, 0, 0, Perl_magic_setamagic, 0, 0, 0 },
127 { 0, 0, 0, 0, Perl_magic_killbackrefs, 0, 0, 0 },
128 { 0, 0, 0, 0, Perl_magic_freeovrld, 0, 0, 0 },
129 { 0, Perl_magic_setutf8, 0, 0, 0, 0, 0, 0 },
8b09643d 130#ifdef USE_LOCALE_COLLATE
b7b5e578 131 { 0, Perl_magic_setcollxfrm, 0, 0, 0, 0, 0, 0 },
0ffb5b03 132#else
b7b5e578 133 { 0, 0, 0, 0, 0, 0, 0, 0 },
0ffb5b03 134#endif
b7b5e578
NC
135 { 0, Perl_magic_sethint, 0, Perl_magic_clearhint, 0, 0, 0, 0 },
136 { 0, 0, 0, Perl_magic_clearhints, 0, 0, 0, 0 }
137};
0ffb5b03 138#else
c7fdacb9 139EXT_MGVTBL PL_magic_vtables[magic_vtable_max];
b7b5e578
NC
140#endif
141
b2e9fc6f
NC
142#define want_vtbl_bm want_vtbl_regexp
143#define want_vtbl_fm want_vtbl_regexp
144
b7b5e578
NC
145#define PL_vtbl_amagic PL_magic_vtables[want_vtbl_amagic]
146#define PL_vtbl_amagicelem PL_magic_vtables[want_vtbl_amagicelem]
147#define PL_vtbl_arylen PL_magic_vtables[want_vtbl_arylen]
148#define PL_vtbl_arylen_p PL_magic_vtables[want_vtbl_arylen_p]
149#define PL_vtbl_backref PL_magic_vtables[want_vtbl_backref]
150#define PL_vtbl_bm PL_magic_vtables[want_vtbl_bm]
151#define PL_vtbl_collxfrm PL_magic_vtables[want_vtbl_collxfrm]
152#define PL_vtbl_dbline PL_magic_vtables[want_vtbl_dbline]
153#define PL_vtbl_defelem PL_magic_vtables[want_vtbl_defelem]
154#define PL_vtbl_env PL_magic_vtables[want_vtbl_env]
155#define PL_vtbl_envelem PL_magic_vtables[want_vtbl_envelem]
156#define PL_vtbl_fm PL_magic_vtables[want_vtbl_fm]
157#define PL_vtbl_hints PL_magic_vtables[want_vtbl_hints]
158#define PL_vtbl_hintselem PL_magic_vtables[want_vtbl_hintselem]
159#define PL_vtbl_isa PL_magic_vtables[want_vtbl_isa]
160#define PL_vtbl_isaelem PL_magic_vtables[want_vtbl_isaelem]
161#define PL_vtbl_mglob PL_magic_vtables[want_vtbl_mglob]
162#define PL_vtbl_nkeys PL_magic_vtables[want_vtbl_nkeys]
163#define PL_vtbl_ovrld PL_magic_vtables[want_vtbl_ovrld]
164#define PL_vtbl_pack PL_magic_vtables[want_vtbl_pack]
165#define PL_vtbl_packelem PL_magic_vtables[want_vtbl_packelem]
166#define PL_vtbl_pos PL_magic_vtables[want_vtbl_pos]
167#define PL_vtbl_regdata PL_magic_vtables[want_vtbl_regdata]
168#define PL_vtbl_regdatum PL_magic_vtables[want_vtbl_regdatum]
169#define PL_vtbl_regexp PL_magic_vtables[want_vtbl_regexp]
170#define PL_vtbl_sigelem PL_magic_vtables[want_vtbl_sigelem]
171#define PL_vtbl_substr PL_magic_vtables[want_vtbl_substr]
172#define PL_vtbl_sv PL_magic_vtables[want_vtbl_sv]
173#define PL_vtbl_taint PL_magic_vtables[want_vtbl_taint]
174#define PL_vtbl_utf8 PL_magic_vtables[want_vtbl_utf8]
175#define PL_vtbl_uvar PL_magic_vtables[want_vtbl_uvar]
176#define PL_vtbl_vec PL_magic_vtables[want_vtbl_vec]
8b09643d
NC
177
178/* ex: set ro: */