#include <sample.h>
#include <ch.h>

EXPORTCH double func1_chdl(void *varg) {
    ChInterp_t interp;
    ChVaList_t ap;
    double x;
    double retval;

    Ch_VaStart(interp, ap, varg);
    x = Ch_VaArg(interp, ap, double);
    retval = func1(x);
    Ch_VaEnd(interp, ap);
    return retval;
}

EXPORTCH double func2_chdl(void *varg) {
    ChInterp_t interp;
    ChVaList_t ap;
    double x;
    double y;
    double retval;

    Ch_VaStart(interp, ap, varg);
    x = Ch_VaArg(interp, ap, double);
    y = Ch_VaArg(interp, ap, double);
    retval = func2(x, y);
    Ch_VaEnd(interp, ap);
    return retval;
}
