home *** CD-ROM | disk | FTP | other *** search
- /* OpenEGS.c This module handles all EGS
- libraries.
- */
- #include <exec/types.h>
- #include <exec/lists.h>
- #include <proto/all.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- #include <egs/egs.h>
- #include <egs/egsintui.h>
- #include <egs/egsintuigfx.h>
- #include <egs/egslayers.h>
- #include <egs/egsgfx.h>
- #include <egs/egsgadbox.h>
-
- #define EGSCODE
- #include "egslibraries.h"
- #undef EGSCODE
- #include <clib/alib_protos.h>
-
-
-
-
- int OpenEGSLibraries (void) {
- int ret=1;
-
-
-
- if (!(EGBRadioBase = OpenLibrary ("egb/gbradio.library",6))) {
- printf ("Could not open GBRadio.library\n");
- return 0;
- }
- if (!(EGBMenuSelectBase = OpenLibrary ("egb/gbmenuselect.library",6))) {
- printf ("Could not open GBMenuSelect.library.\n");
- return 0;
- }
- if (!(EGBSelectBase = OpenLibrary ("egb/gbselect.library",6))) {
- printf ("Could not open GBSelect.library.\n");
- return 0;
- }
- if (!(EGBSetBase = OpenLibrary ("egb/gbsets.library",6))) {
- printf ("Could not open GBSets.library.\n");
- return 0;
- }
- if (!(EGBTwoDimPropBase = OpenLibrary ("egb/gbtwodimprop.library",6))) {
- printf ("Could not open GBTwoDimProp.library.\n");
- return 0;
- }
- if (!(EGSBase=OpenLibrary("egs.library",6))) {
- printf ("Could not open EGS.library.\n");
- return 0;
- }
-
- if (!(EGSIntuiBase=OpenLibrary("egsintui.library",6))) {
- printf ("Could not open EGSIntui.library.\n");
- return 0;
- }
- if (!(EGSGfxBase=OpenLibrary("egsgfx.library",6))) {
- printf ("Could not ope EGSGfx.library.\n");
- return 0;
- }
- if (!(EGSBlitBase = OpenLibrary("egsblit.library",6))) {
- printf ("Could not open egsblit.library");
- return 0;
- }
- if (!(EGBBase = OpenLibrary("egsgadbox.library",6))) {
- printf ("Could not open EGSGadBox.library.\n");
- return 0;
- }
- if (!(EGSRequestBase = OpenLibrary ("egsrequest.library",2))) {
- printf ("Could not open EGSRequest.library.\n");
- return 0;
- }
- if (!(EGBTextInfoBase = OpenLibrary ("egb/gbtextinfo.library",6))) {
- printf ("Could not open GBTextInfo.library.\n");
- return 0;
- }
- if (!(IFFParseBase = OpenLibrary ("iffparse.library",6))) {
- printf ("Could not open IFFParse.library.\n");
- return 0;
- }
- if (!(EGBViewBase = OpenLibrary ("egb/gbview.library",6))) {
- printf ("Could not open GBView Library!\n");
- return 0;
- }
- if (!(EGSABlitBase = OpenLibrary ("egsalphablit.library",6))) {
- printf ("Could not open EGSAlphaBlit.library!\n");
- return 0;
- }
- if (!(EGBColorPotBase = OpenLibrary ("egb/gbcolorpot.library",6))) {
- printf ("Could not open GBColorPot.library!\n");
- return 0;
- }
- return ret;
- }
-
-
- /****************************************
- PUBLIC: CloseEGSLibraries.
- This routine closes all libraries in
- reverse order.
- ****************************************/
- void CloseEGSLibraries(void) {
-
- if (EGBColorPotBase) {CloseLibrary (EGBColorPotBase);EGBColorPotBase=NULL; }
- if (EGSABlitBase) {CloseLibrary(EGSABlitBase);EGSABlitBase=NULL; }
- if (EGBViewBase) {CloseLibrary (EGBViewBase); EGBViewBase=NULL; }
- if (IFFParseBase) { CloseLibrary (IFFParseBase); IFFParseBase=NULL; }
- if (EGBTextInfoBase) { CloseLibrary (EGBTextInfoBase); EGBTextInfoBase=NULL; }
- if (EGSRequestBase) { CloseLibrary (EGSRequestBase); EGSRequestBase=NULL; }
- if(EGSBase) { CloseLibrary(EGSBase); EGSBase=NULL; }
- if(EGSBlitBase) { CloseLibrary(EGSBlitBase); EGSBlitBase=NULL; }
- if(EGSGfxBase) { CloseLibrary(EGSGfxBase); EGSGfxBase=NULL; }
- if(EGSIntuiBase){ CloseLibrary(EGSIntuiBase); EGSIntuiBase=NULL; }
- if (EGBBase) { CloseLibrary(EGBBase); EGBBase=NULL; }
- if (EGBTwoDimPropBase) { CloseLibrary (EGBTwoDimPropBase); EGBTwoDimPropBase=NULL;}
- if (EGBSetBase) { CloseLibrary (EGBSetBase); EGBSetBase=NULL; }
- if (EGBSelectBase){ CloseLibrary (EGBSelectBase);EGBSelectBase=NULL; }
- if (EGBMenuSelectBase) { CloseLibrary (EGBMenuSelectBase);
- EGBMenuSelectBase = NULL;
- }
- if (EGBRadioBase) { CloseLibrary (EGBRadioBase); EGBRadioBase=NULL; }
- }
-
-
-