protoize, unprotoize - convert C source between K&R and ANSI C


protoize [-CgklnNqvV] [-B dir] [-c compile_opts]
		 [-d dirlist] [-p compiler] [-x dirlist]
		 [file ...]
unprotoize [-knNqvV] [-c compile_opts] [-d dirlist]
		 [-i indentstring] [-p compiler] [-x dirlist]
		 [file ...]


The protoize(1) and unprotoize(1) utilities convert C source files between the traditional (K&R) formats and the ANSI/ISO C standard format (including prototypes). Both tools make use of the gcc(1) compiler, which must be installed on your system.

The protoize(1) utility converts existing function declarations and definitions into prototype form, and can insert declarations and prototypes for functions that are implicitly declared. The unprotoize(1) utility reverses the process.

The files indicated by file must be source files, not header files. The utilities compile the files to find the functions they define. Information about the functions in file is saved in the file file.X; the .X files are normally deleted (but see -x). The converted files replace the original files, which are renamed with the file extension .save. If the save file already exists, the source file is discarded.

The protoize(1) and unprotoize(1) utilities take the following options:

-B dir
Look in directory dir for the SYSCALLS.c.X file.
Rename the files to end in .C instead of .c. This can be useful when converting C++ files, but will not work properly on file allocation table (FAT) file systems or on file systems available across a network, where case sensitivity is not available. This option is available in protoize(1) only.
-c compile_opts
Pass compile_opts to gcc(1) when creating the .X file. The options must be passed as a single argument, and the options -g, -O, -c, -S, and -o are ignored if they are part of compile_opts.
-d dirlist
Search the directories in dirlist for files to be converted. Files in those directories named with the -x option will not be converted.
Add a global declaration for each function that is called and not declared. The declarations are inserted at the beginning of the file before the first function definition that contains a call to an undeclared function. This option is for protoize(1) only.
-i indentstring
Indent the old-style parameter declarations with the specified indentstring. This option is for unprotoize(1) only.
Keep the .X files; normally they are deleted.
Add a local declaration for each function that is called and not declared. A prototype declaration is inserted into each block that calls the function without a declaration. This option is for protoize(1) only.
Do not create .save files; delete the originals. This is a dangerous option to use.
Do not change the files; instead, print information about the conversions that would have been done.
-p compiler
Use the specified compiler instead of gcc(1). This is intended for use with alternate versions of gcc(1).
Quiet mode; suppress warnings about definitions and declarations that cannot be converted.
Display version number.
Synonym for -V; display the version number of protoize(1) or unprotoize(1).
-x filelist
Exclude the files in filelist from conversion.


The protoize(1) utility exits with status 0 for success, and >0 if an error occurred.


The protoize(1) utility makes use of the following file:

Information about system calls. Use the -B option to specify a different directory for the SYSCALLS.c.X file.


Note that this document discusses only the Interix versions of protoize(1) and unprotoize(1); it is copyright © by Microsoft Corporation The protoize(1) and unprotoize(1) utilities are covered under the General Public License and are copyright by the Free Software Foundation.