Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!ncr-sd!serene!rfarris From: rfarris@serene.UUCP (Rick Farris) Newsgroups: comp.lang.c Subject: Re: where do you put prototype declarations? Message-ID: <372@serene.UUCP> Date: 1 Feb 89 10:24:07 GMT References: <584@mccc.UUCP> <3449@sdsu.UUCP> Reply-To: rfarris@serene.UUCP (Rick Farris) Organization: Serenity BBS, Del Mar, California Lines: 25 In article <3449@sdsu.UUCP> roetzhei@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. This simplifies separate compilation and testing and > provides me with a ready index of the program's functions (and their > parameters). Because my programs typically have many functions > (hundreds), I keep the prototypes in alphabetical order within the > file. I used to do that, but on large projects, it's a royal pain to have to re-make the whole thing everytime you add another function to the prototype list. Now I create an include file for each source file, which includes the function prototypes for that source file. I call it filename.X, for external interfaces. Then I #include filename.X in each of the source files that use functions from filename.C. There's a rather good description of the whole process in "Portable C and Unix System Programming", by "J.E. Lapin" (actually the staff at Rabbit Software), published by Prentice Hall. Rick Farris RF Engineering POB M Del Mar, CA 92014 voice (619) 259-6793 rfarris@serene.cts.com ...!uunet!serene!rfarris serene.UUCP 259-7757