#include<stk.h>
#include<LINK/stkWrapper/LINK_STk.h>
#include<LINK/stkWrapper/Wrapper.h>
#include<LINK/algorithm/Algorithms.h>

#include <stdio.h>
#include <stdlib.h>

static PRIMITIVE animation_run(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-run: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationRun(i);
	return UNDEFINED;
}

static PRIMITIVE animation_done(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-done: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationDone(i);
	return UNDEFINED;
}

static PRIMITIVE animation_continue(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-continue: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationContinue(i);
	return UNDEFINED;
}

static PRIMITIVE animation_step(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-step: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationStep(i);
	return UNDEFINED;
}

static PRIMITIVE animation_backup(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-backup: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationBackup(i);
	return UNDEFINED;
}

static PRIMITIVE animation_break(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-break: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationBreak(i);
	return UNDEFINED;
}

static PRIMITIVE animation_clearbreaks(SCM k)
{
        Graph *gr;
        if (!INTEGERP(k))
                Err("animation-clear-breaks: bad arg 1, <integer> expected", k);
	int i = INTEGER(k);
	animationClearBreaks(i);
	return UNDEFINED;
}

void gen_Animation_Wrapper()
{
        STk_add_new_cpp_primitive("animation-run", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_run);
        STk_add_new_cpp_primitive("animation-done", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_done);
        STk_add_new_cpp_primitive("animation-continue", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_continue);
        STk_add_new_cpp_primitive("animation-step", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_step);
        STk_add_new_cpp_primitive("animation-backup", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_backup);
        STk_add_new_cpp_primitive("animation-clear-breaks", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_clearbreaks);
        STk_add_new_cpp_primitive("animation-break", tc_subr_1,
                               (PRIMITIVE (*)(...))animation_break);
}
