#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

int main() {
	int (*modFunc)(int);
	int retVal;
	void *handle;

	printf("DSO Example in C - Before Loading Module\n");
	fflush(NULL);

	handle = dlopen ("./libmod.so.0.0.0", RTLD_LAZY);
	modFunc = dlsym(handle, "mod");
	retVal = (*modFunc)(77);
	dlclose(handle);

	printf("After closing module. Got: %d\n", retVal);
	fflush(NULL);

	return 0;
}
