/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include<ch.h>
...
EXPORTCH void functionName_chdl(void *varg) {
  ChInterp_t interp;
  ChVaList_t ap;

  /* use pointers to access arrays */
  data_type1 arg1;
  data_type2 arg2;
  struct tag_t *pretval;

  /* get arguments passed from the Ch function */
  Ch_VaStart(interp, ap, varg);
  pretval = Ch_VaArg(interp, ap, struct tag_t *); /* address of struct in Ch space */
  arg1 = Ch_VaArg(interp, ap, data_type1);   /* get 1st argument  */
  arg2 = Ch_VaArg(interp, ap, data_type2);   /* get 2nd argument  */

  *pretval = functionName(arg1, arg2);

  Ch_VaEnd(interp, ap);
}
