home *** CD-ROM | disk | FTP | other *** search
-
-
-
- CCCCPPPPRRRROOOOTTTTOOOO((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333)))) CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
-
-
-
- NNNNAAAAMMMMEEEE
- cproto - generate C function prototypes and convert function
- definitions
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ccccpppprrrroooottttoooo [ _o_p_t_i_o_n ... ] [ _f_i_l_e ... ]
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- CCCCpppprrrroooottttoooo generates function prototypes for functions defined
- in the specified C source files to the standard output. The
- function definitions may be in the old style or ANSI C
- style. Optionally, ccccpppprrrroooottttoooo also outputs declarations for
- variables defined in the files. If no _f_i_l_e argument is
- given, ccccpppprrrroooottttoooo reads its input from the standard input.
-
- By giving a command line option, ccccpppprrrroooottttoooo will also convert
- function definitions in the specified files from the old
- style to the ANSI C style. The original source files along
- with files specified by
-
- #include "file"
-
- directives appearing in the source code will be overwritten
- with the converted code. If no file names are given on the
- command line, then the program reads the source code from
- the standard input and outputs the converted source to the
- standard output.
-
- If any comments appear in the parameter declarations for a
- function definition, such as in the example,
-
- main (argc, argv)
- int argc; /* number of arguments */
- char *argv[]; /* arguments */
- {
- }
-
- then the converted function definition will have the form
-
- int
- main (
- int argc, /* number of arguments */
- char *argv[] /* arguments */
- )
- {
- }
-
- Otherwise, the converted function definition will look like
-
- int
- main (int argc, char *argv[])
- {
-
-
-
- Page 1 (printed 3/9/94)
-
-
-
-
-
-
- CCCCPPPPRRRROOOOTTTTOOOO((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333)))) CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
-
-
-
- }
-
-
- CCCCpppprrrroooottttoooo can optionally convert function definitions from the
- ANSI style to the old style. In this mode, the program also
- converts function declarators and prototypes that appear
- outside function bodies. This is not a complete ANSI C to
- old C conversion. The program does not change anything
- within function bodies.
-
- OOOOPPPPTTTTIIIIOOOONNNNSSSS
- ----eeee Output the keyword eeeexxxxtttteeeerrrrnnnn in front of every generated
- prototype or declaration that has global scope.
-
- ----ffff_n Set the style of generated function prototypes where _n
- is a number from 0 to 3. For example, consider the
- function definition
-
- main (argc, argv)
- int argc;
- char *argv[];
- {
- }
-
- If the value is 0, then no prototypes are generated.
- When set to 1, the output is:
-
- int main(/*int argc, char *argv[]*/);
-
- For a value of 2, the output has the form:
-
- int main(int /*argc*/, char */*argv*/[]);
-
- The default value is 3. It produces the full function
- prototype:
-
- int main(int argc, char *argv[]);
-
-
- ----cccc The parameter comments in the prototypes generated by
- the -f1 and -f2 options are omitted by default. Use
- this option to enable the output of these comments.
-
- ----mmmm Put a macro around the parameter list of every
- generated prototype. For example:
-
- int main P_((int argc, char *argv[]));
-
-
- ----MMMM_n_a_m_e
- Set the name of the macro used to surround prototype
- parameter lists when option -m is selected. The
-
-
-
- Page 2 (printed 3/9/94)
-
-
-
-
-
-
- CCCCPPPPRRRROOOOTTTTOOOO((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333)))) CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
-
-
-
- default is "P_".
-
- ----dddd Omit the definition of the prototype macro used by the
- -m option.
-
- ----pppp Disable promotion of formal parameters in old style
- function definitions. By default, parameters of type
- cccchhhhaaaarrrr or sssshhhhoooorrrrtttt in old style function definitions are
- promoted to type iiiinnnntttt in the function prototype or
- converted ANSI C function definition. Parameters of
- type ffffllllooooaaaatttt get promoted to ddddoooouuuubbbblllleeee as well.
-
- ----qqqq Do not output any error messages when the program
- cannot read the file specified in an #_i_n_c_l_u_d_e
- directive.
-
- ----ssss By default, ccccpppprrrroooottttoooo only generates declarations for
- functions and variables having global scope. This
- option will output ssssttttaaaattttiiiicccc declarations as well.
-
- ----vvvv Also output declarations for variables defined in the
- source.
-
- ----aaaa Convert function definitions from the old style to the
- ANSI C style.
-
- ----tttt Convert function definitions from the ANSI C style to
- the traditional style.
-
- ----bbbb Rewrite function definition heads to include both old
- style and new style declarations separated by a
- conditional compilation directive. For example, the
- program can generate this function definition:
-
- #ifdef ANSI_FUNC
-
- int
- main (int argc, char *argv[])
- #else
-
- int
- main (argc, argv)
- int argc;
- char *argv[]
- #endif
- {
- }
-
-
- ----BBBB_d_i_r_e_c_t_i_v_e
- Set the conditional compilation directive to output at
- the beginning of function definitions generated by the
-
-
-
- Page 3 (printed 3/9/94)
-
-
-
-
-
-
- CCCCPPPPRRRROOOOTTTTOOOO((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333)))) CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
-
-
-
- -b option. The default is
-
- #ifdef ANSI_FUNC
-
-
- ----PPPP_t_e_m_p_l_a_t_e
- ----FFFF_t_e_m_p_l_a_t_e
- ----CCCC_t_e_m_p_l_a_t_e
- Set the output format for generated prototypes,
- function definitions, and function definitions with
- parameter comments respectively. The format is
- specified by a template in the form
-
- " int f ( a, b )"
-
- but you may replace each space in this string with any
- number of whitespace characters. For example, the
- option
-
- -F"int f(\n\ta,\n\tb\n\t)"
-
- will produce
-
- int main(
- int argc,
- char *argv[]
- )
-
-
- ----DDDD_n_a_m_e[=_v_a_l_u_e]
- This option is passed through to the preprocessor and
- is used to define symbols for use with conditionals
- such as #_i_f_d_e_f.
-
- ----UUUU_n_a_m_e
- This option is passed through to the preprocessor and
- is used to remove any definitions of this symbol.
-
- ----IIII_d_i_r_e_c_t_o_r_y
- This option is passed through to the preprocessor and
- is used to specify a directory to search for files that
- are referenced with #_i_n_c_l_u_d_e.
-
- ----EEEE_c_p_p
- Pipe the input files through the specified C
- preprocessor command when generating prototypes. By
- default, the program uses /lib/cpp.
-
- ----EEEE_0 Do not run the C preprocessor.
-
- ----VVVV Print version information.
-
-
-
-
- Page 4 (printed 3/9/94)
-
-
-
-
-
-
- CCCCPPPPRRRROOOOTTTTOOOO((((1111)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333)))) CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
-
-
-
- EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
- The environment variable CPROTO is scanned for a list of
- options in the same format as the command line options.
- Options given on the command line override any corresponding
- environment option.
-
- BBBBUUUUGGGGSSSS
- If an untagged struct, union or enum declaration appears in
- a generated function prototype or converted function
- definition, the content of the declaration between the
- braces is empty.
-
- The program does not pipe the source files through the C
- preprocessor when it is converting function definitions.
- Instead, it tries to handle preprocessor directives and
- macros itself and can be confused by tricky macro
- expansions. The conversion also discards some comments in
- the function definition head.
-
- The -v option does not generate declarations for variables
- defined with the eeeexxxxtttteeeerrrrnnnn specifier. This doesn't strictly
- conform to the C language standard but this rule was
- implemented because include files commonly declare variables
- this way.
-
- When the program encounters an error, it usually outputs the
- not very descriptive message "syntax error".
-
- Options that take string arguments only interpret the
- following character escape sequences:
-
- \n newline
- \t tab
-
-
- AAAAUUUUTTTTHHHHOOOORRRR
- Chin Huang
- cthuang@zerosan.UUCP
- chin.huang@canrem.com
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- cc(1), cpp(1)
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 5 (printed 3/9/94)
-
-
-
-