HTML automatically generated with rman
Table of Contents

Name

cproto - generate C function prototypes from C source code

Synopsis

cproto [ option ... ] [ file ... ]

Description

Cproto reads C source code files and outputs function prototypes for external functions defined in the source to standard output. The function definitions may be in the old style or ANSI style. Optionally, cproto also outputs declarations for any external variables defined in the file. If no file argument is given, cproto takes its input from the standard input.

Options

-e
Output the keyword extern in front of each declaration having global scope.
-fn
Set the style of function prototype where n is a number from 0 to 4. 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[]);

A value of 4 produces prototypes guarded by a macro:


int main P_((int argc, char *argv[]));

-mname
Set the name of the macro used to guard prototypes when option -f4 is selected. By default it is "P_".
-d
Omit the definition of the prototype macro named by the -m option.
-p
Disable promotion of formal parameters in function prototypes. By default, parameters of type char or short in traditional style function definitions are promoted to type int in the function prototype. Parameters of type float get promoted to double as well.
-s
Also output static declarations.
-v
Also output declarations for variables defined in the file.
-Fstring
Set the format used to output each prototype. The string is a template in the form


" int main ( a, b )"

where each space in the string may be replaced with whitespace characters. For example, the option


-F"int main(\n\ta,\n\tb\n\t)"

will produce prototypes in the format


int main(
        int argc,
        char *argv[]
        );

-Dname[=value]
This option is passed through to the preprocessor and is used to define symbols for use with conditionals such as #ifdef.
-Uname
This option is passed through to the preprocessor and is used to remove any definitions of this symbol.
-Idirectory
This option is passed through to the preprocessor and is used to specify a directory to search for files that are referenced with #include.
-V
Print version information.

Author

Chin Huang cthuang@contact.uucp chin.huang@canrem.uucp

Bugs

When cproto finds 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

See Also

cc(1) , cpp(1)

Files

NEMO/usr/lib/cproto - source code location within NEMO


Table of Contents