/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include <dlfcn.h>
return_type setDiffFunc(data_type arg1, int (*pf)()) {
  void *dlhandle, *fptr;
  int retval;

  dlhandle = dlopen("libproject.dl", RTLD_LAZY);
  if(dlhandle == NULL) {
    printf("Error: %s(): dlopen(): %s\n", __func__, dlerror());
    return -1;
  }

  fptr = dlsym(dlhandle, "setDiffFunc_chdl");
  if(fptr == NULL)  {
     printf("Error: %s(): dlsym(): %s\n", __func__, dlerror());
     return -1;
  }

  dlrunfun(fptr, &retval, setDiffFunc, arg1, pf);

  if(dlclose(dlhandle)!=0) {
    printf("Error: %s(): dlclose(): %s\n", __func__, dlerror());
    return -1;
  }
  return retval;
}
