
#include "dlfcn.h"
#include "helper.h"

static void* libHandle; 
char LIBNAME[20] = "./libshared.a";

void loadLibrary()
{
  printf("lib name : %s\n", LIBNAME);
  libHandle = dlopen(LIBNAME, 1);
  printf("lib Handle : %s\n", libHandle);
  printf("Dl Error: %s\n", dlerror());

  if(libHandle == 0)
  { 
	printf("couldn't load library");	  
	  return;
  }

  return;



}

void* getfunction(int i)
{
 void* func;	
 char* name = "check";
 loadLibrary();

 func = dlsym(libHandle, "check");

 if(func != 0)
	 printf("function found");

 //printf("func = %s\n", func); 
 return func;
}


