Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 1a4654cdb333ad144ff9f7b2e16de416 > files > 17

cpp2html-1.2-3mdk.i586.rpm

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.10 i586) [Netscape]">
   <title>Cpp2html - GNU Project - Free Software Foundation (FSF)</title>
</head>
<body bgcolor="#FFFFFF">

<h1>
GNU cpp2html 1.2</h1>
by <a href="mailto:bettini@gnu.org">Lorenzo Bettini</a>
<p>This is a <i>simple program that, given a source C/C++ file, produces
an html source with syntax highlighting</i>.
<p>cpp2html is <b><font color="#009900">free software</font></b>. Please
see the file <a href="COPYING">COPYING</a> for details. For documentation,
please read this file. As it is a GPL program, I provide sources (~70k),
but if you don't fell like compiling it, you can download Win32 executable
(~100k) (<blink><font color="#FF0000">new</font></blink>).
<p>Cpp2html is a <a href="http://www.gnu.org">GNU</a> program, so you can
download it also fro GNU's ftp site:
<br><a href="ftp://ftp.gnu.org/gnu/cpp2html/">ftp://ftp.gnu.org/gnu/cpp2html/</a>
<p>or from here:
<ul>
<li>
<a href="cpp2html-1.2.tar.gz">Latest Version</a> (sources, .tar.gz)
-
<a href="cpp2html-1.2.tar.gz.md5sum">md5sum</a> - <a href="cpp2html-1.2.tar.gz.md5sum.sig">signature
of md5sum</a></li>

<li>
<a href="cpp2html-1.2-exe-Win32.zip">Latest Version</a> (win32 executable,
zipped) - <a href="cpp2html-1.2-exe-Win32.zip.md5sum">md5sum</a>
- <a href="cpp2html-1.2-exe-Win32.zip.md5sum.sig">signature of md5sum</a></li>

