home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / c / AsyncIO.lha / AsyncIO / src / AsyncLib.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-05  |  549 b   |  36 lines

  1. #include <proto/exec.h>
  2. #include <proto/asyncio.h>
  3.  
  4. void __regargs __autoopenfail( char * );
  5.  
  6. struct Library    *AsyncIOBase;
  7. static void *libbase;
  8.  
  9. /* Use a custom variable instead? */
  10. extern long __oslibversion;
  11.  
  12. LONG
  13. _STI_110_OpenAsyncIO( VOID )
  14. {
  15.     AsyncIOBase = libbase = OpenLibrary( "asyncio.library", __oslibversion );
  16.  
  17.     if( AsyncIOBase == NULL )
  18.     {
  19.         __autoopenfail( "asyncio.library" );
  20.         return( 1 );
  21.     }
  22.  
  23.     return( 0 );
  24. }
  25.  
  26.  
  27. VOID
  28. _STD_110_CloseAsyncIO( VOID )
  29. {
  30.     if( libbase )
  31.     {
  32.         CloseLibrary( libbase );
  33.         libbase = AsyncIOBase = NULL;
  34.     }
  35. }
  36.