8 #define NEED_newRV_noinc
9 #define NEED_sv_2pv_flags
10 #define NEED_sv_2pv_nolen
13 /* In theory, ExtUtils::ParseXS provide backcompat for this. However, the only
14 * available version doing that right now is 3.03_02, which is a dev release. We
15 * don't want to depend on dev releases, so we copy the code here. It should be
16 * removed once there's a stable ExtUtils::ParseXS version newer than 3.03_02. */
18 # define XS_EXTERNAL XS
21 #define MOP_CALL_BOOT(name) mop_call_xs(aTHX_ name, cv, mark);
24 #define XSPROTO(name) XS_EXTERNAL(name)
27 void mop_call_xs (pTHX_ XSPROTO(subaddr), CV *cv, SV **mark);
30 KEY__expected_method_class,
35 KEY_associated_metaclass,
36 KEY_associated_methods,
37 KEY_attribute_metaclass,
42 KEY_constructor_class,
44 KEY_definition_context,
50 KEY_instance_metaclass,
60 KEY_wrapped_method_metaclass,
62 KEY_package_cache_flag,
65 } mop_prehashed_key_t;
67 #define KEY_FOR(name) mop_prehashed_key_for(KEY_ ##name)
68 #define HASH_FOR(name) mop_prehashed_hash_for(KEY_ ##name)
70 void mop_prehash_keys (void);
71 SV *mop_prehashed_key_for (mop_prehashed_key_t key);
72 U32 mop_prehashed_hash_for (mop_prehashed_key_t key);
74 #define INSTALL_SIMPLE_READER(klass, name) INSTALL_SIMPLE_READER_WITH_KEY(klass, name, name)
75 #define INSTALL_SIMPLE_READER_WITH_KEY(klass, name, key) \
77 CV *cv = newXS("Class::MOP::" #klass "::" #name, mop_xs_simple_reader, __FILE__); \
78 CvXSUBANY(cv).any_i32 = KEY_ ##key; \
81 XS_EXTERNAL(mop_xs_simple_reader);
83 extern SV *mop_method_metaclass;
84 extern SV *mop_associated_metaclass;
87 UV mop_check_package_cache_flag(pTHX_ HV *stash);
88 int mop_get_code_info (SV *coderef, char **pkg, char **name);
89 SV *mop_call0(pTHX_ SV *const self, SV *const method);
100 typedef bool (*get_package_symbols_cb_t) (const char *, STRLEN, SV *, void *);
102 void mop_get_package_symbols(HV *stash, type_filter_t filter, get_package_symbols_cb_t cb, void *ud);
103 HV *mop_get_all_package_symbols (HV *stash, type_filter_t filter);