summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-04 20:28:49 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-04 20:28:49 +0000
commitd4140b3c2673dbeca01f87df5d46d89c9bc532c7 (patch)
tree384b6230ab1b329c2a8f4ab7c1382ff247133f77 /include/modules.h
parent6956999bd5adfb1892e33ce48f630b9b0d411f9e (diff)
New MODULE_INIT macro. I'm going to regret this.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1546 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/modules.h b/include/modules.h
index b5039ae19..6e2c06848 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -105,7 +105,6 @@ typedef enum { MOD_OP_LOAD, MOD_OP_UNLOAD } ModuleOperation;
typedef struct Command_ Command;
typedef struct CommandHash_ CommandHash;
-typedef struct Module_ Module;
typedef struct ModuleLang_ ModuleLang;
typedef struct ModuleHash_ ModuleHash;
typedef struct ModuleQueue_ ModuleQueue;
@@ -134,7 +133,10 @@ struct ModuleLang_ {
char **argv;
};
-struct Module_ {
+class Module
+{
+ public:
+ // XXX :(
char *name;
char *filename;
void *handle;
@@ -152,9 +154,17 @@ struct Module_ {
void (*hostHelp)(User *u); /* 6 */
void (*helpHelp)(User *u); /* 7 */
-/* CommandHash *cmdList[MAX_CMD_HASH]; */
MessageHash *msgList[MAX_CMD_HASH];
ModuleLang lang[NUM_LANGS];
+
+ /** Creates and initialises a new module.
+ * @param loadernick The nickname of the user loading the module.
+ */
+ Module(const std::string &loadernick);
+
+ /** Destroys a module, freeing resources it has allocated.
+ */
+ ~Module();
};
struct ModuleHash_ {