home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Resources / System / BoingBag1 / Contributions / Workbench / RexxArpLib3p6 / src / sreq / simplib.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  885b  |  46 lines

  1. #include <exec/types.h>
  2. #include <exec/exec.h>
  3. #include <graphics/gfx.h>
  4. #include <intuition/intuition.h>
  5. #include <functions.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. extern struct GfxBase *GfxBase;
  10. extern struct IntuitionBase *IntuitionBase;
  11.  
  12. #include <simpreq.h>
  13.  
  14. /**
  15.  *
  16.  *   Open graphics and intuition. Returns 1 on success, 0 on failure.
  17.  *
  18. **/
  19. BOOL SReqOpenLibs ( void )
  20. {
  21.     GfxBase = ( struct GfxBase * ) OpenLibrary("graphics.library", 0L);
  22.     if (GfxBase == NULL)
  23.         return( FALSE );
  24.     
  25.     IntuitionBase = ( struct IntuitionBase * ) OpenLibrary("intuition.library", 0L);
  26.     if (IntuitionBase == NULL)
  27.         return( FALSE );
  28.     
  29.     return( TRUE );
  30. }
  31.  
  32. /**
  33.  *
  34.  *   Close graphics and intuition. Returns 1.
  35.  *
  36. **/
  37. BOOL SReqCloseLibs( void )
  38. {
  39.     if (IntuitionBase)
  40.         CloseLibrary( (struct Library *) IntuitionBase);
  41.     if (GfxBase)
  42.         CloseLibrary( (struct Library *) GfxBase);
  43.     
  44.     return( TRUE );
  45. }
  46.