home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_dev-disk / egsdemos / moreexamples / global / egslibraries.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  4.1 KB  |  127 lines

  1.                             /* OpenEGS.c     This module handles all EGS
  2.                                              libraries.
  3.                             */
  4. #include <exec/types.h>
  5. #include <exec/lists.h>
  6. #include <proto/all.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9.  
  10. #include <egs/egs.h>
  11. #include <egs/egsintui.h>
  12. #include <egs/egsintuigfx.h>
  13. #include <egs/egslayers.h>
  14. #include <egs/egsgfx.h>
  15. #include <egs/egsgadbox.h>
  16.  
  17. #define EGSCODE
  18. #include "egslibraries.h"
  19. #undef EGSCODE
  20. #include <clib/alib_protos.h>
  21.  
  22.  
  23.  
  24.  
  25. int OpenEGSLibraries (void) {
  26.   int ret=1;
  27.  
  28.  
  29.  
  30.   if (!(EGBRadioBase = OpenLibrary ("egb/gbradio.library",6))) {
  31.     printf ("Could not open GBRadio.library\n");
  32.     return 0;
  33.   }
  34.   if (!(EGBMenuSelectBase = OpenLibrary ("egb/gbmenuselect.library",6))) {
  35.     printf ("Could not open GBMenuSelect.library.\n");
  36.     return 0;
  37.   }
  38.   if (!(EGBSelectBase = OpenLibrary ("egb/gbselect.library",6))) {
  39.     printf ("Could not open GBSelect.library.\n");
  40.     return 0;
  41.   }
  42.   if (!(EGBSetBase = OpenLibrary ("egb/gbsets.library",6))) {
  43.     printf ("Could not open GBSets.library.\n");
  44.     return 0;
  45.   }
  46.   if (!(EGBTwoDimPropBase = OpenLibrary ("egb/gbtwodimprop.library",6))) {
  47.     printf ("Could not open GBTwoDimProp.library.\n");
  48.     return 0;
  49.   }
  50.   if (!(EGSBase=OpenLibrary("egs.library",6))) {
  51.     printf ("Could not open EGS.library.\n");
  52.     return 0;
  53.   }
  54.  
  55.   if (!(EGSIntuiBase=OpenLibrary("egsintui.library",6))) {
  56.     printf ("Could not open EGSIntui.library.\n");
  57.     return 0;
  58.   }
  59.   if (!(EGSGfxBase=OpenLibrary("egsgfx.library",6))) {
  60.     printf ("Could not ope EGSGfx.library.\n");
  61.     return 0;
  62.   }
  63.   if (!(EGSBlitBase = OpenLibrary("egsblit.library",6))) {
  64.     printf ("Could not open egsblit.library");
  65.     return 0;
  66.   }
  67.   if (!(EGBBase = OpenLibrary("egsgadbox.library",6))) {
  68.     printf ("Could not open EGSGadBox.library.\n");
  69.     return 0;
  70.   }
  71.   if (!(EGSRequestBase = OpenLibrary ("egsrequest.library",2))) {
  72.     printf ("Could not open EGSRequest.library.\n");
  73.     return 0;
  74.   }
  75.   if (!(EGBTextInfoBase = OpenLibrary ("egb/gbtextinfo.library",6))) {
  76.     printf ("Could not open GBTextInfo.library.\n");
  77.     return 0;
  78.   }
  79.   if (!(IFFParseBase = OpenLibrary ("iffparse.library",6))) {
  80.     printf ("Could not open IFFParse.library.\n");
  81.     return 0;
  82.   }
  83.   if (!(EGBViewBase = OpenLibrary ("egb/gbview.library",6))) {
  84.     printf ("Could not open GBView Library!\n");
  85.     return 0;
  86.   }
  87.   if (!(EGSABlitBase = OpenLibrary ("egsalphablit.library",6))) {
  88.     printf ("Could not open EGSAlphaBlit.library!\n");
  89.     return 0;
  90.   }
  91.   if (!(EGBColorPotBase = OpenLibrary ("egb/gbcolorpot.library",6))) {
  92.     printf ("Could not open GBColorPot.library!\n");
  93.     return 0;
  94.   }
  95.   return ret;
  96. }
  97.  
  98.  
  99. /****************************************
  100.                 PUBLIC:              CloseEGSLibraries.
  101.                                      This routine closes all libraries in
  102.                                      reverse order.
  103. ****************************************/
  104. void CloseEGSLibraries(void) {
  105.  
  106.   if (EGBColorPotBase) {CloseLibrary (EGBColorPotBase);EGBColorPotBase=NULL; }
  107.   if (EGSABlitBase) {CloseLibrary(EGSABlitBase);EGSABlitBase=NULL; }
  108.   if (EGBViewBase) {CloseLibrary (EGBViewBase); EGBViewBase=NULL; }
  109.   if (IFFParseBase) { CloseLibrary (IFFParseBase); IFFParseBase=NULL; }
  110.   if (EGBTextInfoBase) { CloseLibrary (EGBTextInfoBase); EGBTextInfoBase=NULL; }
  111.   if (EGSRequestBase) { CloseLibrary (EGSRequestBase); EGSRequestBase=NULL; }
  112.   if(EGSBase)     { CloseLibrary(EGSBase);      EGSBase=NULL;      }
  113.   if(EGSBlitBase) { CloseLibrary(EGSBlitBase);  EGSBlitBase=NULL;  }
  114.   if(EGSGfxBase)  { CloseLibrary(EGSGfxBase);   EGSGfxBase=NULL;   }
  115.   if(EGSIntuiBase){ CloseLibrary(EGSIntuiBase); EGSIntuiBase=NULL; }
  116.   if (EGBBase)    { CloseLibrary(EGBBase);      EGBBase=NULL;  }
  117.   if (EGBTwoDimPropBase) { CloseLibrary (EGBTwoDimPropBase); EGBTwoDimPropBase=NULL;}
  118.   if (EGBSetBase) { CloseLibrary (EGBSetBase); EGBSetBase=NULL; }
  119.   if (EGBSelectBase){ CloseLibrary (EGBSelectBase);EGBSelectBase=NULL; }
  120.   if (EGBMenuSelectBase) { CloseLibrary (EGBMenuSelectBase);
  121.                           EGBMenuSelectBase = NULL;
  122.   }
  123.   if (EGBRadioBase) { CloseLibrary (EGBRadioBase); EGBRadioBase=NULL; }
  124.  }
  125.  
  126.  
  127.