home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17463 < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.9 KB  |  53 lines

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