source: issm/trunk-jpl/externalpackages/petsc-dev/src/linux-gnu-amd64/man/man1/c2html.1@ 11896

Last change on this file since 11896 was 11896, checked in by habbalf, 13 years ago

petsc-dev : Petsc development code in external packages. Mercurial updates

File size: 4.1 KB
Line 
1.TH C2HTML 1 \" -*- nroff -*-
2.SH NAME
3c2html \- generates highlighted html-files from C source
4.SH SYNOPSIS
5.B c2html
6[options] [filename...]
7.br
8.SH DESCRIPTION
9This manual page
10documents how to use
11.BR c2html .
12If no arguments are given on the command line of
13.BR c2html ,
14it
15reads from stdin and writes to stdout.
16
17If invoked with filenames as arguments
18.B c2html
19will write it's output into new files. Names of output
20files are generated by appending ".html" to the
21corresponding input filename.
22
23You can convert both .c and .h files with
24.BR c2html .
25.SS Installing as a CGI program
26.B c2html
27can be installed as a CGI program and convert source files on the
28fly. In order to set this up for apache the webmaster has to add the
29two lines
30
31.RS
32 AddType text/x-c .c .h
33 Action text/x-c /cgi-bin/c2html
34.RE
35
36to the webserver configuration file.
37.B c2html
38depends on the webserver properly setting environment variable
39PATH_TRANSLATED to the pathname of the source file.
40If
41.B c2html
42has been compiled with option -DCOMPRESSION=1 then it will invoke
43.B gzip
44to compress the generated HTML before sending it to the requesting
45browser. Of course
46.B c2html
47takes care to check if the browser accepts gzip encoding.
48.SS OPTIONS
49.TP
50.I "--"
51Interpret all following arguments on the command line as filenames.
52This is useful, if you want to convert files beginning with a '-'.
53.TP
54.I "-b filename"
55Insert the file 'filename' after converted data and before
56HTML footer. See also the
57.I "-s"
58option.
59.TP
60.I "-c"
61Turns off CGI-script detection and HTTP header generation.
62This is needed to use
63.B c2html
64as a subcommand in another CGI script.
65.TP
66.I "-h filename"
67Insert the file 'filename' after the HTML headers and before
68the converted data. See also the
69.I "-s"
70option.
71.TP
72.I "-i"
73Generate an index only. This will generate a list of references (HREF's)
74to
75the labels that
76.B c2html
77creates for your source file. The references are created as list items
78(<li>) in an HTML list. Each line has the form
79.br
80<li><a href="#name">prototype()</a></li>
81.br
82so they can be used directly as an index list, or further parsed by
83another script.
84.br
85If you want the index at the top of the source file, you will need a
86wrapper script like this one:
87\"
88.br
89 #! /bin/sh
90.br
91 echo "Content-type: text/html"
92.br
93 echo ""
94.br
95 echo "<html>"
96.br
97 echo "<head><title>$PATH_TRANSLATED</title>"
98.br
99 echo "<meta name=\\"generator\\""
100.br
101 echo "content=\\"\`c2html -V\`\\">"
102.br
103 echo "</head>"
104.br
105 echo "<body>"
106.br
107 echo "<h1>Source of $PATH_TRANSLATED</h1>"
108.br
109 echo "<ul>Structures and functions"
110.br
111 cat $PATH_TRANSLATED | c2html -isc
112.br
113 echo "</ul>"
114.br
115 echo "<hr></hr>"
116.br
117 cat $PATH_TRANSLATED | c2html -sc
118.br
119 echo "</body></html>"
120.br
121 exit
122.br
123.TP
124.I "-n"
125Number lines and label them with 'line' followed by the line
126number. Empty lines get no label, but the linecounter will count
127them nevertheless. With this feature you can refer to special
128lines of code from other parts of the generated file
129or from external files with a line like this:
130
131<A HREF="foo.c.html#line301">Go to line 301</A>
132.TP
133.I "-s"
134With this option you can suppress the generation of HTML headers.
135This is especially useful together with options
136.I "-b file"
137and
138.IR "-h file" .
139.TP
140.I "-t title"
141Set the title to 'title'. The default is the filename you
142converted or "stdin" if reading from stdin. This option is only
143used if
144.I "-s"
145is not set.
146.TP
147.I "-u"
148Print usage information.
149.TP
150.I "-w width"
151sets the WIDTH attribute for HTML tag <PRE>. If this option is not
152used a default of 80 is assumed. (Currently most browsers are
153ignoring this attribute).
154.TP
155.I -V
156reports the version number of
157.BR c2html .
158.SH EXIT STATUS
159.B c2html
160returns 0 on success, 1 if input files are not existing/readable, 2 if
161output files are not creatable/writable, 3 if invoked with illegal
162options and 4 if
163.B gzip
164cannot be invoked.
165.SH AUTHORS
166Florian Schintke <schintke@cs.tu-berlin.de>
167.br
168Martin Kammerhofer <mkamm@gmx.net> wrote the CGI feature.
169.br
170Rob Ewan <rob@ewan.com> wrote the indexing feature.
171.SH SEE ALSO
172.BR java2html (1),
173.BR pas2html (1),
174.BR perl2html (1).
Note: See TracBrowser for help on using the repository browser.