-*-Text-*- % This file, README.PC, is part of CWEB-p. % The CWEB programs by Silvio Levy are based on programs by D. E. Knuth. % ANSI-C conforming changes and Turbo-C++ implementation are made by % Hans-Hermann Bode , additional support for other % ANSI-C compilers provided by Klaus Guntermann % . % The programs are distributed WITHOUT ANY WARRANTY, express or implied. % This readme file last updated September 1992 by Hans-Hermann Bode. % Copyright (C) 1987,1990,1992 Silvio Levy and Donald E. Knuth % Copyright (C) 1991,1992 Hans-Hermann Bode % Permission is granted to make and distribute verbatim copies of this % document provided that the copyright notice and this permission notice % are preserved on all copies. % Permission is granted to copy and distribute modified versions of this % document under the conditions for verbatim copying, provided that the % entire resulting derived work is distributed under the terms of a % permission notice identical to this one. % Please send comments, suggestions, etc. concerning to the original CWEB to % levy@math.berkeley.edu. % Send suggestions and complaints concerning to the ANSI-C/Turbo-C++ % implementation to HHBODE@DOSUNI1.BITNET. This is the ANSI-C/Turbo-C++ implementation of Silvio Levy's and Donald E. Knuth's CWEB system, compiled and provided with changefiles for ANSI C and Turbo C++ and a makefile for Turbo Make by Hans-Hermann Bode, including additional changes to improve support of ANSI-C compilers and a makefile for c89 by Klaus Guntermann. Note that the changes for the Turbo-C++ compiler are made conditional (they will become effective only if the symbol __TURBOC__ is defined, which automatically is the case when compiled with Turbo C++), so users of other systems with ANSI-C compilers might be able to compile the sources without editing. This directory contains the following files from the original CWEB distribution: ./makefile.org makefile from the original distribution ./readme.org readme file from the original distribution ./common.h header file to be included in ctangle.w and cweave.w ./common.w common code for ctangle and cweave ./ctangle.w the tangle processor ./cweave.w the weave processor ./cweb.1 manual page (nroff format) ./cweb.el elisp file for GNU Emacs ./cwebmac.tex macros for formatting ./cwebman.tex the user manual ./prod.w production rules to be included in cweave.w ./examples directory containing examples of CWEB programming ./examples/wc.w - UNIX word-count utility ./examples/treeprin.w - tree-structured directory lister by Norman Ramsey ./examples/wmerge.w - WEB-like file merger by Silvio Levy ./examples/extex.w - spellchecking filter for TeX and CWEB by Don Knuth ./examples/wordtest.w - spellchecker by Don Knuth ./examples/xlib_typ.w - include file for XView programs ./examples/xview_ty.w - ditto ./examples/kspell.el - Emacs interface to extex/wordtest ./examples/makefile - generic makefile for CWEB applications ./examples/readme - readme file from the examples directory Note that the changefiles provided in the original distribution for vms are removed here. Note also that treeprin.w and makefile from the examples directory may have to be edited for use on PC systems. The following files are added in this distribution: ./cweb.man manual page (ASCII format) ./common-p.hch change file for common.h ./common-p.ch change file for common.w ./ctangl-p.ch change file for ctangle.w ./cweave-p.ch change file for cweave.w ./prod-p.ch change file for prod.w ./ccwebmac.ch change file for cwebmac.tex (including C++ macros) ./makefile.pc makefile for Turbo C++ ./makefile.c89 makefile for c89 ./readme.pc this file ./readme.c89 informations for c89 users ./common-p.h WMERGEd product of common.h and common-p.hch ./prod-p.w WMERGEd product of prod.w and prod-p.ch ./ccwebmac.tex WMERGEd product of cwebmac.tex and ccwebmac.ch ./common.c CTANGLEd product of common.w and common-p.ch ./ctangle.c CTANGLEd product of ctangle.w and ctangl-p.ch ./ctangle.exe executable tangle processor, ANSI-C/Turbo-C++ version ./cweave.exe executable weave processor, ANSI-C/Turbo-C++ version ./wmerge.exe executable WEB merge program, from examples directory ./examples/wmerge-p.ch change file for wmerge.w ./examples/wmerge.c CTANGLEd product of wmerge.w and wmerge-p.ch The files with extensions .h, .w, .tex, .c, and .exe are reproducable from the other sources by means of an executable WMERGE, CTANGLE, and an ANSI-C compiler. Before starting, you should run cwebman.tex (needs cwebmac.tex!) through TeX and print out the manual. Then, if you are on a PC-/MS-DOS system, all you have to do to get a working CWEB system is to copy ctangle.exe and cweave.exe (and, optionally, wmerge.exe) to your binaries directory and ccwebmac.tex (!) to your TeX-inputs directory; that's it, you are ready to use CWEB! If you are on another system, see below. *** Notes 1. When you have to recompile the tangle and weave processors, in case touch common.c and ctangle.c to make them up-to-date, choose the correct makefile for your system, and say `make all'. Currently, there are provided `makefile.pc' for Turbo C++ and `makefile.c89' for c89; rename the appropriate one to `Makefile' before calling make. If neither of these is working, take one as a template and change it appropriately. Note that makefile.org is lacking some dependencies, so better start from makefile.c89 when on a Unix system (cf. readme.c89). Incidentally, if you try the recompilation on a PC-/MS-DOS system with another compiler than Turbo C++, you may have no luck without changing the sources. In this case, it's best to create a new set of changefiles and use the supplied executables to generate new .c files rather than to edit the .c files themselves. 2. If you edit one of the .w files (which is not recommended) or associated .ch files, keep in mind that you'll need a working tangle processor to generate updated C files. So, if for some reason you can't use the executables from the distribution, follow step 1 above before doing anything else. Furthermore, after editing common.h, prod.w, cwebmac.tex (which is not recommended, again), common-p.hch, prod-p.ch, or ccwebmac.ch, you'll need a working wmerge program to rebuild common-p.h, prod-p.w, and ccwebmac.tex, respectively. You can find the source file wmerge.w along with a changefile wmerge-p.ch for ANSI C/Turbo C++ in the examples directory; there is a tangled wmerge.c also in case you don't have a working tangle processor so far. 3. If you want a full documentation of the tangle and weave programs, say `make doc'. This should produce the files common.dvi, ctangle.dvi, cweave.dvi, and---with the Turbo Makefile---cwebman.dvi. 4. To delete all intermediate files created in the make processes say `make clean', to delete even the DVI files with the Turbo Makefile say `make veryclean'. 5. The weave and tangle processors now recognize a CWEBINCLUDE environment variable if common.c is compiled with INCLUDEDIR defined (which is the default in the makefiles). When an include file (@i command) cannot be found in the current or given directory, its name (completely as given!) is prefixed by the contents of CWEBINCLUDE and a second try is made. A multi-path search is not supported yet, i.e., CWEBINCLUDE---if not empty---must contain a single path name and must end with a `/' or `\'. Example: set CWEBINCLUDE=c:/usr/local/lib/cweb/ Furthermore, the file name in an @i command should never indicate an absolute path, otherwise the mechanism described above will not work. 6. The tangle and weave processors of this implementation are able to understand traditional C, ANSI C, and C++. The latter feature, however, is just a first attempt, i.e., most C++ sources should be handled satisfactory, but some C++ constructions may yield unpleasant results in typesetting by CWEAVE. If you encounter problems, send a report to HHBODE@DOSUNI1.BITNET. Note that CTANGLE always uses a default extension .c for its output file; this may not be appropriate for C++ compilers, but you can work around this by supplying a third argument in the command line (see cwebman). 7. You can define a font for comments in the C part of the modules by means of the \cmntfont macro. It defaults to \tenss, i.e., ten-point sans-serif; if you don't like this, say, e.g., \let\cmntfont=\tenrm to get a ten-point roman comment font or whatever. This command should be placed in the limbo section of your sources or in your own version of ccwebmac.tex.