diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-30 13:48:58 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:20 -0700 |
commit | 84c7b88ccae183c236ad7ca5cdb8dd097de25420 (patch) | |
tree | 577a4bbf1ee6e20f10c3fd0065f5b3de8b54741d /ext/XS-APItest/APItest.xs | |
parent | 89a5757c96fe4f4c0a6bfec37e8037a7d311ee5a (diff) | |
download | perl-84c7b88ccae183c236ad7ca5cdb8dd097de25420.tar.gz |
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.
Diffstat (limited to 'ext/XS-APItest/APItest.xs')
-rw-r--r-- | ext/XS-APItest/APItest.xs | 25 |
1 files changed, 25 insertions, 0 deletions
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 @@ -2003,6 +2003,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 I32 flags |