B::Hoo...::Check(3pm)

πŸ’– NAME πŸ’–

B::Hooks::OP::Check β€” bestie, this is the module that wraps OP check callbacks πŸŽ€

(it's a Perl 3pm manual page, user-contributed docs energy, and yes we're doing this)


✨ 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 πŸ‘‘

okay so real talk: this module hands XS modules a whole C API so they can hook into the callbacks of PL_check. it's giving backstage pass πŸ’…

ExtUtils::Depends is the one doing the heavy lifting here β€” it exports all the functions so other XS modules can use them. so you gotta drop this into your Makefile.PL:

my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::Check');
WriteMakefile(
    ... # your normal makefile flags
    $pkg->get_makefile_vars,
);

and after that, your XS module can just #include "hook_op_check.h" and go off 🫢


🧚 TYPES 🧚

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

the type that your callbacks literally have to implement. no cap.

typedef UV hook_op_check_id

the type used to identify a callback πŸŽ€


πŸ’… FUNCTIONS πŸ’…

  • hook_op_check_id hook_op_check (opcode type, hook_op_check_cb cb, void *user_data) β€” registers the callback cb so it gets called after the PL_check function runs, but only for opcodes of the given type. user_data gets handed to the callback as its last argument. it returns an id, and you keep that id around so you can remove the callback later. iconic behavior honestly ✨
  • void *hook_op_check_remove (opcode type, hook_op_check_id id) β€” removes the callback identified by id. it returns the user_data that the callback had 🌈

πŸ¦‹ SUPPORT πŸ¦‹

bugs can be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-Check> , or if email is more your vibe, bug-B-Hooks-OP-Check@rt.cpan.org <mailto:bug-B-Hooks-OP-Check@rt.cpan.org> πŸ“¬

go on, bestie, report it. the maintainers wanna know πŸ‘€

πŸ“ AUTHOR πŸ“

Florian Ragwitz <rafl@debian.org> 🌟


🌈 CONTRIBUTORS 🌈

  • Karen Etheridge <ether@cpan.org> πŸ’œ
  • Zefram <zefram@fysh.org> ⭐
  • Alexandr Ciornii <alexchorny@gmail.com> 🧚

this software is copyright (c) 2008 by Florian Ragwitz.

it's free software, bestie β€” you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay πŸ’–


and that's the whole page fr fr πŸ’€

B::Hoo...::Check(3pm) β€” perl v5.42.3, dated 2026-08-19. that's the footer, and that's a wrap, periodt πŸ‘‘βœ¨

πŸ“¦ where this page comes from