home *** CD-ROM | disk | FTP | other *** search
- #include <proto/exec.h>
- #include <utility/tagitem.h>
- #include <proto/reqtools.h>
- #include <libraries/reqtools.h>
-
- #include "sc:source/constructor.h"
-
- void __regargs __autoopenfail (char *);
-
- static void *libbase;
- struct ReqToolsBase *ReqToolsBase;
- extern long __oslibversion;
-
- CBMLIB_CONSTRUCTOR(openreqtools)
- {
- long old_os_lib = __oslibversion;
-
- __oslibversion = REQTOOLSVERSION;
-
- ReqToolsBase = libbase = (void *) OpenLibrary (REQTOOLSNAME, __oslibversion);
- if (!ReqToolsBase)
- {
- __autoopenfail (REQTOOLSNAME);
-
- __oslibversion = old_os_lib;
- return 1;
- }
-
- __oslibversion = old_os_lib;
- return 0;
- }
-
- CBMLIB_DESTRUCTOR(closereqtools)
- {
- if (libbase) {
- CloseLibrary ((struct Library *) libbase);
- libbase = ReqToolsBase = NULL;
- }
- }
-