1B::Hooks::OP::PPAddr(3)User Contributed Perl DocumentatioBn::Hooks::OP::PPAddr(3)
2
3
4
6 B::Hooks::OP::PPAddr - Hook into opcode execution
7
9 version 0.06
10
12 #include "hook_op_check.h"
13 #include "hook_op_ppaddr.h"
14
15 STATIC OP *
16 execute_entereval (pTHX_ OP *op, void *user_data) {
17 ...
18 }
19
20 STATIC OP *
21 check_entereval (pTHX_ OP *op, void *user_data) {
22 hook_op_ppaddr (op, execute_entereval, NULL);
23 }
24
25 hook_op_check (OP_ENTEREVAL, check_entereval, NULL);
26
28 This module provides a C API for XS modules to hook into the execution
29 of perl opcodes.
30
31 ExtUtils::Depends is used to export all functions for other XS modules
32 to use. Include the following in your Makefile.PL:
33
34 my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::PPAddr');
35 WriteMakefile(
36 ... # your normal makefile flags
37 $pkg->get_makefile_vars,
38 );
39
40 Your XS module can now include "hook_op_ppaddr.h".
41
43 OP
44 typedef OP *(*hook_op_ppaddr_cb_t) (pTHX_ OP *, void *user_data)
45
46 Type that callbacks need to implement.
47
49 hook_op_ppaddr
50 void hook_op_ppaddr (OP *op, hook_op_ppaddr_cb_t cb, void *user_data)
51
52 Replace the function to execute "op" with the callback "cb".
53 "user_data" will be passed to the callback as the last argument.
54
55 hook_op_ppaddr_around
56 void hook_op_ppaddr_around (OP *op, hook_op_ppaddr_cb_t before, hook_op_ppaddr_cb_t after, void *user_data)
57
58 Register the callbacks "before" and "after" to be called before and
59 after the execution of "op". "user_data" will be passed to the callback
60 as the last argument.
61
63 • B::Hooks::OP::Check
64
66 Bugs may be submitted through the RT bug tracker
67 <https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-PPAddr>
68 (or bug-B-Hooks-OP-PPAddr@rt.cpan.org <mailto:bug-B-Hooks-OP-
69 PPAddr@rt.cpan.org>).
70
72 Florian Ragwitz <rafl@debian.org>
73
75 • Karen Etheridge <ether@cpan.org>
76
77 • Alexandr Ciornii <alexchorny@gmail.com>
78
79 • Stephan Loyd <stephanloyd9@gmail.com>
80
82 This software is copyright (c) 2008 by Florian Ragwitz.
83
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86
87
88
89perl v5.36.0 2022-07-22 B::Hooks::OP::PPAddr(3)