#include <inline/stub.h>
#ifndef BASE_EXT_DECL
#define BASE_EXT_DECL extern struct Library * DiskfontBase;
#endif
#ifndef BASE_PAR_DECL
#define BASE_PAR_DECL
#define BASE_PAR_DECL0
#endif
#ifndef BASE_NAME
#define BASE_NAME DiskfontBase
#endif
__inline static struct TextFont * OpenDiskFont(BASE_PAR_DECL struct TextAttr* textAttr)
{
	BASE_EXT_DECL
	register struct TextFont * res __asm("d0");
	register void *a6 __asm ("a6");
	register struct TextAttr* a0 __asm("a0");

	a6 = BASE_NAME;
	a0 = textAttr;
	__asm volatile ("
	jsr a6@(-0x1e)"
	: "=r" (res)
	: "r" (a6), "r" (a0)
	: "d0", "d1", "a0", "a1");
	*(char *)a0=*(char *)a0;
	return res;
}
__inline static long AvailFonts(BASE_PAR_DECL char* buffer, long bufBytes, long flags)
{
	BASE_EXT_DECL
	register long res __asm("d0");
	register void *a6 __asm ("a6");
	register char* a0 __asm("a0");
	register long d0 __asm("d0");
	register long d1 __asm("d1");

	a6 = BASE_NAME;
	a0 = buffer;
	d0 = bufBytes;
	d1 = flags;
	__asm volatile ("
	jsr a6@(-0x24)"
	: "=r" (res)
	: "r" (a6), "r" (a0), "r" (d0), "r" (d1)
	: "d0", "d1", "a0", "a1");
	*(char *)a0=*(char *)a0;
	return res;
}
__inline static struct FontContentsHeader* NewFontContents(BASE_PAR_DECL BPTR fontsLock, const char* fontName)
{
	BASE_EXT_DECL
	register struct FontContentsHeader* res __asm("d0");
	register void *a6 __asm ("a6");
	register BPTR a0 __asm("a0");
	register const char* a1 __asm("a1");

	a6 = BASE_NAME;
	a0 = fontsLock;
	a1 = fontName;
	__asm volatile ("
	jsr a6@(-0x2a)"
	: "=r" (res)
	: "r" (a6), "r" (a0), "r" (a1)
	: "d0", "d1", "a0", "a1");
	return res;
}
__inline static void DisposeFontContents(BASE_PAR_DECL struct FontContentsHeader* fontContentsHeader)
{
	BASE_EXT_DECL
	register void *a6 __asm ("a6");
	register struct FontContentsHeader* a1 __asm("a1");

	a6 = BASE_NAME;
	a1 = fontContentsHeader;
	__asm volatile ("
	jsr a6@(-0x30)"
	: /* no output */
	: "r" (a6), "r" (a1)
	: "d0", "d1", "a0", "a1");
	*(char *)a1=*(char *)a1;
}
#undef BASE_EXT_DECL
#undef BASE_PAR_DECL
#undef BASE_PAR_DECL0
#undef BASE_NAME
