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

void functionName(string_t s) {
  void *dlhandle, *fptr;

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

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

  dlrunfun(fptr, NULL, functionName, s);  /* string is valid data type for dlrunfun */
 
  if(dlclose(dlhandle) != 0) {
    fprintf(_stderr, "Error: %s(): dlclose(): %s\n", 
                        __func__, dlerror());
    return;
  }  
}
