STATIC const char vmg_wrongargnum[] = "Wrong number of arguments";
STATIC const char vmg_argstorefailed[] = "Error while storing arguments";
+/* --- Context-safe global data -------------------------------------------- */
+
+#define MY_CXT_KEY __PACKAGE__ "::_guts" XS_VERSION
+
+typedef struct {
+ HV *b__op_stashes[OPc_MAX];
+} my_cxt_t;
+
+START_MY_CXT
+
/* --- Signatures ---------------------------------------------------------- */
#define SIG_WZO ((U16) (0x3891))
#endif /* VMG_THREADSAFE */
-/* --- Context-safe global data -------------------------------------------- */
-
-#define MY_CXT_KEY __PACKAGE__ "::_guts" XS_VERSION
+/* --- Wizard SV objects --------------------------------------------------- */
-typedef struct {
- HV *b__op_stashes[OPc_MAX];
-} my_cxt_t;
+STATIC int vmg_wizard_sv_free(pTHX_ SV *sv, MAGIC *mg) {
+ if (PL_dirty) /* During global destruction, the context is already freed */
+ return 0;
-START_MY_CXT
+ vmg_wizard_free((vmg_wizard *) mg->mg_ptr);
-/* --- Wizard SV objects --------------------------------------------------- */
+ return 0;
+}
-STATIC int vmg_wizard_sv_free(pTHX_ SV *sv, MAGIC *mg);
#if VMG_THREADSAFE
-STATIC int vmg_wizard_sv_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params);
-#endif
+
+STATIC int vmg_wizard_sv_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
+ mg->mg_ptr = (char *) vmg_wizard_dup((const vmg_wizard *) mg->mg_ptr, params);
+
+ return 0;
+}
+
+#endif /* VMG_THREADSAFE */
STATIC MGVTBL vmg_wizard_sv_vtbl = {
NULL, /* get */
#endif
-STATIC int vmg_wizard_sv_free(pTHX_ SV *sv, MAGIC *mg) {
- if (PL_dirty) /* During global destruction, the context is already freed */
- return 0;
-
- vmg_wizard_free((vmg_wizard *) mg->mg_ptr);
-
- return 0;
-}
-
-#if VMG_THREADSAFE
-
-STATIC int vmg_wizard_sv_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *params) {
- mg->mg_ptr = (char *) vmg_wizard_dup((const vmg_wizard *) mg->mg_ptr, params);
-
- return 0;
-}
-
-#endif /* VMG_THREADSAFE */
-
/* --- User-level functions implementation --------------------------------- */
STATIC const MAGIC *vmg_find(const SV *sv, const SV *wiz) {