X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xs-src%2FMouse.xs;h=a905f63c97a9c8d5e7b51c03ccd1cc6d5f296325;hb=6ff81d81df833c5faa820ab7148df1c7d58d24d3;hp=8d0f3a815d7e27af035c6e13264f504087d84259;hpb=646c0371bdfda5817f842c54577c4d5605a4c3c0;p=gitmo%2FMouse.git diff --git a/xs-src/Mouse.xs b/xs-src/Mouse.xs index 8d0f3a8..a905f63 100644 --- a/xs-src/Mouse.xs +++ b/xs-src/Mouse.xs @@ -1,3 +1,4 @@ +#define NEED_newSVpvn_flags_GLOBAL #include "mouse.h" SV* mouse_package; @@ -31,7 +32,7 @@ HV* namespace(SV* self) CODE: { - SV* const package = mouse_instance_get_slot(aTHX_ self, mouse_package); + SV* const package = get_slot(self, mouse_package); if(!(package && SvOK(package))){ croak("No package name defined"); } @@ -45,8 +46,8 @@ void add_method(SV* self, SV* name, SV* code, ...) CODE: { - SV* const package = mouse_instance_get_slot(aTHX_ self, mouse_package); /* $self->{package} */ - SV* const methods = mouse_instance_get_slot(aTHX_ self, mouse_methods); /* $self->{methods} */ + SV* const package = get_slot(self, mouse_package); /* $self->{package} */ + SV* const methods = get_slot(self, mouse_methods); /* $self->{methods} */ GV* gv; SV* code_ref; @@ -83,7 +84,7 @@ CODE: } sv_setsv_mg((SV*)gv, code_ref); /* *gv = $code_ref */ - mouse_instance_set_slot(aTHX_ methods, name, code); /* $self->{methods}{$name} = $code */ + set_slot(methods, name, code); /* $self->{methods}{$name} = $code */ /* TODO: name the CODE ref if it's anonymous */ //code_entity = (CV*)SvRV(code_ref); @@ -120,6 +121,7 @@ PPCODE: } } + MODULE = Mouse PACKAGE = Mouse::Meta::Role BOOT: @@ -170,16 +172,3 @@ BOOT: newCONSTSUB(gv_stashpvs("Mouse::Meta::Attribute", TRUE), "accessor_metaclass", newSVpvs("Mouse::Meta::Method::Accessor::XS")); -MODULE = Mouse PACKAGE = Mouse::Meta::TypeConstraint - -BOOT: - INSTALL_SIMPLE_READER(TypeConstraint, name); - INSTALL_SIMPLE_READER(TypeConstraint, parent); - INSTALL_SIMPLE_READER(TypeConstraint, message); - - INSTALL_SIMPLE_READER_WITH_KEY(TypeConstraint, _compiled_type_constraint, compiled_type_constraint); - INSTALL_SIMPLE_READER(TypeConstraint, _compiled_type_coercion); /* Mouse specific */ - - INSTALL_SIMPLE_PREDICATE_WITH_KEY(TypeConstraint, has_coercion, _compiled_type_coercion); - -