GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
B::Hooks::OP::PPAddr(3) User Contributed Perl Documentation B::Hooks::OP::PPAddr(3)

B::Hooks::OP::PPAddr - Hook into opcode execution

version 0.06

    #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);

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".

    typedef OP *(*hook_op_ppaddr_cb_t) (pTHX_ OP *, void *user_data)

Type that callbacks need to implement.

    void hook_op_ppaddr (OP *op, hook_op_ppaddr_cb_t cb, void *user_data)

Replace the function to execute "op" with the callback "cb". "user_data" will be passed to the callback as the last argument.

    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" and "after" to be called before and after the execution of "op". "user_data" will be passed to the callback as the last argument.

B::Hooks::OP::Check

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-PPAddr> (or bug-B-Hooks-OP-PPAddr@rt.cpan.org <mailto:bug-B-Hooks-OP-PPAddr@rt.cpan.org>).

Florian Ragwitz <rafl@debian.org>

  • Karen Etheridge <ether@cpan.org>
  • Alexandr Ciornii <alexchorny@gmail.com>
  • Stephan Loyd <stephanloyd9@gmail.com>

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.

2017-08-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.