home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3952 / README < prev    next >
Encoding:
Text File  |  1991-09-02  |  3.7 KB  |  95 lines

  1. @(#) README 1.1 91/09/01 23:08:31
  2.  
  3. unproto - ANSI C to old C converter
  4.  
  5. Purpose:
  6.  
  7. This is a filter that sits in between the C preprocessor and the next C
  8. compiler stage. Its purpose is to leave old-style C alone, and to
  9. de-ANSI-fy function headings, function pointer type declarations (and
  10. casts), function type declarations, and combinations thereof. Many
  11. freely-distributable unprotoizers have problems with the latter because
  12. they are based on a non-recursive algorithm or even make assumptions
  13. about code layout.
  14.  
  15. The unprototyper has support for systems that require special tricks
  16. for variadic functions (many don't). A sample `stdarg.h' file is
  17. provided.
  18.  
  19. Restrictions:
  20.  
  21. Other ANSI-isms are just passed on without modification, such as
  22. trigraphs, token pasting (##), #pragmas and stringizing (#text).
  23.  
  24. The unprototyper does not understand declarations of (whatever). The
  25. result will be a syntax error so this should not go by unnoticed.
  26.  
  27. Operation:
  28.  
  29. This package implements an non-default C preprocessor (the output from
  30. the default C preprocessor being piped through the unprototyper).  How
  31. one tells the C compiler to use an non-default preprocessor program is
  32. somewhat compiler-dependent:
  33.  
  34.     SunOS 4.x:  cc -Qpath directory_with_non-default_cpp ...
  35.  
  36.     SysV Rel2:  cc -Bdirectory_with_non-default_cpp/ -tp ...
  37.  
  38. Your C compiler manual should provide the necessary information.
  39.  
  40. On some systems the lint(1) command is just a shell script, and writing
  41. a version that uses the unprototyper should not be too hard. With SunOS
  42. 4.x, /usr/bin/lint is not a shell script, but it accepts the same
  43. command syntax as the cc(1) for the specification of a non-default
  44. compiler pass. 
  45.  
  46. You may have to do some research on the lint command provided with your
  47. own machine.
  48.  
  49. Configuration:
  50.  
  51. Check the contents of the `stdarg.h' file provided with this package.
  52. This file serves a dual purpose. It should be included by C source file
  53. that implements ANSI-style variadic functions. It is also used to
  54. configure the `unproto' program so that it emits the proper magic for
  55. the `...' construct.
  56.  
  57. The `stdarg.h' file contains definitions for the sparc architecture and
  58. for architectures that pass arguments via the stack (usually OK for
  59. 80*86, mc68k and vax C compilers).  Risc processors often need special
  60. tricks.  These are usually found in the file `/usr/include/varargs.h'.
  61.  
  62. The file `varargs.c' provided with this package can be used to verify
  63. that the `stdarg.h' file has been set up correctly.
  64.  
  65. For maximal flexibility, you can use the `cpp' shell script provided
  66. with this package to set up the pipe between the default C preprocessor
  67. and the unprototyper command. The script assumes that the unprototyper
  68. binary is called `unproto'. See the Makefile for details.
  69.  
  70. The overhead of shell-script interpretation can be avoided by having
  71. the unprototyper itself open the pipe to the C preprocessor.  In this
  72. case, the `unproto.c' source file should be compiled with the
  73. `PIPE_THROUGH_CPP' macro defined as the pathname of the C preprocessor
  74. (usually `/lib/cpp'), and the unprototyper binary should be called
  75. `cpp'.  See the Makefile for details.
  76.  
  77. Installation:
  78.  
  79. Install the `stdarg.h' include file and the `unproto.1' manual page in
  80. suitable places.
  81.  
  82. If you use the `cpp' shell script to pipe the preprocessor output
  83. through the unprototyper program, install the `unproto' binary in a
  84. place where the `cpp' shell script can find it, and install the `cpp'
  85. shell script in a suitable place.
  86.  
  87. If the unprototyper itself opens the pipe to the C preprocessor (i.e.
  88. the unprototyper was built with the `PIPE_THROUGH_CPP' macro defined),
  89. install the `cpp' unprototyper binary in a suitable place.
  90.  
  91.     Wietse Venema
  92.     wietse@wzv.win.tue.nl
  93.     Eindhoven University of Technology
  94.     The Netherlands
  95.