Copyright © 1996-2013,2014 by Thomas E. Dickey
cproto generates function prototypes for functions defined in the specified C source files to the standard output. The function definitions may be in K&R or ANSI C style, or in lint-library form. cproto can also convert function definitions in the specified files from the K&R style to the ANSI C style.
This was written (and was maintained) by Chin Huang <email@example.com>. I added the logic to support lint libraries (my main purpose), added code to display the offending token/type in error, wrote the configure script, designed regression tests and ported to VAX/VMS.
Some time before working on cproto, I had hand-built lint-libraries for X11 on SunOS. The vendor did not distribute usable lint-libraries: the corresponding ".ln" files were zero-length, and there were no text-files to match. Moreover, X11 did not build lint-libraries that matched the sources (many functions were missing or had different parameters).
To complicate matters, I was developing with both the public X
Consortium code and a distribution of Motif. The latter
XtInherit design flaw which was
topical about fourteen years later in the XFree86/Xorg split.
None of the Motif distribution's libraries had lint libraries,
but equivalents could be constructed from the header files.
Since the llib-* text files are basically the ".c" files with the function-bodies emptied, it was possible to edit them and produce correct lint library source.
But that is very time-consuming, and not something that I would do more than once. Modifying cproto was a better solution; I used the resulting lint-libraries for several years.
There was a defunct project (a
snapshot) from 2000 on SourceForge. It appears to have been
replaced in 2009 by a project for lexical analysis of
lua, which is unrelated.
Currently I use cproto to generate lint-libraries for ncurses. I also make occasional fixes, e.g., "4.7a".
See the changelog for details:
There are numerous references on the net to cproto. Here are a few of the more interesting ones:
used as a starting point for c2man.
used as part of the development process
used as part of their development process
used as starting point for a 1999 master's project.
used as a tool