home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume17 / cproto / patch01 / cproto.man next >
Encoding:
Text File  |  1991-04-04  |  4.0 KB  |  199 lines

  1.  
  2.  
  3. CPROTO(1)                  Unix Programmer's Manual                  CPROTO(1)
  4.  
  5.  
  6. NAME
  7.      cproto - generate C function prototypes from C source code
  8.  
  9. SYNOPSIS
  10.      cproto [ option ... ] [ file ... ]
  11.  
  12. DESCRIPTION
  13.      Cproto reads C source code files  and  outputs  function  prototypes  for
  14.      external  functions  defined  in  the  source  to  standard  output.  The
  15.      function definitions may be in the old style or ANSI style.   Optionally,
  16.      cproto  also  outputs  declarations for any external variables defined in
  17.      the file.  If no file argument is given, cproto takes its input from  the
  18.      standard input.
  19.  
  20. OPTIONS
  21.  
  22.      -e   Output the keyword extern in front of each declaration having global
  23.           scope.
  24.  
  25.      -fn  Set the style of function prototype where n is a number from 0 to 4.
  26.           For example, consider the function definition
  27.  
  28.                 main (argc, argv)
  29.                 int argc;
  30.                 char *argv[];
  31.                 {
  32.                  ...
  33.                 }
  34.  
  35.           If the value is 0, then no prototypes are generated.  When set to 1,
  36.           the output is:
  37.  
  38.                 int main(/*int argc, char *argv[]*/);
  39.  
  40.           For a value of 2, the output has the form:
  41.  
  42.                 int main(int /*argc*/, char */*argv*/[]);
  43.  
  44.           The default value is 3.  It produces the full function prototype:
  45.  
  46.                 int main(int argc, char *argv[]);
  47.  
  48.           A value of 4 produces prototypes guarded by a macro:
  49.  
  50.                 int main P_((int argc, char *argv[]));
  51.  
  52.  
  53.      -mname
  54.           Set the name of the macro used to guard prototypes when  option  -f4
  55.           is selected.  By default it is "P_".
  56.  
  57.      -d   Omit the definition of the prototype macro named by the -m option.
  58.  
  59.      -p   Disable promotion of formal parameters in function  prototypes.   By
  60.           default,  parameters  of  type  char  or  short in traditional style
  61.           function definitions are  promoted  to  type  int  in  the  function
  62.  
  63.  
  64.                               February 28, 1991                              1
  65.  
  66.  
  67.  
  68.  
  69. CPROTO(1)                  Unix Programmer's Manual                  CPROTO(1)
  70.  
  71.  
  72.           prototype.  Parameters of type float get promoted to double as well.
  73.  
  74.      -s   Also output static declarations.
  75.  
  76.      -v   Also output declarations for variables defined in the file.
  77.  
  78.      -Fstring
  79.           Set the format used to output  each  prototype.   The  string  is  a
  80.           template in the form
  81.  
  82.                 " int main ( a, b )"
  83.  
  84.           where each space in the  string  may  be  replaced  with  whitespace
  85.           characters.  For example, the option
  86.  
  87.                 -F"int main(\n\ta,\n\tb\n\t)"
  88.  
  89.           will produce prototypes in the format
  90.  
  91.                 int main(
  92.                         int argc,
  93.                         char *argv[]
  94.                         );
  95.  
  96.  
  97.      -Dname\[=value\]
  98.           This option is passed through to the preprocessor  and  is  used  to
  99.           define symbols for use with conditionals such as #ifdef.
  100.  
  101.      -Uname
  102.           This option is passed through to the preprocessor  and  is  used  to
  103.           remove any definitions of this symbol.
  104.  
  105.      -Idirectory
  106.           This option is passed through to the preprocessor  and  is  used  to
  107.           specify  a  directory  to  search for files that are referenced with
  108.           #include.
  109.  
  110.      -V   Print version information.
  111.  
  112. BUGS
  113.      When cproto finds an error, it usually outputs the not  very  descriptive
  114.      message "syntax error".
  115.  
  116.      Options that take string arguments only interpret the following
  117.           character escape sequences:
  118.  
  119.                 \n   newline
  120.                 \t   tab
  121.  
  122.  
  123. AUTHOR
  124.      Chin Huang
  125.      cthuang@contact.uucp
  126.      chin.huang@canrem.uucp
  127.  
  128.  
  129.  
  130.                               February 28, 1991                              2
  131.  
  132.  
  133.  
  134.  
  135. CPROTO(1)                  Unix Programmer's Manual                  CPROTO(1)
  136.  
  137.  
  138. SEE ALSO
  139.      cc(1), cpp(1)
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                               February 28, 1991                              3
  197.  
  198.  
  199.