/*       
 * glibload.c
 * ~~~~~~~~~~~~~~~~~~
 * loads libraries intuition, graphics, mathtrans, mathffp and req.
 * success returns 1
 * © Copyright 1991 Christian E. Hopps
*/
#include <intuition/intuition.h>
#include <graphics/gfxbase.h>
#include <libraries/reqbase.h>
#include <libraries/mathffp.h>

extern struct IntuitionBase 	*IntuitionBase;
extern struct GfxBase 		*GfxBase;
extern struct ReqLib  	 	*ReqBase; 
extern struct MathBase		*MathBase;
extern struct MathTransBase		*MathTransBase;

int GLibLoad()
{
	int success = 1;

	if(!(IntuitionBase =		 (struct IntuitionBase *)
					OpenLibrary("intuition.library",NULL)))
	{
		success = 0;
	}
	
	if(!(GfxBase = 				(struct GfxBase *)
				OpenLibrary("graphics.library",NULL)))
	{
		success = 0;
	}

	if(!(ReqBase = 				(struct ReqLib *)
				OpenLibrary("req.library",NULL)))
	{
		success = 0;
	}

	if(!(MathBase = 				(struct MathBase *)
				OpenLibrary("mathffp.library",NULL)))
	{
		
		success = 0;
	}

	if(!(MathTransBase = 				(struct MathTransBase *)
				OpenLibrary("mathtrans.library",NULL)))
	{
		printf("\ncould not find mathtans.library check libs:\n");
		success = 0;
	}

	return(success);
}