summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 00:21:29 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 00:21:29 +0000
commitb8c04482bbbe531e48bb1328d17db8acb1e323a0 (patch)
tree3a56e0f1771d9aa249215c18a2de17b4e2e60189
parente459e5833e10f3de02168ff99f10b28090d90aac (diff)
This compiles. I have absolutely no idea if it works.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1579 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--src/core/os_modinfo.c26
-rw-r--r--src/core/os_modload.c8
-rw-r--r--src/core/os_modunload.c3
-rw-r--r--src/modules/hs_request.c4
4 files changed, 18 insertions, 23 deletions
diff --git a/src/core/os_modinfo.c b/src/core/os_modinfo.c
index 6764bd837..80cf9ea1c 100644
--- a/src/core/os_modinfo.c
+++ b/src/core/os_modinfo.c
@@ -17,8 +17,8 @@
int do_modinfo(User * u);
void myOperServHelp(User * u);
-int showModuleMsgLoaded(MessageHash * msgList, char *mod_name, User * u);
-int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name, User * u);
+int showModuleMsgLoaded(MessageHash * msgList, const char *mod_name, User * u);
+int showModuleCmdLoaded(CommandHash * cmdList, const char *mod_name, User * u);
class OSModInfo : public Module
{
@@ -70,18 +70,18 @@ int do_modinfo(User * u)
tm = *localtime(&m->time);
strftime_lang(timebuf, sizeof(timebuf), u,
STRFTIME_DATE_TIME_FORMAT, &tm);
- notice_lang(s_OperServ, u, OPER_MODULE_INFO_LIST, m->name,
+ notice_lang(s_OperServ, u, OPER_MODULE_INFO_LIST, m->name.c_str(),
m->version ? m->version : "?",
m->author ? m->author : "?", timebuf);
for (idx = 0; idx < MAX_CMD_HASH; idx++) {
- showModuleCmdLoaded(HOSTSERV[idx], m->name, u);
- showModuleCmdLoaded(OPERSERV[idx], m->name, u);
- showModuleCmdLoaded(NICKSERV[idx], m->name, u);
- showModuleCmdLoaded(CHANSERV[idx], m->name, u);
- showModuleCmdLoaded(BOTSERV[idx], m->name, u);
- showModuleCmdLoaded(MEMOSERV[idx], m->name, u);
- showModuleCmdLoaded(HELPSERV[idx], m->name, u);
- showModuleMsgLoaded(IRCD[idx], m->name, u);
+ showModuleCmdLoaded(HOSTSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(OPERSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(NICKSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(CHANSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(BOTSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(MEMOSERV[idx], m->name.c_str(), u);
+ showModuleCmdLoaded(HELPSERV[idx], m->name.c_str(), u);
+ showModuleMsgLoaded(IRCD[idx], m->name.c_str(), u);
}
} else {
@@ -90,7 +90,7 @@ int do_modinfo(User * u)
return MOD_CONT;
}
-int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name, User * u)
+int showModuleCmdLoaded(CommandHash * cmdList, const char *mod_name, User * u)
{
Command *c;
CommandHash *current;
@@ -108,7 +108,7 @@ int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name, User * u)
return display;
}
-int showModuleMsgLoaded(MessageHash * msgList, char *mod_name, User * u)
+int showModuleMsgLoaded(MessageHash * msgList, const char *mod_name, User * u)
{
Message *msg;
MessageHash *mcurrent;
diff --git a/src/core/os_modload.c b/src/core/os_modload.c
index 637ec1dd3..d1a906c31 100644
--- a/src/core/os_modload.c
+++ b/src/core/os_modload.c
@@ -71,14 +71,10 @@ int do_modload(User * u)
return MOD_CONT;
}
- m = createModule(name);
- alog("Trying to load module [%s]", mod_operation_queue->m->name);
- status = loadModule(mod_operation_queue->m, mod_operation_queue->u);
- alog("Module loading status: %d (%s)", status, ModuleGetErrStr(status));
+ int status = loadModule(name, u);
if (status != MOD_ERR_OK)
{
- notice_lang(s_OperServ, user, OPER_MODULE_LOAD_FAIL, m->name);
- destroyModule(m);
+ notice_lang(s_OperServ, u, OPER_MODULE_LOAD_FAIL, m->name.c_str());
}
return MOD_CONT;
diff --git a/src/core/os_modunload.c b/src/core/os_modunload.c
index fdc51d402..2c967f84d 100644
--- a/src/core/os_modunload.c
+++ b/src/core/os_modunload.c
@@ -73,13 +73,12 @@ int do_modunload(User *u)
return MOD_CONT;
}
- alog("Trying to unload module [%s]", m->name);
+ alog("Trying to unload module [%s]", name);
status = unloadModule(m, u);
if (!status)
{
- alog("Module unloading status: %d (%s)", status, ModuleGetErrStr(status));
notice_lang(s_OperServ, u, OPER_MODULE_REMOVE_FAIL, name);
}
diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c
index 2fe05ecf6..16135568b 100644
--- a/src/modules/hs_request.c
+++ b/src/modules/hs_request.c
@@ -256,7 +256,7 @@ void my_memo_lang(User * u, char *name, int z, int number, ...)
if ((mod_current_module_name)
&& (!mod_current_module
- || strcmp(mod_current_module_name, mod_current_module->name)))
+ || mod_current_module_name != mod_current_module->name))
mod_current_module = findModule(mod_current_module_name);
u2 = finduser(name);
@@ -288,7 +288,7 @@ void my_memo_lang(User * u, char *name, int z, int number, ...)
}
free(buf);
} else {
- alog("%s: INVALID language string call, language: [%d], String [%d]", mod_current_module->name, lang, number);
+ alog("%s: INVALID language string call, language: [%d], String [%d]", mod_current_module->name.c_str(), lang, number);
}
}