/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include <stdio.h>
#include "ptfun_c.h" 
#include <ch.h>

static ChInterp_t interp;
static void ptfun_chdl_funarg();
static void *ptfun_chdl_funptr; 

EXPORTCH void ptfun_setHandle_chdl(void *varg){
  ChVaList_t ap;
  funcHandle handle_ch;

  Ch_VaStart(interp, ap, varg);
  /* get the Ch function pointer */
  handle_ch = Ch_VaArg(interp, ap, funcHandle);   
  ptfun_setHandle(handle_ch);
  Ch_VaEnd(interp, ap);
}

EXPORTCH funcHandle ptfun_getHandle_chdl(void *varg){
  ChVaList_t ap;
  funcHandle retval_ch;

  Ch_VaStart(interp, ap, varg);
  retval_ch = ptfun_getHandle();
  Ch_VaEnd(interp, ap);

  return retval_ch;
}
