diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-06-23 18:26:02 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-06-23 18:26:02 -0500 |
commit | 35660a608346b7ce1d3002a3f7ffb307363d6c74 (patch) | |
tree | d19ebec7a8e0502d79ddcc4a8255313f61fe5fd1 | |
parent | 2e70e3dbecd6043588db255bee68816b51c5c21d (diff) | |
download | smartmatch-35660a608346b7ce1d3002a3f7ffb307363d6c74.tar.gz smartmatch-35660a608346b7ce1d3002a3f7ffb307363d6c74.zip |
why was i doing this from xs to begin with
-rw-r--r-- | lib/smartmatch.pm | 4 | ||||
-rw-r--r-- | 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); |