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

EXPORTCH void ret_comp_arr_chdl(void *varg) {
  ChInterp_t interp;
  int i;
  ChVaList_t ap;

  double *pa;

  Ch_VaStart(interp, ap, varg);
  pa  = Ch_VaArg(interp, ap, double *); /* get address of array in Ch space */

  /* do some computational jobs as follows */
  for(i=0; i<ARRAY_DIM; i++) { 
    *pa = i+1;
    pa++;
  }

  Ch_VaEnd(interp, ap);
}
