#include "TPT.h"

BOOL                OpenLibs(void)
{
	if (IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", NULL))
	{
		if (GfxBase = (struct GfxBase *) OpenLibrary("graphics.library", NULL))
		{
#ifdef DO_DEBUG
			TDebug(2,"OpenLibs: opened libraries OK");
#endif
			return (TRUE);
		}
	}

	CloseLibs();
	return (FALSE);
}

void CloseLibs(void)
{
	/* DO NOT put TDEBUG statements in this
	** function!! The debug port is already CLOSED!
	*/

	if (IntuitionBase)
		CloseLibrary((struct Library *) IntuitionBase);

	if (GfxBase)
		CloseLibrary((struct Library *) GfxBase);

	IntuitionBase = NULL;
	GfxBase = NULL;

	return;
}
