-
-
26 Aug 2017 20:48:54 UTC
- Distribution: B-Hooks-OP-PPAddr
- Module version: 0.06
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (3829 / 10 / 0)
- Kwalitee
Bus factor: 4- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (75.31KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- TYPES
- FUNCTIONS
- SEE ALSO
- SUPPORT
- AUTHOR
- CONTRIBUTORS
- COPYRIGHT AND LICENCE
NAME
B::Hooks::OP::PPAddr - Hook into opcode execution
VERSION
version 0.06
SYNOPSIS
#include "hook_op_check.h" #include "hook_op_ppaddr.h" STATIC OP * execute_entereval (pTHX_ OP *op, void *user_data) { ... } STATIC OP * check_entereval (pTHX_ OP *op, void *user_data) { hook_op_ppaddr (op, execute_entereval, NULL); } hook_op_check (OP_ENTEREVAL, check_entereval, NULL);
DESCRIPTION
This module provides a C API for XS modules to hook into the execution of perl opcodes.
ExtUtils::Depends is used to export all functions for other XS modules to use. Include the following in your Makefile.PL:
my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::PPAddr'); WriteMakefile( ... # your normal makefile flags $pkg->get_makefile_vars, );
Your XS module can now include
hook_op_ppaddr.h
.TYPES
OP
typedef OP *(*hook_op_ppaddr_cb_t) (pTHX_ OP *, void *user_data)
Type that callbacks need to implement.
FUNCTIONS
hook_op_ppaddr
void hook_op_ppaddr (OP *op, hook_op_ppaddr_cb_t cb, void *user_data)
Replace the function to execute
op
with the callbackcb
.user_data
will be passed to the callback as the last argument.hook_op_ppaddr_around
void hook_op_ppaddr_around (OP *op, hook_op_ppaddr_cb_t before, hook_op_ppaddr_cb_t after, void *user_data)
Register the callbacks
before
andafter
to be called before and after the execution ofop
.user_data
will be passed to the callback as the last argument.SEE ALSO
SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-B-Hooks-OP-PPAddr@rt.cpan.org).
AUTHOR
Florian Ragwitz <rafl@debian.org>
CONTRIBUTORS
Karen Etheridge <ether@cpan.org>
Alexandr Ciornii <alexchorny@gmail.com>
Stephan Loyd <stephanloyd9@gmail.com>
COPYRIGHT AND LICENCE
This software is copyright (c) 2008 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install B::Hooks::OP::PPAddr, copy and paste the appropriate command in to your terminal.
cpanm B::Hooks::OP::PPAddr
perl -MCPAN -e shell install B::Hooks::OP::PPAddr
For more information on module installation, please visit the detailed CPAN module installation guide.