<li>
<a href="cygwin1.zip">Cygnus DLL</a> for win32 (<font color="#009900">needed
for win32 executable</font>, zipped)</li>
</ul>
You may also want to check the <i>md5sum</i> of the archives, which are
also digitally signed by me (Lorenzo Bettini) with <i>GNU gpg</i> (<a href="http://www.gnupg.org">http://www.gnupg.org</a>).
My GPG public key can be found at my home page (see at the end of this
doc).
<p>Cpp2html main home page is at GNU site:
<br><a href="http://www.gnu.org/software/cpp2html/cpp2html.html">http://www.gnu.org/software/cpp2html/cpp2html.html</a>
<p>you can also get the pacthes (see <a href="#Patching from a previous version">below</a>
for patching from a previous version).
<h2>
Changes in this release</h2>

<ul>
<li>
Fixed bug in number scanning (reported by Curtis Weyant &lt;<a href="mailto:dylan38@angelfire.com">dylan38@angelfire.com</a>>)</li>

<li>
Fixed bug in #include scanning (reported by Martin Gebert &lt;<a href="mailto:Murphy.Gebert@gmx.de">Murphy.Gebert@gmx.de</a>>)</li>

<li>
Added TODO list (thanks Xavier Outhier &lt;<a href="mailto:xavier.outhier@anfdata.cz">xavier.outhier@anfdata.cz</a>>)</li>
</ul>

<h2>
Changes in release 1.1</h2>

<ul>
<li>
<tt>--header</tt> and <tt>--footer</tt> options added by Xavier Outhier
&lt;<a href="mailto:xouthier@yahoo.fr">xouthier@yahoo.fr</a>>, that allow
to specify files to be included at the beginning and at the end of the
generated document.</li>

<li>
<a href="http://www.gnu.org/software/gengetopt">GNU gengetopt</a> is used
for command line parsing.</li>

<li>
hexadecimal and floating point numbers are treated (Tom Hull &lt;<a href="mailto:thull@kscable.com">thull@kscable.com</a>>).</li>

<li>
fixed the bug of /* comment in another environment (notified by Michael
Gasche &lt;<a href="mailto:mgasche@datacomm.ch">mgasche@datacomm.ch</a>>)</li>
</ul>
see also <a href="NEWS">NEWS</a> file and <a href="ChangeLog">ChangeLog</a>
for the complete list of changes between versions.
<h2>
Installation</h2>
See the file <a href="INSTALL">INSTALL</a> for detailed building and installation
instructions; anyway if you're used to compiling Linux software that comes
with sources you may simply follow the usual procedure:
<pre>cd <i>&lt;source code main directory>
</i><tt>./configure
make
make install</tt></pre>
Note: unless you specify a different install directory by --prefix option
of configure (e.g. <tt>./configure --prefix=<i>&lt;your home></i></tt>),
you must be root to '<tt>make install</tt>'.
<p>Files will be installed in the following directories:
<ul>
<li>
<tt>Executables&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ->
/prefix/bin</tt></li>

<li>
<tt>docs and samples&nbsp;&nbsp;&nbsp;&nbsp; -> /prefix/share/doc/cpp2html</tt></li>

<li>
<tt>conf files&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-> /prefix/share/cpp2html</tt></li>
</ul>
Default value for prefix is <tt>/usr/local</tt> but you may change it with
--prefix option to configure (see above).
<br>&nbsp;
<h3>
What you need to build cpp2html</h3>
<b><font color="#FF0000">Actually you need nothing more than a Unix C/C++
compiler</font></b>
<p>cpp2html has been developed under <font color="#008000">Linux</font>,
using <b>gcc</b> (C++), and <b>bison</b> (yacc) and <b>flex</b> (lex),
and ported under <font color="#008000">Win32</font> with <b>Cygnus C/C++</b>
compiler, available at <a href="http://www.cygnus.com/">http://www.cygnus.com/</a>
(a .DLL is also distributed togheter with the .exe: you may simply copy
it in the same place of the .exe). I used the excellent GNU <b>Autoconf</b>
and <b>Automake</b>. I also used <b>Autotools </b>(<a href="ftp://ftp.ugcs.caltech.edu/pub/elef/autotools">ftp://ftp.ugcs.caltech.edu/pub/elef/autotools</a>)
which creates a starting source tree (according to GNU standards) with
autoconf, automake starting files. Finally I used GNU <b>gengetopt</b>
(<a href="http://www.gnu.org/software/gengetopt">http://www.gnu.org/software/gengetopt</a>),
for command line parsing. Here's a document for <a href="README.compile_VC6">compiling
cpp2html with Visual C++ 6.0</a>, by Nazar Gabriel &lt;<a href="mailto:nazargabriel@hotmail.com">nazargabriel@hotmail.com</a>>.
<p>Actually, unless you want to develop cpp2html, you don't need all these
tools to build cpp2html because I provide generated sources; you don't
need neither bison (yacc) nor flex (lex), for the same reason. Actually
programs that use lex generated files need to link with library <i>libfl
</i>(or
<i>libl
</i>for
lex); anyway configuration phase can discover if this library is missing
and in that case it sets the program to link with a source file I provide.
This hack works for flex: I don't know about lex generated scanners. But,
again, this is a problem only if you develop cpp2html and you use lex.
<h3>
<a NAME="Patching from a previous version"></a>Patching from a previous
version</h3>
If you downloaded a pacth, say <tt>cpp2html-1.3-1.3.1-patch.gz</tt> (i.e.
the pacth to go from version 1.3 to version 1.3.1), cd to the directory
with sources from the previous version (<tt>cpp2html-1.3</tt>) and type:
<pre>gunzip -cd ../cpp2html-1.3-1.3.1.patch.gz | patch -p1</pre>
and restart the compilation process (if you had already run configure a
simple
<tt>make</tt> will do).
<h2>
Usage</h2>
cpp2html only does a lexical analisys of the source code, so the C++ program
is assumed to be correct !
<p>here's how to run it:
<pre>cpp2html --input <i>&lt;file (a C++ prog)></i> --output <i>&lt;file (an html)></i></pre>
If you do not specify the name of the output file, the name will be the
one of the source file with a .html appended.
<br>if you want a real html document, specify <b>--doc</b> option at the
end. Otherwise you just get some text to copy and paste in you own html
pages. If you choose -doc option the page will have a white background
and your source file name as title. <b>--tab n</b> option apply a substitution
of tab characters with <i>n</i> spaces. You also may want to specify the
title of the page with <b>--title "my title" </b>option (this implies -doc).
Now you can also generate an html with CSS format, by using <b>--css "url
of .css"</b> (try some .css files included in the package). The order of
the options is not relevant. You may also want to customize the produced
document: you can use <b>--header</b> and <b>--footer</b> options that
allow you to specify files to be included, respectively, at the beginning
and at the end of the document.
<p>Here are some links to some of the sources of cpp2html colored with
cpp2html itself:
<ul>
<li>
<a href="main.cc.html">main.cc.html</a></li>

<li>
<a href="generators.cc.html">generators.cc.html</a></li>

<li>
<a href="tags.cc.html">tags.cc.html</a></li>

<li>
<a href="messages.cc.html">messages.cc.html</a></li>
</ul>
These files have been generated with the following commands:
<pre>cpp2html --doc main.cc
cpp2html --doc generators.cc
cpp2html --doc tags.cc
cpp2html --doc messages.cc</pre>
Obviosly it works with C files as well:
<ul>
<li>
<a href="cmdline.c.html">cmdline.c.html</a></li>
</ul>
Created with the command:
<pre>cpp2html -i cmdline.c -o cmdline.c.html --css="cpp2html.css"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --header="./header.html" --footer="./footer.html"</pre>
And obviously it works with header files as well (which we colored in black
and white :-)
<ul>
<li>
<a href="main.h.html">main.h.html</a></li>

<li>
<a href="decorators.h.html">decorators.h.html</a></li>

<li>
<a href="generators.h.html">generators.h.html</a></li>

<li>
<a href="list.h.html">list.h.html</a></li>

<li>
<a href="tags.h.html">tags.h.html</a></li>

<li>
<a href="cmdline.h.html">cmdline.h.html</a></li>
</ul>
created with the command:
<pre>cpp2html *.h --css="mono.css"</pre>
And here's the output of `cpp2html -help`
<pre>Usage: cpp2html [OPTION]... [INPUT-FILE]...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cpp2html &lt; INPUT-FILE > OUTPUT-FILE [OPTION]...
&nbsp;
given a source C/C++ file, produces an html source with syntax highlighting.
&nbsp;
&nbsp; -v, --verbose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; verbose mode on
&nbsp; -d, --doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; creates html with title, header...
&nbsp; -c, --css=URL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use a css for formatting (implies --doc)
&nbsp; -T, --title=TITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; give title to the html (implies --doc)
&nbsp; -i, --input=FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input file (default standard input)
&nbsp; -o, --output=FILE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output file (default standard output)
&nbsp; -t, --tab=TABLEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specify tab length (default 8)
&nbsp; -V, --version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print version</pre>
As it handles standard output and input you may also run it like
<pre>cat MyFile.cpp | cpp2html | lpr</pre>
You may want to specify your options for syntax highlighting in the file
<b>tags.j2h</b>.
If this file is not present in the current directory, some default colors
will be used. Here's the <tt>tags.j2h</tt> file that comes with this distribution:
<pre>keyword blue b ;
type green ;
string red ;
comment brown i ;
number purple ;</pre>
as you might see the syntax of this file is quite straightforward:
<ul>
<li>
b = bold</li>

<li>
i = italics</li>

<li>
u = underline</li>
</ul>
You may also specify more than on of these options separated by commas
<br>e.g.
<br><tt>keyword blue u, b ;</tt>
<p>you may see all possible colors in the file <a href="colors.html">colors.html</a>
<p>if something goes wrong with your options try to run cpp2html with
<tt>--verbose</tt>
option enabled.
<h2>
Credits</h2>
These people helped me with java2html, and I used such features in cpp2html
as well, so:
<ul>
<li>
Marcus G. Daniels &lt;<a href="mailto:marcusd@gnu.org">marcusd@gnu.org</a>>
who gave me some good advices about GNU standards,</li>

<li>
Osvaldo Pinali Doederlein &lt;<a href="mailto:osvaldo@visionnaire.com.br">osvaldo@visionnaire.com.br</a>>
for tab option idea,</li>

<li>
Richard Freedman &lt;<a href="mailto:rich_freedman@chiinc.com">rich_freedman@chiinc.com</a>>
for feed back and bugs signalations</li>

<li>
John Constantine &lt;<a href="mailto:John.Constantine@mail.cc.trincoll.edu">John.Constantine@mail.cc.trincoll.edu</a>>
for some great suggestions I'll surely apply.</li>

<li>
Raymond Lambe &lt;<a href="mailto:rlambe@morgan.ucs.mun.ca">rlambe@morgan.ucs.mun.ca</a>>,
for quotation bug signalation</li>

<li>
Robert J. Clark &lt;<a href="mailto:clark@klgroup.com">clark@klgroup.com</a>>
for adding -input, -output, -title options</li>

<li>
Hans-Peter Bischof &lt;<a href="mailto:hpb@cs.rit.edu">hpb@cs.rit.edu</a>>
for suggestions (to apply).</li>

<li>
Luc Maisonobe &lt;<a href="mailto:Luc.Maisonobe@cnes.fr">Luc.Maisonobe@cnes.fr</a>>
for the patch for const char * in order to make it work under gcc 2.95</li>

<li>
Jari Korva &lt;<a href="mailto:jari.korva@iki.fi">jari.korva@iki.fi</a>>
for the bug of \" inside a string and &amp; treatme nt, and especially
for adding CSS options and handling</li>

<li>
Kaloian Doganov &lt;<a href="mailto:kaloian@stones.com">kaloian@stones.com</a>>
for .css suggestion and for providing some nice .css files</li>

<li>
Ziv Caspi &lt;<a href="mailto:zivc@peach-networks.com">zivc@peach-networks.com</a>>
found the bug of \\ in chars</li>

<li>
Chris Mason &lt;<a href="mailto:cjmaso@essex.ac.uk">cjmaso@essex.ac.uk</a>>
found the darkgreen bug, and that --tab was not documented</li>

<li>
Michael Gasche &lt;<a href="mailto:mgasche@datacomm.ch">mgasche@datacomm.ch</a>>
found the bug of /* comment inside another environment</li>

<li>
Xavier Outhier &lt;<a href="mailto:xouthier@yahoo.fr">xouthier@yahoo.fr</a>>
added --header and --footer options</li>

<li>
Tom Hull &lt;<a href="mailto:thull@kscable.com">thull@kscable.com</a>>
added hexadecimal and floating point handling</li>
</ul>
See also <a href="THANKS">THANKS</a>&nbsp; :-)
<h2>
Feedback</h2>
Tell me if you like this software :-)
<p>Actually I want to extend it, so if you have some ideas...
<br>The most import one will be to make cpp2html more customizable :-)
<p>Please send all bug reports by electronic mail to:
<br><a href="mailto:bug-cpp2html@gnu.org">bug-cpp2html@gnu.org</a>
<br>&nbsp;
<br>&nbsp;
<center><table BORDER CELLPADDING=10 COLS=1 WIDTH="100%" BGCOLOR="#FFFF00" NOSAVE >
<tr NOSAVE>
<td NOSAVE><font color="#009900">See also </font><font color="#FF0000">java2html</font><font color="#009900">&nbsp;
<a href="http://www.gnu.org/software/java2html/java2html.html">http://www.gnu.org/software/java2html/java2html.html</a>.</font></td>
</tr>
</table></center>

<h1>
TODO</h1>
Here's the <a href="TODO.txt">list of TODO stuff</a>, if you'd like to
contribute :-)
<h1>
Mailing Lists</h1>
The following mailing lists are available:
<ul>
<li>
<a href="mailto:help-cpp2html@gnu.org">help-cpp2html@gnu.org</a>, for generic
discussions about the program and for asking for help about it (open mailing
list), <a href="http://mail.gnu.org/mailman/listinfo/help-cpp2html">http://mail.gnu.org/mailman/listinfo/help-cpp2html</a></li>

<li>
<a href="mailto:info-cpp2html@gnu.org">info-cpp2html@gnu.org</a>, for receiving
information about new releases and features (read-only mailing list), <a href="http://mail.gnu.org/mailman/listinfo/info-cpp2html">http://mail.gnu.org/mailman/listinfo/info-cpp2html</a></li>
</ul>
if you want to subscribe to a mailing list just go to the URL and follow
the instructions, or send me an e-mail and I'll subscribe you.
<p>My home page is
<br><a href="http://w3.newnet.it/bettini">http://w3.newnet.it/bettini</a>&nbsp;
or
<br><a href="http://infostud.dsi.unifi.it/~bettini">http://infostud.dsi.unifi.it/~bettini</a>
(very fast if you're in University)
<p>cpp2html is free software. See the file COPYING for copying conditions.
Anyway I won't get offended if you send me a postcard :-)
<p>
<hr>
<p>Return to <a href="http://www.gnu.org">GNU's home page</a>.
<p>Please send FSF &amp; GNU inquiries &amp; questions to <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>.
There are also <a href="http://www.gnu.org/home.html#ContactInfo">other
ways to contact</a> the FSF.
<p>Please send comments on these web pages to <i><a href="mailto:webmasters@www.gnu.org">webmasters@www.gnu.org</a></i>,
send other questions to <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>.
<p>Copyright (C) 1999 Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111, USA
<p>Verbatim copying and distribution of this entire article is permitted
in any medium, provided this notice is preserved.
<p>&nbsp;Updated:&nbsp;<!-- hhmts start -->27 Mar 1999 jonas&nbsp;<!-- hhmts end -->
<br>
<hr>
</body>
</html>