summaryrefslogtreecommitdiff
path: root/ext/XS-APItest/APItest.xs
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-30 13:48:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:20 -0700
commit84c7b88ccae183c236ad7ca5cdb8dd097de25420 (patch)
tree577a4bbf1ee6e20f10c3fd0065f5b3de8b54741d /ext/XS-APItest/APItest.xs
parent89a5757c96fe4f4c0a6bfec37e8037a7d311ee5a (diff)
downloadperl-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.xs25
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