Menu
CTAN
Comprehensive TeX Archive Network
Home Upload Browse

Direc­tory tex-archive/web/c_cpp/cweb/examples

This directory contains several files for programs that are tutorial
and/or useful. If you are new to CWEB, read "wc.w" first; it's a
typical example of CWEB applied to system programming.

The Makefile on this directory is a generic way to build applications
written in CWEB. Say, for example, "make wc" to get an executable
program "wc" from wc.w. Say "make wc.dvi" to get a printable listing
of its documentation. The program "wc" is a slight improvement over
UNIX's standard word-count utility. (Try it, for example, with "wc *".)

The treeprint program, by Norman Ramsey, generates tree-structured
representations of file hierarchies. To use it, say "make treeprint.run"
and then
   find dir -type p -print | sort | treeprint
(on a UNIX system), where dir is a directory with interesting subdirectories.

The wmerge program, by Silvio Levy, produces a single CWEB file from a
given CWEB file and a change file. It expands any "web include" (@i)
specifications in the original CWEB file. To use it, say "make wmerge.run"
and then, e.g., "wmerge foo.w bar.ch > foobar.w". Both CTANGLE and
CWEAVE already accept change files, so you need not merge anything yourself
in normal day-to-day operations; but wmerge can be useful in connection with
the spelling checker described below.

If you intend to read the source code of CTANGLE and CWEAVE, you may
well wish to read wmerge.w first, or the hardcopy version obtained from
"make wmerge.dvi"; it is similar but much simpler.

The extex and wordtest programs, by Don Knuth, are useful spellcheckers.
After "make extex.run" say also "ln extex excweb"; this gives
you two filter programs, extex and excweb, that remove extraneous
material from TeX and CWEB source files, respectively. To use them,
you can say for example
   cat foo.w | excweb | spell
(or replace "cat foo.w" with "wmerge foo.w bar.ch"). A similar pipeline
for TeX files would be
   cat foo.tex | extex | spell
Even better is to replace "spell" by "wordtest /usr/local/lib/dict/words",
if you have a suitable dictionary. One such dictionary in the public domain
can be found in directory ~ftp/pub/dict at ftp.cs.stanford.edu, available
via anonymous ftp. To make your own dictionary from given ones,
   cat dict1 dict2 dict3 dict4 | wordtest > words
is quick and effective. See the documentation of wordtest for more info.

A file kspell.el that provides an emacs user interface to extex+excweb+wordtest
also appears in this directory. (Somebody should write ELWEB...)

The files xview_types.w and xlib_types.w are examples of @i (include) files
that can be used when writing XView programs. They are based on the header
files in OpenWindows Version 3.0.

An example XView application appears in Knuth's program oemacs.w, which
he uses for heavy emacsing. It's not very portable, but if you have
OpenWindows3 and a Sun Type-4 keyboard you may like it as much as he does.
(It replaces "emacstool".) The file oemacs.el goes with it.

Files

Name Size Date Notes
Makefile 961 2003-12-29 01:00:00
README 2946 2005-04-03 01:00:00
extex.c 5270 2003-12-29 01:00:00
extex.ch 578 1997-02-24 01:00:00
extex.w 12652 1999-05-04 01:00:00
kspell.el 10549 2005-04-03 01:00:00
oemacs.c 10985 2003-12-29 01:00:00
oemacs.el 8023 1996-12-04 01:00:00
oemacs.w 38418 1993-01-10 01:00:00
treeprint.c 3116 2003-12-29 01:00:00
treeprint.w 6835 1996-05-29 01:00:00
wc-dos.ch 217 1995-04-25 01:00:00
wc.c 2929 2003-12-29 01:00:00
wc.w 9029 2004-06-12 01:00:00
wmer-os2.ch 581 1996-05-29 01:00:00
wmerg-pc.ch 599 2006-07-18 01:00:00
wmerge.c 11899 2003-12-29 01:00:00
wmerge.w 25351 2003-03-06 01:00:00
wordtest.c 7039 2003-12-29 01:00:00
wordtest.w 20892 1993-06-10 01:00:00
xlib_types.w 1858 1992-11-09 01:00:00
xview_types.w 5811 1992-11-09 01:00:00
Guest Book Sitemap Contact 2014-04-24 18:13 CEST