Refactor XS metaclass object structure
[gitmo/Mouse.git] / mouse.h
diff --git a/mouse.h b/mouse.h
index 8f543c5..a7a5986 100644 (file)
--- a/mouse.h
+++ b/mouse.h
@@ -6,7 +6,6 @@
 #include <perl.h>
 #include <XSUB.h>
 
-#define  NEED_newSVpvn_flags
 #include "ppport.h"
 
 /* for portability */
 #define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ s, sizeof(s)-1, 0U)
 #endif
 
+#ifndef get_cvs
+#define get_cvs(name, flags) get_cv(name, flags)
+#endif
+
 #ifndef GvNAME_get
 #define GvNAME_get GvNAME
 #endif
@@ -69,9 +72,18 @@ bool mouse_is_class_loaded(pTHX_ SV*);
 #define mcall0s(invocant, m)       mcall0((invocant), sv_2mortal(newSVpvs_share(m)))
 #define mcall1s(invocant, m, arg1) mcall1((invocant), sv_2mortal(newSVpvs_share(m)), (arg1))
 
+#define get_metaclass_by_name(name) mouse_get_metaclass_by_name(aTHX_ name)
+
 SV* mouse_call0(pTHX_ SV *const self, SV *const method);
 SV* mouse_call1(pTHX_ SV *const self, SV *const method, SV* const arg1);
 
+SV* mouse_get_metaclass_by_name(pTHX_ SV* const metaclass_name);
+
+GV* mouse_stash_fetch(pTHX_ HV* const stash, const char* const name, I32 const namelen, I32 const create);
+#define stash_fetch(s, n, l, c) mouse_stash_fetch(aTHX_ (s), (n), (l), (c))
+#define stash_fetchs(s, n, c)   mouse_stash_fetch(aTHX_ (s), STR_WITH_LEN(n), (c))
+
+
 #define MOUSEf_DIE_ON_FAIL 0x01
 MAGIC* mouse_mg_find(pTHX_ SV* const sv, const MGVTBL* const vtbl, I32 const flags);