summaryrefslogtreecommitdiff
path: root/src/modules.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 00:34:29 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 00:34:29 +0000
commitd18d3f094cddedc6e6363f616eedb909eb02016a (patch)
tree0fafab8f507646bd3a5d6d49e525bda7d4ac64ed /src/modules.c
parentb8c04482bbbe531e48bb1328d17db8acb1e323a0 (diff)
Convert moduleSetType() to not require a module pointer.. actually, this is probably the wrong way to go about this (we should use a member func),
but who cares for now. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1580 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules.c')
-rw-r--r--src/modules.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/modules.c b/src/modules.c
index 2f4eb6285..f4231c638 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -233,9 +233,10 @@ int encryption_module_init(void) {
alog("Loading Encryption Module: [%s]", EncModule);
ret = loadModule(EncModule, NULL);
- moduleSetType(ENCRYPTION);
if (ret != MOD_ERR_OK)
alog("ERROR: status: [%d][%s]", ret, ModuleGetErrStr(ret));
+ else
+ moduleSetType(findModule(EncModule), ENCRYPTION);
mod_current_module = NULL;
return ret;
}
@@ -249,10 +250,10 @@ int protocol_module_init(void)
alog("Loading IRCD Protocol Module: [%s]", IRCDModule);
ret = loadModule(IRCDModule, NULL);
- moduleSetType(PROTOCOL);
if (ret == MOD_ERR_OK)
{
+ moduleSetType(findModule(IRCDModule), PROTOCOL);
/* This is really NOT the correct place to do config checks, but
* as we only have the ircd struct filled here, we have to over
* here. -GD
@@ -767,16 +768,9 @@ int unloadModule(Module * m, User * u)
}
}
-/**
- * Module setType()
- * Lets the module set a type, CORE,PROTOCOL,3RD etc..
- **/
-void moduleSetType(MODType type)
+void moduleSetType(Module *m, MODType type)
{
- if ((mod_current_module_name) && (!mod_current_module)) {
- mod_current_module = findModule(mod_current_module_name);
- }
- mod_current_module->type = type;
+ m->type = type;
}
/**