]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/dynamic.h
Move forward declarations to typedefs.h
[user/henk/code/inspircd.git] / include / dynamic.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __DLL_H
15 #define __DLL_H
16
17 /** The DLLManager class is able to load a module file by filename,
18  * and locate its init_module symbol.
19  */
20 class CoreExport DLLManager : public classbase
21 {
22  protected:
23         /** The last error string
24          */
25         std::string err;
26
27  public:
28         /** This constructor loads the module using dlopen()
29          * @param fname The filename to load. This should be within
30          * the modules dir.
31          */
32         DLLManager(const char *fname);
33         virtual ~DLLManager();
34
35         /** Get the last error from dlopen() or dlsym().
36          */
37         const std::string& LastError()
38         {
39                  return err;
40         }
41
42         /** The module library handle.
43          */
44         void *h;
45
46         /** Return a module by calling the init function
47          */
48         Module* callInit();
49 };
50
51 #endif
52