home *** CD-ROM | disk | FTP | other *** search
- FUNCTION openlibs() - Easily open any of several system libraries
-
- openlibs( which_ones )
- int which_ones;
-
- This function takes an integer argument which specifies which libraries
- you would like to have opened for your program. The libraries you can open
- are:
-
- GFX : graphics.library
- INTUI or INTUITION : intuition.library
- DFONT or DISKFONT : diskfont.library
- ARP : arp.library
- TRANSLATOR : translator.library
- REXX : rexxsyslib.library
-
-
- These values are simply numeric #define's, which can be or'ed together.
-
-
- To open the graphics.library, you would simply do the following:
-
- success = openlibs(GFX);
- if (success == NULL)
- deal_with_failure();
-
- You can open multiple libraries with a single call by doing the following:
-
- success = openlibs(GFX | ARP | INTUITION | DISKFONT);
- if (success == NULL)
- deal_with_failure();
-
- The above opens the graphics.library, arp.library, intuition.library,
- and diskfont.library all in a single call.
-
- If any of the libraries fail to open, openlibs() will print an error
- message to your output stream saying which library didn't open and it
- will return NULL.
-
- openlibs() will close any libraries it opened if a succesive
- OpenLibrary() call fails. Therefore, you don't have to worry about opened
- libraries sitting around and never being closed. This is to say that if
- you ask for GFX | INTUI | ARP, and graphics.library and intuition.library
- open, but arp.library doesn't, graphics and intuition will be closed down
- for you and NULL returned.
-
-
-
- TODO : Shouldn't be much else. Maybe a way to add more libraries that
- can be opened without having to recompile. Possibly a name/variable
- combo....
-
- BUGS : can only support 32 different libraries to be opened. That's not
- too much of a restriction, but it still is one.
-
-
-