3 SV *mop_method_metaclass;
4 SV *mop_associated_metaclass;
8 find_method (const char *key, STRLEN keylen, SV *val, void *ud)
10 bool *found_method = (bool *)ud;
12 PERL_UNUSED_ARG(keylen);
18 EXTERN_C XS(boot_Class__MOP__Package);
19 EXTERN_C XS(boot_Class__MOP__Attribute);
20 EXTERN_C XS(boot_Class__MOP__Method);
22 MODULE = Class::MOP PACKAGE = Class::MOP
29 mop_method_metaclass = newSVpvs("method_metaclass");
30 mop_wrap = newSVpvs("wrap");
31 mop_associated_metaclass = newSVpvs("associated_metaclass");
33 MOP_CALL_BOOT (boot_Class__MOP__Package);
34 MOP_CALL_BOOT (boot_Class__MOP__Attribute);
35 MOP_CALL_BOOT (boot_Class__MOP__Method);
37 # use prototype here to be compatible with get_code_info from Sub::Identify
39 get_code_info(coderef)
47 if (mop_get_code_info(coderef, &pkg, &name)) {
49 mPUSHs(newSVpv(pkg, 0));
50 mPUSHs(newSVpv(name, 0));
54 is_class_loaded(klass=&PL_sv_undef)
58 bool found_method = FALSE;
61 if (!(SvPOKp(klass) && SvCUR(klass))) { /* XXX: SvPOK does not work with magical scalars */
65 stash = gv_stashsv(klass, 0);
70 if (hv_exists_ent (stash, KEY_FOR(VERSION), HASH_FOR(VERSION))) {
71 HE *version = hv_fetch_ent(stash, KEY_FOR(VERSION), 0, HASH_FOR(VERSION));
73 if (version && HeVAL(version) && (version_sv = GvSV(HeVAL(version)))) {
74 if (SvROK(version_sv)) {
75 SV *version_sv_ref = SvRV(version_sv);
77 if (SvOK(version_sv_ref)) {
81 else if (SvOK(version_sv)) {
87 if (hv_exists_ent (stash, KEY_FOR(ISA), HASH_FOR(ISA))) {
88 HE *isa = hv_fetch_ent(stash, KEY_FOR(ISA), 0, HASH_FOR(ISA));
89 if (isa && HeVAL(isa) && GvAV(HeVAL(isa)) && av_len(GvAV(HeVAL(isa))) != -1) {
94 mop_get_package_symbols(stash, TYPE_FILTER_CODE, find_method, &found_method);