1 .TH CWEB 1 "7 April 2010" "Web2C @VERSION@"
2 .\"=====================================================================
4 ctangle, cweave \- translate CWEB to C and/or TeX
5 .\"=====================================================================
11 .IR webfile [ \fB.w\fP ]
12 .RI [{ changefile [ \fB.ch\fP ]| \fB\-\fP }
13 .RI [ outfile [ \fB.c\fP ]]]
18 .IR webfile [ \fB.w\fP ]
19 .RI [{ changefile [ \fB.ch\fP ]| \fB\-\fP }
20 .RI [ outfile [ \fB.tex\fP ]]]
22 .\"=====================================================================
26 program converts a CWEB
27 source document into a C\ program that may be compiled in the usual way.
28 The output file includes #line specifications so that debugging can be
29 done in terms of the CWEB source file.
33 program converts the same CWEB file into a TeX file that may be
34 formatted and printed in the usual way.
35 It takes appropriate care of typographic details like page
36 layout and the use of indentation, italics, boldface, etc., and it supplies
37 extensive cross-index information that it gathers automatically.
39 CWEB allows you to prepare a single
40 document containing all the information that is needed both to produce
41 a compilable C\ program and to produce a well-formatted document
42 describing the program in as much detail as the writer may desire.
43 The user of CWEB ought to be familiar with TeX as well as\ C.
45 The command line should have one, two, or three names on it.
46 The first is taken as the CWEB file (and
48 is added if there is no extension).
49 If that file cannot be opened, the extension
51 is tried instead. (But
55 usually implies Pascal.)
56 If there is a second name, it is a change file (and
58 is added if there is no extension).
59 The change file overrides parts of the WEB file,
60 as described in the documentation.
61 If there is a third name, it overrides
62 the default name of the output file, which is ordinarily the same as
63 the name of the input file (but on the current directory) with the
69 Options in the command line may be either turned off with\ \-
70 (if they are on by default) or turned on with\ + (if they are off by
72 In fact, the options are processed from left to right,
73 so a sequence like -f\ +f corresponds to +f (which is the default).
77 option suppresses the banner line that normally appears on your terminal
78 when ctangle or cweave begins.
81 option suppresses the happy message that normally appears if the processing
85 option suppresses progress reports (starred module numbers) as the processing
89 you get nothing but error messages.
93 option prints statistics about memory usage at the end of a run
94 (assuming that the programs have been compiled with the -DSTAT switch).
96 There are three other options applicable to
100 means do not force a newline after every statement in the formatted output.
102 inhibits the enclosure of C\ material formatted by
106 Such brackets are normally inserted so that special hooks
109 and similar programs.
111 means omit the index and table of contents.
112 .\"=====================================================================
114 The environment variable CWEBINPUTS is used to search for the input files,
115 or the system default if CWEBINPUTS is not set. See
117 for the details of the searching.
118 .\"=====================================================================
120 The location of the files mentioned below varies from system to
123 utility to find their locations.
126 TeX macros used by cweave output.
130 .\"=====================================================================
133 .I Literate Programming
139 .I The CWEB System of Structured Documentation
140 by Donald E. Knuth and Silvio Levy (hardcopy version of cwebman.tex
141 and the source code listings).
145 .\"=====================================================================
147 Don Knuth wrote WEB for TeX and Pascal.
148 Silvio Levy designed and developed CWEB
149 by adapting the WEB conventions to\ C and by recoding everything in CWEB.
150 Knuth began using CWEB and made further refinements.
151 Many other helpers are acknowledged in the CWEB manual.