home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Utilities / amiCheck / Source / libraries.c < prev    next >
C/C++ Source or Header  |  1998-06-11  |  2KB  |  85 lines

  1. /*********************************************************
  2.  opens and closes all libraries we want except
  3.  guifront
  4.  *********************************************************/
  5. #include <exec/libraries.h>
  6. #include <clib/exec_protos.h>
  7. #include <clib/console_protos.h>
  8. #include "libraries.h"
  9.  
  10. /* what we need */
  11. struct IOStdReq ioreq;
  12.  
  13. struct Library *DiskfontBase = NULL;
  14. struct Library *GfxBase = NULL;
  15. struct Library *IntuitionBase = NULL;
  16. struct Library *UtilityBase = NULL;
  17. /*struct Library *ConsoleDevice = NULL;*/
  18. /*struct Library *KeymapBase = NULL;*/
  19. struct Library *DosBase = NULL;
  20. struct Library *AslBase = NULL;
  21. /* struct Library *IconBase = NULL;*/
  22. struct Library *EasyRexxBase = NULL;
  23. struct Library *AmigaGuideBase = NULL;
  24.  
  25. BOOL LibOpen(long base)
  26. {
  27.  if ( (IntuitionBase = OpenLibrary("intuition.library",base))==NULL)
  28.         return (FALSE);
  29.  
  30.  if ( (DiskfontBase = OpenLibrary("diskfont.library",base))==NULL)
  31.         return (FALSE);
  32.  
  33.  if ( (GfxBase = OpenLibrary("graphics.library",base))==NULL)
  34.         return (FALSE);
  35.        
  36.  if ( (UtilityBase = OpenLibrary("utility.library",base)) == NULL)
  37.     return (FALSE);
  38.  
  39.  if ( (DosBase = OpenLibrary("dos.library",base)) == NULL)
  40.     return (FALSE);
  41.  
  42.  if ( (AslBase = OpenLibrary("asl.library",base)) == NULL)
  43.     return (FALSE);
  44.  
  45. /*
  46. if ( (IconBase = OpenLibrary("icon.library",base)) == NULL)
  47.     return (FALSE);
  48. */
  49.  
  50. /*
  51.  if ( (KeymapBase = OpenLibrary("keymap.library",base)) == NULL)
  52.     return (FALSE);
  53. */
  54. /*
  55.  if ( OpenDevice("console.device",-1,(struct IORequest *)&ioreq,0) == NULL)
  56.     return (FALSE);
  57.  ConsoleDevice = (struct Library *)ioreq.io_Device;
  58. */
  59.  
  60.  /* allow this to fail */
  61.  EasyRexxBase = OpenLibrary(EASYREXXNAME,EASYREXXVERSION);
  62.  
  63.  /* allow this to fail */
  64.  AmigaGuideBase = OpenLibrary("amigaguide.library",37L);
  65.  
  66.  return (TRUE);
  67. }
  68.  
  69. void LibClose(void)
  70. {
  71.   if (DiskfontBase != NULL) CloseLibrary(DiskfontBase);
  72.   if (GfxBase != NULL) CloseLibrary(GfxBase);
  73.   if (UtilityBase != NULL) CloseLibrary(UtilityBase);
  74.   if (DosBase != NULL) CloseLibrary(DosBase);
  75.   if (AslBase != NULL) CloseLibrary(AslBase);
  76.  /* if (IconBase != NULL) CloseLibrary(IconBase);*/
  77.  
  78. /*  if (KeymapBase != NULL) CloseLibrary(KeymapBase); */
  79. /*  if (ConsoleDevice != NULL) CloseDevice( (struct IORequest *)&ioreq);*/
  80.  
  81.   if (EasyRexxBase != NULL) CloseLibrary(EasyRexxBase);
  82.   if (AmigaGuideBase != NULL) CloseLibrary(AmigaGuideBase);
  83.   if (IntuitionBase != NULL) CloseLibrary(IntuitionBase);
  84. }
  85.