home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Programmation / c / Docs / cwebbin-p13.lha / cwebbin-p13 / examples / README.p11 < prev    next >
Encoding:
Text File  |  1995-03-16  |  4.0 KB  |  79 lines

  1. This directory contains several files for programs that are tutorial
  2. and/or useful.  If you are new to CWEB, read "wc.w" first; it's a
  3. typical example of CWEB applied to system programming.
  4.  
  5. The MAKEFILE in this directory is a complete example makefile for the
  6. SAS/C compiler on the Commodore Amiga.  Say, for example, "smake all"
  7. to get all the executable programs from their sources.  Say "smake docs"
  8. to get a printable listing of their documentations.
  9.  
  10. The WC program is a slight improvement over UNIX's standard word-count
  11. utility.  To use it, say "make wc" to get an executable program "wc"
  12. from wc.w.  Say "make wc.dvi" to get a printable listing of its documentation.
  13.  
  14. The TREEPRINT program, by Norman Ramsey, generates tree-structured
  15. representations of file hierarchies.  To use it, say "make treeprint"
  16. and then
  17.    find dir -type p -print | sort | treeprint
  18. (on a UNIX system), where dir is a directory with interesting subdirectories.
  19.  
  20. The files XVIEW_TYPES.W and XLIB_TYPES.W are examples of @i (include) files
  21. that can be used when writing XView programs.  They are based on the header
  22. files in OpenWindows Version 3.0.
  23.  
  24. An examples XVIEW application appears in Knuth's program OEMACS.W, which
  25. he uses for heavy emacsing.  It's not very portable, but if you have
  26. OpenWindows3 and a Sun Type-4 keyboard you may like it as much as he does.
  27. (It replaces "emacstool".)  The file OEMACS.EL goes with it.
  28.  
  29. The EXTEX and WORDTEST programs, by Don Knuth, are useful spellcheckers.
  30. After "make extex" say also "ln extex excweb"; this gives
  31. you two filter programs, extex and excweb, that remove extraneous
  32. material from TeX and CWEB source files, respectively. To use them,
  33. you can say for example
  34.    cat foo.w | excweb | spell
  35. (or replace "cat foo.w" with "wmerge foo.w bar.ch"). A similar pipeline
  36. for TeX files would be
  37.    cat foo.tex | extex | spell
  38. Even better is to replace "spell" by "wordtest /usr/local/lib/dict/words",
  39. if you have a suitable dictionary.  One such dictionary in the public domain
  40. can be found in directory ~ftp/pub/dict at labrea.stanford.edu, available
  41. via anonymous ftp.  To make your own dictionary from given ones,
  42.    cat dict1 dict2 dict3 dict4 | wordtest > words
  43. is quick and effective.  See the documentation of wordtest for more info.
  44.  
  45. A file KSPELL.EL that provides an emacs user interface to extex+excweb+wordtest
  46. also appears in this directory.  (Somebody should write ELWEB...)
  47.  
  48. All the CWEB example programs listed above are provided with change files
  49. for full ANSI-C compliance (prototypes, #include files, etc.), so they
  50. should be compilable with any decent C compiler, although they may not be
  51. operational on every machine.
  52.  
  53. The COMMONWORDS program, by Andreas Scherer, is based on the WEB program of
  54. the same name by Don Knuth.  It counts the frequencies of the most common
  55. words in a given text file.  To use it, say "make commonwords" and then
  56. "commonwords < commonwords.w".
  57.  
  58. The PRIMES program, by Andreas Scherer, is based on the WEB program of the
  59. same name by Don Knuth.  It generates the first thousand prime numbers.
  60. To use it, say "make primes" and then simply "primes".
  61.  
  62. The SAMPLE program, by Andreas Scherer, is based on the WEB program of the
  63. same name by Don Knuth.  It generates samples of random numbers.  To use
  64. it, say "make sample" and then simply "sample".  Answer the input questions
  65. with positive integers and see the results.
  66.  
  67. The MATRIX program, by Andreas Scherer, is an example for C++ programming
  68. with CWEB 3.  Also it is an example for German users; the complete source
  69. is written with umlauts and quotes as defined in `gcwebmac.tex'.  Its
  70. purpose is to invert 4x4 matrices with elements from the complex set.
  71.  
  72. The CCT program, by Andreas Scherer, copies `text files' between different
  73. systems and translates the character codes according to external tables.
  74. It is also capable of transforming a file with extended ASCII characters
  75. into a portable 7-bit representation, by replacing most of the codes higher
  76. than 127 by suitable TeX macros.  In the same source file CCT.W is a second
  77. program, CCTSETUP, which generates external transformation files needed by
  78. CCT itself.
  79.