#include<stk.h>
#include<LINK/stkWrapper/LINK_STk.h>
#include<LINK/stkWrapper/Wrapper.h>
#include<LINK/stkWrapper/Register.h>
#include<LINK/generator/Generators.h>
#include<LINK/graph/UBinGraph.h>
#include<LINK/graph/Graph.h>
#include <fstream.h>

static PRIMITIVE GenHalinGraphCmd(SCM g)
{
        Graph *gr = getGraph(g);
        if (!gr)
                Err("gen-halin-graph: bad arg 1, <graph*> expected", g);
        Graph *hg = GenHalinGraph(gr);
        Register<Graph>::createEntry(Wrapper<UBinGraph>::type,
                                     Wrapper<UBinGraph>::name, hg);
        Graph **gp = new Graph*(hg);
        return STk_make_CXXwrapper(Wrapper<UBinGraph*>::type,
                Wrapper<UBinGraph*>::name, (void *) gp, LINK_DYNAMIC);
}

void gen_HalinGraph_Wrapper()
{
        STk_add_new_cpp_primitive("gen-halin-graph", tc_subr_1,
                               (PRIMITIVE (*)(...))GenHalinGraphCmd);
}
