Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

B::Hooks::OP::Check

Name B::Hooks::OP::Check
Version 0.22
Located at /usr/local/lib64/perl5
File /usr/local/lib64/perl5/B/Hooks/OP/Check.pm
Is Core No
Search CPAN for this module B::Hooks::OP::Check
Documentation B::Hooks::OP::Check
Module Details B::Hooks::OP::Check


NAME

B::Hooks::OP::Check - Wrap OP check callbacks


VERSION

version 0.22


SYNOPSIS

    # include "hook_op_check.h"
    STATIC OP *my_const_check_op (pTHX_ OP *op, void *user_data) {
        /* ... */
        return op;
    }
    STATIC hook_op_check_id my_hook_id = 0;
    void
    setup ()
        CODE:
            my_hook_id = hook_op_check (OP_CONST, my_const_check_op, NULL);
    void
    teardown ()
        CODE:
            hook_op_check_remove (OP_CONST, my_hook_id);


DESCRIPTION

This module provides a C API for XS modules to hook into the callbacks of PL_check.

the ExtUtils::Depends manpage 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::Check');
    WriteMakefile(
        ... # your normal makefile flags
        $pkg->get_makefile_vars,
    );

Your XS module can now include hook_op_check.h.


TYPES

typedef OP *(*hook_op_check_cb) (pTHX_ OP *, void *);

Type that callbacks need to implement.

typedef UV hook_op_check_id

Type to identify a callback.


FUNCTIONS

hook_op_check_id hook_op_check (opcode type, hook_op_check_cb cb, void *user_data)

Register the callback cb to be called after the PL_check function for opcodes of the given type. user_data will be passed to the callback as the last argument. Returns an id that can be used to remove the callback later on.

void *hook_op_check_remove (opcode type, hook_op_check_id id)

Remove the callback identified by id. Returns the user_data that the callback had.


SUPPORT

Bugs may be submitted through the RT bug tracker (or bug-B-Hooks-OP-Check@rt.cpan.org).


AUTHOR

Florian Ragwitz <rafl@debian.org>


CONTRIBUTORS


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.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024