4 find_method (const char *key, STRLEN keylen, SV *val, void *ud)
6 bool *found_method = (bool *)ud;
8 PERL_UNUSED_ARG(keylen);
14 EXTERN_C XS(boot_Class__MOP__Mixin__HasMethods);
15 EXTERN_C XS(boot_Class__MOP__Package);
16 EXTERN_C XS(boot_Class__MOP__Mixin__AttributeCore);
17 EXTERN_C XS(boot_Class__MOP__Method);
19 MODULE = Class::MOP PACKAGE = Class::MOP
26 MOP_CALL_BOOT (boot_Class__MOP__Mixin__HasMethods);
27 MOP_CALL_BOOT (boot_Class__MOP__Package);
28 MOP_CALL_BOOT (boot_Class__MOP__Mixin__AttributeCore);
29 MOP_CALL_BOOT (boot_Class__MOP__Method);
31 # use prototype here to be compatible with get_code_info from Sub::Identify
33 get_code_info(coderef)
41 if (mop_get_code_info(coderef, &pkg, &name)) {
43 mPUSHs(newSVpv(pkg, 0));
44 mPUSHs(newSVpv(name, 0));
48 is_class_loaded(klass)
52 bool found_method = FALSE;
55 if (!(SvPOKp(klass) && SvCUR(klass))) { /* XXX: SvPOK does not work with magical scalars */
59 stash = gv_stashsv(klass, 0);
64 if (hv_exists_ent (stash, KEY_FOR(VERSION), HASH_FOR(VERSION))) {
65 HE *version = hv_fetch_ent(stash, KEY_FOR(VERSION), 0, HASH_FOR(VERSION));
67 if (version && HeVAL(version) && (version_sv = GvSV(HeVAL(version)))) {
68 if (SvROK(version_sv)) {
69 SV *version_sv_ref = SvRV(version_sv);
71 if (SvOK(version_sv_ref)) {
75 else if (SvOK(version_sv)) {
81 if (hv_exists_ent (stash, KEY_FOR(ISA), HASH_FOR(ISA))) {
82 HE *isa = hv_fetch_ent(stash, KEY_FOR(ISA), 0, HASH_FOR(ISA));
83 if (isa && HeVAL(isa) && GvAV(HeVAL(isa)) && av_len(GvAV(HeVAL(isa))) != -1) {
88 mop_get_package_symbols(stash, TYPE_FILTER_CODE, find_method, &found_method);