{
    "content": [
        {
            "type": "text",
            "text": "# h2ph(1) (man)\n\n**Summary:** h2ph - convert .h C header files to .ph Perl header files\n\n## See Also\n\n- perl(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (1 lines) — 1 subsections\n  - h2ph [-d destination directory] [-r | -a] [-l] [-h] [-e] [-D (1 lines)\n- **DESCRIPTION** (18 lines)\n- **OPTIONS** (33 lines)\n- **ENVIRONMENT** (2 lines)\n- **FILES** (5 lines)\n- **AUTHOR** (2 lines)\n- **SEE ALSO** (2 lines)\n- **DIAGNOSTICS** (2 lines)\n- **BUGS** (24 lines)\n\n## Full Content\n\n### NAME\n\nh2ph - convert .h C header files to .ph Perl header files\n\n### SYNOPSIS\n\n#### h2ph [-d destination directory] [-r | -a] [-l] [-h] [-e] [-D] [-Q] [headerfiles]\n\n### DESCRIPTION\n\nh2ph converts any C header files specified to the corresponding Perl header file format.  It\nis most easily run while in /usr/include:\n\ncd /usr/include; h2ph * sys/*\n\nor\n\ncd /usr/include; h2ph * sys/* arpa/* netinet/*\n\nor\n\ncd /usr/include; h2ph -r -l .\n\nThe output files are placed in the hierarchy rooted at Perl's architecture dependent library\ndirectory.  You can specify a different hierarchy with a -d switch.\n\nIf run with no arguments, filters standard input to standard output.\n\n### OPTIONS\n\n-d destinationdir\nPut the resulting .ph files beneath destinationdir, instead of beneath the default Perl\nlibrary location ($Config{'installsitearch'}).\n\n-r  Run recursively; if any of headerfiles are directories, then run h2ph on all files in\nthose directories (and their subdirectories, etc.).  -r and -a are mutually exclusive.\n\n-a  Run automagically; convert headerfiles, as well as any .h files which they include.  This\noption will search for .h files in all directories which your C compiler ordinarily uses.\n-a and -r are mutually exclusive.\n\n-l  Symbolic links will be replicated in the destination directory.  If -l is not specified,\nthen links are skipped over.\n\n-h  Put 'hints' in the .ph files which will help in locating problems with h2ph.  In those\ncases when you require a .ph file containing syntax errors, instead of the cryptic\n\n[ some error condition ] at (eval mmm) line nnn\n\nyou will see the slightly more helpful\n\n[ some error condition ] at filename.ph line nnn\n\nHowever, the .ph files almost double in size when built using -h.\n\n-e  If an error is encountered during conversion, output file will be removed and a warning\nemitted instead of terminating the conversion immediately.\n\n-D  Include the code from the .h file as a comment in the .ph file.  This is primarily used\nfor debugging h2ph.\n\n-Q  'Quiet' mode; don't print out the names of the files being converted.\n\n### ENVIRONMENT\n\nNo environment variables are used.\n\n### FILES\n\n/usr/include/*.h\n/usr/include/sys/*.h\n\netc.\n\n### AUTHOR\n\nLarry Wall\n\n### SEE ALSO\n\nperl(1)\n\n### DIAGNOSTICS\n\nThe usual warnings if it can't read or write the files involved.\n\n### BUGS\n\nDoesn't construct the %sizeof array for you.\n\nIt doesn't handle all C constructs, but it does attempt to isolate definitions inside evals\nso that you can get at the definitions that it can translate.\n\nIt's only intended as a rough tool.  You may need to dicker with the files produced.\n\nYou have to run this program by hand; it's not run as part of the Perl installation.\n\nDoesn't handle complicated expressions built piecemeal, a la:\n\nenum {\nFIRSTVALUE,\nSECONDVALUE,\n#ifdef ABC\nTHIRDVALUE\n#endif\n};\n\nDoesn't necessarily locate all of your C compiler's internally-defined symbols.\n\n\n\nperl v5.34.0                                 2025-07-25                                      H2PH(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "h2ph",
        "section": "1",
        "mode": "man",
        "summary": "h2ph - convert .h C header files to .ph Perl header files",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "perl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/perl/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "h2ph [-d destination directory] [-r | -a] [-l] [-h] [-e] [-D] [-Q] [headerfiles]",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 24,
                "subsections": []
            }
        ]
    }
}