{
    "mode": "perldoc",
    "parameter": "B::Hooks::OP::Check",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/B%3A%3AHooks%3A%3AOP%3A%3ACheck/json",
    "generated": "2026-06-16T09:58:18Z",
    "synopsis": "# include \"hookopcheck.h\"\nSTATIC OP *myconstcheckop (pTHX OP *op, void *userdata) {\n/* ... */\nreturn op;\n}\nSTATIC hookopcheckid myhookid = 0;\nvoid\nsetup ()\nCODE:\nmyhookid = hookopcheck (OPCONST, myconstcheckop, NULL);\nvoid\nteardown ()\nCODE:\nhookopcheckremove (OPCONST, myhookid);",
    "sections": {
        "NAME": {
            "content": "B::Hooks::OP::Check - Wrap OP check callbacks\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 0.22\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "# include \"hookopcheck.h\"\n\nSTATIC OP *myconstcheckop (pTHX OP *op, void *userdata) {\n/* ... */\nreturn op;\n}\n\nSTATIC hookopcheckid myhookid = 0;\n\nvoid\nsetup ()\nCODE:\nmyhookid = hookopcheck (OPCONST, myconstcheckop, NULL);\n\nvoid\nteardown ()\nCODE:\nhookopcheckremove (OPCONST, myhookid);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides a C API for XS modules to hook into the callbacks of \"PLcheck\".\n\nExtUtils::Depends is used to export all functions for other XS modules to use. Include the\nfollowing in your Makefile.PL:\n\nmy $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::Check');\nWriteMakefile(\n... # your normal makefile flags\n$pkg->getmakefilevars,\n);\n\nYour XS module can now include \"hookopcheck.h\".\n",
            "subsections": []
        },
        "TYPES": {
            "content": "typedef OP *(*hookopcheckcb) (pTHX OP *, void *);\nType that callbacks need to implement.\n\ntypedef UV hookopcheckid\nType to identify a callback.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "hookopcheckid hookopcheck (opcode type, hookopcheckcb cb, void *userdata)\nRegister the callback \"cb\" to be called after the \"PLcheck\" function for opcodes of the given\n\"type\". \"userdata\" will be passed to the callback as the last argument. Returns an id that can\nbe used to remove the callback later on.\n\nvoid *hookopcheckremove (opcode type, hookopcheckid id)\nRemove the callback identified by \"id\". Returns the userdata that the callback had.\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Bugs may be submitted through the RT bug tracker\n<https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-OP-Check> (or\nbug-B-Hooks-OP-Check@rt.cpan.org <mailto:bug-B-Hooks-OP-Check@rt.cpan.org>).\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Florian Ragwitz <rafl@debian.org>\n",
            "subsections": []
        },
        "CONTRIBUTORS": {
            "content": "*   Karen Etheridge <ether@cpan.org>\n\n*   Zefram <zefram@fysh.org>\n\n*   Alexandr Ciornii <alexchorny@gmail.com>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENCE": {
            "content": "This software is copyright (c) 2008 by Florian Ragwitz.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "B::Hooks::OP::Check - Wrap OP check callbacks",
    "flags": [],
    "examples": [],
    "see_also": []
}