///home/berryj/link/bin/genMethods "-t" "Testobj*" "-I" "LINK/userobj/Testobj.h" "-d" "userobj" "-y" "display_testobjptr" "-m" "mark_testobjptr" "-w" "free_testobjptr" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/userobj/Testobj.h>

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

void display_testobjptr(SCM, SCM, int);
void mark_testobjptr(SCM);
void free_testobjptr(SCM);

typedef Testobj* _Testobj_;

#define _Testobj_DATA(x) ((Testobj**) (EXTDATA(x)))
#define _Testobj_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Testobj* >::type))
#define _Testobj_ISNT_DATA(x) (!_Testobj_IS_DATA(x))

#define _Testobj_CXX_DATA(x) (*(Testobj**) (EXTDATA(VAL(x))))
#define _Testobj_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Testobj* >::type))
#define _Testobj_CXX_ISNT_DATA(x) (!_Testobj_CXX_IS_DATA(x))


static SCM is_Testobj_(SCM i)
{
	if (_Testobj_CXX_IS_DATA(i))
		return Truth;
	return Ntruth;
}

PRIMITIVE STk_init__Testobj_()
{
	Wrapper<_Testobj_>::type = STk_new_CXXwrapper_id(
			Wrapper<_Testobj_>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			display_testobjptr,
			(void (*)(SCM x))mark_testobjptr,
			(void (*)(SCM x))free_testobjptr);
	Tcl_InitHashTable(&Register<_Testobj_>::objTable, TCL_ONE_WORD_KEYS);
	STk_add_new_cpp_primitive("Testobj?", tc_subr_1,
	(PRIMITIVE (*)(...))  is_Testobj_);
	return UNDEFINED;
}

void genExtra_Testobj_Methods(void);

PRIMITIVE STk_init_methods__Testobj_()
{
	genExtra_Testobj_Methods();
	return UNDEFINED;
}
