where do you put prototype declarations?

thomas.j.roberts tjr at cbnewsc.ATT.COM
Sat Feb 4 04:44:32 AEST 1989


>From article <372 at serene.UUCP>, by rfarris at serene.UUCP (Rick Farris):
> In article <3449 at sdsu.UUCP> roetzhei at sdsu.UCSD.EDU (William Roetzheim) writes:
> 
>>   I may be the only one, but I like to put all of my function
>> prototypes in one include file which contains only function
>> prototypes. . .

I do this, too, but use a tool to pull out all of the declarations from
the files containing the definitions. This tool puts "/* foo.c */" ahead
of the prototypes from file foo.c, so it serves as a (crude) index to
functions. I do NOT make the object files depend upon this header file
(called "proto.h"), nor do I automatically re-create proto.h whenever
any .c files are modified; I need to explicitly re-create proto.h whenever
I change the definition of, or add any functions.

Tom Roberts
AT&T Bell Laboratories
att!ihnet!tjr



More information about the Comp.lang.c mailing list