Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.amiga » header files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
header files [message #282362] Wed, 22 January 1986 14:32 Go to next message
cosell is currently offline  cosell
Messages: 9
Registered: May 2013
Karma: 0
Junior Member
Article-I.D.: caip.1069
Posted: Wed Jan 22 14:32:43 1986
Date-Received: Fri, 24-Jan-86 08:31:20 EST
Sender: daemon@caip.RUTGERS.EDU
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 40

From: Bernie Cosell 

There have been a few comments about how all the .h files work (or don't).  The
trouble is neither with AmigaDOS nor the C compiler: there are simply *bugs* in
the include files.  The problem is that in, say, intuition.h it'll define some
struct whose fields are all sorts of other intersting structs -- intution.h
*MUST* #include *ALL* of the files it'll need to insure that those structures
are, themselves, declared.  And those #include files must be careful to,
themselves, #include the files to define the structs and parameters that *they*
need, and so on.  Unfortunately, there are a fair bunch of missing #includes,
and that shows up in the necessity of simple C programs having to include
*piles* of extraneous .h files that it really shouldn't.  It is pretty clear
how these problems arose: obviously at some early epoch of the system the .h
files were all clean and correctly treed.  Then, as the system evolved, folks
added new fields to various structures and the later adders were not so
careful, and so errors crept in.

I've fixed my system to have mostly rational .h file setups: what I've done is
be scrupulos about *NOT* being willing to include gratuitous .h files.  When I
get an error out of lc1, I search through the include hierarchy for the
undefined field or parameter that was missing.  The search will uncover two
things:
  a) files that use the structure or field or parameter, and
  b) the file that defines it.
With a little bit of thought it is pretty easy to psyche out just what the
`correct' tree of internal-includes ought to be.  You edit it in and you're
include world moves closer to rationality.  In pretty short order you're all
fixed up!  (In one or two cases, as I recall, you not only have to #include a
suitable file, but you also have to upgrade the file to have the
"#ifndef DIR_FILENAME_H" hack to aviod multiple-includes.  It's pretty obvious
when you get into it...)

an apology: I would have been delighted to post the actual changes it takes to
fix thing up... but...  I did *not* really keep track of what I was doing.  I
got annoyed one evening at the include=file craziness and, in my naivete, I I
really thought that I'd find one little edit to fix and I'd be done, so I just
dove in and began tweaking ...and tweaking... and tweaking.  Sorry about that!
But it really did only take about 1/2 hour to do the whole thing.  

  /Bernie
Re: header files [message #282374 is a reply to message #282362] Thu, 23 January 1986 13:01 Go to previous messageGo to next message
bruceb is currently offline  bruceb
Messages: 41
Registered: October 1985
Karma: 0
Member
Article-I.D.: amiga.597
Posted: Thu Jan 23 13:01:59 1986
Date-Received: Fri, 24-Jan-86 22:25:45 EST
References: <1069@caip.RUTGERS.EDU>
Reply-To: bruceb@amiga.UUCP (Bruce Barrett)
Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030
Lines: 10


Version 1.1 of the development system (Lattice V3.03) includes 2 solutions to
(some of) the recent complaints about the .h files.
	1) All .h files now include the .h files they require to compile
	2) The warning "error #61" which complained about pointers within
		structures pointing to undefined structures has been
		removed.
Yes we realized it was a problem, yes we were busy testing and fixing
other things, yes it is now fixed.  Sorry for the inconvience.
--Bruce Barrett
Re: header files [message #282381 is a reply to message #282362] Thu, 23 January 1986 20:58 Go to previous message
mykes is currently offline  mykes
Messages: 45
Registered: January 1986
Karma: 0
Member
Article-I.D.: 3comvax.382
Posted: Thu Jan 23 20:58:22 1986
Date-Received: Sat, 25-Jan-86 08:32:23 EST
References: <1069@caip.RUTGERS.EDU>
Reply-To: mykes@3comvax.UUCP (Mike Schwartz)
Organization: 3Com Corp; Mountain View, CA
Lines: 10


Another crude but effective way to make more sense out of the header file
nonsense is to change all pointers to structures into ULONGs.  This will
remain portable (with MANX and lattice).  Only those structures that have
nested structures in them cannot be fixed this way.

In the programs that use particular structures, you should cast the ULONG
back into a pointer to the structure of appropriate type.  This may sound
clumsy, but it will make a lot of 'C' source code generate smaller object
code!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: COMSPEC ... Warning: Somewhat commercial
Next Topic: The Amiga in business
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Mar 29 06:23:39 EDT 2024

Total time taken to generate the page: 0.00344 seconds