Newsgroups: comp.lang.c++ Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: .h-file extractor from c++ source file available? Message-ID: <1988Aug7.005251.7548@utzoo.uucp> Organization: U of Toronto Zoology References: <2192@hplabsz.HPL.HP.COM> Date: Sun, 7 Aug 88 00:52:51 GMT In article <2192@hplabsz.HPL.HP.COM> collins@hplabsz.HPL.HP.COM (Patricia Collins) writes: >Do you know of a utility for extracting include files from c++ source >files? It's probably doable with a straightforward awk script... Do you mean something that builds a .h file containing things like external declarations for the functions in the source file? If so, my own experiments (in C, not C++, but I *think* the experience reads over) suggest that this doesn't work too well. In practice one often wants to include things like data-structure definitions in the .h, *but* one also wants to have some such definitions that are local to the source file. Doing it right requires at least marking the items in the source file that are meant for the .h file. Doing *that* works better than writing the .h file as a separate entity -- it keeps the relevant things together in one file -- but it's nearly the same amount of work. Some of this may be sensitive to the details of my own programming style, but I'd be skeptical of claims that automatic extraction without marking worked well. -- MSDOS is not dead, it just | Henry Spencer at U of Toronto Zoology smells that way. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu