summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-04 05:45:58 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-04 05:45:58 +0000
commit2708eea5d13c249143b83fbaa8b552992f0ac8b6 (patch)
tree5afffad5f83ca6daa89784c27f4d4e9c5f4eb8fc /src
parentf58026749b0c0770a322893b27c013168be5cdbc (diff)
Removed NICKMAX and CHANMAX, replaced user->nick, c->name, and ci->name with std::string
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2732 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/actions.c6
-rw-r--r--src/bots.cpp2
-rw-r--r--src/botserv.c41
-rw-r--r--src/channels.c87
-rw-r--r--src/chanserv.c45
-rw-r--r--src/commands.c12
-rw-r--r--src/config.c8
-rw-r--r--src/core/bs_act.c6
-rw-r--r--src/core/bs_assign.c2
-rw-r--r--src/core/bs_badwords.c22
-rw-r--r--src/core/bs_bot.c6
-rw-r--r--src/core/bs_info.c6
-rw-r--r--src/core/bs_say.c6
-rw-r--r--src/core/bs_set.c24
-rw-r--r--src/core/bs_unassign.c2
-rw-r--r--src/core/cs_access.c42
-rw-r--r--src/core/cs_akick.c56
-rw-r--r--src/core/cs_ban.c8
-rw-r--r--src/core/cs_clear.c4
-rw-r--r--src/core/cs_drop.c6
-rw-r--r--src/core/cs_forbid.c14
-rw-r--r--src/core/cs_info.c4
-rw-r--r--src/core/cs_invite.c6
-rw-r--r--src/core/cs_kick.c8
-rw-r--r--src/core/cs_list.c10
-rw-r--r--src/core/cs_modes.c10
-rw-r--r--src/core/cs_register.c9
-rw-r--r--src/core/cs_set.c94
-rw-r--r--src/core/cs_suspend.c20
-rw-r--r--src/core/cs_topic.c10
-rw-r--r--src/core/cs_unban.c4
-rw-r--r--src/core/cs_xop.c30
-rw-r--r--src/core/db_plain.cpp12
-rw-r--r--src/core/hs_del.c2
-rw-r--r--src/core/hs_delall.c2
-rw-r--r--src/core/hs_set.c4
-rw-r--r--src/core/hs_setall.c4
-rw-r--r--src/core/ms_cancel.c2
-rw-r--r--src/core/ms_check.c2
-rw-r--r--src/core/ms_list.c4
-rw-r--r--src/core/ms_read.c4
-rw-r--r--src/core/ms_sendall.c2
-rw-r--r--src/core/ns_access.c10
-rw-r--r--src/core/ns_alist.c4
-rw-r--r--src/core/ns_drop.c8
-rw-r--r--src/core/ns_forbid.c8
-rw-r--r--src/core/ns_getemail.c2
-rw-r--r--src/core/ns_getpass.c8
-rw-r--r--src/core/ns_ghost.c14
-rw-r--r--src/core/ns_group.c32
-rw-r--r--src/core/ns_identify.c10
-rw-r--r--src/core/ns_logout.c2
-rw-r--r--src/core/ns_recover.c4
-rw-r--r--src/core/ns_register.c40
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/core/ns_resetpass.c6
-rw-r--r--src/core/ns_saset.c6
-rw-r--r--src/core/ns_sendpass.c2
-rw-r--r--src/core/ns_set.c4
-rw-r--r--src/core/ns_status.c27
-rw-r--r--src/core/ns_suspend.c12
-rw-r--r--src/core/os_akill.c16
-rw-r--r--src/core/os_chankill.c13
-rw-r--r--src/core/os_chanlist.c6
-rw-r--r--src/core/os_clearmodes.c2
-rw-r--r--src/core/os_defcon.c8
-rw-r--r--src/core/os_global.c4
-rw-r--r--src/core/os_jupe.c4
-rw-r--r--src/core/os_kick.c6
-rw-r--r--src/core/os_mode.c2
-rw-r--r--src/core/os_news.c8
-rw-r--r--src/core/os_noop.c8
-rw-r--r--src/core/os_oline.c4
-rw-r--r--src/core/os_quit.c4
-rw-r--r--src/core/os_reload.c2
-rw-r--r--src/core/os_restart.c4
-rw-r--r--src/core/os_session.c4
-rw-r--r--src/core/os_set.c8
-rw-r--r--src/core/os_sgline.c4
-rw-r--r--src/core/os_shutdown.c4
-rw-r--r--src/core/os_sqline.c4
-rw-r--r--src/core/os_staff.c2
-rw-r--r--src/core/os_svsnick.c8
-rw-r--r--src/core/os_szline.c4
-rw-r--r--src/core/os_umode.c4
-rw-r--r--src/core/os_userlist.c6
-rw-r--r--src/core/ss_main.c2
-rw-r--r--src/hostserv.c2
-rw-r--r--src/memoserv.c14
-rw-r--r--src/messages.c2
-rw-r--r--src/misc.c4
-rw-r--r--src/modes.cpp14
-rw-r--r--src/modulemanager.cpp4
-rw-r--r--src/modules/cs_appendtopic.c10
-rw-r--r--src/modules/cs_enforce.c14
-rw-r--r--src/modules/cs_tban.c4
-rw-r--r--src/modules/hs_request.c10
-rw-r--r--src/nickserv.c21
-rw-r--r--src/operserv.c4
-rw-r--r--src/protocol.cpp6
-rw-r--r--src/protocol/bahamut.c20
-rw-r--r--src/protocol/inspircd11.c26
-rw-r--r--src/protocol/inspircd12.cpp30
-rw-r--r--src/protocol/ratbox.c32
-rw-r--r--src/protocol/unreal32.c22
-rw-r--r--src/regchannel.cpp4
-rw-r--r--src/sessions.c2
-rw-r--r--src/users.c46
108 files changed, 624 insertions, 657 deletions
diff --git a/src/actions.c b/src/actions.c
index 6ed840653..0e15f2cf4 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -97,8 +97,8 @@ void sqline(const std::string &mask, const std::string &reason)
cunext = cu->next;
if (is_oper(cu->user))
continue;
- av[0] = c->name;
- av[1] = cu->user->nick;
+ av[0] = c->name.c_str();
+ av[1] = cu->user->nick.c_str();
av[2] = reason.c_str();
ircdproto->SendKick(findbot(Config.s_OperServ), c, cu->user, "Q-Lined: %s", av[2]);
do_kick(Config.s_ChanServ, 3, av);
@@ -158,7 +158,7 @@ void common_unban(ChannelInfo *ci, const std::string &nick)
for (ban = ci->c->bans->entries; ban; ban = next)
{
next = ban->next;
- if (entry_match(ban, u->nick, u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip))
+ if (entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip))
ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask);
}
}
diff --git a/src/bots.cpp b/src/bots.cpp
index cae202bf2..ddd517b77 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -167,7 +167,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci)
if (ci->c && ci->c->usercount >= Config.BSMinUsers)
{
if (u)
- ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick);
+ ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick.c_str());
else
ircdproto->SendPart(ci->bi, ci->c, "");
}
diff --git a/src/botserv.c b/src/botserv.c
index bbe3f30c9..f145e7028 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -91,7 +91,7 @@ void botserv(User * u, char *buf)
if (!(s = strtok(NULL, ""))) {
*s = 0;
}
- ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick, "PING %s", s);
+ ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick.c_str(), "PING %s", s);
} else {
mod_run_cmd(Config.s_BotServ, u, BOTSERV, cmd);
}
@@ -114,7 +114,7 @@ void botmsgs(User * u, BotInfo * bi, char *buf)
if (!(s = strtok(NULL, ""))) {
*s = 0;
}
- ircdproto->SendCTCP(bi, u->nick, "PING %s", s);
+ ircdproto->SendCTCP(bi, u->nick.c_str(), "PING %s", s);
}
else if (cmd && bi->cmdTable)
{
@@ -145,7 +145,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
/* Answer to ping if needed, without breaking the buffer. */
if (!strnicmp(buf, "\1PING", 5)) {
- ircdproto->SendCTCP(ci->bi, u->nick, "PING %s", buf);
+ ircdproto->SendCTCP(ci->bi, u->nick.c_str(), "PING %s", buf);
}
/* If it's a /me, cut the CTCP part at the beginning (not
@@ -409,7 +409,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
/* return if the user is on the ignore list */
- if (get_ignore(u->nick) != NULL) {
+ if (get_ignore(u->nick.c_str()) != NULL) {
return;
}
@@ -650,7 +650,7 @@ void bot_join(ChannelInfo * ci)
"%s invited %s into the channel.",
ci->bi->nick, ci->bi->nick);
}
- ircdproto->SendJoin(ci->bi, ci->c->name, ci->c->creation_time);
+ ircdproto->SendJoin(ci->bi, ci->c->name.c_str(), ci->c->creation_time);
ci->c->SetMode(NULL, CMODE_PROTECT, ci->bi->nick);
ci->c->SetMode(NULL, CMODE_OP, ci->bi->nick);
FOREACH_MOD(I_OnBotJoin, OnBotJoin(ci, ci->bi));
@@ -707,8 +707,8 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- av[0] = ci->name;
- av[1] = u->nick;
+ av[0] = ci->name.c_str();
+ av[1] = u->nick.c_str();
av[2] = buf;
ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
@@ -732,20 +732,18 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
if ((ModeManager::FindUserModeByName(UMODE_PROTECTED)))
{
if (is_protected(u) && (requester != u)) {
- ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
- getstring(ACCESS_DENIED));
+ ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED));
return;
}
}
- if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick, nick) && (get_access(u, ci) >= get_access(requester, ci)))
+ if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci)))
return;
if (ModeManager::FindChannelModeByName(CMODE_EXCEPT))
{
if (is_excepted(ci, u) == 1) {
- ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
- getstring(BOT_EXCEPT));
+ ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(BOT_EXCEPT));
return;
}
}
@@ -754,7 +752,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
ci->c->SetMode(NULL, CMODE_BAN, mask);
- kav[0] = ci->name;
+ kav[0] = ci->name.c_str();
kav[1] = nick;
if (!reason) {
@@ -767,7 +765,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
/* Check if we need to do a signkick or not -GD */
if ((ci->HasFlag(CI_SIGNKICK) || ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK))
- ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", kav[2], requester->nick);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", kav[2], requester->nick.c_str());
else
ircdproto->SendKick(ci->bi, ci->c, u, "%s", kav[2]);
@@ -791,16 +789,15 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
if ((ModeManager::FindUserModeByName(UMODE_PROTECTED)))
{
if (is_protected(u) && (requester != u)) {
- ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
- getstring(ACCESS_DENIED));
+ ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED));
return;
}
}
- if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick, nick) && (get_access(u, ci) >= get_access(requester, ci)))
+ if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci)))
return;
- av[0] = ci->name;
+ av[0] = ci->name.c_str();
av[1] = nick;
if (!reason) {
@@ -812,7 +809,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
}
if (ci->HasFlag(CI_SIGNKICK) || ((ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK)))
- ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", av[2], requester->nick);
+ ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", av[2], requester->nick.c_str());
else
ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]);
do_kick(ci->bi->nick, 3, av);
@@ -839,15 +836,13 @@ void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode,
if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) {
if (is_protected(u) && *mode == '-' && (requester != u)) {
- ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
- getstring(ACCESS_DENIED));
+ ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED));
return;
}
}
if (*mode == '-' && ci->HasFlag(CI_PEACE)
- && stricmp(requester->nick, nick)
- && (get_access(u, ci) >= get_access(requester, ci)))
+ && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci)))
return;
ci->c->SetModes(NULL, "%s %s", mode, nick);
diff --git a/src/channels.c b/src/channels.c
index 79f956581..5e9ca98de 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -33,7 +33,7 @@ Channel::Channel(const std::string &name, time_t ts)
if (name.empty())
throw CoreException("A channel without a name ?");
- strscpy(this->name, name.c_str(), sizeof(this->name));
+ this->name = name;
list = &chanlist[HASH(this->name)];
this->prev = NULL;
this->next = *list;
@@ -43,7 +43,6 @@ Channel::Channel(const std::string &name, time_t ts)
this->creation_time = ts;
this->topic = NULL;
- *this->topic_setter = 0;
this->bans = this->excepts = this->invites = NULL;
this->users = NULL;
this->usercount = 0;
@@ -51,7 +50,7 @@ Channel::Channel(const std::string &name, time_t ts)
this->server_modetime = this->chanserv_modetime = 0;
this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_sync = 0;
- this->ci = cs_findchan(this->name);
+ this->ci = cs_findchan(this->name.c_str());
if (this->ci)
{
this->ci->c = this;
@@ -75,7 +74,7 @@ Channel::~Channel()
FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
if (debug)
- alog("debug: Deleting channel %s", this->name);
+ alog("debug: Deleting channel %s", this->name.c_str());
for (bd = this->bd; bd; bd = next)
{
@@ -148,7 +147,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string &param, bool En
{
if (param.empty())
{
- alog("Channel: