///home/berryj/link/bin/genMethods "-g" "-t" "char" "-d" "basic" "-y" "display_char" "-w" "free_char" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/stkWrapper/Wrapper.h>
#include <LINK/stkWrapper/Register.h>

void display_char(SCM, SCM, int);
void free_char(SCM);

typedef char _char;

#define _charDATA(x) ((char*) (EXTDATA(x)))
#define _charIS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<char >::type))
#define _charISNT_DATA(x) (!_charIS_DATA(x))

#define _charCXX_DATA(x) (*(char*) (EXTDATA(VAL(x))))
#define _charCXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<char >::type))
#define _charCXX_ISNT_DATA(x) (!_charCXX_IS_DATA(x))


PRIMITIVE STk_init__char()
{
	Wrapper<_char>::type = STk_new_CXXwrapper_id(
			Wrapper<_char>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			display_char,
			(void (*)(SCM x))0,
			(void (*)(SCM x))free_char);
	Tcl_InitHashTable(&Register<_char>::objTable, TCL_ONE_WORD_KEYS);
	return UNDEFINED;
}

void genExtra_charMethods(void);

PRIMITIVE STk_init_methods__char()
{
	genExtra_charMethods();
	return UNDEFINED;
}
