1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
22 DLLManager::DLLManager(InspIRCd*, const char *fname)
26 if (!strstr(fname,".so"))
28 err = "This doesn't look like a module file to me...";
32 h = dlopen(fname, RTLD_NOW|RTLD_LOCAL);
35 err = (char*)dlerror();
40 DLLManager::~DLLManager()
42 /* close the library */
49 bool DLLManager::GetSymbol(void** v, const char* sym_name)
52 * try extract a symbol from the library
53 * get any error message is there is any
58 dlerror(); // clear value
59 *v = dlsym(h, sym_name);
60 err = (char*)dlerror();