int
mop_get_code_info (SV *coderef, char **pkg, char **name)
{
- GV *gv;
-
if (!SvOK(coderef) || !SvROK(coderef) || SvTYPE(SvRV(coderef)) != SVt_PVCV) {
return 0;
}
*/
if ( isGV_with_GP(CvGV(coderef)) ) {
- gv = CvGV(coderef);
- *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
- *name = GvNAME( CvGV(coderef) );
+ GV *gv = CvGV(coderef);
+ *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
+ *name = GvNAME( CvGV(coderef) );
} else {
- *pkg = "__UNKNOWN__";
- *name = "__ANON__";
+ *pkg = "__UNKNOWN__";
+ *name = "__ANON__";
}
return 1;
}
+/* XXX: eventually this should just use the implementation in Package::Stash */
void
mop_get_package_symbols (HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud)
{
SV *key;
U32 hash;
} prehashed_keys[key_last] = {
+ DECLARE_KEY(_expected_method_class),
+ DECLARE_KEY(ISA),
+ DECLARE_KEY(VERSION),
+ DECLARE_KEY(accessor),
+ DECLARE_KEY(associated_class),
+ DECLARE_KEY(associated_metaclass),
+ DECLARE_KEY(associated_methods),
+ DECLARE_KEY(attribute_metaclass),
+ DECLARE_KEY(attributes),
+ DECLARE_KEY(body),
+ DECLARE_KEY(builder),
+ DECLARE_KEY(clearer),
+ DECLARE_KEY(constructor_class),
+ DECLARE_KEY(constructor_name),
+ DECLARE_KEY(definition_context),
+ DECLARE_KEY(destructor_class),
+ DECLARE_KEY(immutable_trait),
+ DECLARE_KEY(init_arg),
+ DECLARE_KEY(initializer),
+ DECLARE_KEY(insertion_order),
+ DECLARE_KEY(instance_metaclass),
+ DECLARE_KEY(is_inline),
+ DECLARE_KEY(method_metaclass),
+ DECLARE_KEY(methods),
DECLARE_KEY(name),
DECLARE_KEY(package),
DECLARE_KEY(package_name),
- DECLARE_KEY(body),
+ DECLARE_KEY(predicate),
+ DECLARE_KEY(reader),
+ DECLARE_KEY(wrapped_method_metaclass),
+ DECLARE_KEY(writer),
DECLARE_KEY_WITH_VALUE(package_cache_flag, "_package_cache_flag"),
- DECLARE_KEY(methods),
- DECLARE_KEY(VERSION),
- DECLARE_KEY(ISA)
+ DECLARE_KEY_WITH_VALUE(_version, "-version")
};
SV *