From d18d3f094cddedc6e6363f616eedb909eb02016a Mon Sep 17 00:00:00 2001 From: "Robin Burchell w00t@inspircd.org" Date: Sat, 8 Nov 2008 00:34:29 +0000 Subject: 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 --- src/modules.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/modules.c') 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; } /** -- cgit