home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / mkptypes.zip / readme < prev   
Text File  |  1991-02-05  |  2KB  |  42 lines

  1. Here is mkptypes, a program for generating prototype declarations for all
  2. functions appearing in a C source file. The input C code may be either
  3. K&R or ANSI C (i.e. it's OK if the functions are defined using prototypes).
  4. Unlike some of the sed-based scripts floating around, it (usually)
  5. handles prototype promotion (e.g. the prototype for 'int foo() char x;...'
  6. is 'int foo(int x)'). Also, it should work OK on just about any computer,
  7. not just Unix-based ones (it's been tested under minix, Unix, and TOS).
  8.  
  9. Use: typically, you would type 'mkptypes *.c >proto.h' and then add a
  10. '#include "proto.h"' line to all the C source files. An ANSI conformant
  11. compiler will then be able to do type checking on function calls across
  12. module boundaries. As a bonus, proto.h will tell you which source files
  13. functions were defined in, and (if you gave the -n function to mkptypes)
  14. their line numbers. The resulting include file may also be used by
  15. non-ANSI compilers; you can disable this feature (for cleaner, strictly
  16. ANSI-conforming output) with the -A flag. See the mkptypes.man file for
  17. a description of all the flags mkptypes accepts.
  18.  
  19. Please read the description of bugs in mkptypes.man; definitely mkptypes
  20. will not handle all programs correctly, but it does work on the majority of
  21. them. A sample of its output is provided in the file "mkptypes.h"; this
  22. is the result of 'mkptypes mkptypes.c >mkptypes.h'.
  23.  
  24. There is ABSOLUTELY NO WARRANTY for the program; as I said, it doesn't work
  25. on all programs (complicated function definitions can make it produce bogus
  26. output). It does what I need, though, and it can certainly make porting stuff
  27. to ANSI compilers easier.
  28.  
  29. An earlier version of mkptypes was released on Usenet under the name
  30. "mkproto". This version has several new command line options, and some bug
  31. fixes. It has been renamed to avoid conflict with a file system utility
  32. available under some versions of Unix.
  33.  
  34. Mkptypes is in the public domain. If you find any bugs (other than the ones
  35. documented) please let me know.
  36. --
  37. Eric R. Smith                     email:
  38. Dept. of Mathematics            ersmith@uwovax.uwo.ca
  39. University of Western Ontario   ersmith@uwovax.bitnet
  40. London, Ont. Canada N6A 5B7
  41. ph: (519) 661-3638
  42.