#include <exec/exec.h>

#ifdef __MAXON__
#include <pragma/exec_lib.h>
#else
#include <proto/exec.h>    // all other compilers
#endif


#include "/include/compiler.h"

#include "plugins/plugins.h"
#include "plugins/pluginbase.h"


struct ExecBase				*SysBase;
struct DosLibrary				*DOSBase;

extern struct PLUGINBASE	*PLUGINBASE;


ULONG SAVEDS STDARGS L_OpenLibs(void)
{
	SysBase							= (*((struct ExecBase **) 4));
	PLUGINBASE->clb_SysBase		= SysBase;

	if (!(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 37)))
		return FALSE;

	return TRUE;
}

void SAVEDS STDARGS L_CloseLibs(void)
{
	if (DOSBase)
		CloseLibrary((struct Library *)DOSBase);
}
