home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18557 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.3 KB  |  67 lines

  1. Path: sparky!uunet!mcsun!news.funet.fi!funic!sauna.cs.hut.fi!news.cs.hut.fi!s37732v
  2. From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: IntuitionBase
  5. Date: 12 Jan 93 10:33:40 GMT
  6. Organization: Helsinki University of Technology, Finland
  7. Lines: 53
  8. Distribution: inet
  9. Message-ID: <S37732V.93Jan12123340@lk-hp-22.hut.fi>
  10. References: <1993Jan11.054350.13351@daimi.aau.dk> <Dok9wB1w165w@ersys.edmonton.ab.ca>
  11. NNTP-Posting-Host: lk-hp-22.hut.fi
  12. In-reply-to: ruil@ersys.edmonton.ab.ca's message of Mon, 11 Jan 93 16:34:36 MST
  13.  
  14. In article <Dok9wB1w165w@ersys.edmonton.ab.ca> ruil@ersys.edmonton.ab.ca (Rui Lopes) writes:
  15.  
  16.    Well, that's what I thought to, but IntuitionBase is a Library structure 
  17.    (ie. you declare it as: struct Library *IntuitionBase) but what I want is 
  18.    the IntuitionBase structure that holds current system information.  I was 
  19.    hoping that there would be some sort of function that would do this, but 
  20.    I can't find any.....
  21.    Later,
  22.  
  23.    Rui Lopes              ruil@ersys.edmonton.ab.ca 
  24.  
  25. Because IntuitionBase structure is documented, you should declare it like
  26. this.
  27.  
  28. struct IntuitionBase *IntuitionBase = NULL;
  29.  
  30. Setting it to NULL isn`t necessary but it makes it easier to check if
  31. it was open in a clean up code.
  32.  
  33. Here is a little clip how to use it
  34. ----------------------------------
  35. #include    "intuition/intuition.h"
  36.  
  37. struct IntuitionBase *IntuitionBase = NULL;
  38.  
  39. main()
  40. {
  41.   ULONG lock;
  42.  
  43.   IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",33);
  44.   if(IntuitionBase == NULL) return;
  45.  
  46.   /* Now we can use IntuitionBase */
  47.   lock = LockIBase(0);
  48.   
  49.   /* Access IntuitionBase in here. */
  50.   info = IntuitionBase->wantedinfo;
  51.  
  52.   UnlockIBase(lock);     /* or was it UnLockIBase(lock)? */
  53.  
  54.   etc...
  55. }
  56. --
  57.  
  58.  
  59. **************************************************************************
  60. *         Markus Aalto              | Helsinki University of Technology  *
  61. *                                   |                                    *
  62. *  EMail: s37732v@vipunen.hut.fi    | Faculty of Electric Engineering    *
  63. *  Fax:   358-0-8746991 (Sometimes) |                                    *
  64. *                                   | Undergraduate in Computer Science  *
  65. **************************************************************************
  66.         
  67.