2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2007 Oliver Lupton <oliverlupton@gmail.com>
6 * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
7 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
8 * Copyright (C) 2003, 2006 Craig Edwards <craigedwards@brainbox.cc>
10 * This file is part of InspIRCd. InspIRCd is free software: you can
11 * redistribute it and/or modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation, version 2.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 DLLManager::DLLManager(const char *fname)
32 if (!strstr(fname,".so"))
34 err = "This doesn't look like a module file to me...";
39 h = dlopen(fname, RTLD_NOW|RTLD_LOCAL);
46 DLLManager::~DLLManager()
48 /* close the library */
58 Module* DLLManager::CallInit()
64 initfn.vptr = dlsym(h, MODULE_INIT_STR);
71 return (*initfn.fptr)();
74 std::string DLLManager::GetVersion()
79 const char* srcver = (char*)dlsym(h, "inspircd_src_version");
82 return "Unversioned module";