🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #7532

Re: functions.h

#7532
From: Kristian Nielsen
Date: Mon, 17 Dec 1990 14:40
41 lines
2298 bytes
jol@sei.cmu.edu (Jun Lee) writes:

>Hi.

>Can anyone tell me what is contained in <function.h?  I take it this is
>a Aztec C thing and I was wondering what would be a comparable include
>file on a Lattice 5.1.  

The Lattice/SAS equivalent is <proto/all.h>. It contains function
definitions with type checking as provided in ANSI-C, and also saves you
some typecasts. A typical example of a source line from this include file
would be

   void *OpenLibrary(char *,ULONG);

or something similar. This tells the compiler that Openlibrary takes a
string and an unsigned long integer as arguments, and returns a generic
pointer (ie. struct IntuitionBase *, struct GfxBase * etc.). This way, it is
not nessesary to do an explicit typecast, as in IntuitionBase = (struct
IntuitionBase *)OpenLibrary(...). Also, should one forget the library
version number, as in GfxBase = OpenLibrary("graphics.library"), the
compiler will give you a warning (saves you some bug hunting!).
  As an added bonus, the Lattice include (I dunno about Aztec) also has
(optional) #pragma - definitions, enabling the compiler to make more
efficient system calls than is possible using the stubs in amiga.library.
BTW, at least with Lattice, you needn't include the definitions for ALL the
system calls, you can restrict you program to only include the parts of the
system that you are using, by specifying, for example 

   #include <proto/intuition.h>

Of course, if you don't mind about compile times, it is more comfortable
just to include the entire set.

	Kristian

-- 
==========================================================================
Kristian Nielsen                          |      ///   Only the AMIGA
Student at DIKU, University of Copenhagen |     ///
(Department of Computer Science)          | \\\///     makes it possible!
Technical Details
Message-ID: <1990Dec17.144036.4219@diku.dk>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!rpi!uupsi!sunic!dkuug!freja.diku.dk!bombadil
References: <9871@fy.sei.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!rpi!uupsi!sunic!dkuug!freja.diku.dk!bombadil
From: bombadil@diku.dk (Kristian Nielsen)
Newsgroups: comp.sys.amiga.tech
Subject: Re: functions.h
Message-ID: <1990Dec17.144036.4219@diku.dk>
Date: 17 Dec 90 14:40:36 GMT
References: <9871@fy.sei.cmu.edu>
Organization: Department Of Computer Science, University Of Copenhagen
Lines: 36