home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / cdity / EasyTM_src.lha / EasyTM-src / librarian.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-27  |  1.6 KB  |  65 lines

  1. //************************************
  2. //
  3. // Name : Librarian.c
  4. //
  5. //************************************
  6.  
  7.  
  8. //**** Header files
  9.  
  10. //** OS Include files
  11. #include <workbench/icon.h>
  12. #include <workbench/workbench.h>
  13. #include <libraries/wbstart.h>
  14.  
  15. //** OS function prototypes
  16. #include <clib/exec_protos.h>
  17.  
  18. //** OS function inline calls
  19. #include <pragmas/exec_pragmas.h>
  20.  
  21. //** ANSI C includes
  22.  
  23. //** application include
  24.  
  25. #include "Librarian.h"
  26.  
  27.  
  28. //**** Library bases
  29.  
  30. struct Library *WorkbenchBase=NULL;
  31. struct Library *WBStartBase=NULL;
  32. struct Library *CxBase=NULL;
  33. struct Library *UtilityBase=NULL;
  34. struct Library *IconBase=NULL;
  35. struct Library *AslBase = NULL;
  36. struct Library *IntuitionBase=NULL;
  37.  
  38.  
  39. //**** Aux functions
  40.  
  41. int OpenLibs(void) {
  42.   WBStartBase    = OpenLibrary(WBSTART_NAME,WBSTART_VERSION);
  43.   WorkbenchBase    = OpenLibrary(WORKBENCH_NAME,37);
  44.   CxBase        = OpenLibrary("commodities.library", 37);
  45.   UtilityBase   = OpenLibrary("utility.library", 37);
  46.   IconBase      = OpenLibrary(ICONNAME, 0);
  47.   AslBase    = OpenLibrary("asl.library", 37L);
  48.   IntuitionBase    = OpenLibrary("intuition.library",37);
  49.   return ( (WBStartBase) && (WorkbenchBase) && (IconBase) &&
  50.            (CxBase)      && (UtilityBase)   &&
  51.            (AslBase)     && (IntuitionBase) );
  52. } // OpenLibs
  53.  
  54. void CloseLibs(void) {
  55.   if (WBStartBase)    CloseLibrary(WBStartBase);
  56.   if (WorkbenchBase)    CloseLibrary(WorkbenchBase);
  57.   if (CxBase)        CloseLibrary(CxBase);
  58.   if (UtilityBase)    CloseLibrary(UtilityBase);
  59.   if (IconBase)        CloseLibrary(IconBase);
  60.   if (AslBase)        CloseLibrary(AslBase);
  61.   if (IntuitionBase)    CloseLibrary(IntuitionBase);
  62. } // CloseLibs()
  63.  
  64. //**** End of file
  65.