Add another MOOSE_TEST_MD option, MooseX
[gitmo/Moose.git] / xs / Method.xs
1 #include "mop.h"
2
3 MODULE = Class::MOP::Method   PACKAGE = Class::MOP::Method
4
5 PROTOTYPES: DISABLE
6
7 BOOT:
8     INSTALL_SIMPLE_READER(Method, name);
9     INSTALL_SIMPLE_READER(Method, package_name);
10     INSTALL_SIMPLE_READER(Method, body);
11
12 bool
13 is_stub(self)
14     SV *self
15
16     PREINIT:
17         CV *const body = (CV *)SvRV( HeVAL( hv_fetch_ent((HV *)SvRV(self), KEY_FOR(body), 0, HASH_FOR(body)) ) );
18
19     CODE:
20         RETVAL = !( CvISXSUB(body) || CvROOT(body) );
21
22     OUTPUT:
23         RETVAL