diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-13 14:17:22 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-11 10:12:17 +0200 |
commit | 8b09643d068d86543c3782211d4a527ee93fee77 (patch) | |
tree | 32056686eb6f479513c1c0d5c0a05fd94ec70674 /mg_vtable.h | |
parent | 4de01b548a201d0dc90101ced2980c754fbf0e00 (diff) | |
download | perl-8b09643d068d86543c3782211d4a527ee93fee77.tar.gz |
Generate the definitions for magic vtables from data in a regen script.
Previously perl.h contained a long section of MGVTBL_SET() macros declaring
the core's various magic vtables. Convert the information into data structures
in a new script regen/mg_table.pl, and use this to generate a new file
mg_vtable.h, included by perl.h
This is the first step in reducing the number of places that data relating to
magic vtables is declared (and has to be kept in sync), and will allow more
flexibility in parts of the core's implementation.
Diffstat (limited to 'mg_vtable.h')
-rw-r--r-- | mg_vtable.h | 416 |
1 files changed, 416 insertions, 0 deletions
diff --git a/mg_vtable.h b/mg_vtable.h new file mode 100644 index 0000000000..ebe448a454 --- /dev/null +++ b/mg_vtable.h @@ -0,0 +1,416 @@ +/* -*- buffer-read-only: t -*- + * + * mg_vtable.h + * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! + * This file is built by regen/mg_vtable.pl. + * Any changes made here will be lost! + */ + +/* These all need to be 0, not NULL, as NULL can be (void*)0, which is a + * pointer to data, whereas we're assigning pointers to functions, which are + * not the same beast. ANSI doesn't allow the assignment from one to the other. + * (although most, but not all, compilers are prepared to do it) + */ + +/* args are: + vtable + get + set + len + clear + free + copy + dup + local +*/ + +MGVTBL_SET( + PL_vtbl_sv, + Perl_magic_get, + Perl_magic_set, + Perl_magic_len, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_env, + 0, + Perl_magic_set_all_env, + 0, + Perl_magic_clear_all_env, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_envelem, + 0, + Perl_magic_setenv, + 0, + Perl_magic_clearenv, + 0, + 0, + 0, + 0 +); + +#ifndef PERL_MICRO +MGVTBL_SET( + PL_vtbl_sigelem, + Perl_magic_getsig, + Perl_magic_setsig, + 0, + Perl_magic_clearsig, + 0, + 0, + 0, + 0 +); +#endif + +MGVTBL_SET( + PL_vtbl_pack, + 0, + 0, + Perl_magic_sizepack, + Perl_magic_wipepack, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_packelem, + Perl_magic_getpack, + Perl_magic_setpack, + 0, + Perl_magic_clearpack, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_dbline, + 0, + Perl_magic_setdbline, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_isa, + 0, + Perl_magic_setisa, + 0, + Perl_magic_clearisa, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_isaelem, + 0, + Perl_magic_setisa, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET_CONST_MAGIC_GET( + PL_vtbl_arylen, + Perl_magic_getarylen, + Perl_magic_setarylen, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_arylen_p, + 0, + 0, + 0, + 0, + Perl_magic_freearylen_p, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_mglob, + 0, + Perl_magic_setmglob, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_nkeys, + Perl_magic_getnkeys, + Perl_magic_setnkeys, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_taint, + Perl_magic_gettaint, + Perl_magic_settaint, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_substr, + Perl_magic_getsubstr, + Perl_magic_setsubstr, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_vec, + Perl_magic_getvec, + Perl_magic_setvec, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_pos, + Perl_magic_getpos, + Perl_magic_setpos, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_bm, + 0, + Perl_magic_setregexp, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_fm, + 0, + Perl_magic_setregexp, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_uvar, + Perl_magic_getuvar, + Perl_magic_setuvar, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_defelem, + Perl_magic_getdefelem, + Perl_magic_setdefelem, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_regexp, + 0, + Perl_magic_setregexp, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_regdata, + 0, + 0, + Perl_magic_regdata_cnt, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_regdatum, + Perl_magic_regdatum_get, + Perl_magic_regdatum_set, + 0, + 0, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_amagic, + 0, + Perl_magic_setamagic, + 0, + 0, + Perl_magic_setamagic, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_amagicelem, + 0, + Perl_magic_setamagic, + 0, + 0, + Perl_magic_setamagic, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_backref, + 0, + 0, + 0, + 0, + Perl_magic_killbackrefs, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_ovrld, + 0, + 0, + 0, + 0, + Perl_magic_freeovrld, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_utf8, + 0, + Perl_magic_setutf8, + 0, + 0, + 0, + 0, + 0, + 0 +); + +#ifdef USE_LOCALE_COLLATE +MGVTBL_SET( + PL_vtbl_collxfrm, + 0, + Perl_magic_setcollxfrm, + 0, + 0, + 0, + 0, + 0, + 0 +); +#endif + +MGVTBL_SET( + PL_vtbl_hintselem, + 0, + Perl_magic_sethint, + 0, + Perl_magic_clearhint, + 0, + 0, + 0, + 0 +); + +MGVTBL_SET( + PL_vtbl_hints, + 0, + 0, + 0, + Perl_magic_clearhints, + 0, + 0, + 0, + 0 +); + + +/* ex: set ro: */ |