}
int
-get_code_info (SV *coderef, char **pkg, char **name)
+mop_get_code_info (SV *coderef, char **pkg, char **name)
{
if (!SvOK(coderef) || !SvROK(coderef) || SvTYPE(SvRV(coderef)) != SVt_PVCV) {
return 0;
}
void
-get_package_symbols (HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud)
+mop_get_package_symbols (HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud)
{
HE *he;
}
HV *
-get_all_package_symbols (HV *stash, type_filter_t filter)
+mop_get_all_package_symbols (HV *stash, type_filter_t filter)
{
HV *ret = newHV ();
- get_package_symbols (stash, filter, collect_all_symbols, ret);
+ mop_get_package_symbols (stash, filter, collect_all_symbols, ret);
return ret;
}
PERL_HASH(hash_##name, #name, sizeof(#name) - 1); \
} while (0)
-extern SV *method_metaclass;
-extern SV *associated_metaclass;
-extern SV *wrap;
+extern SV *mop_method_metaclass;
+extern SV *mop_associated_metaclass;
+extern SV *mop_wrap;
UV mop_check_package_cache_flag(pTHX_ HV *stash);
-int get_code_info (SV *coderef, char **pkg, char **name);
+int mop_get_code_info (SV *coderef, char **pkg, char **name);
SV *mop_call0(pTHX_ SV *const self, SV *const method);
typedef enum {
typedef bool (*get_package_symbols_cb_t) (const char *, STRLEN, SV *, void *);
-void get_package_symbols(HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud);
-HV *get_all_package_symbols (HV *stash, type_filter_t filter);
+void mop_get_package_symbols(HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud);
+HV *mop_get_all_package_symbols (HV *stash, type_filter_t filter);
#endif
HV *symbols;
dSP;
- symbols = get_all_package_symbols(stash, TYPE_FILTER_CODE);
+ symbols = mop_get_all_package_symbols(stash, TYPE_FILTER_CODE);
(void)hv_iterinit(symbols);
while ( (coderef = hv_iternextsv(symbols, &method_name, &method_name_len)) ) {
SV *method_slot;
SV *method_object;
- if (!get_code_info(coderef, &cvpkg_name, &cv_name)) {
+ if (!mop_get_code_info(coderef, &cvpkg_name, &cv_name)) {
continue;
}
}
}
- method_metaclass_name = mop_call0(aTHX_ self, method_metaclass); /* $self->method_metaclass() */
+ method_metaclass_name = mop_call0(aTHX_ self, mop_method_metaclass); /* $self->method_metaclass() */
/*
$method_object = $method_metaclass->wrap(
EXTEND(SP, 8);
PUSHs(method_metaclass_name); /* invocant */
mPUSHs(newRV_inc((SV *)cv));
- PUSHs(associated_metaclass);
+ PUSHs(mop_associated_metaclass);
PUSHs(self);
PUSHs(key_package_name);
PUSHs(class_name);
mPUSHs(newSVpv(method_name, method_name_len));
PUTBACK;
- call_sv(wrap, G_SCALAR | G_METHOD);
+ call_sv(mop_wrap, G_SCALAR | G_METHOD);
SPAGAIN;
method_object = POPs;
PUTBACK;
DECLARE_KEY(VERSION);
DECLARE_KEY(ISA);
-SV *method_metaclass;
-SV *associated_metaclass;
-SV *wrap;
+SV *mop_method_metaclass;
+SV *mop_associated_metaclass;
+SV *mop_wrap;
MODULE = Class::MOP PACKAGE = Class::MOP
PREHASH_KEY(VERSION);
PREHASH_KEY_WITH_VALUE(package_cache_flag, "_package_cache_flag");
- method_metaclass = newSVpvs("method_metaclass");
- wrap = newSVpvs("wrap");
- associated_metaclass = newSVpvs("associated_metaclass");
+ mop_method_metaclass = newSVpvs("method_metaclass");
+ mop_wrap = newSVpvs("wrap");
+ mop_associated_metaclass = newSVpvs("associated_metaclass");
MOP_CALL_BOOT (boot_Class__MOP__Package);
MOP_CALL_BOOT (boot_Class__MOP__Class);
char *pkg = NULL;
char *name = NULL;
PPCODE:
- if (get_code_info(coderef, &pkg, &name)) {
+ if (mop_get_code_info(coderef, &pkg, &name)) {
EXTEND(SP, 2);
PUSHs(newSVpv(pkg, 0));
PUSHs(newSVpv(name, 0));
}
}
- get_package_symbols(stash, TYPE_FILTER_CODE, find_method, &found_method);
+ mop_get_package_symbols(stash, TYPE_FILTER_CODE, find_method, &found_method);
if (found_method) {
XSRETURN_YES;
}
XSRETURN_UNDEF;
}
- symbols = get_all_package_symbols(stash, filter);
+ symbols = mop_get_all_package_symbols(stash, filter);
PUSHs(sv_2mortal(newRV_noinc((SV *)symbols)));
void