272 lines
4.7 KiB
HTML
272 lines
4.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of H2PH</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>H2PH</H1>
|
|
Section: Perl Programmers Reference Guide (1)<BR>Updated: 2020-10-19<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
h2ph - convert .h C header files to .ph Perl header files
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>h2ph [-d destination directory] [-r | -a] [-l] [-h] [-e] [-D] [-Q]
|
|
[headerfiles]</B>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
<I>h2ph</I>
|
|
converts any C header files specified to the corresponding Perl header file
|
|
format.
|
|
It is most easily run while in /usr/include:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
cd /usr/include; h2ph * sys/*
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
or
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
cd /usr/include; h2ph * sys/* arpa/* netinet/*
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
or
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
cd /usr/include; h2ph -r -l .
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
The output files are placed in the hierarchy rooted at Perl's
|
|
architecture dependent library directory. You can specify a different
|
|
hierarchy with a <B>-d</B> switch.
|
|
<P>
|
|
|
|
If run with no arguments, filters standard input to standard output.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">-d destination_dir<DD>
|
|
|
|
|
|
Put the resulting <B>.ph</B> files beneath <B>destination_dir</B>, instead of
|
|
beneath the default Perl library location (<TT>$Config{'installsitearch'}</TT>).
|
|
<DT id="2">-r<DD>
|
|
|
|
|
|
Run recursively; if any of <B>headerfiles</B> are directories, then run <I>h2ph</I>
|
|
on all files in those directories (and their subdirectories, etc.). <B>-r</B>
|
|
and <B>-a</B> are mutually exclusive.
|
|
<DT id="3">-a<DD>
|
|
|
|
|
|
Run automagically; convert <B>headerfiles</B>, as well as any <B>.h</B> files
|
|
which they include. This option will search for <B>.h</B> files in all
|
|
directories which your C compiler ordinarily uses. <B>-a</B> and <B>-r</B> are
|
|
mutually exclusive.
|
|
<DT id="4">-l<DD>
|
|
|
|
|
|
Symbolic links will be replicated in the destination directory. If <B>-l</B>
|
|
is not specified, then links are skipped over.
|
|
<DT id="5">-h<DD>
|
|
|
|
|
|
Put 'hints' in the .ph files which will help in locating problems with
|
|
<I>h2ph</I>. In those cases when you <B>require</B> a <B>.ph</B> file containing syntax
|
|
errors, instead of the cryptic
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
[ some error condition ] at (eval mmm) line nnn
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
you will see the slightly more helpful
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
[ some error condition ] at filename.ph line nnn
|
|
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
|
However, the <B>.ph</B> files almost double in size when built using <B>-h</B>.
|
|
<DT id="6">-e<DD>
|
|
|
|
|
|
If an error is encountered during conversion, output file will be removed and
|
|
a warning emitted instead of terminating the conversion immediately.
|
|
<DT id="7">-D<DD>
|
|
|
|
|
|
Include the code from the <B>.h</B> file as a comment in the <B>.ph</B> file.
|
|
This is primarily used for debugging <I>h2ph</I>.
|
|
<DT id="8">-Q<DD>
|
|
|
|
|
|
'Quiet' mode; don't print out the names of the files being converted.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
|
|
|
|
No environment variables are used.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
/usr/include/*.h
|
|
/usr/include/sys/*.h
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
etc.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Larry Wall
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+perl">perl</A></B>(1)
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>DIAGNOSTICS</H2>
|
|
|
|
|
|
|
|
The usual warnings if it can't read or write the files involved.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
|
|
|
|
Doesn't construct the <TT>%sizeof</TT> array for you.
|
|
<P>
|
|
|
|
It doesn't handle all C constructs, but it does attempt to isolate
|
|
definitions inside evals so that you can get at the definitions
|
|
that it can translate.
|
|
<P>
|
|
|
|
It's only intended as a rough tool.
|
|
You may need to dicker with the files produced.
|
|
<P>
|
|
|
|
You have to run this program by hand; it's not run as part of the Perl
|
|
installation.
|
|
<P>
|
|
|
|
Doesn't handle complicated expressions built piecemeal, a la:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
enum {
|
|
FIRST_VALUE,
|
|
SECOND_VALUE,
|
|
#ifdef ABC
|
|
THIRD_VALUE
|
|
#endif
|
|
};
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Doesn't necessarily locate all of your C compiler's internally-defined
|
|
symbols.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="10"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="11"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="12"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="13"><A HREF="#lbAF">ENVIRONMENT</A><DD>
|
|
<DT id="14"><A HREF="#lbAG">FILES</A><DD>
|
|
<DT id="15"><A HREF="#lbAH">AUTHOR</A><DD>
|
|
<DT id="16"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="17"><A HREF="#lbAJ">DIAGNOSTICS</A><DD>
|
|
<DT id="18"><A HREF="#lbAK">BUGS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:16 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|