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

  1. NAME
  2.     mkptypes - make prototypes for functions
  3.  
  4.  
  5. SYNOPSIS
  6.     mkptypes [ -e ][ -n ][ -p symbol ][ -s ][ -x ][ -z ][ -A ] [ file ... ]
  7.  
  8.  
  9. DESCRIPTION
  10.     Mkptypes takes as input one or more C source code files, and produces as
  11.     output (on the standard output stream) a list of function prototypes (a
  12.     la ANSI) for the external functions defined in the given source files. This
  13.     output, redirected to a file, is suitable for #include'ing in a C source
  14.     file. The function definitions in the original source may be either "old-
  15.     style" (in which case appropriate prototypes are generated for the funct-
  16.     ions) or "new-style" (in which the definition includes a prototype already).
  17.  
  18.     The -e option causes the "extern" keyword to be explicitly printed for
  19.     external functions. Some non-ANSI compilers may need this.
  20.  
  21.     The -n option causes the line number where each function was defined to
  22.     be prepended to the prototype declaration as a comment.
  23.  
  24.     The -p option controls the name of the macro used to guard prototype
  25.     definitions. Normally this is "_P", but you can change it to any string you
  26.     like. To eliminate the guard macro entirely, use the -A option.
  27.  
  28.     The -s option causes prototypes to be generated for functions declared
  29.     "static" as well as extern functions.
  30.  
  31.     The -x option causes parameter names to be omitted from the output proto-
  32.     types. This may be necessary for some brain-damaged pseudo-ANSI com-
  33.     pilers. You may also prefer this style of output. This option has not been
  34.     thoroughly tested.
  35.  
  36.     The -z option suppresses the definition of the prototype macro given by -p.
  37.     Header files generated by mkptypes with this option will not work unless
  38.     the prototype macro has been defined elsewhere in the program by the user.
  39.     Used with the -p option, the -z option allows use of predefined prototype
  40.     hiding macros that may exist on some systems.
  41.  
  42.     The -A option causes the prototypes emitted to be only readable by ANSI
  43.     compilers.  Normally, the prototypes are "macro-ized" so that compilers
  44.     with __STDC__not defined don't see them.
  45.  
  46.     If files are specified on the command line, then a comment specifying the
  47.     file of origin is emitted before the prototypes constructed from that file.
  48.     If no files are given, then no comments are emitted and the C source code
  49.     is taken from the standard input stream.
  50.  
  51. BUGS
  52.     Mkptypes is easily confused by complicated declarations, such as
  53.  
  54.            int ((*signal)())() f ...
  55.     or
  56.  
  57.            struct foo f int x, y; g foofunc() f ...
  58.  
  59.     This is because the program doesn't actually understand type definitions.
  60.     Some programs may need to be run through the preprocessor before being
  61.     run through mkptypes . The -n option will not work correctly on prepro-
  62.     cessor output if function definitions (as opposed to declarations) appear
  63.     in header files.
  64.  
  65.     Typedef'd types aren't correctly promoted, e.g. for
  66.  
  67.            typedef schar char; int foo(x) schar x;...
  68.     mkptypes incorrectly generates the prototype int foo(schar x) rather than
  69.     the [correct] int foo(int x).
  70.  
  71.     Functions named "inline" with no explicit type qualifiers are not recog-
  72.     nized.
  73.  
  74.  
  75. SEE ALSO
  76.     cc (1), lint (1).
  77.  
  78.  
  79. AUTHOR
  80.     Eric R. Smith <ersmith@uwovax.uwo.ca>
  81.  
  82.  
  83. NOTE
  84.     There is no warranty for this program (as noted above, it's guaranteed to
  85.     break sometimes anyways!). Mkptypes is in the public domain.
  86.