///home/berryj/link/bin/genMethods "-g" "-t" "int" "-h" "Array" "-I" "LINK/basic/Array.h" "-d" "basic" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>

#include <LINK/basic/Array.h>

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


typedef int _int;
typedef Array<int > _Array_int_;
static Array<int > s__Array_int_;

#define _Array_int_DATA(x) ((Array<int >*) (EXTDATA(x)))
#define _Array_int_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Array<int > >::type))
#define _Array_int_ISNT_DATA(x) (!_Array_int_IS_DATA(x))

#define _Array_int_CXX_DATA(x) (*(Array<int >*) (EXTDATA(VAL(x))))
#define _Array_int_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Array<int > >::type))
#define _Array_int_CXX_ISNT_DATA(x) (!_Array_int_CXX_IS_DATA(x))


PRIMITIVE STk_init__Array_int_()
{
	Wrapper<_Array_int_>::type = STk_new_CXXwrapper_id(
			Wrapper<_Array_int_>::name, 
			"",
			(void (*)(SCM x, SCM port, int mode))
			ArrayWrapper<_int>::displayTypedArray,
			(void (*)(SCM x))ArrayWrapper<_int>::markTypedArray,
			(void (*)(SCM x))ArrayWrapper<_int>::freeTypedArray);
	Tcl_InitHashTable(&Register<_Array_int_>::objTable, TCL_ONE_WORD_KEYS);
	return UNDEFINED;
}

void genExtra_Array_int_Methods(void);

PRIMITIVE STk_init_methods__Array_int_()
{
	STk_add_new_cpp_primitive("Vector-int-make", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::makeLinkArray);
	STk_add_new_cpp_primitive("Vector-int-make2", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::makeFilledLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-ref", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::refLinkArray);
	STk_add_new_cpp_primitive("Vector-int?", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::linkArrayP);
	STk_add_new_cpp_primitive("vector-int", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::buildLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-fill!", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::fillLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-copy", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::copyLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-set!", tc_subr_3, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::setLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-length", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::lengthLinkArray);
	STk_add_new_cpp_primitive("Vector-int-eqv?", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::eqvLinkArray);
	STk_add_new_cpp_primitive("Vector-int-<", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::lthLinkArray);
	STk_add_new_cpp_primitive("Vector-int-<=", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::leLinkArray);
	STk_add_new_cpp_primitive("Vector-int->", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::grLinkArray);
	STk_add_new_cpp_primitive("Vector-int->=", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::geLinkArray);
	STk_add_new_cpp_primitive("Vector-int-vector-resize", tc_subr_2, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::resizeLinkArray);
	STk_add_new_cpp_primitive("list->Vector-int", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::stkList2LinkArray);
	STk_add_new_cpp_primitive("Vector-int->list", tc_subr_1, 
	(PRIMITIVE (*)(...))  ArrayWrapper<_int>::linkArray2STkList);

	addOneArgMethod("vector-copy",
		Wrapper<_Array_int_ >::name, 
		"Vector-int-vector-copy", LINK_OVL);
	addOneArgMethod("vector->list",
		Wrapper<_Array_int_ >::name, 
		"Vector-int-vector->list", LINK_OVL);
	addOneArgMethod("vector-length",
		Wrapper<_Array_int_ >::name, 
		"Vector-int-vector-length", LINK_OVL);
	addTwoArgMethod("vector-ref",
		Wrapper<_Array_int_ >::name, 
		"<integer>",
		"Vector-int-vector-ref", LINK_OVL);
	addTwoArgMethod("vector-fill!",
		Wrapper<_Array_int_ >::name, 
		Wrapper<_int >::name, 
		"Vector-int-vector-fill!", LINK_OVL);
	addTwoArgMethod("vector-resize",
		Wrapper<_Array_int_ >::name, 
		"<integer>",
		"Vector-int-vector-resize", LINK_OVL);
	addThreeArgMethod("vector-set!",
		Wrapper<_Array_int_ >::name, 
		"<integer>",
		Wrapper<_int >::name, 
		"Vector-int-vector-set!", LINK_OVL);
	addTwoArgMethod("eqv?",
		Wrapper<_Array_int_ >::name, 
		Wrapper<_Array_int_ >::name, 
		"Vector-int-eqv?", LINK_OVL);
	addBooleanMethod("<",
		Wrapper<_Array_int_ >::name, 
		"Vector-int-<", LINK_OVL);
	addBooleanMethod("<=",
		Wrapper<_Array_int_ >::name, 
		"Vector-int-<=", LINK_OVL);
	addBooleanMethod(">",
		Wrapper<_Array_int_ >::name, 
		"Vector-int->", LINK_OVL);
	addBooleanMethod(">=",
		Wrapper<_Array_int_ >::name, 
		"Vector-int->=", LINK_OVL);
	genExtra_Array_int_Methods();
	return UNDEFINED;
}
