From 84c7b88ccae183c236ad7ca5cdb8dd097de25420 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Fri, 30 Sep 2011 13:48:58 -0700 Subject: whichsig nul-cleanup. This adds _pv, _pvn, and _pv versions of whichsig() in mg.c, which get both kill "NAME" and %SIG lookup nul-clean. --- ext/XS-APItest/APItest.xs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'ext/XS-APItest/APItest.xs') diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index b9049e5299..0f09c3a95c 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -2002,6 +2002,31 @@ gv_autoload_type(stash, methname, type, method) } XPUSHs( gv ? (SV*)gv : &PL_sv_undef); +void +whichsig_type(namesv, type) + SV* namesv + int type + PREINIT: + STRLEN len; + const char * const name = SvPV_const(namesv, len); + I32 i; + PPCODE: + switch (type) { + case 0: + i = whichsig(name); + break; + case 1: + i = whichsig_sv(namesv); + break; + case 2: + i = whichsig_pv(name); + break; + case 3: + i = whichsig_pvn(name, len); + break; + } + XPUSHs(sv_2mortal(newSViv(i))); + void eval_sv(sv, flags) SV* sv -- cgit v1.2.1