include files -- help needed

Paul Stachour stachour at sctc.com
Tue Jun 11 01:50:07 AEST 1991


guthriew at arcturus.uucp (Guthrie;Wade) writes:
> ...(stuff)   
>In order to follow the guidelines of

>	1) no nested include files and
>	2) limiting the scope of globals and typedefs,

> ...(more stuff)

    We have found the guideline of no nested include files
too restricting, as well as (my opinion) silly.  Anytime you
use a service-routine, you should not have to see how that
service routine works.  But if your access to a service routine 
depends (as it should) on the data-structures defined by that
sevice routine (such as a structure containing a complex number)
that you don't use, but that the set-of-service routines do,
  YOU SHOULD NOT BE REQUIRED TO INCLUDE THE DEFN OF COMPLEX NUMBERS

      And this principle applies though many levels of nesting.
We use the "protected" method to prevent the secondary problem in
C of including a file more than once. It's not a big thing, just
a slight increase in procrocessor time.

   Of course the way to work is to be in a language with real
modules, such as Ada, Euclid, or Modula2, but I suspect that
is not likely in your environment.

    Good Luck!  ..Paul (SCTC)
-- 
Paul Stachour          SCTC, 1210 W. County Rd E, Suite 100           
stachour at sctc.com          Arden Hills, MN  55112
                             [1]-(612) 482-7467



More information about the Comp.lang.c mailing list