//genMethods "-g" "-t" "Graph" "-I" "LINK/graph/Graph.h" "-d" "graph" "-y" "display_graph" "-w" "free_graph" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>
#include <LINK/graph/Graph.h>
#include <LINK/stkWrapper/Wrapper.h>
#include <LINK/stkWrapper/Register.h>
void display_graph(SCM, SCM, int);
void free_graph(SCM);
typedef Graph _Graph;
#define _GraphDATA(x) ((Graph*) (EXTDATA(x)))
#define _GraphIS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Graph >::type))
#define _GraphISNT_DATA(x) (!IS_DATA(x))
#define _GraphCXX_DATA(x) (*(Graph*) (EXTDATA(VAL(x))))
#define _GraphCXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<Graph >::type))
#define _GraphCXX_ISNT_DATA(x) (!CXX_IS_DATA(x))
#include<strstream.h>
void display_graph(SCM c, SCM port, int mode)
{
        ostrstream oss;
	if (_GraphDATA(c))
        	oss << *_GraphDATA(c);
        oss << ends;
        char *buffer = oss.str();
        Puts(buffer, (port));
        delete buffer;
}
void free_graph(SCM p)
{
        //cout << "free_graph" << endl;
        if (!EXTSTATICP(p)) {
                Register<Graph>::deleteEntry(_GraphDATA(p));
		delete _GraphDATA(p);
	}
}
// define your new methods above 
// and register them using STk_add_new_cpp_primitive() below
void genExtra_GraphMethods() {}
