Contents of the HEADHUNT.DOC file
Date: 4 Sept 87
Author: Lawrence Allen (BIX: lallen, CompuServe: 75776,2477)
Purpose: Scans TurboC source files to produce a list of the
header files that contain the prototypes for the
library functions called.
Usage: headhunt infilespec [outfilespec] [-n]
where if outfilespec is omitted, output is to stdout.
-n if present, outputs the file header names only.
Eg. "stdio.h" rather than the default format:
HeadHunt automates a tedious part of ANSI-compatibility: the search
through source files for library functions and the look up of which
header files contain their prototypes.
I've provided the source to make it possible to customize for other
"ANSI-compatible" C compilers and to allow you to add your own
functions and headers.
Please note that TurboC's header files also contain lots of #defines,
global variables, etc. whose use would require their inclusion.
HeadHunt does not pick these up. I left these out for several reasons.
First, it would slow down processing considerably. Second, I figured
that if you're using these labels you're probably looking at the header
files and therefore are less likely to forget to #include them. Third,
the compiler is sure to complain and alert you if they're left out.
If you want to handle this other stuff, simply remove the test for a
left parenthesis after the call to getword() in main() and add the new
identifiers to functab and headers.