From 35660a608346b7ce1d3002a3f7ffb307363d6c74 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 23 Jun 2012 18:26:02 -0500 Subject: why was i doing this from xs to begin with --- lib/smartmatch.pm | 4 ++-- smartmatch.xs | 25 ------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/lib/smartmatch.pm b/lib/smartmatch.pm index ad3caaa..19d0320 100644 --- a/lib/smartmatch.pm +++ b/lib/smartmatch.pm @@ -72,11 +72,11 @@ sub import { unless $package->can('match'); } - register($engine); + $^H{'smartmatch/engine'} = $engine; } sub unimport { - unregister(); + delete $^H{'smartmatch/engine'}; } =head1 BUGS diff --git a/smartmatch.xs b/smartmatch.xs index d2816e9..a6bec4f 100644 --- a/smartmatch.xs +++ b/smartmatch.xs @@ -120,28 +120,3 @@ PROTOTYPES: DISABLE BOOT: hook_op_check_smartmatch(); - -void -register (engine) - SV *engine; - CODE: - if (SvROK(engine)) { - croak("not an engine name"); - } - - PL_hints |= HINT_LOCALIZE_HH; - gv_HVadd(PL_hintgv); - - SvREFCNT_inc(engine); - if (!hv_stores(GvHV(PL_hintgv), SMARTMATCH_HH_KEY, engine)) { - SvREFCNT_dec(engine); - croak("couldn't store the engine"); - } - -void -unregister () - CODE: - PL_hints |= HINT_LOCALIZE_HH; - gv_HVadd(PL_hintgv); - - hv_delete(GvHV(PL_hintgv), SMARTMATCH_HH_KEY, 17, G_DISCARD); -- cgit v1.2.3