///home/berryj/link/bin/genMethods "-g" "-t" "Edge*" "-I" "LINK/graph/Edge.h" "-d" "graph" "-y" "display_edgeptr" "-m" "mark_edgeptr" "-w" "free_edgeptr" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/graph/Edge.h>

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

void display_edgeptr(SCM, SCM, int);
void mark_edgeptr(SCM);
void free_edgeptr(SCM);

typedef Edge* _Edge_;

#define _Edge_DATA(x) ((Edge**) (EXTDATA(x)))
#define _Edge_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Edge* >::type))
#define _Edge_ISNT_DATA(x) (!_Edge_IS_DATA(x))

#define _Edge_CXX_DATA(x) (*(Edge**) (EXTDATA(VAL(x))))
#define _Edge_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Edge* >::type))
#define _Edge_CXX_ISNT_DATA(x) (!_Edge_CXX_IS_DATA(x))


static SCM is_Edge_(SCM i)
{
	if (_Edge_CXX_IS_DATA(i))
		return Truth;
	return Ntruth;
}

PRIMITIVE STk_init__Edge_()
{
	Wrapper<_Edge_>::type = STk_new_CXXwrapper_id(
			Wrapper<_Edge_>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			display_edgeptr,
			(void (*)(SCM x))mark_edgeptr,
			(void (*)(SCM x))free_edgeptr);
	Tcl_InitHashTable(&Register<_Edge_>::objTable, TCL_ONE_WORD_KEYS);
	STk_add_new_cpp_primitive("Edge?", tc_subr_1,
	(PRIMITIVE (*)(...))  is_Edge_);
	return UNDEFINED;
}

void genExtra_Edge_Methods(void);

PRIMITIVE STk_init_methods__Edge_()
{
	genExtra_Edge_Methods();
	return UNDEFINED;
}
