From: Vincent Pit Date: Fri, 8 Jan 2010 21:37:15 +0000 (+0100) Subject: This is 0.02 X-Git-Tag: v0.02^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Op.git;a=commitdiff_plain;h=50984c4a3e39b187b5b52ceeba826bc819d23564 This is 0.02 --- diff --git a/Changes b/Changes index d028904..150f2f5 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,13 @@ Revision history for Sub-Op +0.02 2010-01-08 21:40 UTC + + Chg : INCOMPATIBLE CHANGE : The "len" member of the sub_op_config_t + struct was renamed to "namelen". + + Fix : Handle existing prototyped subs and constants. + + Fix : Less symbols and packages should be vivified under B::. + + Tst : Test monkeypatching of B::OP and B::Deparse. + + Upd : Bump Variable::Magic dependency to 0.40. + 0.01 2010-01-02 21:10 UTC First version, released on an unsuspecting world. diff --git a/META.yml b/META.yml index a28249c..ae86514 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Sub-Op -version: 0.01 +version: 0.02 abstract: Install subroutines as opcodes. author: - Vincent Pit @@ -18,13 +18,15 @@ build_requires: ExtUtils::MakeMaker: 0 File::Spec: 0 POSIX: 0 + Scalar::Util: 0 Test::More: 0 - Variable::Magic: 0.39 + Variable::Magic: 0.40 requires: B::Hooks::EndOfScope: 0 DynaLoader: 0 perl: 5.01 - Variable::Magic: 0.39 + Scalar::Util: 0 + Variable::Magic: 0.40 resources: bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sub-Op homepage: http://search.cpan.org/dist/Sub-Op/ diff --git a/README b/README index 4fe59d2..2273fa8 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Sub::Op - Install subroutines as opcodes. VERSION - Version 0.01 + Version 0.02 SYNOPSIS In your XS file : @@ -27,11 +27,11 @@ SYNOPSIS BOOT: { sub_op_config_t c; - c.name = "reftype"; - c.len = sizeof("reftype")-1; - c.pp = scalar_util_reftype; - c.check = 0; - c.ud = NULL; + c.name = "reftype"; + c.namelen = sizeof("reftype")-1; + c.pp = scalar_util_reftype; + c.check = 0; + c.ud = NULL; sub_op_register(aTHX_ &c); } @@ -98,7 +98,7 @@ C API The name of the subroutine you want to replace. Allowed to be static. - * "STRLEN len" + * "STRLEN namelen" "name"'s length, in bytes. @@ -146,6 +146,17 @@ EXAMPLES See the t/Sub-Op-LexicalSub directory that implements a complete example. +CAVEATS + Preexistent definitions of a sub whose name is handled by Sub::Op are + restored at the end of the lexical scope in which the module is used. + But if you define a sub in the scope of action of Sub::Op with a name + that is currently being replaced, the new declaration will be + obliterated at the scope end. + + Function calls without parenthesis inside an "eval STRING" in the scope + of the pragma won't be replaced. I know a few ways of fixing this, but + I've not yet decided on which. + DEPENDENCIES perl 5.10. @@ -156,6 +167,11 @@ DEPENDENCIES SEE ALSO subs::auto. + B::Hooks::XSUB::CallAsOp provides a C API to declare XSUBs that + effectively call a specific PP function. Thus, it allows you to write + XSUBs with the PP stack conventions used for implementing perl core + keywords. There's no opcode replacement and no parsing hacks. + B::Hooks::OP::Check::EntersubForCV. AUTHOR diff --git a/lib/Sub/Op.pm b/lib/Sub/Op.pm index 1c783f6..8b73256 100644 --- a/lib/Sub/Op.pm +++ b/lib/Sub/Op.pm @@ -11,7 +11,7 @@ Sub::Op - Install subroutines as opcodes. =head1 VERSION -Version 0.01 +Version 0.02 =cut @@ -20,7 +20,7 @@ our ($VERSION, @ISA); sub dl_load_flags { 0x01 } BEGIN { - $VERSION = '0.01'; + $VERSION = '0.02'; require DynaLoader; push @ISA, 'DynaLoader'; __PACKAGE__->bootstrap($VERSION); diff --git a/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm b/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm index 8d04dc0..0888de5 100644 --- a/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm +++ b/t/Sub-Op-LexicalSub/lib/Sub/Op/LexicalSub.pm @@ -8,7 +8,7 @@ our ($VERSION, @ISA); use Sub::Op; BEGIN { - $VERSION = '0.01'; + $VERSION = '0.02'; require DynaLoader; push @ISA, 'DynaLoader'; __PACKAGE__->bootstrap($VERSION);