/* This file contains functions return struct */
#include <sample.h>
#include <ch.h>

EXPORTCH void func3_chdl(void *varg) {
    ChInterp_t interp;
    ChVaList_t ap;
    int n;
    TAG *retval;

    Ch_VaStart(interp, ap, varg);
    retval = Ch_VaArg(interp, ap, TAG*);
    n = Ch_VaArg(interp, ap, int);
    *retval = func3(n);
    Ch_VaEnd(interp, ap);
}

EXPORTCH void func4_chdl(void *varg) {
    ChInterp_t interp;
    ChVaList_t ap;
    int n;
    TAG *retval;

    Ch_VaStart(interp, ap, varg);
    retval = Ch_VaArg(interp, ap, TAG*);
    n = Ch_VaArg(interp, ap, int);
    *retval = func4(n);
    Ch_VaEnd(interp, ap);
}

