X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/78715d5b936b62f120bb4a996e5e94a0f656d445..4e3e027a77ba070985c4006b111360ea9bf0f2a1:/ext/XS-APItest/APItest.pm diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm index 6da5a88..2fda1fc 100644 --- a/ext/XS-APItest/APItest.pm +++ b/ext/XS-APItest/APItest.pm @@ -1,10 +1,12 @@ package XS::APItest; -{ use 5.011001; } +{ use 5.011001; } # 5.11 is a long long time ago... What gives with this? use strict; use warnings; use Carp; +our $VERSION = '1.12'; + require XSLoader; # Export everything since these functions are only used by a test script @@ -38,7 +40,7 @@ sub import { } } foreach (keys %{$exports||{}}) { - next unless /\A(?:rpn|calcrpn|stufftest|swaptwostmts|looprest|scopelessblock|stmtasexpr|stmtsasexpr|loopblock|blockasexpr|swaplabel|labelconst|arrayfullexpr|arraylistexpr|arraytermexpr|arrayarithexpr|arrayexprflags)\z/; + next unless /\A(?:rpn|calcrpn|stufftest|swaptwostmts|looprest|scopelessblock|stmtasexpr|stmtsasexpr|loopblock|blockasexpr|swaplabel|labelconst|arrayfullexpr|arraylistexpr|arraytermexpr|arrayarithexpr|arrayexprflags|subsignature|DEFSV|with_vars|join_with_space)\z/; $^H{"XS::APItest/$_"} = 1; delete $exports->{$_}; } @@ -52,8 +54,6 @@ sub import { } } -our $VERSION = '0.33'; - use vars '$WARNINGS_ON_BOOTSTRAP'; use vars map "\$${_}_called_PP", qw(BEGIN UNITCHECK CHECK INIT END); @@ -222,12 +222,14 @@ what it might be medifying). =item B, B, B These exercise the C calls of the same names. Everything after the flags -arg is passed as the the args to the called function. They return whatever +arg is passed as the args to the called function. They return whatever the C function itself pushed onto the stack, plus the return value from the function; for example - call_sv( sub { @_, 'c' }, G_ARRAY, 'a', 'b'); # returns 'a', 'b', 'c', 3 - call_sv( sub { @_ }, G_SCALAR, 'a', 'b'); # returns 'b', 1 + call_sv( sub { @_, 'c' }, G_ARRAY, 'a', 'b'); + # returns 'a', 'b', 'c', 3 + call_sv( sub { @_ }, G_SCALAR, 'a', 'b'); + # returns 'b', 1 =item B @@ -252,6 +254,10 @@ They are lexically scoped. =over +=item DEFSV + +Behaves like C<$_>. + =item rpn(EXPRESSION) This construct is a Perl expression. I must be an RPN