#ifndef _INLINE_CATHARSIS_H
#define _INLINE_CATHARSIS_H

#ifndef __INLINE_MACROS_H
#include <inline/macros.h>
#endif

#ifndef CATHARSIS_CATHARSIS_H
#include <catharsis/catharsis.h>
#endif

#ifndef CATHARSIS_BASE_NAME
#define CATHARSIS_BASE_NAME CatharsisBase
#endif

#define ModifyCharacterA(fontdescription) \
	LP1NR(0x24, ModifyCharacterA, struct FontDescription *, fontdescription, a0, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define ModifyCharacter(tags...) \
	({uint32 _tags[] = {tags}; ModifyCharacterA((struct FontDescription *) _tags);})
#endif

#define CreateCatharsisFontA(font) \
	LP1(0x30, struct TextFont *, CreateCatharsisFontA, struct TextFont *, font, a0, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CreateCatharsisFont(tags...) \
	({uint32 _tags[] = {tags}; CreateCatharsisFontA((struct TextFont *) _tags);})
#endif

#define OpenCatharsisFontA(font) \
	LP1(0x3c, struct TextFont *, OpenCatharsisFontA, struct TextFont *, font, a0, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define OpenCatharsisFont(tags...) \
	({uint32 _tags[] = {tags}; OpenCatharsisFontA((struct TextFont *) _tags);})
#endif

#define CloseCatharsisFontA(font) \
	LP1NR(0x48, CloseCatharsisFontA, struct TextFont *, font, a0, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CloseCatharsisFont(tags...) \
	({uint32 _tags[] = {tags}; CloseCatharsisFontA((struct TextFont *) _tags);})
#endif

#define ComputeCatharsisValueA(background, foreground, percent, status) \
	LP4(0x54, ULONG, ComputeCatharsisValueA, ULONG, background, d0, ULONG, foreground, d1, ULONG, percent, d2, ULONG, status, d3, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define ComputeCatharsisValue(background, foreground, percent, tags...) \
	({uint32 _tags[] = {tags}; ComputeCatharsisValueA((background), (foreground), (percent), (ULONG) _tags);})
#endif

#define CompressColorValueA(red, green, blue) \
	LP3(0x60, ULONG, CompressColorValueA, ULONG, red, d0, ULONG, green, d1, ULONG, blue, d2, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CompressColorValue(red, green, tags...) \
	({uint32 _tags[] = {tags}; CompressColorValueA((red), (green), (ULONG) _tags);})
#endif

#define CompatibleColorValueA(value) \
	LP1(0x6c, ULONG, CompatibleColorValueA, ULONG, value, d0, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CompatibleColorValue(tags...) \
	({uint32 _tags[] = {tags}; CompatibleColorValueA((ULONG) _tags);})
#endif

#define CatharsisColorValueA(background, foreground, var_red, var_green, var_blue) \
	LP5(0x78, ULONG, CatharsisColorValueA, ULONG, background, d0, ULONG, foreground, d1, ULONG *, var_red, a0, ULONG *, var_green, a1, ULONG *, var_blue, a2, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CatharsisColorValue(background, foreground, var_red, var_green, tags...) \
	({uint32 _tags[] = {tags}; CatharsisColorValueA((background), (foreground), (var_red), (var_green), (ULONG *) _tags);})
#endif

#define CatharsisTextA(rastport, string, stringlen, pennumber, catharsisfont) \
	LP5NR(0x84, CatharsisTextA, struct RastPort *, rastport, a1, STRPTR, string, a0, ULONG, stringlen, d0, ULONG, pennumber, d1, struct TextFont *, catharsisfont, a2, \
	, CATHARSIS_BASE_NAME)

#ifndef NO_INLINE_STDARG
#define CatharsisText(rastport, string, stringlen, pennumber, tags...) \
	({uint32 _tags[] = {tags}; CatharsisTextA((rastport), (string), (stringlen), (pennumber), (struct TextFont *) _tags);})
#endif

#endif /*  _INLINE_CATHARSIS_H  */
