home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************
- opens and closes all libraries we want except
- guifront
- *********************************************************/
- #include <exec/libraries.h>
- #include <clib/exec_protos.h>
- #include <clib/console_protos.h>
- #include "libraries.h"
-
- /* what we need */
- struct IOStdReq ioreq;
-
- struct Library *DiskfontBase = NULL;
- struct Library *GfxBase = NULL;
- struct Library *IntuitionBase = NULL;
- struct Library *UtilityBase = NULL;
- /*struct Library *ConsoleDevice = NULL;*/
- /*struct Library *KeymapBase = NULL;*/
- struct Library *DosBase = NULL;
- struct Library *AslBase = NULL;
- /* struct Library *IconBase = NULL;*/
- struct Library *EasyRexxBase = NULL;
- struct Library *AmigaGuideBase = NULL;
-
- BOOL LibOpen(long base)
- {
- if ( (IntuitionBase = OpenLibrary("intuition.library",base))==NULL)
- return (FALSE);
-
- if ( (DiskfontBase = OpenLibrary("diskfont.library",base))==NULL)
- return (FALSE);
-
- if ( (GfxBase = OpenLibrary("graphics.library",base))==NULL)
- return (FALSE);
-
- if ( (UtilityBase = OpenLibrary("utility.library",base)) == NULL)
- return (FALSE);
-
- if ( (DosBase = OpenLibrary("dos.library",base)) == NULL)
- return (FALSE);
-
- if ( (AslBase = OpenLibrary("asl.library",base)) == NULL)
- return (FALSE);
-
- /*
- if ( (IconBase = OpenLibrary("icon.library",base)) == NULL)
- return (FALSE);
- */
-
- /*
- if ( (KeymapBase = OpenLibrary("keymap.library",base)) == NULL)
- return (FALSE);
- */
- /*
- if ( OpenDevice("console.device",-1,(struct IORequest *)&ioreq,0) == NULL)
- return (FALSE);
- ConsoleDevice = (struct Library *)ioreq.io_Device;
- */
-
- /* allow this to fail */
- EasyRexxBase = OpenLibrary(EASYREXXNAME,EASYREXXVERSION);
-
- /* allow this to fail */
- AmigaGuideBase = OpenLibrary("amigaguide.library",37L);
-
- return (TRUE);
- }
-
- void LibClose(void)
- {
- if (DiskfontBase != NULL) CloseLibrary(DiskfontBase);
- if (GfxBase != NULL) CloseLibrary(GfxBase);
- if (UtilityBase != NULL) CloseLibrary(UtilityBase);
- if (DosBase != NULL) CloseLibrary(DosBase);
- if (AslBase != NULL) CloseLibrary(AslBase);
- /* if (IconBase != NULL) CloseLibrary(IconBase);*/
-
- /* if (KeymapBase != NULL) CloseLibrary(KeymapBase); */
- /* if (ConsoleDevice != NULL) CloseDevice( (struct IORequest *)&ioreq);*/
-
- if (EasyRexxBase != NULL) CloseLibrary(EasyRexxBase);
- if (AmigaGuideBase != NULL) CloseLibrary(AmigaGuideBase);
- if (IntuitionBase != NULL) CloseLibrary(IntuitionBase);
- }
-