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


Manual Reference Pages  -  B::HOOKS::OP::CHECK::ENTERSUBFORCV (3)

.ds Aq ’

NAME

B::Hooks::OP::Check::EntersubForCV - Invoke callbacks on construction of entersub OPs for certain CVs

CONTENTS

SYNOPSIS

    From Perl



    sub foo {}

    use B::Hooks::OP::Check::EntersubForCV
        \&foo => sub { warn "entersub for foo() being compiled" };

    foo(); # callback is invoked when this like is compiled

    no B::Hooks::OP::Check::EntersubForCV \&foo;

    foo(); # callback isnt invoked



    From C/XS



    #include "hook_op_check_entersubforcv.h"

    STATIC OP *
    my_callback (pTHX_ OP *op, CV *cv, void *user_data) {
        /* ... */
        return op;
    }

    hook_op_check_id id;

    /* register callback */
    id = hook_op_check_entersubforcv (cv, my_callback, NULL);

    /* unregister */
    hook_op_check_entersubforcv_remove (id);



DESCRIPTION

Perl API

    import / register



    use B::Hooks::OP::Check::EntersubForCV
        \&code => \&handler;

    # or
    my $id = B::Hooks::OP::Check::EntersubForCV::register(\&code => \&handler);



Register handler to be executed when an entersub opcode for the CV code points to is compiled.

When using register an id that can be used for later removal of the handler using unregister is returned.

    unimport / unregister



    no B::Hooks::OP::Check::EntersubForCV \&code;

    # or
    B::Hooks::OP::Check::EntersubForCV::unregister($id);



Stop calling the registered handler for code for all entersubs after this.

C API

    TYPES

OP *(*hook_op_check_entersubforcv_cb) (pTHX_ OP *, CV *, void *)

The type the handlers need to implement.

    FUNCTIONS

hook_op_check_id hook_op_check_entersubforcv (CV *cv, hook_op_check_entersubforcv_cb cb, void *user_data)

Register the callback cb to be called when an entersub opcode for cv is compiled. user_data will be passed to the callback as the last argument.

Returns an id that can be used to remove the handler using hook_op_check_entersubforcv_remove.

void *hook_op_check_entersubforcv_remove (hook_op_check_id id)

Remove a previously registered handler referred to by id.

Returns the user data that was associated with the handler.

SEE ALSO

B::Hooks::OP::Check

AUTHOR

Florian Ragwitz <rafl@debian.org>

COPYRIGHT AND LICENSE

Copyright (c) 2008, 2009 Florian Ragwitz

This module is free software.

You may distribute this code under the same terms as Perl itself.

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


perl v5.20.3 B::HOOKS::OP::CHECK::ENTERSUBFORCV (3) 2012-03-12

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