#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 <stdio.h>
#include <stdlib.h>

static PRIMITIVE GenCompleteGraphCmd(SCM n)
{
        Graph *gr;
        if (!INTEGERP(n))
                Err("gen-cycle: bad arg 1, <integer> expected", n);
	int sz = INTEGER(n);
        Graph *g = GenCompleteGraph(sz);
        Register<Graph>::createEntry(Wrapper<UBinGraph>::type,
                                     Wrapper<UBinGraph>::name, g);
        Graph **gp = new Graph*(g);

        return STk_make_CXXwrapper(Wrapper<UBinGraph*>::type,
                Wrapper<UBinGraph*>::name, (void *) gp, LINK_DYNAMIC);
}

void gen_CompleteGraph_Wrapper()
{
        STk_add_new_cpp_primitive("gen-complete-graph", tc_subr_1,
                               (PRIMITIVE (*)(...))GenCompleteGraphCmd);
}
