1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
22 #include "inspstring.h"
23 #include "helperfuncs.h"
25 DLLManager::DLLManager(const char *fname)
27 // Try to open the library now and get any error message.
29 h=dlopen( fname, RTLD_NOW );
33 DLLManager::~DLLManager()
35 // close the library if it isn't null
41 bool DLLManager::GetSymbol(void **v, const char *sym_name)
43 // try extract a symbol from the library
44 // get any error message is there is any
48 *v = dlsym( h, sym_name );
63 DLLFactoryBase::DLLFactoryBase(const char *fname, const char *factory) : DLLManager(fname)
65 // try get the factory function if there is no error yet
71 GetSymbol( (void **)&factory_func, factory ? factory : "init_module" );
77 DLLFactoryBase::~DLLFactoryBase()