#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "DFHack.h" #include "PluginManager.h" #include "Hooks.h" #include /* * Plugin loading functions */ namespace DFHack { DFLibrary* GLOBAL_NAMES = (DFLibrary*)RTLD_DEFAULT; DFLibrary * OpenPlugin (const char * filename) { dlerror(); DFLibrary * ret = (DFLibrary *) dlopen(filename, RTLD_NOW | RTLD_LOCAL); if(!ret) { std::cerr << dlerror() << std::endl; } return ret; } void * LookupPlugin (DFLibrary * plugin ,const char * function) { return (void *) dlsym((void *)plugin, function); } void ClosePlugin (DFLibrary * plugin) { dlclose((void *) plugin); } }