summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-07-25 00:37:43 +0000
committercyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>2009-07-25 00:37:43 +0000
commitb2a57b09742da6c2f2011ad41eb470139d88e14f (patch)
tree054e41a724108706c5ea5f659d2065fe5fae2504
parent443654f15bf036bb18f9847332e2bd03ec823b3d (diff)
Changed params parameter of Command's Execute() from std::vector<std::string> to std::vector<ci::string>, seems to have no ill effects but may require some testing to be sure.
Also a few minor cleanups here and there. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2392 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--include/modules.h6
-rw-r--r--src/command.cpp2
-rw-r--r--src/commands.c8
-rw-r--r--src/core/bs_act.c5
-rw-r--r--src/core/bs_assign.c2
-rw-r--r--src/core/bs_badwords.c26
-rw-r--r--src/core/bs_bot.c16
-rw-r--r--src/core/bs_botlist.c2
-rw-r--r--src/core/bs_help.c8
-rw-r--r--src/core/bs_info.c2
-rw-r--r--src/core/bs_kick.c44
-rw-r--r--src/core/bs_say.c3
-rw-r--r--src/core/bs_set.c50
-rw-r--r--src/core/bs_unassign.c2
-rw-r--r--src/core/cs_access.c36
-rw-r--r--src/core/cs_akick.c29
-rw-r--r--src/core/cs_ban.c6
-rw-r--r--src/core/cs_clear.c20
-rw-r--r--src/core/cs_drop.c7
-rw-r--r--src/core/cs_forbid.c5
-rw-r--r--src/core/cs_getkey.c3
-rw-r--r--src/core/cs_getpass.c2
-rw-r--r--src/core/cs_help.c8
-rw-r--r--src/core/cs_identify.c3
-rw-r--r--src/core/cs_info.c12
-rw-r--r--src/core/cs_invite.c9
-rw-r--r--src/core/cs_kick.c3
-rw-r--r--src/core/cs_list.c14
-rw-r--r--src/core/cs_logout.c3
-rw-r--r--src/core/cs_modes.c31
-rw-r--r--src/core/cs_register.c3
-rw-r--r--src/core/cs_sendpass.c2
-rw-r--r--src/core/cs_set.c60
-rw-r--r--src/core/cs_status.c2
-rw-r--r--src/core/cs_suspend.c4
-rw-r--r--src/core/cs_topic.c2
-rw-r--r--src/core/cs_xop.c30
-rw-r--r--src/core/hs_del.c2
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_group.c2
-rw-r--r--src/core/hs_help.c4
-rw-r--r--src/core/hs_list.c2
-rw-r--r--src/core/hs_off.c2
-rw-r--r--src/core/hs_on.c2
-rw-r--r--src/core/hs_set.c2
-rw-r--r--src/core/hs_setall.c2
-rw-r--r--src/core/ms_cancel.c2
-rw-r--r--src/core/ms_check.c2
-rw-r--r--src/core/ms_del.c30
-rw-r--r--src/core/ms_help.c4
-rw-r--r--src/core/ms_info.c2
-rw-r--r--src/core/ms_list.c34
-rw-r--r--src/core/ms_read.c36
-rw-r--r--src/core/ms_rsend.c2
-rw-r--r--src/core/ms_send.c2
-rw-r--r--src/core/ms_sendall.c2
-rw-r--r--src/core/ms_set.c93
-rw-r--r--src/core/ms_staff.c2
-rw-r--r--src/core/ns_access.c26
-rw-r--r--src/core/ns_alist.c20
-rw-r--r--src/core/ns_drop.c2
-rw-r--r--src/core/ns_forbid.c2
-rw-r--r--src/core/ns_getemail.c12
-rw-r--r--src/core/ns_getpass.c2
-rw-r--r--src/core/ns_ghost.c2
-rw-r--r--src/core/ns_group.c4
-rw-r--r--src/core/ns_help.c8
-rw-r--r--src/core/ns_identify.c2
-rw-r--r--src/core/ns_info.c8
-rw-r--r--src/core/ns_list.c13
-rw-r--r--src/core/ns_logout.c6
-rw-r--r--src/core/ns_recover.c2
-rw-r--r--src/core/ns_register.c10
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/core/ns_saset.c155
-rw-r--r--src/core/ns_sendpass.c2
-rw-r--r--src/core/ns_set.c140
-rw-r--r--src/core/ns_status.c2
-rw-r--r--src/core/ns_suspend.c4
-rw-r--r--src/core/ns_update.c4
-rw-r--r--src/core/os_akill.c26
-rw-r--r--src/core/os_chankill.c2
-rw-r--r--src/core/os_chanlist.c6
-rw-r--r--src/core/os_clearmodes.c9
-rw-r--r--src/core/os_defcon.c2
-rw-r--r--src/core/os_global.c2
-rw-r--r--src/core/os_help.c4
-rw-r--r--src/core/os_ignore.c24
-rw-r--r--src/core/os_jupe.c2
-rw-r--r--src/core/os_kick.c2
-rw-r--r--src/core/os_mode.c4
-rw-r--r--src/core/os_modinfo.c2
-rw-r--r--src/core/os_modlist.c18
-rw-r--r--src/core/os_modload.c2
-rw-r--r--src/core/os_modunload.c2
-rw-r--r--src/core/os_news.c30
-rw-r--r--src/core/os_noop.c8
-rw-r--r--src/core/os_oline.c2
-rw-r--r--src/core/os_quit.c2
-rw-r--r--src/core/os_reload.c2
-rw-r--r--src/core/os_restart.c3
-rw-r--r--src/core/os_session.c39
-rw-r--r--src/core/os_set.c88
-rw-r--r--src/core/os_sgline.c26
-rw-r--r--src/core/os_shutdown.c2
-rw-r--r--src/core/os_sqline.c26
-rw-r--r--src/core/os_staff.c2
-rw-r--r--src/core/os_stats.c40
-rw-r--r--src/core/os_svsnick.c2
-rw-r--r--src/core/os_szline.c26
-rw-r--r--src/core/os_umode.c2
-rw-r--r--src/core/os_update.c2
-rw-r--r--src/core/os_userlist.c6
-rw-r--r--src/core/ss_main.c4
-rw-r--r--src/modules/cs_appendtopic.c2
-rw-r--r--src/modules/cs_enforce.c24
-rw-r--r--src/modules/cs_tban.c2
-rw-r--r--src/modules/hs_request.c20
-rw-r--r--src/modules/ns_maxemail.c6
-rw-r--r--src/modules/os_info.c26
120 files changed, 777 insertions, 851 deletions
diff --git a/include/modules.h b/include/modules.h
index 61eab28df..23152df95 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -249,7 +249,7 @@ class CoreExport Command
/** Execute this command.
* @param u The user executing the command.
*/
- virtual CommandReturn Execute(User *u, std::vector<std::string> &);
+ virtual CommandReturn Execute(User *u, std::vector<ci::string> &);
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
* @param u The user requesting help
@@ -519,7 +519,7 @@ class CoreExport Module
* @param params The parameters the user is sending
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnPreCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params) { return EVENT_CONTINUE; }
+ virtual EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params) { return EVENT_CONTINUE; }
/** Called after a command has been executed.
* @param u The user executing the command
@@ -527,7 +527,7 @@ class CoreExport Module
* @param command The command the user executed
* @param params The parameters the user sent
*/
- virtual void OnPostCommand(User *u, const std::string &service, const std::string &command, const std::vector<std::string> &params) { }
+ virtual void OnPostCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params) { }
/** Called when anope saves databases.
* NOTE: This event is deprecated pending new database handling.
diff --git a/src/command.cpp b/src/command.cpp
index 26b464483..f3bc7ad1f 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -34,7 +34,7 @@ Command::~Command()
}
}
-CommandReturn Command::Execute(User *u, std::vector<std::string> &) { return MOD_CONT; }
+CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_CONT; }
bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; }
diff --git a/src/commands.c b/src/commands.c
index 17f854a99..a564b644e 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -88,7 +88,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
// Check whether or not access string is empty
}
- std::vector<std::string> params;
+ std::vector<ci::string> params;
std::string curparam;
char *s = NULL;
while ((s = strtok(NULL, " ")))
@@ -111,7 +111,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
curparam.erase(curparam.size() - 1, curparam.size());
// Add it
- params.push_back(curparam);
+ params.push_back(curparam.c_str());
}
if (params.size() < c->MinParams)
@@ -121,7 +121,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
}
EventReturn MOD_RESULT = EVENT_CONTINUE;
- FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name, params));
+ FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name.c_str(), params));
if (MOD_RESULT == EVENT_STOP)
return;
@@ -174,7 +174,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
retVal = c->Execute(u, params);
- FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name, params));
+ FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name.c_str(), params));
}
/*************************************************************************/
diff --git a/src/core/bs_act.c b/src/core/bs_act.c
index 21f18063b..b81e43c13 100644
--- a/src/core/bs_act.c
+++ b/src/core/bs_act.c
@@ -20,10 +20,9 @@ class CommandBSAct : public Command
public:
CommandBSAct() : Command("ACT", 2, 2)
{
-
}
- CommandReturn Execute(User *u, std::vector<std::string> &params)
+ CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
ChannelInfo *ci = cs_findchan(params[0].c_str());
@@ -47,9 +46,7 @@ class CommandBSAct : public Command
size_t i = 0;
while ((i = params[1].find_first_of("\001"), i) && i != std::string::npos)
- {
params[1].erase(i, 1);
- }
ircdproto->SendAction(ci->bi, ci->name, "%s", params[1].c_str());
ci->bi->lastmsg = time(NULL);
diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c
index 20c5e3bb4..95ee8a9aa 100644
--- a/src/core/bs_assign.c
+++ b/src/core/bs_assign.c
@@ -22,7 +22,7 @@ class CommandBSAssign : public Command
{
}
- CommandRetu