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

int setHandle(int i, funcHandle funptr, void *usrMsg)  { 
  void *fptr;
  int retval;

  /* ldd is loaded in .h */
  fptr = dlsym(_Chsethandle_handle, "setHandle_chdl");
  if(fptr == NULL)  {
     printf("Error: %s(): dlsym(): %s\n", __func__, dlerror());
     return -1;
  }

  dlrunfun(fptr, &retval, setHandle, i, funptr, usrMsg);
  return retval;
}

void callFun(int i)  {
  void *fptr;

  fptr = dlsym(_Chsethandle_handle, "callFun_chdl");
  if(fptr == NULL)  {
     printf("Error: %s(): dlsym(): %s\n", __func__, dlerror());
     return;
  }

  dlrunfun(fptr, NULL, callFun, i);
  return;
}
