home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!peraue
- From: peraue@cs.vu.nl (Paul-Erik Raue)
- Subject: Re: Does opening libraries require a fixed varname?
- Message-ID: <BzEB53.1sG@cs.vu.nl>
- Sender: news@cs.vu.nl
- Organization: Digital Intelligence
- X-Newsreader: TIN [version 1.1 PL8]
- References: <BzDnFz.FM5@usenet.ucs.indiana.edu>
- Date: Thu, 17 Dec 1992 08:48:39 GMT
- Lines: 40
-
- Sam Hulick (shulick@navajo.ucs.indiana.edu) wrote:
-
- : If I wanted, for instance, to open intuition.library, does the line
- : *HAVE* to be:
-
- : IntuitionBase = OpenLibr.......
-
- : Can it be something like "IBase = OpenLibrary(.." or "blech = Open..."
- : In other words, does it matter what you call the variable?
- : GadToolsBase, ExecBase, GfxBase, etc.
-
- It depends on what language you program in, but seeing as your example is
- in C (or a very similar language), the answer is a qualified yes.
-
- The link libraries in C which contain the stubs to call the library functions
- are defined using the variable IntuitionBase for intuition.library calls
- and GfxBase for graphics.library calls and so on, and if you look in the
- pragmas for the library calls you should see that they too use these variable
- names.
-
- It would be possible to use the variable IBase instead of IntuitionBase, but
- that would probably include re-writing all stubs to functions. If you do
- want to change the name I suggest you use:
-
- #define IBase IntuitionBase
-
- which will let you write IBase in your program and the preprocessor expands
- this to IntuitionBase.
-
- : --
- : // Amiga 3000 ___ \ Sam Hulick: shulick@indiana.edu (NeXTmail OK!)
- : // 68030 25 MHz /__/\ \ My opinions wear combat boots. Or whatever.
- : \\// OS 2.04 \__\/ / "Walk! Not bloody likely. I am going in a
- : \/ / taxi." --George Bernard Shaw
-
- Good luck,
- Paul-Erik Raue (peraue@cs.vu.nl)
- --
- Slang is language that takes off its coat, spits on its hands, and goes
- to work.
-