Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!cs.umn.edu!sctc.com!stachour From: stachour@sctc.com (Paul Stachour) Newsgroups: comp.lang.c Subject: Re: include files -- help needed Message-ID: <1991Jun10.155007.15139@sctc.com> Date: 10 Jun 91 15:50:07 GMT References: <1991Jun7.233854.11170@arcturus.uucp> Organization: SCTC Lines: 32 guthriew@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@sctc.com Arden Hills, MN 55112 [1]-(612) 482-7467