X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs%2FMethod.xs;h=590cd06f3ffa438fafd8ce244859911137f6390d;hb=7ec7b950c0cc43c8ba1f2c53a8ebffcfc23ef858;hp=ba2c850b5ba14635c411dc1f499a45418bf0b9ce;hpb=22932438751f5ca55563fc133b53f464dedbf3de;p=gitmo%2FClass-MOP.git diff --git a/xs/Method.xs b/xs/Method.xs index ba2c850..590cd06 100644 --- a/xs/Method.xs +++ b/xs/Method.xs @@ -4,47 +4,7 @@ MODULE = Class::MOP::Method PACKAGE = Class::MOP::Method PROTOTYPES: DISABLE -void -name(self) - SV *self - PREINIT: - register HE *he; - PPCODE: - if ( ! SvROK(self) ) { - die("Cannot call name as a class method"); - } - - if ( (he = hv_fetch_ent((HV *)SvRV(self), KEY_FOR(name), 0, HASH_FOR(name))) ) - XPUSHs(HeVAL(he)); - else - ST(0) = &PL_sv_undef; - -void -package_name(self) - SV *self - PREINIT: - register HE *he; - PPCODE: - if ( ! SvROK(self) ) { - die("Cannot call package_name as a class method"); - } - - if ( (he = hv_fetch_ent((HV *)SvRV(self), KEY_FOR(package_name), 0, HASH_FOR(package_name))) ) - XPUSHs(HeVAL(he)); - else - ST(0) = &PL_sv_undef; - -void -body(self) - SV *self - PREINIT: - register HE *he; - PPCODE: - if ( ! SvROK(self) ) { - die("Cannot call body as a class method"); - } - - if ( (he = hv_fetch_ent((HV *)SvRV(self), KEY_FOR(body), 0, HASH_FOR(body))) ) - XPUSHs(HeVAL(he)); - else - ST(0) = &PL_sv_undef; +BOOT: + INSTALL_SIMPLE_READER(Method, name); + INSTALL_SIMPLE_READER(Method, package_name); + INSTALL_SIMPLE_READER(Method, body);