home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 432b.lha / EzLib / doc / openlibs.doc < prev    next >
Encoding:
Text File  |  1990-11-11  |  1.8 KB  |  57 lines

  1. FUNCTION  openlibs()  -  Easily open any of several system libraries
  2.  
  3.       openlibs( which_ones )
  4.         int which_ones;
  5.  
  6.     This function takes an integer argument which specifies which libraries
  7. you would like to have opened for your program.  The libraries you can open
  8. are:
  9.  
  10.           GFX              : graphics.library
  11.           INTUI or INTUITION      : intuition.library
  12.           DFONT or DISKFONT       : diskfont.library
  13.           ARP              : arp.library
  14.           TRANSLATOR          : translator.library
  15.           REXX              : rexxsyslib.library
  16.  
  17.  
  18. These values are simply numeric #define's, which can be or'ed together.
  19.  
  20.  
  21. To open the graphics.library, you would simply do the following:
  22.  
  23.   success = openlibs(GFX);
  24.   if (success == NULL)
  25.     deal_with_failure();
  26.  
  27. You can open multiple libraries with a single call by doing the following:
  28.  
  29.   success = openlibs(GFX | ARP | INTUITION | DISKFONT);
  30.   if (success == NULL)
  31.     deal_with_failure();
  32.  
  33.     The above opens the graphics.library, arp.library, intuition.library,
  34. and diskfont.library all in a single call.
  35.  
  36.     If any of the libraries fail to open, openlibs() will print an error
  37. message to your output stream saying which library didn't open and it
  38. will return NULL.
  39.  
  40.     openlibs() will close any libraries it opened if a succesive
  41. OpenLibrary() call fails.  Therefore, you don't have to worry about opened
  42. libraries sitting around and never being closed.  This is to say that if
  43. you ask for GFX | INTUI | ARP, and graphics.library and intuition.library
  44. open, but arp.library doesn't, graphics and intuition will be closed down
  45. for you and NULL returned.
  46.  
  47.  
  48.  
  49. TODO : Shouldn't be much else.  Maybe a way to add more libraries that
  50.        can be opened without having to recompile.  Possibly a name/variable
  51.        combo....
  52.  
  53. BUGS :    can only support 32 different libraries to be opened.  That's not
  54.     too much of a restriction, but it still is one.
  55.  
  56.  
  57.