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