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 * ---------------------------------------------------
20 #include "inspstring.h"
22 DLLManager::DLLManager(const char *fname)
24 // Try to open the library now and get any error message.
26 h=dlopen( fname, RTLD_NOW );
30 DLLManager::~DLLManager()
32 // close the library if it isn't null
38 bool DLLManager::GetSymbol(void **v, const char *sym_name)
40 // try extract a symbol from the library
41 // get any error message is there is any
45 *v = dlsym( h, sym_name );
60 DLLFactoryBase::DLLFactoryBase(const char *fname, const char *factory) : DLLManager(fname)
62 // try get the factory function if there is no error yet
68 GetSymbol( (void **)&factory_func, factory ? factory : "init_module" );
74 DLLFactoryBase::~DLLFactoryBase()