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

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

void display_int(SCM, SCM, int);
void free_int(SCM);

typedef int _int;

#define _intDATA(x) ((int*) (EXTDATA(x)))
#define _intIS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<int >::type))
#define _intISNT_DATA(x) (!_intIS_DATA(x))

#define _intCXX_DATA(x) (*(int*) (EXTDATA(VAL(x))))
#define _intCXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<int >::type))
#define _intCXX_ISNT_DATA(x) (!_intCXX_IS_DATA(x))


PRIMITIVE STk_init__int()
{
	Wrapper<_int>::type = STk_new_CXXwrapper_id(
			Wrapper<_int>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			display_int,
			(void (*)(SCM x))0,
			(void (*)(SCM x))free_int);
	Tcl_InitHashTable(&Register<_int>::objTable, TCL_ONE_WORD_KEYS);
	return UNDEFINED;
}

void genExtra_intMethods(void);

PRIMITIVE STk_init_methods__int()
{
	genExtra_intMethods();
	return UNDEFINED;
}
