diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
commit | c32c3c99a1e1d395c88e901de200c21b9ca1e84f (patch) | |
tree | e272e1dc395df2947314ff24f0f9ce12b94f8f53 /src/protocol | |
parent | 431918ceacfd5a580d4f28a8ae6077c9bbc44b99 (diff) |
Made all protocol modules able to be compiled via mostly constifying strings.
Due to the above, also had to constify strings in many other areas.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1202 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol')
36 files changed, 3231 insertions, 3240 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 7c5a33d3a..db66b6554 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -147,10 +147,10 @@ IRCDCAPAB myIrcdcap[] = { }; -void bahamut_set_umode(User * user, int ac, char **av) +void bahamut_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -471,7 +471,7 @@ CUMode myCumodes[128] = { -void bahamut_cmd_mode(char *source, char *dest, char *buf) +void bahamut_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -489,20 +489,20 @@ void bahamut_cmd_mode(char *source, char *dest, char *buf) } /* SVSHOLD - set */ -void bahamut_cmd_svshold(char *nick) +void bahamut_cmd_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s %d :%s", nick, NSReleaseTimeout, "Being held for registered user"); } /* SVSHOLD - release */ -void bahamut_cmd_release_svshold(char *nick) +void bahamut_cmd_release_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s 0", nick); } /* SVSMODE -b */ -void bahamut_cmd_unban(char *name, char *nick) +void bahamut_cmd_unban(const char *name, const char *nick) { bahamut_cmd_svsmode_chan(name, "-b", nick); } @@ -510,7 +510,7 @@ void bahamut_cmd_unban(char *name, char *nick) /* SVSMODE channel modes */ -void bahamut_cmd_svsmode_chan(char *name, char *mode, char *nick) +void bahamut_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "SVSMODE %s %s %s", name, mode, nick); @@ -519,13 +519,13 @@ void bahamut_cmd_svsmode_chan(char *name, char *mode, char *nick) } } -void bahamut_cmd_bot_chan_mode(char *nick, char *chan) +void bahamut_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); } /* EVENT: SJOIN */ -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -549,7 +549,7 @@ int anope_event_sjoin(char *source, int ac, char **av) ** parv[0] = new nickname ** parv[1] = hopcount */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -568,14 +568,14 @@ int anope_event_nick(char *source, int ac, char **av) } /* EVENT : CAPAB */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } /* EVENT : OS */ -int anope_event_os(char *source, int ac, char **av) +int anope_event_os(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -584,7 +584,7 @@ int anope_event_os(char *source, int ac, char **av) } /* EVENT : NS */ -int anope_event_ns(char *source, int ac, char **av) +int anope_event_ns(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -593,7 +593,7 @@ int anope_event_ns(char *source, int ac, char **av) } /* EVENT : MS */ -int anope_event_ms(char *source, int ac, char **av) +int anope_event_ms(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -602,7 +602,7 @@ int anope_event_ms(char *source, int ac, char **av) } /* EVENT : HS */ -int anope_event_hs(char *source, int ac, char **av) +int anope_event_hs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -611,7 +611,7 @@ int anope_event_hs(char *source, int ac, char **av) } /* EVENT : CS */ -int anope_event_cs(char *source, int ac, char **av) +int anope_event_cs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -619,7 +619,7 @@ int anope_event_cs(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -696,7 +696,7 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ /* SQLINE */ -void bahamut_cmd_sqline(char *mask, char *reason) +void bahamut_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -706,13 +706,13 @@ void bahamut_cmd_sqline(char *mask, char *reason) } /* UNSGLINE */ -void bahamut_cmd_unsgline(char *mask) +void bahamut_cmd_unsgline(const char *mask) { send_cmd(NULL, "UNSGLINE 0 :%s", mask); } /* UNSZLINE */ -void bahamut_cmd_unszline(char *mask) +void bahamut_cmd_unszline(const char *mask) { /* this will likely fail so its only here for legacy */ send_cmd(NULL, "UNSZLINE 0 %s", mask); @@ -721,7 +721,7 @@ void bahamut_cmd_unszline(char *mask) } /* SZLINE */ -void bahamut_cmd_szline(char *mask, char *reason, char *whom) +void bahamut_cmd_szline(const char *mask, const char *reason, const char *whom) { /* this will likely fail so its only here for legacy */ send_cmd(NULL, "SZLINE %s :%s", mask, reason); @@ -736,13 +736,13 @@ void BahamutIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void bahamut_cmd_svsadmin(char *server, int set) +void bahamut_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } /* SGLINE */ -void bahamut_cmd_sgline(char *mask, char *reason) +void bahamut_cmd_sgline(const char *mask, const char *reason) { send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason); } @@ -754,7 +754,7 @@ void BahamutIRCdProto::cmd_remove_akill(const char *user, const char *host) } /* PART */ -void bahamut_cmd_part(char *nick, char *chan, char *buf) +void bahamut_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -768,21 +768,21 @@ void bahamut_cmd_part(char *nick, char *chan, char *buf) } /* TOPIC */ -void bahamut_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void bahamut_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); } /* UNSQLINE */ -void bahamut_cmd_unsqline(char *user) +void bahamut_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } /* JOIN - SJOIN */ -void bahamut_cmd_join(char *user, char *channel, time_t chantime) +void bahamut_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel); } @@ -800,8 +800,8 @@ void bahamut_cmd_burst() * parv[5]=time set * parv[6]=reason */ -void bahamut_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void bahamut_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who, (long int) time(NULL), reason); @@ -816,7 +816,7 @@ void bahamut_cmd_akill(char *user, char *host, char *who, time_t when, /* Note: if the stamp is null 0, the below usage is correct of Bahamut */ -void bahamut_cmd_svskill(char *source, char *user, char *buf) +void bahamut_cmd_svskill(const char *source, const char *user, const char *buf) { if (!source || !user || !buf) { @@ -833,7 +833,7 @@ void bahamut_cmd_svskill(char *source, char *user, char *buf) * parv[3] - mode (or services id if old svs version) * parv[4] - optional arguement (services id) */ -void bahamut_cmd_svsmode(User * u, int ac, char **av) +void bahamut_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), @@ -846,13 +846,13 @@ void bahamut_cmd_svsmode(User * u, int ac, char **av) * parv[1] = server name * parv[2] = comment */ -void bahamut_cmd_squit(char *servname, char *message) +void bahamut_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } /* PONG */ -void bahamut_cmd_pong(char *servname, char *who) +void bahamut_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -871,13 +871,13 @@ void bahamut_cmd_svinfo() } /* PASS */ -void bahamut_cmd_pass(char *pass) +void bahamut_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } /* SERVER */ -void bahamut_cmd_server(char *servname, int hop, char *descript) +void bahamut_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -912,7 +912,7 @@ void bahamut_cmd_connect(int servernum) /* EVENT : SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -923,7 +923,7 @@ int anope_event_server(char *source, int ac, char **av) } /* EVENT : PRIVMSG */ -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -939,13 +939,13 @@ int anope_event_privmsg(char *source, int ac, char **av) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -953,7 +953,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -961,7 +961,7 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -969,7 +969,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -977,7 +977,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -986,7 +986,7 @@ int anope_event_quit(char *source, int ac, char **av) } /* EVENT: MODE */ -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1000,7 +1000,7 @@ int anope_event_mode(char *source, int ac, char **av) } /* EVENT: KILL */ -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1010,7 +1010,7 @@ int anope_event_kill(char *source, int ac, char **av) } /* EVENT: KICK */ -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1019,7 +1019,7 @@ int anope_event_kick(char *source, int ac, char **av) } /* EVENT: JOIN */ -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1028,7 +1028,7 @@ int anope_event_join(char *source, int ac, char **av) } /* EVENT: MOTD */ -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1038,7 +1038,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -void bahamut_cmd_notice_ops(char *source, char *dest, char *buf) +void bahamut_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1047,7 +1047,7 @@ void bahamut_cmd_notice_ops(char *source, char *dest, char *buf) } /* NOTICE */ -void bahamut_cmd_notice(char *source, char *dest, char *buf) +void bahamut_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1060,12 +1060,12 @@ void bahamut_cmd_notice(char *source, char *dest, char *buf) } } -void bahamut_cmd_notice2(char *source, char *dest, char *msg) +void bahamut_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void bahamut_cmd_privmsg(char *source, char *dest, char *buf) +void bahamut_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1074,23 +1074,23 @@ void bahamut_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void bahamut_cmd_privmsg2(char *source, char *dest, char *msg) +void bahamut_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void bahamut_cmd_serv_notice(char *source, char *dest, char *msg) +void bahamut_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void bahamut_cmd_serv_privmsg(char *source, char *dest, char *msg) +void bahamut_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } /* GLOBOPS */ -void bahamut_cmd_global(char *source, char *buf) +void bahamut_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1100,7 +1100,7 @@ void bahamut_cmd_global(char *source, char *buf) } /* 391 */ -void bahamut_cmd_391(char *source, char *timestr) +void bahamut_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1109,7 +1109,7 @@ void bahamut_cmd_391(char *source, char *timestr) } /* 250 */ -void bahamut_cmd_250(char *buf) +void bahamut_cmd_250(const char *buf) { if (!buf) { return; @@ -1119,7 +1119,7 @@ void bahamut_cmd_250(char *buf) } /* 307 */ -void bahamut_cmd_307(char *buf) +void bahamut_cmd_307(const char *buf) { if (!buf) { return; @@ -1129,7 +1129,7 @@ void bahamut_cmd_307(char *buf) } /* 311 */ -void bahamut_cmd_311(char *buf) +void bahamut_cmd_311(const char *buf) { if (!buf) { return; @@ -1139,7 +1139,7 @@ void bahamut_cmd_311(char *buf) } /* 312 */ -void bahamut_cmd_312(char *buf) +void bahamut_cmd_312(const char *buf) { if (!buf) { return; @@ -1149,7 +1149,7 @@ void bahamut_cmd_312(char *buf) } /* 317 */ -void bahamut_cmd_317(char *buf) +void bahamut_cmd_317(const char *buf) { if (!buf) { return; @@ -1159,7 +1159,7 @@ void bahamut_cmd_317(char *buf) } /* 219 */ -void bahamut_cmd_219(char *source, char *letter) +void bahamut_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1174,7 +1174,7 @@ void bahamut_cmd_219(char *source, char *letter) } /* 401 */ -void bahamut_cmd_401(char *source, char *who) +void bahamut_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1183,7 +1183,7 @@ void bahamut_cmd_401(char *source, char *who) } /* 318 */ -void bahamut_cmd_318(char *source, char *who) +void bahamut_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1193,7 +1193,7 @@ void bahamut_cmd_318(char *source, char *who) } /* 242 */ -void bahamut_cmd_242(char *buf) +void bahamut_cmd_242(const char *buf) { if (!buf) { return; @@ -1203,7 +1203,7 @@ void bahamut_cmd_242(char *buf) } /* 243 */ -void bahamut_cmd_243(char *buf) +void bahamut_cmd_243(const char *buf) { if (!buf) { return; @@ -1213,7 +1213,7 @@ void bahamut_cmd_243(char *buf) } /* 211 */ -void bahamut_cmd_211(char *buf) +void bahamut_cmd_211(const char *buf) { if (!buf) { return; @@ -1222,7 +1222,7 @@ void bahamut_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void bahamut_cmd_nick(char *nick, char *name, char *modes) +void bahamut_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1231,7 +1231,7 @@ void bahamut_cmd_nick(char *nick, char *name, char *modes) bahamut_cmd_sqline(nick, "Reserved for services"); } -void bahamut_cmd_kick(char *source, char *chan, char *user, char *buf) +void bahamut_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1240,30 +1240,30 @@ void bahamut_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void bahamut_cmd_372(char *source, char *msg) +void bahamut_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void bahamut_cmd_372_error(char *source) +void bahamut_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void bahamut_cmd_375(char *source) +void bahamut_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void bahamut_cmd_376(char *source) +void bahamut_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* INVITE */ -void bahamut_cmd_invite(char *source, char *chan, char *nick) +void bahamut_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1273,7 +1273,7 @@ void bahamut_cmd_invite(char *source, char *chan, char *nick) } /* QUIT */ -void bahamut_cmd_quit(char *source, char *buf) +void bahamut_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -1282,7 +1282,7 @@ void bahamut_cmd_quit(char *source, char *buf) } } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1291,7 +1291,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1299,7 +1299,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void bahamut_cmd_351(char *source) +void bahamut_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1307,8 +1307,8 @@ void bahamut_cmd_351(char *source) } -void bahamut_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void bahamut_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1322,7 +1322,7 @@ void bahamut_cmd_bot_nick(char *nick, char *user, char *host, char *real, * parv[2] = new nickname * parv[3] = timestamp */ -void bahamut_cmd_svsnick(char *source, char *guest, time_t when) +void bahamut_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1330,19 +1330,19 @@ void bahamut_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void bahamut_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void bahamut_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, (long int) time(NULL), modes, user, host, ServerName, real); } -void bahamut_cmd_svso(char *source, char *nick, char *flag) +void bahamut_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void bahamut_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void bahamut_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { /* Not Supported by this IRCD */ } @@ -1354,7 +1354,7 @@ void bahamut_cmd_vhost_off(User * u) /* SVSMODE +d */ /* sent if svid is something weird */ -void bahamut_cmd_svid_umode(char *nick, time_t ts) +void bahamut_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1369,13 +1369,13 @@ void bahamut_cmd_nc_change(User * u) } /* SVSMODE +d */ -void bahamut_cmd_svid_umode2(User * u, char *ts) +void bahamut_cmd_svid_umode2(User * u, const char *ts) { /* not used by bahamut ircds */ } -void bahamut_cmd_svid_umode3(User * u, char *ts) +void bahamut_cmd_svid_umode3(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1385,7 +1385,7 @@ void bahamut_cmd_svid_umode3(User * u, char *ts) } /* NICK <newnick> */ -void bahamut_cmd_chg_nick(char *oldnick, char *newnick) +void bahamut_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1394,7 +1394,7 @@ void bahamut_cmd_chg_nick(char *oldnick, char *newnick) send_cmd(oldnick, "NICK %s", newnick); } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1404,38 +1404,38 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_gnotice(char *source, int ac, char **av) +int anope_event_gnotice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -void bahamut_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void bahamut_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Can not find any reference to these in Bahamut */ } -void bahamut_cmd_svspart(char *source, char *nick, char *chan) +void bahamut_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Can not find any reference to these in Bahamut */ } -void bahamut_cmd_swhois(char *source, char *who, char *mask) +void bahamut_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } @@ -1446,7 +1446,7 @@ void bahamut_cmd_eob() send_cmd(NULL, "BURST 0"); } -int anope_event_burst(char *source, int ac, char **av) +int anope_event_burst(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -1464,27 +1464,27 @@ int anope_event_burst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_luserslock(char *source, int ac, char **av) +int anope_event_luserslock(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int bahamut_flood_mode_check(char *value) +int bahamut_flood_mode_check(const char *value) { char *dp, *end; @@ -1498,7 +1498,7 @@ int bahamut_flood_mode_check(char *value) } } -void bahamut_cmd_jupe(char *jserver, char *who, char *reason) +void bahamut_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1512,7 +1512,7 @@ void bahamut_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void bahamut_cmd_global_legacy(char *source, char *fmt) +void bahamut_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1521,7 +1521,7 @@ void bahamut_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int bahamut_valid_nick(char *nick) +int bahamut_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1531,13 +1531,13 @@ int bahamut_valid_nick(char *nick) 1 = valid chan 0 = nick is in chan */ -int bahamut_valid_chan(char *chan) +int bahamut_valid_chan(const char *chan) { /* no silly invalid chans */ return 1; } -void bahamut_cmd_ctcp(char *source, char *dest, char *buf) +void bahamut_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; if (!buf) { @@ -1552,7 +1552,7 @@ void bahamut_cmd_ctcp(char *source, char *dest, char *buf) /* this avoids "undefined symbol" messages of those whom try to load mods that call on this function */ -void bahamut_cmd_chghost(char *nick, char *vhost) +void bahamut_cmd_chghost(const char *nick, const char *vhost) { if (debug) { alog("debug: This IRCD does not support vhosting"); diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index 8fc605b32..6c7c2850d 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -58,74 +58,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void bahamut_set_umode(User * user, int ac, char **av); -void bahamut_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void bahamut_set_umode(User * user, int ac, const char **av); +void bahamut_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void bahamut_cmd_vhost_off(User * u); -void bahamut_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void bahamut_cmd_svskill(char *source, char *user, char *buf); -void bahamut_cmd_svsmode(User * u, int ac, char **av); -void bahamut_cmd_372(char *source, char *msg); -void bahamut_cmd_372_error(char *source); -void bahamut_cmd_375(char *source); -void bahamut_cmd_376(char *source); -void bahamut_cmd_nick(char *nick, char *name, char *modes); -void bahamut_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void bahamut_cmd_mode(char *source, char *dest, char *buf); -void bahamut_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void bahamut_cmd_kick(char *source, char *chan, char *user, char *buf); -void bahamut_cmd_notice_ops(char *source, char *dest, char *buf); -void bahamut_cmd_notice(char *source, char *dest, char *buf); -void bahamut_cmd_notice2(char *source, char *dest, char *msg); -void bahamut_cmd_privmsg(char *source, char *dest, char *buf); -void bahamut_cmd_privmsg2(char *source, char *dest, char *msg); -void bahamut_cmd_serv_notice(char *source, char *dest, char *msg); -void bahamut_cmd_serv_privmsg(char *source, char *dest, char *msg); -void bahamut_cmd_bot_chan_mode(char *nick, char *chan); -void bahamut_cmd_351(char *source); -void bahamut_cmd_quit(char *source, char *buf); -void bahamut_cmd_pong(char *servname, char *who); -void bahamut_cmd_join(char *user, char *channel, time_t chantime); -void bahamut_cmd_unsqline(char *user); -void bahamut_cmd_invite(char *source, char *chan, char *nick); -void bahamut_cmd_part(char *nick, char *chan, char *buf); -void bahamut_cmd_391(char *source, char *timestr); -void bahamut_cmd_250(char *buf); -void bahamut_cmd_307(char *buf); -void bahamut_cmd_311(char *buf); -void bahamut_cmd_312(char *buf); -void bahamut_cmd_317(char *buf); -void bahamut_cmd_219(char *source, char *letter); -void bahamut_cmd_401(char *source, char *who); -void bahamut_cmd_318(char *source, char *who); -void bahamut_cmd_242(char *buf); -void bahamut_cmd_243(char *buf); -void bahamut_cmd_211(char *buf); -void bahamut_cmd_global(char *source, char *buf); -void bahamut_cmd_global_legacy(char *source, char *fmt); -void bahamut_cmd_sqline(char *mask, char *reason); -void bahamut_cmd_squit(char *servname, char *message); -void bahamut_cmd_svso(char *source, char *nick, char *flag); -void bahamut_cmd_chg_nick(char *oldnick, char *newnick); -void bahamut_cmd_svsnick(char *source, char *guest, time_t when); -void bahamut_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void bahamut_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void bahamut_cmd_svskill(const char *source, const char *user, const char *buf); +void bahamut_cmd_svsmode(User * u, int ac, const char **av); +void bahamut_cmd_372(const char *source, const char *msg); +void bahamut_cmd_372_error(const char *source); +void bahamut_cmd_375(const char *source); +void bahamut_cmd_376(const char *source); +void bahamut_cmd_nick(const char *nick, const char *name, const char *modes); +void bahamut_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void bahamut_cmd_mode(const char *source, const char *dest, const char *buf); +void bahamut_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void bahamut_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void bahamut_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void bahamut_cmd_notice(const char *source, const char *dest, const char *buf); +void bahamut_cmd_notice2(const char *source, const char *dest, const char *msg); +void bahamut_cmd_privmsg(const char *source, const char *dest, const char *buf); +void bahamut_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void bahamut_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void bahamut_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void bahamut_cmd_bot_chan_mode(const char *nick, const char *chan); +void bahamut_cmd_351(const char *source); +void bahamut_cmd_quit(const char *source, const char *buf); +void bahamut_cmd_pong(const char *servname, const char *who); +void bahamut_cmd_join(const char *user, const char *channel, time_t chantime); +void bahamut_cmd_unsqline(const char *user); +void bahamut_cmd_invite(const char *source, const char *chan, const char *nick); +void bahamut_cmd_part(const char *nick, const char *chan, const char *buf); +void bahamut_cmd_391(const char *source, const char *timestr); +void bahamut_cmd_250(const char *buf); +void bahamut_cmd_307(const char *buf); +void bahamut_cmd_311(const char *buf); +void bahamut_cmd_312(const char *buf); +void bahamut_cmd_317(const char *buf); +void bahamut_cmd_219(const char *source, const char *letter); +void bahamut_cmd_401(const char *source, const char *who); +void bahamut_cmd_318(const char *source, const char *who); +void bahamut_cmd_242(const char *buf); +void bahamut_cmd_243(const char *buf); +void bahamut_cmd_211(const char *buf); +void bahamut_cmd_global(const char *source, const char *buf); +void bahamut_cmd_global_legacy(const char *source, const char *fmt); +void bahamut_cmd_sqline(const char *mask, const char *reason); +void bahamut_cmd_squit(const char *servname, const char *message); +void bahamut_cmd_svso(const char *source, const char *nick, const char *flag); +void bahamut_cmd_chg_nick(const char *oldnick, const char *newnick); +void bahamut_cmd_svsnick(const char *source, const char *guest, time_t when); +void bahamut_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void bahamut_cmd_connect(int servernum); -void bahamut_cmd_svshold(char *nick); -void bahamut_cmd_release_svshold(char *nick); -void bahamut_cmd_unsgline(char *mask); -void bahamut_cmd_unszline(char *mask); -void bahamut_cmd_szline(char *mask, char *reason, char *whom); -void bahamut_cmd_sgline(char *mask, char *reason); -void bahamut_cmd_unban(char *name, char *nick); -void bahamut_cmd_svsmode_chan(char *name, char *mode, char *nick); -void bahamut_cmd_svid_umode(char *nick, time_t ts); +void bahamut_cmd_svshold(const char *nick); +void bahamut_cmd_release_svshold(const char *nick); +void bahamut_cmd_unsgline(const char *mask); +void bahamut_cmd_unszline(const char *mask); +void bahamut_cmd_szline(const char *mask, const char *reason, const char *whom); +void bahamut_cmd_sgline(const char *mask, const char *reason); +void bahamut_cmd_unban(const char *name, const char *nick); +void bahamut_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void bahamut_cmd_svid_umode(const char *nick, time_t ts); void bahamut_cmd_nc_change(User * u); -void bahamut_cmd_svid_umode2(User * u, char *ts); -void bahamut_cmd_svid_umode3(User * u, char *ts); +void bahamut_cmd_svid_umode2(User * u, const char *ts); +void bahamut_cmd_svid_umode3(User * u, const char *ts); void bahamut_cmd_eob(); -int bahamut_flood_mode_check(char *value); -void bahamut_cmd_jupe(char *jserver, char *who, char *reason); -int bahamut_valid_nick(char *nick); -void bahamut_cmd_ctcp(char *source, char *dest, char *buf); +int bahamut_flood_mode_check(const char *value); +void bahamut_cmd_jupe(const char *jserver, const char *who, const char *reason); +int bahamut_valid_nick(const char *nick); +void bahamut_cmd_ctcp(const char *source, const char *dest, const char *buf); class BahamutIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 1a3c72a89..451b26fb6 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -145,10 +145,10 @@ IRCDCAPAB myIrcdcap[] = { /*******************************************************************/ -void charybdis_set_umode(User * user, int ac, char **av) +void charybdis_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -451,7 +451,7 @@ CUMode myCumodes[128] = { -void charybdis_cmd_notice(char *source, char *dest, char *buf) +void charybdis_cmd_notice(const char *source, const char *dest, const char *buf) { Uid *ud; User *u; @@ -471,7 +471,7 @@ void charybdis_cmd_notice(char *source, char *dest, char *buf) } } -void charybdis_cmd_notice2(char *source, char *dest, char *msg) +void charybdis_cmd_notice2(const char *source, const char *dest, const char *msg) { Uid *ud; User *u; @@ -482,7 +482,7 @@ void charybdis_cmd_notice2(char *source, char *dest, char *msg) (UseTS6 ? (u ? u->uid : dest) : dest), msg); } -void charybdis_cmd_privmsg(char *source, char *dest, char *buf) +void charybdis_cmd_privmsg(const char *source, const char *dest, const char *buf) { Uid *ud, *ud2; @@ -496,7 +496,7 @@ void charybdis_cmd_privmsg(char *source, char *dest, char *buf) (UseTS6 ? (ud2 ? ud2->uid : dest) : dest), buf); } -void charybdis_cmd_privmsg2(char *source, char *dest, char *msg) +void charybdis_cmd_privmsg2(const char *source, const char *dest, const char *msg) { Uid *ud, *ud2; @@ -507,18 +507,18 @@ void charybdis_cmd_privmsg2(char *source, char *dest, char *msg) (UseTS6 ? (ud2 ? ud2->uid : dest) : dest), msg); } -void charybdis_cmd_serv_notice(char *source, char *dest, char *msg) +void charybdis_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $$%s :%s", dest, msg); } -void charybdis_cmd_serv_privmsg(char *source, char *dest, char *msg) +void charybdis_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); } -void charybdis_cmd_global(char *source, char *buf) +void charybdis_cmd_global(const char *source, const char *buf) { Uid *u; @@ -539,7 +539,7 @@ void charybdis_cmd_global(char *source, char *buf) } /* GLOBOPS - to handle old WALLOPS */ -void charybdis_cmd_global_legacy(char *source, char *fmt) +void charybdis_cmd_global_legacy(const char *source, const char *fmt) { Uid *u; @@ -557,7 +557,7 @@ void charybdis_cmd_global_legacy(char *source, char *fmt) send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt); } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -587,7 +587,7 @@ int anope_event_sjoin(char *source, int ac, char **av) av[8] = info */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { Server *s; User *user; @@ -595,8 +595,7 @@ int anope_event_nick(char *source, int ac, char **av) if (UseTS6 && ac == 9) { s = findserver_uid(servlist, source); /* Source is always the server */ - *source = '\0'; - user = do_nick(source, av[0], av[4], av[5], s->name, av[8], + user = do_nick("", av[0], av[4], av[5], s->name, av[8], strtoul(av[2], NULL, 10), 0, 0, NULL, av[7]); if (user) { anope_set_umode(user, 1, &av[3]); @@ -630,7 +629,7 @@ int anope_event_nick(char *source, int ac, char **av) av[10] = info */ -int anope_event_euid(char *source, int ac, char **av) +int anope_event_euid(const char *source, int ac, const char **av) { Server *s; User *user; @@ -639,9 +638,8 @@ int anope_event_euid(char *source, int ac, char **av) if (UseTS6 && ac == 11) { s = findserver_uid(servlist, source); /* Source is always the server */ - *source = '\0'; ts = strtoul(av[2], NULL, 10); - user = do_nick(source, av[0], av[4], !strcmp(av[8], "*") ? av[5] : av[8], s->name, av[10], + user = do_nick("", av[0], av[4], !strcmp(av[8], "*") ? av[5] : av[8], s->name, av[10], ts, !stricmp(av[0], av[9]) ? ts : 0, 0, av[5], av[7]); if (user) { anope_set_umode(user, 1, &av[3]); @@ -650,7 +648,7 @@ int anope_event_euid(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { User *u; @@ -700,7 +698,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tburst(char *source, int ac, char **av) +int anope_event_tburst(const char *source, int ac, const char **av) { char *setter; Channel *c; @@ -754,7 +752,7 @@ int anope_event_tburst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -818,7 +816,7 @@ void moduleAddIRCDMsgs(void) /* *INDENT-ON* */ -void charybdis_cmd_sqline(char *mask, char *reason) +void charybdis_cmd_sqline(const char *mask, const char *reason) { Uid *ud; @@ -827,7 +825,7 @@ void charybdis_cmd_sqline(char *mask, char *reason) "RESV * %s :%s", mask, reason); } -void charybdis_cmd_unsgline(char *mask) +void charybdis_cmd_unsgline(const char *mask) { Uid *ud; @@ -836,21 +834,21 @@ void charybdis_cmd_unsgline(char *mask) "UNXLINE * %s", mask); } -void charybdis_cmd_unszline(char *mask) +void charybdis_cmd_unszline(const char *mask) { /* not supported */ } -void charybdis_cmd_szline(char *mask, char *reason, char *whom) +void charybdis_cmd_szline(const char *mask, const char *reason, const char *whom) { /* not supported */ } -void charybdis_cmd_svsadmin(char *server, int set) +void charybdis_cmd_svsadmin(const char *server, int set) { } -void charybdis_cmd_sgline(char *mask, char *reason) +void charybdis_cmd_sgline(const char *mask, const char *reason) { Uid *ud; @@ -859,14 +857,14 @@ void charybdis_cmd_sgline(char *mask, char *reason) "XLINE * %s 0 :%s", mask, reason); } -void Charybdis::cmd_remove_akill(const char *user, const char *host) +void CharybdisProto::cmd_remove_akill(const char *user, const char *host) { Uid *ud = find_uid(s_OperServ); send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); } -void charybdis_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void charybdis_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { Uid *ud; @@ -881,13 +879,13 @@ void charybdis_cmd_vhost_off(User * u) u->nick, u->host); } -void charybdis_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void charybdis_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { send_cmd((UseTS6 ? TS6SID : ServerName), "ENCAP * CHGHOST %s :%s", nick, vhost); } -void charybdis_cmd_unsqline(char *user) +void charybdis_cmd_unsqline(const char *user) { Uid *ud; @@ -896,7 +894,7 @@ void charybdis_cmd_unsqline(char *user) "UNRESV * %s", user); } -void charybdis_cmd_join(char *user, char *channel, time_t chantime) +void charybdis_cmd_join(const char *user, const char *channel, time_t chantime) { Uid *ud; @@ -914,8 +912,8 @@ host: the 'host' portion of the kline reason: the reason for the kline. */ -void charybdis_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void charybdis_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { Uid *ud; @@ -926,7 +924,7 @@ void charybdis_cmd_akill(char *user, char *host, char *who, time_t when, (long int) (expires - (long) time(NULL)), user, host, reason); } -void charybdis_cmd_svskill(char *source, char *user, char *buf) +void charybdis_cmd_svskill(const char *source, const char *user, const char *buf) { Uid *ud, *ud2; @@ -944,7 +942,7 @@ void charybdis_cmd_svskill(char *source, char *user, char *buf) (UseTS6 ? (ud2 ? ud2->uid : user) : user), buf); } -void charybdis_cmd_svsmode(User * u, int ac, char **av) +void charybdis_cmd_svsmode(User * u, int ac, const char **av) { send_cmd((UseTS6 ? TS6SID : ServerName), "SVSMODE %s %s", u->nick, av[0]); @@ -996,7 +994,7 @@ void charybdis_cmd_capab() } /* PASS */ -void charybdis_cmd_pass(char *pass) +void charybdis_cmd_pass(const char *pass) { if (UseTS6) { send_cmd(NULL, "PASS %s TS 6 :%s", pass, TS6SID); @@ -1006,7 +1004,7 @@ void charybdis_cmd_pass(char *pass) } /* SERVER name hop descript */ -void charybdis_cmd_server(char *servname, int hop, char *descript) +void charybdis_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -1033,8 +1031,8 @@ void charybdis_cmd_connect(int servernum) charybdis_cmd_svinfo(); } -void charybdis_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void charybdis_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, NULL); if (UseTS6) { @@ -1051,7 +1049,7 @@ void charybdis_cmd_bot_nick(char *nick, char *user, char *host, char *real, charybdis_cmd_sqline(nick, "Reserved for services"); } -void charybdis_cmd_part(char *nick, char *chan, char *buf) +void charybdis_cmd_part(const char *nick, const char *chan, const char *buf) { Uid *ud; @@ -1064,7 +1062,7 @@ void charybdis_cmd_part(char *nick, char *chan, char *buf) } } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1072,7 +1070,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { User *u = NULL; @@ -1085,7 +1083,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { User *u = NULL; @@ -1100,7 +1098,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1113,7 +1111,7 @@ void charybdis_cmd_eob() /* doesn't support EOB */ } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) { /* ignore cmodes in JOIN as per TS6 v8 */ @@ -1125,7 +1123,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1135,7 +1133,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { User *u; Uid *ud; @@ -1151,7 +1149,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { User *u; @@ -1165,7 +1163,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { Uid *ud; @@ -1177,7 +1175,7 @@ int anope_event_whois(char *source, int ac, char **av) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1192,7 +1190,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sid(char *source, int ac, char **av) +int anope_event_sid(const char *source, int ac, const char **av) { Server *s; @@ -1204,7 +1202,7 @@ int anope_event_sid(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1212,7 +1210,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { User *u; @@ -1226,32 +1224,32 @@ int anope_event_quit(char *source, int ac, char **av) return MOD_CONT; } -void charybdis_cmd_372(char *source, char *msg) +void charybdis_cmd_372(const char *source, const char *msg) { send_cmd((UseTS6 ? TS6SID : ServerName), "372 %s :- %s", source, msg); } -void charybdis_cmd_372_error(char *source) +void charybdis_cmd_372_error(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void charybdis_cmd_375(char *source) +void charybdis_cmd_375(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "375 %s :- %s Message of the Day", source, ServerName); } -void charybdis_cmd_376(char *source) +void charybdis_cmd_376(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "376 %s :End of /MOTD command.", source); } /* 391 */ -void charybdis_cmd_391(char *source, char *timestr) +void charybdis_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1260,7 +1258,7 @@ void charybdis_cmd_391(char *source, char *timestr) } /* 250 */ -void charybdis_cmd_250(char *buf) +void charybdis_cmd_250(const char *buf) { if (!buf) { return; @@ -1270,7 +1268,7 @@ void charybdis_cmd_250(char *buf) } /* 307 */ -void charybdis_cmd_307(char *buf) +void charybdis_cmd_307(const char *buf) { if (!buf) { return; @@ -1280,7 +1278,7 @@ void charybdis_cmd_307(char *buf) } /* 311 */ -void charybdis_cmd_311(char *buf) +void charybdis_cmd_311(const char *buf) { if (!buf) { return; @@ -1290,7 +1288,7 @@ void charybdis_cmd_311(char *buf) } /* 312 */ -void charybdis_cmd_312(char *buf) +void charybdis_cmd_312(const char *buf) { if (!buf) { return; @@ -1300,7 +1298,7 @@ void charybdis_cmd_312(char *buf) } /* 317 */ -void charybdis_cmd_317(char *buf) +void charybdis_cmd_317(const char *buf) { if (!buf) { return; @@ -1310,7 +1308,7 @@ void charybdis_cmd_317(char *buf) } /* 219 */ -void charybdis_cmd_219(char *source, char *letter) +void charybdis_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1325,7 +1323,7 @@ void charybdis_cmd_219(char *source, char *letter) } /* 401 */ -void charybdis_cmd_401(char *source, char *who) +void charybdis_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1335,7 +1333,7 @@ void charybdis_cmd_401(char *source, char *who) } /* 318 */ -void charybdis_cmd_318(char *source, char *who) +void charybdis_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1346,7 +1344,7 @@ void charybdis_cmd_318(char *source, char *who) } /* 242 */ -void charybdis_cmd_242(char *buf) +void charybdis_cmd_242(const char *buf) { if (!buf) { return; @@ -1356,7 +1354,7 @@ void charybdis_cmd_242(char *buf) } /* 243 */ -void charybdis_cmd_243(char *buf) +void charybdis_cmd_243(const char *buf) { if (!buf) { return; @@ -1366,7 +1364,7 @@ void charybdis_cmd_243(char *buf) } /* 211 */ -void charybdis_cmd_211(char *buf) +void charybdis_cmd_211(const char *buf) { if (!buf) { return; @@ -1375,7 +1373,7 @@ void charybdis_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void charybdis_cmd_mode(char *source, char *dest, char *buf) +void charybdis_cmd_mode(const char *source, const char *dest, const char *buf) { Uid *ud; if (!buf) { @@ -1391,7 +1389,7 @@ void charybdis_cmd_mode(char *source, char *dest, char *buf) } } -void charybdis_cmd_tmode(char *source, char *dest, const char *fmt, ...) +void charybdis_cmd_tmode(const char *source, const char *dest, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -1409,7 +1407,7 @@ void charybdis_cmd_tmode(char *source, char *dest, const char *fmt, ...) send_cmd(NULL, "MODE %s %s", dest, buf); } -void charybdis_cmd_nick(char *nick, char *name, char *mode) +void charybdis_cmd_nick(const char *nick, const char *name, const char *mode) { EnforceQlinedNick(nick, NULL); if (UseTS6) { @@ -1426,7 +1424,7 @@ void charybdis_cmd_nick(char *nick, char *name, char *mode) charybdis_cmd_sqline(nick, "Reserved for services"); } -void charybdis_cmd_kick(char *source, char *chan, char *user, char *buf) +void charybdis_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { Uid *ud; User *u; @@ -1444,7 +1442,7 @@ void charybdis_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void charybdis_cmd_notice_ops(char *source, char *dest, char *buf) +void charybdis_cmd_notice_ops(const char *source, const char *dest, const char *buf) { Uid *ud; ud = find_uid(source); @@ -1456,7 +1454,7 @@ void charybdis_cmd_notice_ops(char *source, char *dest, char *buf) send_cmd((UseTS6 ? (ud ? ud->uid : source) : source), "NOTICE @%s :%s", dest, buf); } -void charybdis_cmd_bot_chan_mode(char *nick, char *chan) +void charybdis_cmd_bot_chan_mode(const char *nick, const char *chan) { Uid *u; @@ -1470,7 +1468,7 @@ void charybdis_cmd_bot_chan_mode(char *nick, char *chan) } /* QUIT */ -void charybdis_cmd_quit(char *source, char *buf) +void charybdis_cmd_quit(const char *source, const char *buf) { Uid *ud; ud = find_uid(source); @@ -1484,7 +1482,7 @@ void charybdis_cmd_quit(char *source, char *buf) } /* PONG */ -void charybdis_cmd_pong(char *servname, char *who) +void charybdis_cmd_pong(const char *servname, const char *who) { if (UseTS6) { /* deliberately no SID in the first parameter -- jilles */ @@ -1495,7 +1493,7 @@ void charybdis_cmd_pong(char *servname, char *who) } /* INVITE */ -void charybdis_cmd_invite(char *source, char *chan, char *nick) +void charybdis_cmd_invite(const char *source, const char *chan, const char *nick) { Uid *ud; User *u; @@ -1512,7 +1510,7 @@ void charybdis_cmd_invite(char *source, char *chan, char *nick) } /* SQUIT */ -void charybdis_cmd_squit(char *servname, char *message) +void charybdis_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1521,7 +1519,7 @@ void charybdis_cmd_squit(char *servname, char *message) send_cmd(NULL, "SQUIT %s :%s", servname, message); } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { User *u, *u2; @@ -1544,7 +1542,7 @@ int anope_event_mode(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tmode(char *source, int ac, char **av) +int anope_event_tmode(const char *source, int ac, const char **av) { if (ac > 2 && (*av[1] == '#' || *av[1] == '&')) { do_cmode(source, ac, av); @@ -1552,7 +1550,7 @@ int anope_event_tmode(char *source, int ac, char **av) return MOD_CONT; } -void charybdis_cmd_351(char *source) +void charybdis_cmd_351(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, @@ -1560,23 +1558,23 @@ void charybdis_cmd_351(char *source) } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { int argvsize = 8; int argc; - char **argv; + const char **argv; char *str; if (ac < 1) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = scalloc(argvsize, sizeof(char *)); + argv = (const char **)scalloc(argvsize, sizeof(const char *)); argc = 0; while ((str = myStrGetToken(av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = srealloc(argv, argvsize * sizeof(char *)); + argv = (const char **)srealloc(argv, argvsize * sizeof(const char *)); } argv[argc] = str; argc++; @@ -1586,27 +1584,27 @@ int anope_event_capab(char *source, int ac, char **av) /* Free our built ac/av */ for (argvsize = 0; argvsize < argc; argvsize++) { - free(argv[argvsize]); + free((char *)argv[argvsize]); } - free(argv); + free((char **)argv); return MOD_CONT; } /* SVSHOLD - set */ -void charybdis_cmd_svshold(char *nick) +void charybdis_cmd_svshold(const char *nick) { send_cmd(NULL, "ENCAP * NICKDELAY 300 %s", nick); } /* SVSHOLD - release */ -void charybdis_cmd_release_svshold(char *nick) +void charybdis_cmd_release_svshold(const char *nick) { send_cmd(NULL, "ENCAP * NICKDELAY 0 %s", nick); } /* SVSNICK */ -void charybdis_cmd_svsnick(char *nick, char *newnick, time_t when) +void charybdis_cmd_svsnick(const char *nick, const char *newnick, time_t when) { User *u; @@ -1621,32 +1619,32 @@ void charybdis_cmd_svsnick(char *nick, char *newnick, time_t when) u->nick, newnick, (long int)when, (long int)u->timestamp); } -void charybdis_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void charybdis_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { /* not supported */ } -void charybdis_cmd_svso(char *source, char *nick, char *flag) +void charybdis_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void charybdis_cmd_unban(char *name, char *nick) +void charybdis_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void charybdis_cmd_svsmode_chan(char *name, char *mode, char *nick) +void charybdis_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void charybdis_cmd_svid_umode(char *nick, time_t ts) +void charybdis_cmd_svid_umode(const char *nick, time_t ts) { /* not supported */ } @@ -1659,18 +1657,18 @@ void charybdis_cmd_nc_change(User * u) } /* SVSMODE +d */ -void charybdis_cmd_svid_umode2(User * u, char *ts) +void charybdis_cmd_svid_umode2(User * u, const char *ts) { /* not supported */ } -void charybdis_cmd_svid_umode3(User * u, char *ts) +void charybdis_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ -void charybdis_cmd_chg_nick(char *oldnick, char *newnick) +void charybdis_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1687,13 +1685,13 @@ void charybdis_cmd_chg_nick(char *oldnick, char *newnick) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { if (UseTS6) { TS6UPLINK = sstrdup(av[3]); @@ -1701,37 +1699,37 @@ int anope_event_pass(char *source, int ac, char **av) return MOD_CONT; } -void charybdis_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void charybdis_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void charybdis_cmd_svspart(char *source, char *nick, char *chan) +void charybdis_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void charybdis_cmd_swhois(char *source, char *who, char *mask) +void charybdis_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_bmask(char *source, int ac, char **av) +int anope_event_bmask(const char *source, int ac, const char **av) { Channel *c; char *bans; @@ -1764,7 +1762,7 @@ int anope_event_bmask(char *source, int ac, char **av) return MOD_CONT; } -int charybdis_flood_mode_check(char *value) +int charybdis_flood_mode_check(const char *value) { char *dp, *end; @@ -1780,7 +1778,7 @@ int charybdis_flood_mode_check(char *value) return 0; } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1790,7 +1788,7 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void charybdis_cmd_jupe(char *jserver, char *who, char *reason) +void charybdis_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1807,7 +1805,7 @@ void charybdis_cmd_jupe(char *jserver, char *who, char *reason) 1 = valid nick 0 = nick is in valid */ -int charybdis_valid_nick(char *nick) +int charybdis_valid_nick(const char *nick) { /* TS6 Save extension -Certus */ if (isdigit(*nick)) @@ -1819,14 +1817,14 @@ int charybdis_valid_nick(char *nick) 1 = valid chan 0 = chan is invalid */ -int charybdis_valid_chan(char *chan) +int charybdis_valid_chan(const char *chan) { /* no hard coded invalid chan */ return 1; } -void charybdis_cmd_ctcp(char *source, char *dest, char *buf) +void charybdis_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/charybdis.h b/src/protocol/charybdis.h index 46dbbdf06..2f39a9e5d 100644 --- a/src/protocol/charybdis.h +++ b/src/protocol/charybdis.h @@ -46,74 +46,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -void charybdis_set_umode(User * user, int ac, char **av); -void charybdis_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void charybdis_set_umode(User * user, int ac, const char **av); +void charybdis_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void charybdis_cmd_vhost_off(User * u); -void charybdis_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void charybdis_cmd_svskill(char *source, char *user, char *buf); -void charybdis_cmd_svsmode(User * u, int ac, char **av); -void charybdis_cmd_372(char *source, char *msg); -void charybdis_cmd_372_error(char *source); -void charybdis_cmd_375(char *source); -void charybdis_cmd_376(char *source); -void charybdis_cmd_nick(char *nick, char *name, char *modes); -void charybdis_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void charybdis_cmd_mode(char *source, char *dest, char *buf); -void charybdis_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void charybdis_cmd_kick(char *source, char *chan, char *user, char *buf); -void charybdis_cmd_notice_ops(char *source, char *dest, char *buf); -void charybdis_cmd_notice(char *source, char *dest, char *buf); -void charybdis_cmd_notice2(char *source, char *dest, char *msg); -void charybdis_cmd_privmsg(char *source, char *dest, char *buf); -void charybdis_cmd_privmsg2(char *source, char *dest, char *msg); -void charybdis_cmd_serv_notice(char *source, char *dest, char *msg); -void charybdis_cmd_serv_privmsg(char *source, char *dest, char *msg); -void charybdis_cmd_bot_chan_mode(char *nick, char *chan); -void charybdis_cmd_351(char *source); -void charybdis_cmd_quit(char *source, char *buf); -void charybdis_cmd_pong(char *servname, char *who); -void charybdis_cmd_join(char *user, char *channel, time_t chantime); -void charybdis_cmd_unsqline(char *user); -void charybdis_cmd_invite(char *source, char *chan, char *nick); -void charybdis_cmd_part(char *nick, char *chan, char *buf); -void charybdis_cmd_391(char *source, char *timestr); -void charybdis_cmd_250(char *buf); -void charybdis_cmd_307(char *buf); -void charybdis_cmd_311(char *buf); -void charybdis_cmd_312(char *buf); -void charybdis_cmd_317(char *buf); -void charybdis_cmd_219(char *source, char *letter); -void charybdis_cmd_401(char *source, char *who); -void charybdis_cmd_318(char *source, char *who); -void charybdis_cmd_242(char *buf); -void charybdis_cmd_243(char *buf); -void charybdis_cmd_211(char *buf); -void charybdis_cmd_global(char *source, char *buf); -void charybdis_cmd_global_legacy(char *source, char *fmt); -void charybdis_cmd_sqline(char *mask, char *reason); -void charybdis_cmd_squit(char *servname, char *message); -void charybdis_cmd_svso(char *source, char *nick, char *flag); -void charybdis_cmd_chg_nick(char *oldnick, char *newnick); -void charybdis_cmd_svsnick(char *source, char *guest, time_t when); -void charybdis_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void charybdis_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void charybdis_cmd_svskill(const char *source, const char *user, const char *buf); +void charybdis_cmd_svsmode(User * u, int ac, const char **av); +void charybdis_cmd_372(const char *source, const char *msg); +void charybdis_cmd_372_error(const char *source); +void charybdis_cmd_375(const char *source); +void charybdis_cmd_376(const char *source); +void charybdis_cmd_nick(const char *nick, const char *name, const char *modes); +void charybdis_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void charybdis_cmd_mode(const char *source, const char *dest, const char *buf); +void charybdis_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void charybdis_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void charybdis_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void charybdis_cmd_notice(const char *source, const char *dest, const char *buf); +void charybdis_cmd_notice2(const char *source, const char *dest, const char *msg); +void charybdis_cmd_privmsg(const char *source, const char *dest, const char *buf); +void charybdis_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void charybdis_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void charybdis_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void charybdis_cmd_bot_chan_mode(const char *nick, const char *chan); +void charybdis_cmd_351(const char *source); +void charybdis_cmd_quit(const char *source, const char *buf); +void charybdis_cmd_pong(const char *servname, const char *who); +void charybdis_cmd_join(const char *user, const char *channel, time_t chantime); +void charybdis_cmd_unsqline(const char *user); +void charybdis_cmd_invite(const char *source, const char *chan, const char *nick); +void charybdis_cmd_part(const char *nick, const char *chan, const char *buf); +void charybdis_cmd_391(const char *source, const char *timestr); +void charybdis_cmd_250(const char *buf); +void charybdis_cmd_307(const char *buf); +void charybdis_cmd_311(const char *buf); +void charybdis_cmd_312(const char *buf); +void charybdis_cmd_317(const char *buf); +void charybdis_cmd_219(const char *source, const char *letter); +void charybdis_cmd_401(const char *source, const char *who); +void charybdis_cmd_318(const char *source, const char *who); +void charybdis_cmd_242(const char *buf); +void charybdis_cmd_243(const char *buf); +void charybdis_cmd_211(const char *buf); +void charybdis_cmd_global(const char *source, const char *buf); +void charybdis_cmd_global_legacy(const char *source, const char *fmt); +void charybdis_cmd_sqline(const char *mask, const char *reason); +void charybdis_cmd_squit(const char *servname, const char *message); +void charybdis_cmd_svso(const char *source, const char *nick, const char *flag); +void charybdis_cmd_chg_nick(const char *oldnick, const char *newnick); +void charybdis_cmd_svsnick(const char *source, const char *guest, time_t when); +void charybdis_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void charybdis_cmd_connect(int servernum); -void charybdis_cmd_svshold(char *nick); -void charybdis_cmd_release_svshold(char *nick); -void charybdis_cmd_unsgline(char *mask); -void charybdis_cmd_unszline(char *mask); -void charybdis_cmd_szline(char *mask, char *reason, char *whom); -void charybdis_cmd_sgline(char *mask, char *reason); -void charybdis_cmd_unban(char *name, char *nick); -void charybdis_cmd_svsmode_chan(char *name, char *mode, char *nick); -void charybdis_cmd_svid_umode(char *nick, time_t ts); +void charybdis_cmd_svshold(const char *nick); +void charybdis_cmd_release_svshold(const char *nick); +void charybdis_cmd_unsgline(const char *mask); +void charybdis_cmd_unszline(const char *mask); +void charybdis_cmd_szline(const char *mask, const char *reason, const char *whom); +void charybdis_cmd_sgline(const char *mask, const char *reason); +void charybdis_cmd_unban(const char *name, const char *nick); +void charybdis_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void charybdis_cmd_svid_umode(const char *nick, time_t ts); void charybdis_cmd_nc_change(User * u); -void charybdis_cmd_svid_umode2(User * u, char *ts); -void charybdis_cmd_svid_umode3(User * u, char *ts); +void charybdis_cmd_svid_umode2(User * u, const char *ts); +void charybdis_cmd_svid_umode3(User * u, const char *ts); void charybdis_cmd_eob(); -int charybdis_flood_mode_check(char *value); -void charybdis_cmd_jupe(char *jserver, char *who, char *reason); -int charybdis_valid_nick(char *nick); -void charybdis_cmd_ctcp(char *source, char *dest, char *buf); +int charybdis_flood_mode_check(const char *value); +void charybdis_cmd_jupe(const char *jserver, const char *who, const char *reason); +int charybdis_valid_nick(const char *nick); +void charybdis_cmd_ctcp(const char *source, const char *dest, const char *buf); class CharybdisProto : public IRCDProtoNew { public: diff --git a/src/protocol/dreamforge.c b/src/protocol/dreamforge.c index 5af98dcdb..02fd2311f 100644 --- a/src/protocol/dreamforge.c +++ b/src/protocol/dreamforge.c @@ -144,10 +144,10 @@ IRCDCAPAB myIrcdcap[] = { 0, 0, 0} }; -void dreamforge_set_umode(User * user, int ac, char **av) +void dreamforge_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -434,7 +434,7 @@ CUMode myCumodes[128] = { -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { if (ac != 2) { do_nick(source, av[0], av[3], av[4], av[5], av[7], @@ -447,7 +447,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -510,13 +510,13 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } -void dreamforge_cmd_sqline(char *mask, char *reason) +void dreamforge_cmd_sqline(const char *mask, const char *reason) { send_cmd(NULL, "SQLINE %s :%s", mask, reason); } @@ -526,7 +526,7 @@ void DreamForgeProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void dreamforge_cmd_svsadmin(char *server, int set) +void dreamforge_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } @@ -536,15 +536,15 @@ void DreamForgeProto::cmd_remove_akill(const char *user, const char *host) send_cmd(NULL, "RAKILL %s %s", host, user); } -void dreamforge_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void dreamforge_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); } /* PART */ -void dreamforge_cmd_part(char *nick, char *chan, char *buf) +void dreamforge_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -558,24 +558,24 @@ void dreamforge_cmd_part(char *nick, char *chan, char *buf) } -void dreamforge_cmd_unsqline(char *user) +void dreamforge_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } -void dreamforge_cmd_join(char *user, char *channel, time_t chantime) +void dreamforge_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "JOIN %s", channel); } -void dreamforge_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void dreamforge_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s :%s", host, user, reason); } -void dreamforge_cmd_svskill(char *source, char *user, char *buf) +void dreamforge_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -588,14 +588,14 @@ void dreamforge_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "KILL %s :%s", user, buf); } -void dreamforge_cmd_svsmode(User * u, int ac, char **av) +void dreamforge_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); } -void dreamforge_cmd_squit(char *servname, char *message) +void dreamforge_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } @@ -606,7 +606,7 @@ void anope_pong(char *servname) } /* PASS */ -void dreamforge_cmd_pass(char *pass) +void dreamforge_cmd_pass(const char *pass) { send_cmd(NULL, "PASS :%s", pass); } @@ -617,7 +617,7 @@ void dreamforge_cmd_capab() } /* SERVER name hop descript */ -void dreamforge_cmd_server(char *servname, int hop, char *descript) +void dreamforge_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -637,7 +637,7 @@ void dreamforge_cmd_connect(int servernum) dreamforge_cmd_server(ServerName, 1, ServerDesc); } -void dreamforge_cmd_bot_chan_mode(char *nick, char *chan) +void dreamforge_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } @@ -645,7 +645,7 @@ void dreamforge_cmd_bot_chan_mode(char *nick, char *chan) /* GLOBOPS */ -void dreamforge_cmd_global(char *source, char *buf) +void dreamforge_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -654,7 +654,7 @@ void dreamforge_cmd_global(char *source, char *buf) send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -663,7 +663,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -671,7 +671,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -679,7 +679,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -688,7 +688,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -702,7 +702,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -711,7 +711,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -720,7 +720,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -728,7 +728,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -738,7 +738,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -void dreamforge_cmd_mode(char *source, char *dest, char *buf) +void dreamforge_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -747,7 +747,7 @@ void dreamforge_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "MODE %s %s", dest, buf); } -void dreamforge_cmd_notice_ops(char *source, char *dest, char *buf) +void dreamforge_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -757,7 +757,7 @@ void dreamforge_cmd_notice_ops(char *source, char *dest, char *buf) } -void dreamforge_cmd_notice(char *source, char *dest, char *buf) +void dreamforge_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -770,12 +770,12 @@ void dreamforge_cmd_notice(char *source, char *dest, char *buf) } } -void dreamforge_cmd_notice2(char *source, char *dest, char *msg) +void dreamforge_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void dreamforge_cmd_privmsg(char *source, char *dest, char *buf) +void dreamforge_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -784,22 +784,22 @@ void dreamforge_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void dreamforge_cmd_privmsg2(char *source, char *dest, char *msg) +void dreamforge_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void dreamforge_cmd_serv_notice(char *source, char *dest, char *msg) +void dreamforge_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void dreamforge_cmd_serv_privmsg(char *source, char *dest, char *msg) +void dreamforge_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void dreamforge_cmd_351(char *source) +void dreamforge_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -808,7 +808,7 @@ void dreamforge_cmd_351(char *source) } /* QUIT */ -void dreamforge_cmd_quit(char *source, char *buf) +void dreamforge_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -818,7 +818,7 @@ void dreamforge_cmd_quit(char *source, char *buf) } /* 391 */ -void dreamforge_cmd_391(char *source, char *timestr) +void dreamforge_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -827,7 +827,7 @@ void dreamforge_cmd_391(char *source, char *timestr) } /* 250 */ -void dreamforge_cmd_250(char *buf) +void dreamforge_cmd_250(const char *buf) { if (!buf) { return; @@ -837,7 +837,7 @@ void dreamforge_cmd_250(char *buf) } /* 307 */ -void dreamforge_cmd_307(char *buf) +void dreamforge_cmd_307(const char *buf) { if (!buf) { return; @@ -847,7 +847,7 @@ void dreamforge_cmd_307(char *buf) } /* 311 */ -void dreamforge_cmd_311(char *buf) +void dreamforge_cmd_311(const char *buf) { if (!buf) { return; @@ -857,7 +857,7 @@ void dreamforge_cmd_311(char *buf) } /* 312 */ -void dreamforge_cmd_312(char *buf) +void dreamforge_cmd_312(const char *buf) { if (!buf) { return; @@ -867,7 +867,7 @@ void dreamforge_cmd_312(char *buf) } /* 317 */ -void dreamforge_cmd_317(char *buf) +void dreamforge_cmd_317(const char *buf) { if (!buf) { return; @@ -877,7 +877,7 @@ void dreamforge_cmd_317(char *buf) } /* 219 */ -void dreamforge_cmd_219(char *source, char *letter) +void dreamforge_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -892,7 +892,7 @@ void dreamforge_cmd_219(char *source, char *letter) } /* 401 */ -void dreamforge_cmd_401(char *source, char *who) +void dreamforge_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -901,7 +901,7 @@ void dreamforge_cmd_401(char *source, char *who) } /* 318 */ -void dreamforge_cmd_318(char *source, char *who) +void dreamforge_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -911,7 +911,7 @@ void dreamforge_cmd_318(char *source, char *who) } /* 242 */ -void dreamforge_cmd_242(char *buf) +void dreamforge_cmd_242(const char *buf) { if (!buf) { return; @@ -921,7 +921,7 @@ void dreamforge_cmd_242(char *buf) } /* 243 */ -void dreamforge_cmd_243(char *buf) +void dreamforge_cmd_243(const char *buf) { if (!buf) { return; @@ -931,7 +931,7 @@ void dreamforge_cmd_243(char *buf) } /* 211 */ -void dreamforge_cmd_211(char *buf) +void dreamforge_cmd_211(const char *buf) { if (!buf) { return; @@ -940,7 +940,7 @@ void dreamforge_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void dreamforge_cmd_nick(char *nick, char *name, char *modes) +void dreamforge_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, @@ -950,7 +950,7 @@ void dreamforge_cmd_nick(char *nick, char *name, char *modes) dreamforge_cmd_sqline(nick, "Reserved for services"); } -void dreamforge_cmd_kick(char *source, char *chan, char *user, char *buf) +void dreamforge_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -960,7 +960,7 @@ void dreamforge_cmd_kick(char *source, char *chan, char *user, char *buf) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -970,7 +970,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -978,7 +978,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -986,7 +986,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -994,7 +994,7 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1002,30 +1002,30 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void dreamforge_cmd_372(char *source, char *msg) +void dreamforge_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void dreamforge_cmd_372_error(char *source) +void dreamforge_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void dreamforge_cmd_375(char *source) +void dreamforge_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void dreamforge_cmd_376(char *source) +void dreamforge_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* INVITE */ -void dreamforge_cmd_invite(char *source, char *chan, char *nick) +void dreamforge_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1035,13 +1035,13 @@ void dreamforge_cmd_invite(char *source, char *chan, char *nick) } /* PONG */ -void dreamforge_cmd_pong(char *servname, char *who) +void dreamforge_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } -void dreamforge_cmd_bot_nick(char *nick, char *user, char *host, - char *real, char *modes) +void dreamforge_cmd_bot_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, @@ -1051,43 +1051,43 @@ void dreamforge_cmd_bot_nick(char *nick, char *user, char *host, } /* SVSHOLD - set */ -void dreamforge_cmd_svshold(char *nick) +void dreamforge_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void dreamforge_cmd_release_svshold(char *nick) +void dreamforge_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* UNSGLINE */ -void dreamforge_cmd_unsgline(char *mask) +void dreamforge_cmd_unsgline(const char *mask) { /* Not Supported by this IRCD */ } /* UNSZLINE */ -void dreamforge_cmd_unszline(char *mask) +void dreamforge_cmd_unszline(const char *mask) { /* Not Supported by this IRCD */ } /* SZLINE */ -void dreamforge_cmd_szline(char *mask, char *reason, char *whom) +void dreamforge_cmd_szline(const char *mask, const char *reason, const char *whom) { /* Not Supported by this IRCD */ } /* SGLINE */ -void dreamforge_cmd_sgline(char *mask, char *reason) +void dreamforge_cmd_sgline(const char *mask, const char *reason) { /* Not Supported by this IRCD */ } /* SVSNICK */ -void dreamforge_cmd_svsnick(char *source, char *guest, time_t when) +void dreamforge_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1095,32 +1095,32 @@ void dreamforge_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void dreamforge_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +void dreamforge_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, (long int) time(NULL), user, host, ServerName, real); anope_cmd_mode(nick, nick, "MODE %s", modes); } -void dreamforge_cmd_svso(char *source, char *nick, char *flag) +void dreamforge_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void dreamforge_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void dreamforge_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { /* Not Supported by this IRCD */ } -void dreamforge_cmd_unban(char *name, char *nick) +void dreamforge_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void dreamforge_cmd_svsmode_chan(char *name, char *mode, char *nick) +void dreamforge_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1132,7 +1132,7 @@ void dreamforge_cmd_vhost_off(User * u) /* SVSMODE +d */ /* sent if svid is something weird */ -void dreamforge_cmd_svid_umode(char *nick, time_t ts) +void dreamforge_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s +d 1", nick); } @@ -1145,7 +1145,7 @@ void dreamforge_cmd_nc_change(User * u) } /* SVSMODE +r */ -void dreamforge_cmd_svid_umode2(User * u, char *ts) +void dreamforge_cmd_svid_umode2(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1154,13 +1154,13 @@ void dreamforge_cmd_svid_umode2(User * u, char *ts) } } -void dreamforge_cmd_svid_umode3(User * u, char *ts) +void dreamforge_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ -void dreamforge_cmd_chg_nick(char *oldnick, char *newnick) +void dreamforge_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1169,37 +1169,37 @@ void dreamforge_cmd_chg_nick(char *oldnick, char *newnick) send_cmd(oldnick, "NICK %s", newnick); } -void dreamforge_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void dreamforge_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void dreamforge_cmd_svspart(char *source, char *nick, char *chan) +void dreamforge_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void dreamforge_cmd_swhois(char *source, char *who, char *mask) +void dreamforge_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int dreamforge_flood_mode_check(char *value) +int dreamforge_flood_mode_check(const char *value) { return 0; } @@ -1209,7 +1209,7 @@ void dreamforge_cmd_eob() /* Not supported */ } -void dreamforge_cmd_jupe(char *jserver, char *who, char *reason) +void dreamforge_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1223,7 +1223,7 @@ void dreamforge_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void dreamforge_cmd_global_legacy(char *source, char *fmt) +void dreamforge_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1232,7 +1232,7 @@ void dreamforge_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int dreamforge_valid_nick(char *nick) +int dreamforge_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1242,14 +1242,14 @@ int dreamforge_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int dreamforge_valid_chan(char *chan) +int dreamforge_valid_chan(const char *chan) { /* no hard coded invalid chan */ return 1; } -void dreamforge_cmd_ctcp(char *source, char *dest, char *buf) +void dreamforge_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/dreamforge.h b/src/protocol/dreamforge.h index e11e9f0f2..304b30d2f 100644 --- a/src/protocol/dreamforge.h +++ b/src/protocol/dreamforge.h @@ -38,74 +38,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void dreamforge_set_umode(User * user, int ac, char **av); -void dreamforge_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void dreamforge_set_umode(User * user, int ac, const char **av); +void dreamforge_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void dreamforge_cmd_vhost_off(User * u); -void dreamforge_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void dreamforge_cmd_svskill(char *source, char *user, char *buf); -void dreamforge_cmd_svsmode(User * u, int ac, char **av); -void dreamforge_cmd_372(char *source, char *msg); -void dreamforge_cmd_372_error(char *source); -void dreamforge_cmd_375(char *source); -void dreamforge_cmd_376(char *source); -void dreamforge_cmd_nick(char *nick, char *name, char *modes); -void dreamforge_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void dreamforge_cmd_mode(char *source, char *dest, char *buf); -void dreamforge_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void dreamforge_cmd_kick(char *source, char *chan, char *user, char *buf); -void dreamforge_cmd_notice_ops(char *source, char *dest, char *buf); -void dreamforge_cmd_notice(char *source, char *dest, char *buf); -void dreamforge_cmd_notice2(char *source, char *dest, char *msg); -void dreamforge_cmd_privmsg(char *source, char *dest, char *buf); -void dreamforge_cmd_privmsg2(char *source, char *dest, char *msg); -void dreamforge_cmd_serv_notice(char *source, char *dest, char *msg); -void dreamforge_cmd_serv_privmsg(char *source, char *dest, char *msg); -void dreamforge_cmd_bot_chan_mode(char *nick, char *chan); -void dreamforge_cmd_351(char *source); -void dreamforge_cmd_quit(char *source, char *buf); -void dreamforge_cmd_pong(char *servname, char *who); -void dreamforge_cmd_join(char *user, char *channel, time_t chantime); -void dreamforge_cmd_unsqline(char *user); -void dreamforge_cmd_invite(char *source, char *chan, char *nick); -void dreamforge_cmd_part(char *nick, char *chan, char *buf); -void dreamforge_cmd_391(char *source, char *timestr); -void dreamforge_cmd_250(char *buf); -void dreamforge_cmd_307(char *buf); -void dreamforge_cmd_311(char *buf); -void dreamforge_cmd_312(char *buf); -void dreamforge_cmd_317(char *buf); -void dreamforge_cmd_219(char *source, char *letter); -void dreamforge_cmd_401(char *source, char *who); -void dreamforge_cmd_318(char *source, char *who); -void dreamforge_cmd_242(char *buf); -void dreamforge_cmd_243(char *buf); -void dreamforge_cmd_211(char *buf); -void dreamforge_cmd_global(char *source, char *buf); -void dreamforge_cmd_global_legacy(char *source, char *fmt); -void dreamforge_cmd_sqline(char *mask, char *reason); -void dreamforge_cmd_squit(char *servname, char *message); -void dreamforge_cmd_svso(char *source, char *nick, char *flag); -void dreamforge_cmd_chg_nick(char *oldnick, char *newnick); -void dreamforge_cmd_svsnick(char *source, char *guest, time_t when); -void dreamforge_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void dreamforge_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void dreamforge_cmd_svskill(const char *source, const char *user, const char *buf); +void dreamforge_cmd_svsmode(User * u, int ac, const char **av); +void dreamforge_cmd_372(const char *source, const char *msg); +void dreamforge_cmd_372_error(const char *source); +void dreamforge_cmd_375(const char *source); +void dreamforge_cmd_376(const char *source); +void dreamforge_cmd_nick(const char *nick, const char *name, const char *modes); +void dreamforge_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void dreamforge_cmd_mode(const char *source, const char *dest, const char *buf); +void dreamforge_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void dreamforge_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void dreamforge_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void dreamforge_cmd_notice(const char *source, const char *dest, const char *buf); +void dreamforge_cmd_notice2(const char *source, const char *dest, const char *msg); +void dreamforge_cmd_privmsg(const char *source, const char *dest, const char *buf); +void dreamforge_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void dreamforge_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void dreamforge_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void dreamforge_cmd_bot_chan_mode(const char *nick, const char *chan); +void dreamforge_cmd_351(const char *source); +void dreamforge_cmd_quit(const char *source, const char *buf); +void dreamforge_cmd_pong(const char *servname, const char *who); +void dreamforge_cmd_join(const char *user, const char *channel, time_t chantime); +void dreamforge_cmd_unsqline(const char *user); +void dreamforge_cmd_invite(const char *source, const char *chan, const char *nick); +void dreamforge_cmd_part(const char *nick, const char *chan, const char *buf); +void dreamforge_cmd_391(const char *source, const char *timestr); +void dreamforge_cmd_250(const char *buf); +void dreamforge_cmd_307(const char *buf); +void dreamforge_cmd_311(const char *buf); +void dreamforge_cmd_312(const char *buf); +void dreamforge_cmd_317(const char *buf); +void dreamforge_cmd_219(const char *source, const char *letter); +void dreamforge_cmd_401(const char *source, const char *who); +void dreamforge_cmd_318(const char *source, const char *who); +void dreamforge_cmd_242(const char *buf); +void dreamforge_cmd_243(const char *buf); +void dreamforge_cmd_211(const char *buf); +void dreamforge_cmd_global(const char *source, const char *buf); +void dreamforge_cmd_global_legacy(const char *source, const char *fmt); +void dreamforge_cmd_sqline(const char *mask, const char *reason); +void dreamforge_cmd_squit(const char *servname, const char *message); +void dreamforge_cmd_svso(const char *source, const char *nick, const char *flag); +void dreamforge_cmd_chg_nick(const char *oldnick, const char *newnick); +void dreamforge_cmd_svsnick(const char *source, const char *guest, time_t when); +void dreamforge_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void dreamforge_cmd_connect(int servernum); -void dreamforge_cmd_svshold(char *nick); -void dreamforge_cmd_release_svshold(char *nick); -void dreamforge_cmd_unsgline(char *mask); -void dreamforge_cmd_unszline(char *mask); -void dreamforge_cmd_szline(char *mask, char *reason, char *whom); -void dreamforge_cmd_sgline(char *mask, char *reason); -void dreamforge_cmd_unban(char *name, char *nick); -void dreamforge_cmd_svsmode_chan(char *name, char *mode, char *nick); -void dreamforge_cmd_svid_umode(char *nick, time_t ts); +void dreamforge_cmd_svshold(const char *nick); +void dreamforge_cmd_release_svshold(const char *nick); +void dreamforge_cmd_unsgline(const char *mask); +void dreamforge_cmd_unszline(const char *mask); +void dreamforge_cmd_szline(const char *mask, const char *reason, const char *whom); +void dreamforge_cmd_sgline(const char *mask, const char *reason); +void dreamforge_cmd_unban(const char *name, const char *nick); +void dreamforge_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void dreamforge_cmd_svid_umode(const char *nick, time_t ts); void dreamforge_cmd_nc_change(User * u); -void dreamforge_cmd_svid_umode2(User * u, char *ts); -void dreamforge_cmd_svid_umode3(User * u, char *ts); +void dreamforge_cmd_svid_umode2(User * u, const char *ts); +void dreamforge_cmd_svid_umode3(User * u, const char *ts); void dreamforge_cmd_eob(); -int dreamforge_flood_mode_check(char *value); -void dreamforge_cmd_jupe(char *jserver, char *who, char *reason); -int dreamforge_valid_nick(char *nick); -void dreamforge_cmd_ctcp(char *source, char *dest, char *buf); +int dreamforge_flood_mode_check(const char *value); +void dreamforge_cmd_jupe(const char *jserver, const char *who, const char *reason); +int dreamforge_valid_nick(const char *nick); +void dreamforge_cmd_ctcp(const char *source, const char *dest, const char *buf); class DreamForgeProto : public IRCDProtoNew { public: diff --git a/src/protocol/hybrid.c b/src/protocol/hybrid.c index 51566df95..e04a6c54a 100644 --- a/src/protocol/hybrid.c +++ b/src/protocol/hybrid.c @@ -146,10 +146,10 @@ IRCDCAPAB myIrcdcap[] = { -void hybrid_set_umode(User * user, int ac, char **av) +void hybrid_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -461,7 +461,7 @@ CUMode myCumodes[128] = { -void hybrid_cmd_notice(char *source, char *dest, char *buf) +void hybrid_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -474,12 +474,12 @@ void hybrid_cmd_notice(char *source, char *dest, char *buf) } } -void hybrid_cmd_notice2(char *source, char *dest, char *msg) +void hybrid_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void hybrid_cmd_privmsg(char *source, char *dest, char *buf) +void hybrid_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -488,23 +488,23 @@ void hybrid_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void hybrid_cmd_privmsg2(char *source, char *dest, char *msg) +void hybrid_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void hybrid_cmd_serv_notice(char *source, char *dest, char *msg) +void hybrid_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $$%s :%s", dest, msg); } -void hybrid_cmd_serv_privmsg(char *source, char *dest, char *msg) +void hybrid_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); } -void hybrid_cmd_global(char *source, char *buf) +void hybrid_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -514,18 +514,18 @@ void hybrid_cmd_global(char *source, char *buf) } /* GLOBOPS - to handle old WALLOPS */ -void hybrid_cmd_global_legacy(char *source, char *fmt) +void hybrid_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt); } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { if (ac != 2) { User *user = do_nick(source, av[0], av[4], av[5], av[6], av[7], @@ -539,7 +539,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac == 4) { do_topic(source, ac, av); @@ -578,7 +578,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tburst(char *source, int ac, char **av) +int anope_event_tburst(const char *source, int ac, const char **av) { if (ac != 5) return MOD_CONT; @@ -590,7 +590,7 @@ int anope_event_tburst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -653,7 +653,7 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -void hybrid_cmd_sqline(char *mask, char *reason) +void hybrid_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -661,7 +661,7 @@ void hybrid_cmd_sqline(char *mask, char *reason) send_cmd(ServerName, "RESV * %s :%s", mask, reason); } -void hybrid_cmd_unsgline(char *mask) +void hybrid_cmd_unsgline(const char *mask) { if (!mask) { return; @@ -670,20 +670,20 @@ void hybrid_cmd_unsgline(char *mask) send_cmd(ServerName, "UNXLINE * %s", mask); } -void hybrid_cmd_unszline(char *mask) +void hybrid_cmd_unszline(const char *mask) { /* Does not support */ } -void hybrid_cmd_szline(char *mask, char *reason, char *whom) +void hybrid_cmd_szline(const char *mask, const char *reason, const char *whom) { /* Does not support */ } -void hybrid_cmd_svsadmin(char *server, int set) +void hybrid_cmd_svsadmin(const char *server, int set) { } -void hybrid_cmd_sgline(char *mask, char *reason) +void hybrid_cmd_sgline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -698,8 +698,8 @@ void HybridIRCdProto::cmd_remove_akill(const char *user, const char *host) send_cmd(s_OperServ, "UNKLINE * %s %s", user, host); } -void hybrid_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void hybrid_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s :%s", chan, topic); } @@ -709,12 +709,12 @@ void hybrid_cmd_vhost_off(User * u) /* does not support vhosting */ } -void hybrid_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void hybrid_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { /* does not support vhosting */ } -void hybrid_cmd_unsqline(char *user) +void hybrid_cmd_unsqline(const char *user) { if (!user) { return; @@ -723,7 +723,7 @@ void hybrid_cmd_unsqline(char *user) send_cmd(ServerName, "UNRESV * %s", user); } -void hybrid_cmd_join(char *user, char *channel, time_t chantime) +void hybrid_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) chantime, channel, user); @@ -738,14 +738,14 @@ host: the 'host' portion of the kline reason: the reason for the kline. */ -void hybrid_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void hybrid_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(s_OperServ, "KLINE * %ld %s %s :%s", (long int) (expires - (long) time(NULL)), user, host, reason); } -void hybrid_cmd_svskill(char *source, char *user, char *buf) +void hybrid_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -759,7 +759,7 @@ void hybrid_cmd_svskill(char *source, char *user, char *buf) } -void hybrid_cmd_svsmode(User * u, int ac, char **av) +void hybrid_cmd_svsmode(User * u, int ac, const char **av) { /* Hybrid does not support SVSMODE */ } @@ -805,13 +805,13 @@ void hybrid_cmd_capab() } /* PASS */ -void hybrid_cmd_pass(char *pass) +void hybrid_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } /* SERVER name hop descript */ -void hybrid_cmd_server(char *servname, int hop, char *descript) +void hybrid_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -839,8 +839,8 @@ void hybrid_cmd_svsinfo() -void hybrid_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void hybrid_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, @@ -848,7 +848,7 @@ void hybrid_cmd_bot_nick(char *nick, char *user, char *host, char *real, } -void hybrid_cmd_part(char *nick, char *chan, char *buf) +void hybrid_cmd_part(const char *nick, const char *chan, const char *buf) { if (buf) { send_cmd(nick, "PART %s :%s", chan, buf); @@ -857,7 +857,7 @@ void hybrid_cmd_part(char *nick, char *chan, char *buf) } } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -865,7 +865,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -874,7 +874,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -883,7 +883,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -891,7 +891,7 @@ int anope_event_kick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_eob(char *source, int ac, char **av) +int anope_event_eob(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -912,7 +912,7 @@ void hybrid_cmd_eob() } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -920,7 +920,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -930,7 +930,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -938,7 +938,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -946,7 +946,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -955,7 +955,7 @@ int anope_event_whois(char *source, int ac, char **av) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -964,7 +964,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -972,7 +972,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -980,30 +980,30 @@ int anope_event_quit(char *source, int ac, char **av) return MOD_CONT; } -void hybrid_cmd_372(char *source, char *msg) +void hybrid_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void hybrid_cmd_372_error(char *source) +void hybrid_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void hybrid_cmd_375(char *source) +void hybrid_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void hybrid_cmd_376(char *source) +void hybrid_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* 391 */ -void hybrid_cmd_391(char *source, char *timestr) +void hybrid_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1012,7 +1012,7 @@ void hybrid_cmd_391(char *source, char *timestr) } /* 250 */ -void hybrid_cmd_250(char *buf) +void hybrid_cmd_250(const char *buf) { if (!buf) { return; @@ -1022,7 +1022,7 @@ void hybrid_cmd_250(char *buf) } /* 307 */ -void hybrid_cmd_307(char *buf) +void hybrid_cmd_307(const char *buf) { if (!buf) { return; @@ -1032,7 +1032,7 @@ void hybrid_cmd_307(char *buf) } /* 311 */ -void hybrid_cmd_311(char *buf) +void hybrid_cmd_311(const char *buf) { if (!buf) { return; @@ -1042,7 +1042,7 @@ void hybrid_cmd_311(char *buf) } /* 312 */ -void hybrid_cmd_312(char *buf) +void hybrid_cmd_312(const char *buf) { if (!buf) { return; @@ -1052,7 +1052,7 @@ void hybrid_cmd_312(char *buf) } /* 317 */ -void hybrid_cmd_317(char *buf) +void hybrid_cmd_317(const char *buf) { if (!buf) { return; @@ -1062,7 +1062,7 @@ void hybrid_cmd_317(char *buf) } /* 219 */ -void hybrid_cmd_219(char *source, char *letter) +void hybrid_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1077,7 +1077,7 @@ void hybrid_cmd_219(char *source, char *letter) } /* 401 */ -void hybrid_cmd_401(char *source, char *who) +void hybrid_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1086,7 +1086,7 @@ void hybrid_cmd_401(char *source, char *who) } /* 318 */ -void hybrid_cmd_318(char *source, char *who) +void hybrid_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1096,7 +1096,7 @@ void hybrid_cmd_318(char *source, char *who) } /* 242 */ -void hybrid_cmd_242(char *buf) +void hybrid_cmd_242(const char *buf) { if (!buf) { return; @@ -1106,7 +1106,7 @@ void hybrid_cmd_242(char *buf) } /* 243 */ -void hybrid_cmd_243(char *buf) +void hybrid_cmd_243(const char *buf) { if (!buf) { return; @@ -1116,7 +1116,7 @@ void hybrid_cmd_243(char *buf) } /* 211 */ -void hybrid_cmd_211(char *buf) +void hybrid_cmd_211(const char *buf) { if (!buf) { return; @@ -1125,7 +1125,7 @@ void hybrid_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void hybrid_cmd_mode(char *source, char *dest, char *buf) +void hybrid_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1134,7 +1134,7 @@ void hybrid_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "MODE %s %s", dest, buf); } -void hybrid_cmd_nick(char *nick, char *name, char *mode) +void hybrid_cmd_nick(const char *nick, const char *name, const char *mode) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, @@ -1142,7 +1142,7 @@ void hybrid_cmd_nick(char *nick, char *name, char *mode) ServerName, (name)); } -void hybrid_cmd_kick(char *source, char *chan, char *user, char *buf) +void hybrid_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1151,7 +1151,7 @@ void hybrid_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void hybrid_cmd_notice_ops(char *source, char *dest, char *buf) +void hybrid_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1160,13 +1160,13 @@ void hybrid_cmd_notice_ops(char *source, char *dest, char *buf) send_cmd(NULL, "NOTICE @%s :%s", dest, buf); } -void hybrid_cmd_bot_chan_mode(char *nick, char *chan) +void hybrid_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); } /* QUIT */ -void hybrid_cmd_quit(char *source, char *buf) +void hybrid_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -1176,13 +1176,13 @@ void hybrid_cmd_quit(char *source, char *buf) } /* PONG */ -void hybrid_cmd_pong(char *servname, char *who) +void hybrid_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } /* INVITE */ -void hybrid_cmd_invite(char *source, char *chan, char *nick) +void hybrid_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1192,7 +1192,7 @@ void hybrid_cmd_invite(char *source, char *chan, char *nick) } /* SQUIT */ -void hybrid_cmd_squit(char *servname, char *message) +void hybrid_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1201,7 +1201,7 @@ void hybrid_cmd_squit(char *servname, char *message) send_cmd(NULL, "SQUIT %s :%s", servname, message); } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1214,7 +1214,7 @@ int anope_event_mode(char *source, int ac, char **av) return MOD_CONT; } -void hybrid_cmd_351(char *source) +void hybrid_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1222,23 +1222,23 @@ void hybrid_cmd_351(char *source) } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { int argvsize = 8; int argc; - char **argv; + const char **argv; char *str; if (ac < 1) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = scalloc(argvsize, sizeof(char *)); + argv = (const char **)scalloc(argvsize, sizeof(const char *)); argc = 0; while ((str = myStrGetToken(av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = srealloc(argv, argvsize * sizeof(char *)); + argv = (const char **)srealloc(argv, argvsize * sizeof(const char *)); } argv[argc] = str; argc++; @@ -1248,58 +1248,58 @@ int anope_event_capab(char *source, int ac, char **av) /* Free our built ac/av */ for (argvsize = 0; argvsize < argc; argvsize++) { - free(argv[argvsize]); + free((char *)argv[argvsize]); } - free(argv); + free((char **)argv); return MOD_CONT; } /* SVSHOLD - set */ -void hybrid_cmd_svshold(char *nick) +void hybrid_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void hybrid_cmd_release_svshold(char *nick) +void hybrid_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* SVSNICK */ -void hybrid_cmd_svsnick(char *nick, char *newnick, time_t when) +void hybrid_cmd_svsnick(const char *nick, const char *newnick, time_t when) { /* Not Supported by this IRCD */ } -void hybrid_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void hybrid_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick, (long int) time(NULL), modes, user, host, ServerName, real); } -void hybrid_cmd_svso(char *source, char *nick, char *flag) +void hybrid_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void hybrid_cmd_unban(char *name, char *nick) +void hybrid_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void hybrid_cmd_svsmode_chan(char *name, char *mode, char *nick) +void hybrid_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void hybrid_cmd_svid_umode(char *nick, time_t ts) +void hybrid_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s +d 1", nick); } @@ -1312,19 +1312,19 @@ void hybrid_cmd_nc_change(User * u) } /* SVSMODE +d */ -void hybrid_cmd_svid_umode2(User * u, char *ts) +void hybrid_cmd_svid_umode2(User * u, const char *ts) { /* not used */ } -void hybrid_cmd_svid_umode3(User * u, char *ts) +void hybrid_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ -void hybrid_cmd_chg_nick(char *oldnick, char *newnick) +void hybrid_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1341,54 +1341,54 @@ void hybrid_cmd_chg_nick(char *oldnick, char *newnick) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -void hybrid_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void hybrid_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void hybrid_cmd_svspart(char *source, char *nick, char *chan) +void hybrid_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void hybrid_cmd_swhois(char *source, char *who, char *mask) +void hybrid_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int hybrid_flood_mode_check(char *value) +int hybrid_flood_mode_check(const char *value) { return 0; } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1398,7 +1398,7 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void hybrid_cmd_jupe(char *jserver, char *who, char *reason) +void hybrid_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1415,7 +1415,7 @@ void hybrid_cmd_jupe(char *jserver, char *who, char *reason) 1 = valid nick 0 = nick is in valid */ -int hybrid_valid_nick(char *nick) +int hybrid_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1425,14 +1425,14 @@ int hybrid_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int hybrid_valid_chan(char *chan) +int hybrid_valid_chan(const char *chan) { /* no hard coded invalid chans */ return 1; } -void hybrid_cmd_ctcp(char *source, char *dest, char *buf) +void hybrid_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/hybrid.h b/src/protocol/hybrid.h index 3d52b6e83..42a4fabaf 100644 --- a/src/protocol/hybrid.h +++ b/src/protocol/hybrid.h @@ -43,74 +43,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -void hybrid_set_umode(User * user, int ac, char **av); -void hybrid_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void hybrid_set_umode(User * user, int ac, const char **av); +void hybrid_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void hybrid_cmd_vhost_off(User * u); -void hybrid_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void hybrid_cmd_svskill(char *source, char *user, char *buf); -void hybrid_cmd_svsmode(User * u, int ac, char **av); -void hybrid_cmd_372(char *source, char *msg); -void hybrid_cmd_372_error(char *source); -void hybrid_cmd_375(char *source); -void hybrid_cmd_376(char *source); -void hybrid_cmd_nick(char *nick, char *name, char *modes); -void hybrid_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void hybrid_cmd_mode(char *source, char *dest, char *buf); -void hybrid_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void hybrid_cmd_kick(char *source, char *chan, char *user, char *buf); -void hybrid_cmd_notice_ops(char *source, char *dest, char *buf); -void hybrid_cmd_notice(char *source, char *dest, char *buf); -void hybrid_cmd_notice2(char *source, char *dest, char *msg); -void hybrid_cmd_privmsg(char *source, char *dest, char *buf); -void hybrid_cmd_privmsg2(char *source, char *dest, char *msg); -void hybrid_cmd_serv_notice(char *source, char *dest, char *msg); -void hybrid_cmd_serv_privmsg(char *source, char *dest, char *msg); -void hybrid_cmd_bot_chan_mode(char *nick, char *chan); -void hybrid_cmd_351(char *source); -void hybrid_cmd_quit(char *source, char *buf); -void hybrid_cmd_pong(char *servname, char *who); -void hybrid_cmd_join(char *user, char *channel, time_t chantime); -void hybrid_cmd_unsqline(char *user); -void hybrid_cmd_invite(char *source, char *chan, char *nick); -void hybrid_cmd_part(char *nick, char *chan, char *buf); -void hybrid_cmd_391(char *source, char *timestr); -void hybrid_cmd_250(char *buf); -void hybrid_cmd_307(char *buf); -void hybrid_cmd_311(char *buf); -void hybrid_cmd_312(char *buf); -void hybrid_cmd_317(char *buf); -void hybrid_cmd_219(char *source, char *letter); -void hybrid_cmd_401(char *source, char *who); -void hybrid_cmd_318(char *source, char *who); -void hybrid_cmd_242(char *buf); -void hybrid_cmd_243(char *buf); -void hybrid_cmd_211(char *buf); -void hybrid_cmd_global(char *source, char *buf); -void hybrid_cmd_global_legacy(char *source, char *fmt); -void hybrid_cmd_sqline(char *mask, char *reason); -void hybrid_cmd_squit(char *servname, char *message); -void hybrid_cmd_svso(char *source, char *nick, char *flag); -void hybrid_cmd_chg_nick(char *oldnick, char *newnick); -void hybrid_cmd_svsnick(char *source, char *guest, time_t when); -void hybrid_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void hybrid_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void hybrid_cmd_svskill(const char *source, const char *user, const char *buf); +void hybrid_cmd_svsmode(User * u, int ac, const char **av); +void hybrid_cmd_372(const char *source, const char *msg); +void hybrid_cmd_372_error(const char *source); +void hybrid_cmd_375(const char *source); +void hybrid_cmd_376(const char *source); +void hybrid_cmd_nick(const char *nick, const char *name, const char *modes); +void hybrid_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void hybrid_cmd_mode(const char *source, const char *dest, const char *buf); +void hybrid_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void hybrid_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void hybrid_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void hybrid_cmd_notice(const char *source, const char *dest, const char *buf); +void hybrid_cmd_notice2(const char *source, const char *dest, const char *msg); +void hybrid_cmd_privmsg(const char *source, const char *dest, const char *buf); +void hybrid_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void hybrid_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void hybrid_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void hybrid_cmd_bot_chan_mode(const char *nick, const char *chan); +void hybrid_cmd_351(const char *source); +void hybrid_cmd_quit(const char *source, const char *buf); +void hybrid_cmd_pong(const char *servname, const char *who); +void hybrid_cmd_join(const char *user, const char *channel, time_t chantime); +void hybrid_cmd_unsqline(const char *user); +void hybrid_cmd_invite(const char *source, const char *chan, const char *nick); +void hybrid_cmd_part(const char *nick, const char *chan, const char *buf); +void hybrid_cmd_391(const char *source, const char *timestr); +void hybrid_cmd_250(const char *buf); +void hybrid_cmd_307(const char *buf); +void hybrid_cmd_311(const char *buf); +void hybrid_cmd_312(const char *buf); +void hybrid_cmd_317(const char *buf); +void hybrid_cmd_219(const char *source, const char *letter); +void hybrid_cmd_401(const char *source, const char *who); +void hybrid_cmd_318(const char *source, const char *who); +void hybrid_cmd_242(const char *buf); +void hybrid_cmd_243(const char *buf); +void hybrid_cmd_211(const char *buf); +void hybrid_cmd_global(const char *source, const char *buf); +void hybrid_cmd_global_legacy(const char *source, const char *fmt); +void hybrid_cmd_sqline(const char *mask, const char *reason); +void hybrid_cmd_squit(const char *servname, const char *message); +void hybrid_cmd_svso(const char *source, const char *nick, const char *flag); +void hybrid_cmd_chg_nick(const char *oldnick, const char *newnick); +void hybrid_cmd_svsnick(const char *source, const char *guest, time_t when); +void hybrid_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void hybrid_cmd_connect(int servernum); -void hybrid_cmd_svshold(char *nick); -void hybrid_cmd_release_svshold(char *nick); -void hybrid_cmd_unsgline(char *mask); -void hybrid_cmd_unszline(char *mask); -void hybrid_cmd_szline(char *mask, char *reason, char *whom); -void hybrid_cmd_sgline(char *mask, char *reason); -void hybrid_cmd_unban(char *name, char *nick); -void hybrid_cmd_svsmode_chan(char *name, char *mode, char *nick); -void hybrid_cmd_svid_umode(char *nick, time_t ts); +void hybrid_cmd_svshold(const char *nick); +void hybrid_cmd_release_svshold(const char *nick); +void hybrid_cmd_unsgline(const char *mask); +void hybrid_cmd_unszline(const char *mask); +void hybrid_cmd_szline(const char *mask, const char *reason, const char *whom); +void hybrid_cmd_sgline(const char *mask, const char *reason); +void hybrid_cmd_unban(const char *name, const char *nick); +void hybrid_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void hybrid_cmd_svid_umode(const char *nick, time_t ts); void hybrid_cmd_nc_change(User * u); -void hybrid_cmd_svid_umode2(User * u, char *ts); -void hybrid_cmd_svid_umode3(User * u, char *ts); +void hybrid_cmd_svid_umode2(User * u, const char *ts); +void hybrid_cmd_svid_umode3(User * u, const char *ts); void hybrid_cmd_eob(); -int hybrid_flood_mode_check(char *value); -void hybrid_cmd_jupe(char *jserver, char *who, char *reason); -int hybrid_valid_nick(char *nick); -void hybrid_cmd_ctcp(char *source, char *dest, char *buf); +int hybrid_flood_mode_check(const char *value); +void hybrid_cmd_jupe(const char *jserver, const char *who, const char *reason); +int hybrid_valid_nick(const char *nick); +void hybrid_cmd_ctcp(const char *source, const char *dest, const char *buf); class HybridIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/inspircd10.c b/src/protocol/inspircd10.c index ba5881d09..0f738aefd 100644 --- a/src/protocol/inspircd10.c +++ b/src/protocol/inspircd10.c @@ -382,10 +382,10 @@ CUMode myCumodes[128] = { }; -void inspircd_set_umode(User * user, int ac, char **av) +void inspircd_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -503,18 +503,18 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -void inspircd_cmd_svsadmin(char *server, int set) +void inspircd_cmd_svsadmin(const char *server, int set) { /* Not Supported by this IRCD */ } -void InspIRCd::cmd_remove_akill(const char *user, const char *host) +void InspIRCdProto::cmd_remove_akill(const char *user, const char *host) { send_cmd(s_OperServ, "GLINE %s@%s", user, host); } -void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void inspircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "FTOPIC %s %lu %s :%s", chan, (unsigned long int) when, whosetit, topic); } @@ -524,13 +524,13 @@ void inspircd_cmd_vhost_off(User * u) send_cmd(s_HostServ, "MODE %s -x", u->nick); } -void inspircd_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, (long int) when, (long int) 86400 * 2, reason); } -void inspircd_cmd_svskill(char *source, char *user, char *buf) +void inspircd_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -543,48 +543,48 @@ void inspircd_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "KILL %s :%s", user, buf); } -void inspircd_cmd_svsmode(User * u, int ac, char **av) +void inspircd_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(s_NickServ, "MODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); } -void inspircd_cmd_372(char *source, char *msg) +void inspircd_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void inspircd_cmd_372_error(char *source) +void inspircd_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void inspircd_cmd_375(char *source) +void inspircd_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void inspircd_cmd_376(char *source) +void inspircd_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void inspircd_cmd_nick(char *nick, char *name, char *modes) +void inspircd_cmd_nick(const char *nick, const char *name, const char *modes) { /* :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards */ send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s",(long int) time(NULL),nick,ServiceHost,ServiceHost,ServiceUser,modes,name); send_cmd(ServerName, "OPERTYPE Service"); } -void inspircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void inspircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s",(long int) time(NULL),nick,host,host,user,modes,real); } -void inspircd_cmd_mode(char *source, char *dest, char *buf) +void inspircd_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -592,12 +592,12 @@ void inspircd_cmd_mode(char *source, char *dest, char *buf) send_cmd(source ? source : s_OperServ, "MODE %s %s", dest, buf); } -int anope_event_version(char *source, int ac, char **av) +int anope_event_version(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_idle(char *source, int ac, char **av) +int anope_event_idle(const char *source, int ac, const char **av) { if (ac == 1) { @@ -606,10 +606,10 @@ int anope_event_idle(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ftopic(char *source, int ac, char **av) +int anope_event_ftopic(const char *source, int ac, const char **av) { /* :source FTOPIC channel ts setby :topic */ - char* temp; + const char* temp; if (ac < 4) return MOD_CONT; temp = av[1]; /* temp now holds ts */ @@ -619,14 +619,14 @@ int anope_event_ftopic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_opertype(char* source, int ac, char**av) +int anope_event_opertype(const char *source, int ac, const char **av) { /* opertype is equivalent to mode +o because servers dont do this directly */ User* u; u = finduser(source); if (u && !is_oper(u)) { - char* newav[2]; + const char* newav[2]; newav[0] = source; newav[1] = "+o"; return anope_event_mode(source, 2, newav); @@ -634,7 +634,7 @@ int anope_event_opertype(char* source, int ac, char**av) else return MOD_CONT; } -int anope_event_fmode(char *source, int ac, char **av) +int anope_event_fmode(const char *source, int ac, const char **av) { /* :source FMODE #test +nt */ if (ac != 2) @@ -642,7 +642,7 @@ int anope_event_fmode(char *source, int ac, char **av) return anope_event_mode(source, ac, av); } -int anope_event_samode(char *source, int ac, char **av) +int anope_event_samode(const char *source, int ac, const char **av) { /* :source SAMODE targets modes */ if (ac < 2) @@ -651,7 +651,7 @@ int anope_event_samode(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sanick(char *source, int ac, char **av) +int anope_event_sanick(const char *source, int ac, const char **av) { /* :source SANICK old new */ if (ac != 2) @@ -660,9 +660,9 @@ int anope_event_sanick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sajoin(char *source, int ac, char **av) +int anope_event_sajoin(const char *source, int ac, const char **av) { - char* newav[1]; + const char* newav[1]; if (ac != 2) return MOD_CONT; newav[0] = av[1]; @@ -670,9 +670,9 @@ int anope_event_sajoin(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sapart(char *source, int ac, char **av) +int anope_event_sapart(const char *source, int ac, const char **av) { - char* newav[1]; + const char* newav[1]; if (ac < 2) return MOD_CONT; newav[0] = av[1]; @@ -680,9 +680,9 @@ int anope_event_sapart(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_fjoin(char *source, int ac, char **av) +int anope_event_fjoin(const char *source, int ac, const char **av) { - char* newav[127]; + const char* newav[127]; char people[1024]; int i = 0; @@ -706,14 +706,14 @@ int anope_event_fjoin(char *source, int ac, char **av) return MOD_CONT; } -void inspircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void inspircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s",(long int) time(NULL),nick,host,host,user,modes,real); send_cmd(ServerName, "OPERTYPE Bot"); } -void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf) +void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -722,7 +722,7 @@ void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void inspircd_cmd_notice_ops(char *source, char *dest, char *buf) +void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -732,7 +732,7 @@ void inspircd_cmd_notice_ops(char *source, char *dest, char *buf) } -void inspircd_cmd_notice(char *source, char *dest, char *buf) +void inspircd_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -745,12 +745,12 @@ void inspircd_cmd_notice(char *source, char *dest, char *buf) } } -void inspircd_cmd_notice2(char *source, char *dest, char *msg) +void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void inspircd_cmd_privmsg(char *source, char *dest, char *buf) +void inspircd_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -759,28 +759,28 @@ void inspircd_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void inspircd_cmd_privmsg2(char *source, char *dest, char *msg) +void inspircd_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void inspircd_cmd_serv_notice(char *source, char *dest, char *msg) +void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void inspircd_cmd_serv_privmsg(char *source, char *dest, char *msg) +void inspircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void inspircd_cmd_bot_chan_mode(char *nick, char *chan) +void inspircd_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } -void inspircd_cmd_351(char *source) +void inspircd_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -788,7 +788,7 @@ void inspircd_cmd_351(char *source) } /* QUIT */ -void inspircd_cmd_quit(char *source, char *buf) +void inspircd_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -805,19 +805,19 @@ void inspircd_cmd_protoctl() static char currentpass[1024]; /* PASS */ -void inspircd_cmd_pass(char *pass) +void inspircd_cmd_pass(const char *pass) { strncpy(currentpass,pass,1024); } /* SERVER services-dev.chatspike.net password 0 :Description here */ -void inspircd_cmd_server(char *servname, int hop, char *descript) +void inspircd_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(ServerName, "SERVER %s %s %d :%s", servname, currentpass, hop, descript); } /* PONG */ -void inspircd_cmd_pong(char *servname, char *who) +void inspircd_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -825,13 +825,13 @@ void inspircd_cmd_pong(char *servname, char *who) /* JOIN */ /* Althought inspircd 3.2 does not need the timestamp others do so we get it in the common function call */ -void inspircd_cmd_join(char *user, char *channel, time_t chantime) +void inspircd_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "JOIN %s", channel); } /* UNSQLINE */ -void inspircd_cmd_unsqline(char *user) +void inspircd_cmd_unsqline(const char *user) { if (!user) { return; @@ -840,7 +840,7 @@ void inspircd_cmd_unsqline(char *user) } /* CHGHOST */ -void inspircd_cmd_chghost(char *nick, char *vhost) +void inspircd_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -849,7 +849,7 @@ void inspircd_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void inspircd_cmd_chgident(char *nick, char *vIdent) +void inspircd_cmd_chgident(const char *nick, const char *vIdent) { if (!nick || !vIdent) { return; @@ -858,7 +858,7 @@ void inspircd_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void inspircd_cmd_invite(char *source, char *chan, char *nick) +void inspircd_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -868,7 +868,7 @@ void inspircd_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void inspircd_cmd_part(char *nick, char *chan, char *buf) +void inspircd_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -882,7 +882,7 @@ void inspircd_cmd_part(char *nick, char *chan, char *buf) } /* 391 */ -void inspircd_cmd_391(char *source, char *timestr) +void inspircd_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -891,7 +891,7 @@ void inspircd_cmd_391(char *source, char *timestr) } /* 250 */ -void inspircd_cmd_250(char *buf) +void inspircd_cmd_250(const char *buf) { if (!buf) { return; @@ -901,7 +901,7 @@ void inspircd_cmd_250(char *buf) } /* 307 */ -void inspircd_cmd_307(char *buf) +void inspircd_cmd_307(const char *buf) { if (!buf) { return; @@ -911,7 +911,7 @@ void inspircd_cmd_307(char *buf) } /* 311 */ -void inspircd_cmd_311(char *buf) +void inspircd_cmd_311(const char *buf) { if (!buf) { return; @@ -921,7 +921,7 @@ void inspircd_cmd_311(char *buf) } /* 312 */ -void inspircd_cmd_312(char *buf) +void inspircd_cmd_312(const char *buf) { if (!buf) { return; @@ -931,7 +931,7 @@ void inspircd_cmd_312(char *buf) } /* 317 */ -void inspircd_cmd_317(char *buf) +void inspircd_cmd_317(const char *buf) { if (!buf) { return; @@ -941,7 +941,7 @@ void inspircd_cmd_317(char *buf) } /* 219 */ -void inspircd_cmd_219(char *source, char *letter) +void inspircd_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -956,7 +956,7 @@ void inspircd_cmd_219(char *source, char *letter) } /* 401 */ -void inspircd_cmd_401(char *source, char *who) +void inspircd_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -965,7 +965,7 @@ void inspircd_cmd_401(char *source, char *who) } /* 318 */ -void inspircd_cmd_318(char *source, char *who) +void inspircd_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -975,7 +975,7 @@ void inspircd_cmd_318(char *source, char *who) } /* 242 */ -void inspircd_cmd_242(char *buf) +void inspircd_cmd_242(const char *buf) { if (!buf) { return; @@ -985,7 +985,7 @@ void inspircd_cmd_242(char *buf) } /* 243 */ -void inspircd_cmd_243(char *buf) +void inspircd_cmd_243(const char *buf) { if (!buf) { return; @@ -995,7 +995,7 @@ void inspircd_cmd_243(char *buf) } /* 211 */ -void inspircd_cmd_211(char *buf) +void inspircd_cmd_211(const char *buf) { if (!buf) { return; @@ -1005,7 +1005,7 @@ void inspircd_cmd_211(char *buf) } /* GLOBOPS */ -void inspircd_cmd_global(char *source, char *buf) +void inspircd_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1015,7 +1015,7 @@ void inspircd_cmd_global(char *source, char *buf) } /* SQLINE */ -void inspircd_cmd_sqline(char *mask, char *reason) +void inspircd_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -1025,7 +1025,7 @@ void inspircd_cmd_sqline(char *mask, char *reason) } /* SQUIT */ -void inspircd_cmd_squit(char *servname, char *message) +void inspircd_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1035,12 +1035,12 @@ void inspircd_cmd_squit(char *servname, char *message) } /* SVSO */ -void inspircd_cmd_svso(char *source, char *nick, char *flag) +void inspircd_cmd_svso(const char *source, const char *nick, const char *flag) { } /* NICK <newnick> */ -void inspircd_cmd_chg_nick(char *oldnick, char *newnick) +void inspircd_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1050,7 +1050,7 @@ void inspircd_cmd_chg_nick(char *oldnick, char *newnick) } /* SVSNICK */ -void inspircd_cmd_svsnick(char *source, char *guest, time_t when) +void inspircd_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1061,7 +1061,7 @@ void inspircd_cmd_svsnick(char *source, char *guest, time_t when) /* Functions that use serval cmd functions */ -void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void inspircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (!nick) { return; @@ -1093,7 +1093,7 @@ void inspircd_cmd_connect(int servernum) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1102,7 +1102,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1111,7 +1111,7 @@ int anope_event_436(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1122,7 +1122,7 @@ int anope_event_away(char *source, int ac, char **av) /* Taken from hybrid.c, topic syntax is identical */ -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { Channel *c = findchan(av[0]); time_t topic_time = time(NULL); @@ -1158,7 +1158,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1166,7 +1166,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1175,7 +1175,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1200,7 +1200,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1209,7 +1209,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1218,7 +1218,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1226,7 +1226,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1236,7 +1236,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -1251,11 +1251,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -1270,11 +1270,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -1289,10 +1289,10 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -1307,11 +1307,11 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -1326,12 +1326,12 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; struct in_addr addy; @@ -1361,7 +1361,7 @@ int anope_event_nick(char *source, int ac, char **av) } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -1376,12 +1376,12 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1391,7 +1391,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1399,7 +1399,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1407,7 +1407,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1416,49 +1416,49 @@ int anope_event_whois(char *source, int ac, char **av) } /* SVSHOLD - set */ -void inspircd_cmd_svshold(char *nick) +void inspircd_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void inspircd_cmd_release_svshold(char *nick) +void inspircd_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* UNSGLINE */ -void inspircd_cmd_unsgline(char *mask) +void inspircd_cmd_unsgline(const char *mask) { /* Not Supported by this IRCD */ } /* UNSZLINE */ -void inspircd_cmd_unszline(char *mask) +void inspircd_cmd_unszline(const char *mask) { send_cmd(s_OperServ, "ZLINE %s", mask); } /* SZLINE */ -void inspircd_cmd_szline(char *mask, char *reason, char *whom) +void inspircd_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(ServerName, "ADDLINE Z %s %s %ld 0 :%s", mask, whom, (long int) time(NULL), reason); } /* SGLINE */ -void inspircd_cmd_sgline(char *mask, char *reason) +void inspircd_cmd_sgline(const char *mask, const char *reason) { /* Not Supported by this IRCD */ } -void inspircd_cmd_unban(char *name, char *nick) +void inspircd_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick) +void inspircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1466,7 +1466,7 @@ void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ -void inspircd_cmd_svid_umode(char *nick, time_t ts) +void inspircd_cmd_svid_umode(const char *nick, time_t ts) { if (debug) alog("debug: common_svsmode(0)"); @@ -1482,29 +1482,29 @@ void inspircd_cmd_nc_change(User * u) } /* SVSMODE +r */ -void inspircd_cmd_svid_umode2(User * u, char *ts) +void inspircd_cmd_svid_umode2(User * u, const char *ts) { if (debug) alog("debug: common_svsmode(2)"); common_svsmode(u, "+r", NULL); } -void inspircd_cmd_svid_umode3(User * u, char *ts) +void inspircd_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } -void inspircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void inspircd_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SAJOIN %s %s", nick, chan); } -void inspircd_cmd_svspart(char *source, char *nick, char *chan) +void inspircd_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SAPART %s %s", nick, chan); } -void inspircd_cmd_swhois(char *source, char *who, char *mask) +void inspircd_cmd_swhois(const char *source, const char *who, const char *mask) { } @@ -1514,22 +1514,22 @@ void inspircd_cmd_eob() } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int inspircd_flood_mode_check(char *value) +int inspircd_flood_mode_check(const char *value) { char *dp, *end; @@ -1543,7 +1543,7 @@ int inspircd_flood_mode_check(char *value) } } -void inspircd_cmd_jupe(char *jserver, char *who, char *reason) +void inspircd_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1557,23 +1557,23 @@ void inspircd_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void inspircd_cmd_global_legacy(char *source, char *fmt) +void inspircd_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : s_OperServ, "GLOBOPS :%s", fmt); } -int inspircd_valid_nick(char *nick) +int inspircd_valid_nick(const char *nick) { return 1; } -int inspircd_valid_chan(char *chan) +int inspircd_valid_chan(const char *chan) { return 1; } -void inspircd_cmd_ctcp(char *source, char *dest, char *buf) +void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/inspircd10.h b/src/protocol/inspircd10.h index 35c69e040..301ebd2d2 100644 --- a/src/protocol/inspircd10.h +++ b/src/protocol/inspircd10.h @@ -51,84 +51,84 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void inspircd_set_umode(User * user, int ac, char **av); -void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void inspircd_set_umode(User * user, int ac, const char **av); +void inspircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void inspircd_cmd_vhost_off(User * u); -void inspircd_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void inspircd_cmd_svskill(char *source, char *user, char *buf); -void inspircd_cmd_svsmode(User * u, int ac, char **av); -void inspircd_cmd_372(char *source, char *msg); -void inspircd_cmd_372_error(char *source); -void inspircd_cmd_375(char *source); -void inspircd_cmd_376(char *source); -void inspircd_cmd_nick(char *nick, char *name, char *modes); -void inspircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void inspircd_cmd_mode(char *source, char *dest, char *buf); -void inspircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf); -void inspircd_cmd_notice_ops(char *source, char *dest, char *buf); -void inspircd_cmd_notice(char *source, char *dest, char *buf); -void inspircd_cmd_notice2(char *source, char *dest, char *msg); -void inspircd_cmd_privmsg(char *source, char *dest, char *buf); -void inspircd_cmd_privmsg2(char *source, char *dest, char *msg); -void inspircd_cmd_serv_notice(char *source, char *dest, char *msg); -void inspircd_cmd_serv_privmsg(char *source, char *dest, char *msg); -void inspircd_cmd_bot_chan_mode(char *nick, char *chan); -void inspircd_cmd_351(char *source); -void inspircd_cmd_quit(char *source, char *buf); -void inspircd_cmd_pong(char *servname, char *who); -void inspircd_cmd_join(char *user, char *channel, time_t chantime); -void inspircd_cmd_unsqline(char *user); -void inspircd_cmd_invite(char *source, char *chan, char *nick); -void inspircd_cmd_part(char *nick, char *chan, char *buf); -void inspircd_cmd_391(char *source, char *timestr); -void inspircd_cmd_250(char *buf); -void inspircd_cmd_307(char *buf); -void inspircd_cmd_311(char *buf); -void inspircd_cmd_312(char *buf); -void inspircd_cmd_317(char *buf); -void inspircd_cmd_219(char *source, char *letter); -void inspircd_cmd_401(char *source, char *who); -void inspircd_cmd_318(char *source, char *who); -void inspircd_cmd_242(char *buf); -void inspircd_cmd_243(char *buf); -void inspircd_cmd_211(char *buf); -void inspircd_cmd_global(char *source, char *buf); -void inspircd_cmd_global_legacy(char *source, char *fmt); -void inspircd_cmd_sqline(char *mask, char *reason); -void inspircd_cmd_squit(char *servname, char *message); -void inspircd_cmd_svso(char *source, char *nick, char *flag); -void inspircd_cmd_chg_nick(char *oldnick, char *newnick); -void inspircd_cmd_svsnick(char *source, char *guest, time_t when); -void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void inspircd_cmd_svskill(const char *source, const char *user, const char *buf); +void inspircd_cmd_svsmode(User * u, int ac, const char **av); +void inspircd_cmd_372(const char *source, const char *msg); +void inspircd_cmd_372_error(const char *source); +void inspircd_cmd_375(const char *source); +void inspircd_cmd_376(const char *source); +void inspircd_cmd_nick(const char *nick, const char *name, const char *modes); +void inspircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void inspircd_cmd_mode(const char *source, const char *dest, const char *buf); +void inspircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void inspircd_cmd_notice(const char *source, const char *dest, const char *buf); +void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg); +void inspircd_cmd_privmsg(const char *source, const char *dest, const char *buf); +void inspircd_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void inspircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void inspircd_cmd_bot_chan_mode(const char *nick, const char *chan); +void inspircd_cmd_351(const char *source); +void inspircd_cmd_quit(const char *source, const char *buf); +void inspircd_cmd_pong(const char *servname, const char *who); +void inspircd_cmd_join(const char *user, const char *channel, time_t chantime); +void inspircd_cmd_unsqline(const char *user); +void inspircd_cmd_invite(const char *source, const char *chan, const char *nick); +void inspircd_cmd_part(const char *nick, const char *chan, const char *buf); +void inspircd_cmd_391(const char *source, const char *timestr); +void inspircd_cmd_250(const char *buf); +void inspircd_cmd_307(const char *buf); +void inspircd_cmd_311(const char *buf); +void inspircd_cmd_312(const char *buf); +void inspircd_cmd_317(const char *buf); +void inspircd_cmd_219(const char *source, const char *letter); +void inspircd_cmd_401(const char *source, const char *who); +void inspircd_cmd_318(const char *source, const char *who); +void inspircd_cmd_242(const char *buf); +void inspircd_cmd_243(const char *buf); +void inspircd_cmd_211(const char *buf); +void inspircd_cmd_global(const char *source, const char *buf); +void inspircd_cmd_global_legacy(const char *source, const char *fmt); +void inspircd_cmd_sqline(const char *mask, const char *reason); +void inspircd_cmd_squit(const char *servname, const char *message); +void inspircd_cmd_svso(const char *source, const char *nick, const char *flag); +void inspircd_cmd_chg_nick(const char *oldnick, const char *newnick); +void inspircd_cmd_svsnick(const char *source, const char *guest, time_t when); +void inspircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void inspircd_cmd_connect(int servernum); -void inspircd_cmd_svshold(char *nick); -void inspircd_cmd_release_svshold(char *nick); -void inspircd_cmd_unsgline(char *mask); -void inspircd_cmd_unszline(char *mask); -void inspircd_cmd_szline(char *mask, char *reason, char *whom); -void inspircd_cmd_sgline(char *mask, char *reason); -void inspircd_cmd_unban(char *name, char *nick); -void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick); -void inspircd_cmd_svid_umode(char *nick, time_t ts); +void inspircd_cmd_svshold(const char *nick); +void inspircd_cmd_release_svshold(const char *nick); +void inspircd_cmd_unsgline(const char *mask); +void inspircd_cmd_unszline(const char *mask); +void inspircd_cmd_szline(const char *mask, const char *reason, const char *whom); +void inspircd_cmd_sgline(const char *mask, const char *reason); +void inspircd_cmd_unban(const char *name, const char *nick); +void inspircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void inspircd_cmd_svid_umode(const char *nick, time_t ts); void inspircd_cmd_nc_change(User * u); -void inspircd_cmd_svid_umode2(User * u, char *ts); -void inspircd_cmd_svid_umode3(User * u, char *ts); +void inspircd_cmd_svid_umode2(User * u, const char *ts); +void inspircd_cmd_svid_umode3(User * u, const char *ts); void inspircd_cmd_eob(); -int inspircd_flood_mode_check(char *value); -void inspircd_cmd_jupe(char *jserver, char *who, char *reason); -int inspircd_valid_nick(char *nick); -void inspircd_cmd_ctcp(char *source, char *dest, char *buf); -int anope_event_fjoin(char *source, int ac, char **av); -int anope_event_fmode(char *source, int ac, char **av); -int anope_event_ftopic(char *source, int ac, char **av); -int anope_event_sanick(char *source, int ac, char **av); -int anope_event_samode(char *source, int ac, char **av); -int anope_event_sajoin(char *source, int ac, char **av); -int anope_event_sapart(char *source, int ac, char **av); -int anope_event_version(char *source, int ac, char **av); -int anope_event_opertype(char *source, int ac, char **av); -int anope_event_idle(char* source, int ac, char **av); +int inspircd_flood_mode_check(const char *value); +void inspircd_cmd_jupe(const char *jserver, const char *who, const char *reason); +int inspircd_valid_nick(const char *nick); +void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf); +int anope_event_fjoin(const char *source, int ac, const char **av); +int anope_event_fmode(const char *source, int ac, const char **av); +int anope_event_ftopic(const char *source, int ac, const char **av); +int anope_event_sanick(const char *source, int ac, const char **av); +int anope_event_samode(const char *source, int ac, const char **av); +int anope_event_sajoin(const char *source, int ac, const char **av); +int anope_event_sapart(const char *source, int ac, const char **av); +int anope_event_version(const char *source, int ac, const char **av); +int anope_event_opertype(const char *source, int ac, const char **av); +int anope_event_idle(const char *source, int ac, const char **av); class InspIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index ea272697c..32a87608a 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -393,10 +393,10 @@ static int has_messagefloodmod = 0; static int has_banexceptionmod = 0; static int has_inviteexceptionmod = 0; -void inspircd_set_umode(User * user, int ac, char **av) +void inspircd_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -523,19 +523,19 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -void inspircd_cmd_svsadmin(char *server, int set) +void inspircd_cmd_svsadmin(const char *server, int set) { /* Not Supported by this IRCD */ } -void InspIRCd::cmd_remove_akill(const char *user, const char *host) +void InspIRCdProto::cmd_remove_akill(const char *user, const char *host) { send_cmd(s_OperServ, "GLINE %s@%s", user, host); } void -inspircd_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +inspircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "FTOPIC %s %lu %s :%s", chan, (unsigned long int) when, whosetit, topic); @@ -547,14 +547,14 @@ void inspircd_cmd_vhost_off(User * u) } void -inspircd_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", user, host, who, (long int) when, (long int) 86400 * 2, reason); } -void inspircd_cmd_svskill(char *source, char *user, char *buf) +void inspircd_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf || !source || !user) return; @@ -562,7 +562,7 @@ void inspircd_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "KILL %s :%s", user, buf); } -void inspircd_cmd_svsmode(User * u, int ac, char **av) +void inspircd_cmd_svsmode(User * u, int ac, const char **av) { /* This was originally done using this: send_cmd(s_NickServ, "MODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); @@ -572,29 +572,29 @@ void inspircd_cmd_svsmode(User * u, int ac, char **av) } -void inspircd_cmd_372(char *source, char *msg) +void inspircd_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void inspircd_cmd_372_error(char *source) +void inspircd_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void inspircd_cmd_375(char *source) +void inspircd_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void inspircd_cmd_376(char *source) +void inspircd_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void inspircd_cmd_nick(char *nick, char *name, char *modes) +void inspircd_cmd_nick(const char *nick, const char *name, const char *modes) { /* :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards */ send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s", @@ -605,14 +605,14 @@ void inspircd_cmd_nick(char *nick, char *name, char *modes) } void -inspircd_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +inspircd_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s", (long int) time(NULL), nick, host, host, user, modes, real); } -void inspircd_cmd_mode(char *source, char *dest, char *buf) +void inspircd_cmd_mode(const char *source, const char *dest, const char *buf) { Channel *c; if (!buf) { @@ -623,12 +623,12 @@ void inspircd_cmd_mode(char *source, char *dest, char *buf) send_cmd(source ? source : s_OperServ, "FMODE %s %u %s", dest, (unsigned int)((c) ? c->creation_time : time(NULL)), buf); } -int anope_event_version(char *source, int ac, char **av) +int anope_event_version(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_idle(char *source, int ac, char **av) +int anope_event_idle(const char *source, int ac, const char **av) { if (ac == 1) { send_cmd(av[0], "IDLE %s %ld 0", source, (long int) time(NULL)); @@ -636,10 +636,10 @@ int anope_event_idle(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ftopic(char *source, int ac, char **av) +int anope_event_ftopic(const char *source, int ac, const char **av) { /* :source FTOPIC channel ts setby :topic */ - char *temp; + const char *temp; if (ac < 4) return MOD_CONT; temp = av[1]; /* temp now holds ts */ @@ -649,14 +649,14 @@ int anope_event_ftopic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_opertype(char *source, int ac, char **av) +int anope_event_opertype(const char *source, int ac, const char **av) { /* opertype is equivalent to mode +o because servers dont do this directly */ User *u; u = finduser(source); if (u && !is_oper(u)) { - char *newav[2]; + const char *newav[2]; newav[0] = source; newav[1] = "+o"; return anope_event_mode(source, 2, newav); @@ -664,9 +664,9 @@ int anope_event_opertype(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_fmode(char *source, int ac, char **av) +int anope_event_fmode(const char *source, int ac, const char **av) { - char *newav[25]; + const char *newav[25]; int n, o; Channel *c; @@ -703,9 +703,9 @@ int anope_event_fmode(char *source, int ac, char **av) return anope_event_mode(source, ac - 1, newav); } -int anope_event_fjoin(char *source, int ac, char **av) +int anope_event_fjoin(const char *source, int ac, const char **av) { - char *newav[10]; + const char *newav[10]; /* value used for myStrGetToken */ int curtoken = 0; @@ -763,15 +763,15 @@ int anope_event_fjoin(char *source, int ac, char **av) } void -inspircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +inspircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s", (long int) time(NULL), nick, host, host, user, modes, real); send_cmd(nick, "OPERTYPE Bot"); } -void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf) +void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -780,7 +780,7 @@ void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void inspircd_cmd_notice_ops(char *source, char *dest, char *buf) +void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -790,7 +790,7 @@ void inspircd_cmd_notice_ops(char *source, char *dest, char *buf) } -void inspircd_cmd_notice(char *source, char *dest, char *buf) +void inspircd_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -803,12 +803,12 @@ void inspircd_cmd_notice(char *source, char *dest, char *buf) } } -void inspircd_cmd_notice2(char *source, char *dest, char *msg) +void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void inspircd_cmd_privmsg(char *source, char *dest, char *buf) +void inspircd_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -817,28 +817,28 @@ void inspircd_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void inspircd_cmd_privmsg2(char *source, char *dest, char *msg) +void inspircd_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void inspircd_cmd_serv_notice(char *source, char *dest, char *msg) +void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void inspircd_cmd_serv_privmsg(char *source, char *dest, char *msg) +void inspircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void inspircd_cmd_bot_chan_mode(char *nick, char *chan) +void inspircd_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } -void inspircd_cmd_351(char *source) +void inspircd_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -846,7 +846,7 @@ void inspircd_cmd_351(char *source) } /* QUIT */ -void inspircd_cmd_quit(char *source, char *buf) +void inspircd_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -863,32 +863,32 @@ void inspircd_cmd_protoctl() static char currentpass[1024]; /* PASS */ -void inspircd_cmd_pass(char *pass) +void inspircd_cmd_pass(const char *pass) { strncpy(currentpass, pass, 1024); } /* SERVER services-dev.chatspike.net password 0 :Description here */ -void inspircd_cmd_server(char *servname, int hop, char *descript) +void inspircd_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(ServerName, "SERVER %s %s %d :%s", servname, currentpass, hop, descript); } /* PONG */ -void inspircd_cmd_pong(char *servname, char *who) +void inspircd_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } /* JOIN */ -void inspircd_cmd_join(char *user, char *channel, time_t chantime) +void inspircd_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "JOIN %s", channel); } /* UNSQLINE */ -void inspircd_cmd_unsqline(char *user) +void inspircd_cmd_unsqline(const char *user) { if (!user) { return; @@ -897,7 +897,7 @@ void inspircd_cmd_unsqline(char *user) } /* CHGHOST */ -void inspircd_cmd_chghost(char *nick, char *vhost) +void inspircd_cmd_chghost(const char *nick, const char *vhost) { if (has_chghostmod == 1) { if (!nick || !vhost) { @@ -910,7 +910,7 @@ void inspircd_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void inspircd_cmd_chgident(char *nick, char *vIdent) +void inspircd_cmd_chgident(const char *nick, const char *vIdent) { if (has_chgidentmod == 1) { if (!nick || !vIdent || !*vIdent) { @@ -923,7 +923,7 @@ void inspircd_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void inspircd_cmd_invite(char *source, char *chan, char *nick) +void inspircd_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -933,7 +933,7 @@ void inspircd_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void inspircd_cmd_part(char *nick, char *chan, char *buf) +void inspircd_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -947,7 +947,7 @@ void inspircd_cmd_part(char *nick, char *chan, char *buf) } /* 391 */ -void inspircd_cmd_391(char *source, char *timestr) +void inspircd_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -956,7 +956,7 @@ void inspircd_cmd_391(char *source, char *timestr) } /* 250 */ -void inspircd_cmd_250(char *buf) +void inspircd_cmd_250(const char *buf) { if (!buf) { return; @@ -966,7 +966,7 @@ void inspircd_cmd_250(char *buf) } /* 307 */ -void inspircd_cmd_307(char *buf) +void inspircd_cmd_307(const char *buf) { if (!buf) { return; @@ -976,7 +976,7 @@ void inspircd_cmd_307(char *buf) } /* 311 */ -void inspircd_cmd_311(char *buf) +void inspircd_cmd_311(const char *buf) { if (!buf) { return; @@ -986,7 +986,7 @@ void inspircd_cmd_311(char *buf) } /* 312 */ -void inspircd_cmd_312(char *buf) +void inspircd_cmd_312(const char *buf) { if (!buf) { return; @@ -996,7 +996,7 @@ void inspircd_cmd_312(char *buf) } /* 317 */ -void inspircd_cmd_317(char *buf) +void inspircd_cmd_317(const char *buf) { if (!buf) { return; @@ -1006,7 +1006,7 @@ void inspircd_cmd_317(char *buf) } /* 219 */ -void inspircd_cmd_219(char *source, char *letter) +void inspircd_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1021,7 +1021,7 @@ void inspircd_cmd_219(char *source, char *letter) } /* 401 */ -void inspircd_cmd_401(char *source, char *who) +void inspircd_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1030,7 +1030,7 @@ void inspircd_cmd_401(char *source, char *who) } /* 318 */ -void inspircd_cmd_318(char *source, char *who) +void inspircd_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1040,7 +1040,7 @@ void inspircd_cmd_318(char *source, char *who) } /* 242 */ -void inspircd_cmd_242(char *buf) +void inspircd_cmd_242(const char *buf) { if (!buf) { return; @@ -1050,7 +1050,7 @@ void inspircd_cmd_242(char *buf) } /* 243 */ -void inspircd_cmd_243(char *buf) +void inspircd_cmd_243(const char *buf) { if (!buf) { return; @@ -1060,7 +1060,7 @@ void inspircd_cmd_243(char *buf) } /* 211 */ -void inspircd_cmd_211(char *buf) +void inspircd_cmd_211(const char *buf) { if (!buf) { return; @@ -1070,7 +1070,7 @@ void inspircd_cmd_211(char *buf) } /* GLOBOPS */ -void inspircd_cmd_global(char *source, char *buf) +void inspircd_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1080,7 +1080,7 @@ void inspircd_cmd_global(char *source, char *buf) } /* SQLINE */ -void inspircd_cmd_sqline(char *mask, char *reason) +void inspircd_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -1091,7 +1091,7 @@ void inspircd_cmd_sqline(char *mask, char *reason) } /* SQUIT */ -void inspircd_cmd_squit(char *servname, char *message) +void inspircd_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1101,12 +1101,12 @@ void inspircd_cmd_squit(char *servname, char *message) } /* SVSO */ -void inspircd_cmd_svso(char *source, char *nick, char *flag) +void inspircd_cmd_svso(const char *source, const char *nick, const char *flag) { } /* NICK <newnick> */ -void inspircd_cmd_chg_nick(char *oldnick, char *newnick) +void inspircd_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1116,7 +1116,7 @@ void inspircd_cmd_chg_nick(char *oldnick, char *newnick) } /* SVSNICK */ -void inspircd_cmd_svsnick(char *source, char *guest, time_t when) +void inspircd_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1128,7 +1128,7 @@ void inspircd_cmd_svsnick(char *source, char *guest, time_t when) /* Functions that use serval cmd functions */ -void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void inspircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (!nick) { return; @@ -1162,7 +1162,7 @@ void inspircd_cmd_connect(int servernum) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1171,7 +1171,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1180,7 +1180,7 @@ int anope_event_436(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1191,7 +1191,7 @@ int anope_event_away(char *source, int ac, char **av) /* Taken from hybrid.c, topic syntax is identical */ -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { Channel *c = findchan(av[0]); time_t topic_time = time(NULL); @@ -1227,7 +1227,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1235,7 +1235,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_rsquit(char *source, int ac, char **av) +int anope_event_rsquit(const char *source, int ac, const char **av) { if (ac < 1 || ac > 3) return MOD_CONT; @@ -1249,7 +1249,7 @@ int anope_event_rsquit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1258,7 +1258,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1280,7 +1280,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1289,7 +1289,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1298,7 +1298,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1306,7 +1306,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1316,7 +1316,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -1331,11 +1331,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -1350,11 +1350,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -1369,11 +1369,11 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -1388,11 +1388,11 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -1407,12 +1407,12 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; struct in_addr addy; @@ -1444,7 +1444,7 @@ int anope_event_nick(char *source, int ac, char **av) } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -1459,12 +1459,12 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1474,7 +1474,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1482,7 +1482,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1490,7 +1490,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1498,10 +1498,9 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { int argc; - char **argv; CBModeInfo *cbmi; if (strcasecmp(av[0], "START") == 0) { @@ -1612,13 +1611,7 @@ int anope_event_capab(char *source, int ac, char **av) * fine. It's ugly, but it works.... */ argc = 6; - argv = scalloc(argc, sizeof(char *)); - argv[0] = "NOQUIT"; - argv[1] = "SSJ3"; - argv[2] = "NICK2"; - argv[3] = "VL"; - argv[4] = "TLKEXT"; - argv[5] = "UNCONNECT"; + const char *argv[] = {"NOQUIT", "SSJ3", "NICK2", "VL", "TLKEXT", "UNCONNECT"}; capab_parse(argc, argv); } @@ -1626,51 +1619,51 @@ int anope_event_capab(char *source, int ac, char **av) } /* SVSHOLD - set */ -void inspircd_cmd_svshold(char *nick) +void inspircd_cmd_svshold(const char *nick) { send_cmd(s_OperServ, "SVSHOLD %s %ds :%s", nick, NSReleaseTimeout, "Being held for registered user"); } /* SVSHOLD - release */ -void inspircd_cmd_release_svshold(char *nick) +void inspircd_cmd_release_svshold(const char *nick) { send_cmd(s_OperServ, "SVSHOLD %s", nick); } /* UNSGLINE */ -void inspircd_cmd_unsgline(char *mask) +void inspircd_cmd_unsgline(const char *mask) { /* Not Supported by this IRCD */ } /* UNSZLINE */ -void inspircd_cmd_unszline(char *mask) +void inspircd_cmd_unszline(const char *mask) { send_cmd(s_OperServ, "ZLINE %s", mask); } /* SZLINE */ -void inspircd_cmd_szline(char *mask, char *reason, char *whom) +void inspircd_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(ServerName, "ADDLINE Z %s %s %ld 0 :%s", mask, whom, (long int) time(NULL), reason); } /* SGLINE */ -void inspircd_cmd_sgline(char *mask, char *reason) +void inspircd_cmd_sgline(const char *mask, const char *reason) { /* Not Supported by this IRCD */ } -void inspircd_cmd_unban(char *name, char *nick) +void inspircd_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick) +void inspircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1678,7 +1671,7 @@ void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ -void inspircd_cmd_svid_umode(char *nick, time_t ts) +void inspircd_cmd_svid_umode(const char *nick, time_t ts) { if (debug) alog("debug: common_svsmode(0)"); @@ -1694,29 +1687,29 @@ void inspircd_cmd_nc_change(User * u) } /* SVSMODE +r */ -void inspircd_cmd_svid_umode2(User * u, char *ts) +void inspircd_cmd_svid_umode2(User * u, const char *ts) { if (debug) alog("debug: common_svsmode(2)"); common_svsmode(u, "+r", NULL); } -void inspircd_cmd_svid_umode3(User * u, char *ts) +void inspircd_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } -void inspircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void inspircd_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SVSJOIN %s %s", nick, chan); } -void inspircd_cmd_svspart(char *source, char *nick, char *chan) +void inspircd_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SVSPART %s %s", nick, chan); } -void inspircd_cmd_swhois(char *source, char *who, char *mask) +void inspircd_cmd_swhois(const char *source, const char *who, const char *mask) { /* Not used currently */ } @@ -1727,22 +1720,22 @@ void inspircd_cmd_eob() } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int inspircd_flood_mode_check(char *value) +int inspircd_flood_mode_check(const char *value) { char *dp, *end; @@ -1756,7 +1749,7 @@ int inspircd_flood_mode_check(char *value) } } -void inspircd_cmd_jupe(char *jserver, char *who, char *reason) +void inspircd_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1770,23 +1763,23 @@ void inspircd_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void inspircd_cmd_global_legacy(char *source, char *fmt) +void inspircd_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : s_OperServ, "GLOBOPS :%s", fmt); } -int inspircd_valid_nick(char *nick) +int inspircd_valid_nick(const char *nick) { return 1; } -int inspircd_valid_chan(char *chan) +int inspircd_valid_chan(const char *chan) { return 1; } -void inspircd_cmd_ctcp(char *source, char *dest, char *buf) +void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/inspircd11.h b/src/protocol/inspircd11.h index 4e9a8e85b..b6bf47268 100755 --- a/src/protocol/inspircd11.h +++ b/src/protocol/inspircd11.h @@ -51,85 +51,85 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void inspircd_set_umode(User * user, int ac, char **av); -void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void inspircd_set_umode(User * user, int ac, const char **av); +void inspircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void inspircd_cmd_vhost_off(User * u); -void inspircd_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void inspircd_cmd_svskill(char *source, char *user, char *buf); -void inspircd_cmd_svsmode(User * u, int ac, char **av); -void inspircd_cmd_372(char *source, char *msg); -void inspircd_cmd_372_error(char *source); -void inspircd_cmd_375(char *source); -void inspircd_cmd_376(char *source); -void inspircd_cmd_nick(char *nick, char *name, char *modes); -void inspircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void inspircd_cmd_mode(char *source, char *dest, char *buf); -void inspircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf); -void inspircd_cmd_notice_ops(char *source, char *dest, char *buf); -void inspircd_cmd_notice(char *source, char *dest, char *buf); -void inspircd_cmd_notice2(char *source, char *dest, char *msg); -void inspircd_cmd_privmsg(char *source, char *dest, char *buf); -void inspircd_cmd_privmsg2(char *source, char *dest, char *msg); -void inspircd_cmd_serv_notice(char *source, char *dest, char *msg); -void inspircd_cmd_serv_privmsg(char *source, char *dest, char *msg); -void inspircd_cmd_bot_chan_mode(char *nick, char *chan); -void inspircd_cmd_351(char *source); -void inspircd_cmd_quit(char *source, char *buf); -void inspircd_cmd_pong(char *servname, char *who); -void inspircd_cmd_join(char *user, char *channel, time_t chantime); -void inspircd_cmd_unsqline(char *user); -void inspircd_cmd_invite(char *source, char *chan, char *nick); -void inspircd_cmd_part(char *nick, char *chan, char *buf); -void inspircd_cmd_391(char *source, char *timestr); -void inspircd_cmd_250(char *buf); -void inspircd_cmd_307(char *buf); -void inspircd_cmd_311(char *buf); -void inspircd_cmd_312(char *buf); -void inspircd_cmd_317(char *buf); -void inspircd_cmd_219(char *source, char *letter); -void inspircd_cmd_401(char *source, char *who); -void inspircd_cmd_318(char *source, char *who); -void inspircd_cmd_242(char *buf); -void inspircd_cmd_243(char *buf); -void inspircd_cmd_211(char *buf); -void inspircd_cmd_global(char *source, char *buf); -void inspircd_cmd_global_legacy(char *source, char *fmt); -void inspircd_cmd_sqline(char *mask, char *reason); -void inspircd_cmd_squit(char *servname, char *message); -void inspircd_cmd_svso(char *source, char *nick, char *flag); -void inspircd_cmd_chg_nick(char *oldnick, char *newnick); -void inspircd_cmd_svsnick(char *source, char *guest, time_t when); -void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void inspircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void inspircd_cmd_svskill(const char *source, const char *user, const char *buf); +void inspircd_cmd_svsmode(User * u, int ac, const char **av); +void inspircd_cmd_372(const char *source, const char *msg); +void inspircd_cmd_372_error(const char *source); +void inspircd_cmd_375(const char *source); +void inspircd_cmd_376(const char *source); +void inspircd_cmd_nick(const char *nick, const char *name, const char *modes); +void inspircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void inspircd_cmd_mode(const char *source, const char *dest, const char *buf); +void inspircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void inspircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void inspircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void inspircd_cmd_notice(const char *source, const char *dest, const char *buf); +void inspircd_cmd_notice2(const char *source, const char *dest, const char *msg); +void inspircd_cmd_privmsg(const char *source, const char *dest, const char *buf); +void inspircd_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void inspircd_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void inspircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void inspircd_cmd_bot_chan_mode(const char *nick, const char *chan); +void inspircd_cmd_351(const char *source); +void inspircd_cmd_quit(const char *source, const char *buf); +void inspircd_cmd_pong(const char *servname, const char *who); +void inspircd_cmd_join(const char *user, const char *channel, time_t chantime); +void inspircd_cmd_unsqline(const char *user); +void inspircd_cmd_invite(const char *source, const char *chan, const char *nick); +void inspircd_cmd_part(const char *nick, const char *chan, const char *buf); +void inspircd_cmd_391(const char *source, const char *timestr); +void inspircd_cmd_250(const char *buf); +void inspircd_cmd_307(const char *buf); +void inspircd_cmd_311(const char *buf); +void inspircd_cmd_312(const char *buf); +void inspircd_cmd_317(const char *buf); +void inspircd_cmd_219(const char *source, const char *letter); +void inspircd_cmd_401(const char *source, const char *who); +void inspircd_cmd_318(const char *source, const char *who); +void inspircd_cmd_242(const char *buf); +void inspircd_cmd_243(const char *buf); +void inspircd_cmd_211(const char *buf); +void inspircd_cmd_global(const char *source, const char *buf); +void inspircd_cmd_global_legacy(const char *source, const char *fmt); +void inspircd_cmd_sqline(const char *mask, const char *reason); +void inspircd_cmd_squit(const char *servname, const char *message); +void inspircd_cmd_svso(const char *source, const char *nick, const char *flag); +void inspircd_cmd_chg_nick(const char *oldnick, const char *newnick); +void inspircd_cmd_svsnick(const char *source, const char *guest, time_t when); +void inspircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void inspircd_cmd_connect(int servernum); -void inspircd_cmd_svshold(char *nick); -void inspircd_cmd_release_svshold(char *nick); -void inspircd_cmd_unsgline(char *mask); -void inspircd_cmd_unszline(char *mask); -void inspircd_cmd_szline(char *mask, char *reason, char *whom); -void inspircd_cmd_sgline(char *mask, char *reason); -void inspircd_cmd_unban(char *name, char *nick); -void inspircd_cmd_svsmode_chan(char *name, char *mode, char *nick); -void inspircd_cmd_svid_umode(char *nick, time_t ts); +void inspircd_cmd_svshold(const char *nick); +void inspircd_cmd_release_svshold(const char *nick); +void inspircd_cmd_unsgline(const char *mask); +void inspircd_cmd_unszline(const char *mask); +void inspircd_cmd_szline(const char *mask, const char *reason, const char *whom); +void inspircd_cmd_sgline(const char *mask, const char *reason); +void inspircd_cmd_unban(const char *name, const char *nick); +void inspircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void inspircd_cmd_svid_umode(const char *nick, time_t ts); void inspircd_cmd_nc_change(User * u); -void inspircd_cmd_svid_umode2(User * u, char *ts); -void inspircd_cmd_svid_umode3(User * u, char *ts); +void inspircd_cmd_svid_umode2(User * u, const char *ts); +void inspircd_cmd_svid_umode3(User * u, const char *ts); void inspircd_cmd_eob(); -int inspircd_flood_mode_check(char *value); -void inspircd_cmd_jupe(char *jserver, char *who, char *reason); -int inspircd_valid_nick(char *nick); -void inspircd_cmd_ctcp(char *source, char *dest, char *buf); -int anope_event_fjoin(char *source, int ac, char **av); -int anope_event_fmode(char *source, int ac, char **av); -int anope_event_ftopic(char *source, int ac, char **av); -int anope_event_sanick(char *source, int ac, char **av); -int anope_event_samode(char *source, int ac, char **av); -int anope_event_sajoin(char *source, int ac, char **av); -int anope_event_sapart(char *source, int ac, char **av); -int anope_event_version(char *source, int ac, char **av); -int anope_event_opertype(char *source, int ac, char **av); -int anope_event_idle(char* source, int ac, char **av); -int anope_event_rsquit(char *source, int ac, char **av); +int inspircd_flood_mode_check(const char *value); +void inspircd_cmd_jupe(const char *jserver, const char *who, const char *reason); +int inspircd_valid_nick(const char *nick); +void inspircd_cmd_ctcp(const char *source, const char *dest, const char *buf); +int anope_event_fjoin(const char *source, int ac, const char **av); +int anope_event_fmode(const char *source, int ac, const char **av); +int anope_event_ftopic(const char *source, int ac, const char **av); +int anope_event_sanick(const char *source, int ac, const char **av); +int anope_event_samode(const char *source, int ac, const char **av); +int anope_event_sajoin(const char *source, int ac, const char **av); +int anope_event_sapart(const char *source, int ac, const char **av); +int anope_event_version(const char *source, int ac, const char **av); +int anope_event_opertype(const char *source, int ac, const char **av); +int anope_event_idle(const char *source, int ac, const char **av); +int anope_event_rsquit(const char *source, int ac, const char **av); class InspIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/plexus2.c b/src/protocol/plexus2.c index 8ba499410..596288916 100644 --- a/src/protocol/plexus2.c +++ b/src/protocol/plexus2.c @@ -145,10 +145,10 @@ IRCDCAPAB myIrcdcap[] = { void -plexus_set_umode (User * user, int ac, char **av) +plexus_set_umode (User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -533,7 +533,7 @@ CUMode myCumodes[128] = { void -plexus_cmd_notice (char *source, char *dest, char *buf) +plexus_cmd_notice (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -551,13 +551,13 @@ plexus_cmd_notice (char *source, char *dest, char *buf) } void -plexus_cmd_notice2 (char *source, char *dest, char *msg) +plexus_cmd_notice2 (const char *source, const char *dest, const char *msg) { send_cmd (source, "NOTICE %s :%s", dest, msg); } void -plexus_cmd_privmsg (char *source, char *dest, char *buf) +plexus_cmd_privmsg (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -568,26 +568,26 @@ plexus_cmd_privmsg (char *source, char *dest, char *buf) } void -plexus_cmd_privmsg2 (char *source, char *dest, char *msg) +plexus_cmd_privmsg2 (const char *source, const char *dest, const char *msg) { send_cmd (source, "PRIVMSG %s :%s", dest, msg); } void -plexus_cmd_serv_notice (char *source, char *dest, char *msg) +plexus_cmd_serv_notice (const char *source, const char *dest, const char *msg) { send_cmd (source, "NOTICE $$%s :%s", dest, msg); } void -plexus_cmd_serv_privmsg (char *source, char *dest, char *msg) +plexus_cmd_serv_privmsg (const char *source, const char *dest, const char *msg) { send_cmd (source, "PRIVMSG $$%s :%s", dest, msg); } void -plexus_cmd_global (char *source, char *buf) +plexus_cmd_global (const char *source, const char *buf) { if (!buf) { @@ -599,20 +599,20 @@ plexus_cmd_global (char *source, char *buf) /* GLOBOPS - to handle old WALLOPS */ void -plexus_cmd_global_legacy (char *source, char *fmt) +plexus_cmd_global_legacy (const char *source, const char *fmt) { send_cmd (source ? source : ServerName, "OPERWALL :%s", fmt); } int -anope_event_sjoin (char *source, int ac, char **av) +anope_event_sjoin (const char *source, int ac, const char **av) { do_sjoin (source, ac, av); return MOD_CONT; } int -anope_event_nick (char *source, int ac, char **av) +anope_event_nick (const char *source, int ac, const char **av) { if (ac != 2) { @@ -631,7 +631,7 @@ anope_event_nick (char *source, int ac, char **av) } int -anope_event_topic (char *source, int ac, char **av) +anope_event_topic (const char *source, int ac, const char **av) { if (ac == 4) { @@ -678,7 +678,7 @@ anope_event_topic (char *source, int ac, char **av) } int -anope_event_tburst (char *source, int ac, char **av) +anope_event_tburst (const char *source, int ac, const char **av) { if (ac != 5) return MOD_CONT; @@ -691,7 +691,7 @@ anope_event_tburst (char *source, int ac, char **av) } int -anope_event_436 (char *source, int ac, char **av) +anope_event_436 (const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -778,36 +778,36 @@ moduleAddIRCDMsgs (void) } void -plexus_cmd_sqline (char *mask, char *reason) +plexus_cmd_sqline (const char *mask, const char *reason) { send_cmd (s_OperServ, "RESV * %s :%s", mask, reason); } void -plexus_cmd_unsgline (char *mask) +plexus_cmd_unsgline (const char *mask) { send_cmd (s_OperServ, "UNXLINE * %s", mask); } void -plexus_cmd_unszline (char *mask) +plexus_cmd_unszline (const char *mask) { /* Does not support */ } void -plexus_cmd_szline (char *mask, char *reason, char *whom) +plexus_cmd_szline (const char *mask, const char *reason, const char *whom) { /* Does not support */ } void -plexus_cmd_svsadmin (char *server, int set) +plexus_cmd_svsadmin (const char *server, int set) { } void -plexus_cmd_sgline (char *mask, char *reason) +plexus_cmd_sgline (const char *mask, const char *reason) { send_cmd (s_OperServ, "XLINE * %s :%s", mask, reason); } @@ -818,8 +818,8 @@ void PleXusIRCdProto::cmd_remove_akill(const char *user, const char *host) } void -plexus_cmd_topic (char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +plexus_cmd_topic (const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd (whosets, "SVSTOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -832,7 +832,7 @@ plexus_cmd_vhost_off (User * u) } void -plexus_cmd_vhost_on (char *nick, char *vIdent, char *vhost) +plexus_cmd_vhost_on (const char *nick, const char *vIdent, const char *vhost) { User *u; @@ -851,13 +851,13 @@ plexus_cmd_vhost_on (char *nick, char *vIdent, char *vhost) } void -plexus_cmd_unsqline (char *user) +plexus_cmd_unsqline (const char *user) { send_cmd (s_OperServ, "UNRESV * %s", user); } void -plexus_cmd_join (char *user, char *channel, time_t chantime) +plexus_cmd_join (const char *user, const char *channel, time_t chantime) { send_cmd (ServerName, "SJOIN %ld %s + :%s", (long int) chantime, channel, user); @@ -873,15 +873,15 @@ reason: the reason for the kline. */ void -plexus_cmd_akill (char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +plexus_cmd_akill (const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd (s_OperServ, "KLINE * %ld %s %s :%s", (long int) (expires - (long) time (NULL)), user, host, reason); } void -plexus_cmd_svskill (char *source, char *user, char *buf) +plexus_cmd_svskill (const char *source, const char *user, const char *buf) { if (!buf) { @@ -897,7 +897,7 @@ plexus_cmd_svskill (char *source, char *user, char *buf) } void -plexus_cmd_svsmode (User * u, int ac, char **av) +plexus_cmd_svsmode (User * u, int ac, const char **av) { send_cmd (ServerName, "SVSMODE %s %s", u->nick, av[0]); @@ -949,14 +949,14 @@ plexus_cmd_capab () /* PASS */ void -plexus_cmd_pass (char *pass) +plexus_cmd_pass (const char *pass) { send_cmd (NULL, "PASS %s :TS", pass); } /* SERVER name hop descript */ void -plexus_cmd_server (char *servname, int hop, char *descript) +plexus_cmd_server (const char *servname, int hop, const char *descript) { send_cmd (NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -987,8 +987,8 @@ plexus_cmd_svsinfo () void -plexus_cmd_bot_nick (char *nick, char *user, char *host, char *real, - char *modes) +plexus_cmd_bot_nick (const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick (nick, NULL); send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s %s 0 :%s", nick, @@ -998,7 +998,7 @@ plexus_cmd_bot_nick (char *nick, char *user, char *host, char *real, } void -plexus_cmd_part (char *nick, char *chan, char *buf) +plexus_cmd_part (const char *nick, const char *chan, const char *buf) { if (buf) { @@ -1011,7 +1011,7 @@ plexus_cmd_part (char *nick, char *chan, char *buf) } int -anope_event_sethost (char *source, int ac, char **av) +anope_event_sethost (const char *source, int ac, const char **av) { User *u; @@ -1028,12 +1028,12 @@ anope_event_sethost (char *source, int ac, char **av) return MOD_CONT; } - change_user_host (u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } int -anope_event_ping (char *source, int ac, char **av) +anope_event_ping (const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1042,7 +1042,7 @@ anope_event_ping (char *source, int ac, char **av) } int -anope_event_away (char *source, int ac, char **av) +anope_event_away (const char *source, int ac, const char **av) { if (!source) { @@ -1053,7 +1053,7 @@ anope_event_away (char *source, int ac, char **av) } int -anope_event_kill (char *source, int ac, char **av) +anope_event_kill (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1063,7 +1063,7 @@ anope_event_kill (char *source, int ac, char **av) } int -anope_event_kick (char *source, int ac, char **av) +anope_event_kick (const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1072,7 +1072,7 @@ anope_event_kick (char *source, int ac, char **av) } int -anope_event_eob (char *source, int ac, char **av) +anope_event_eob (const char *source, int ac, const char **av) { Server *s; s = findserver (servlist, source); @@ -1095,7 +1095,7 @@ plexus_cmd_eob () int -anope_event_join (char *source, int ac, char **av) +anope_event_join (const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1104,7 +1104,7 @@ anope_event_join (char *source, int ac, char **av) } int -anope_event_motd (char *source, int ac, char **av) +anope_event_motd (const char *source, int ac, const char **av) { if (!source) { @@ -1116,7 +1116,7 @@ anope_event_motd (char *source, int ac, char **av) } int -anope_event_privmsg (char *source, int ac, char **av) +anope_event_privmsg (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1125,7 +1125,7 @@ anope_event_privmsg (char *source, int ac, char **av) } int -anope_event_part (char *source, int ac, char **av) +anope_event_part (const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1134,7 +1134,7 @@ anope_event_part (char *source, int ac, char **av) } int -anope_event_whois (char *source, int ac, char **av) +anope_event_whois (const char *source, int ac, const char **av) { if (source && ac >= 1) { @@ -1145,7 +1145,7 @@ anope_event_whois (char *source, int ac, char **av) /* EVENT: SERVER */ int -anope_event_server (char *source, int ac, char **av) +anope_event_server (const char *source, int ac, const char **av) { if (!stricmp (av[1], "1")) { @@ -1156,7 +1156,7 @@ anope_event_server (char *source, int ac, char **av) } int -anope_event_squit (char *source, int ac, char **av) +anope_event_squit (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1165,7 +1165,7 @@ anope_event_squit (char *source, int ac, char **av) } int -anope_event_quit (char *source, int ac, char **av) +anope_event_quit (const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1174,34 +1174,34 @@ anope_event_quit (char *source, int ac, char **av) } void -plexus_cmd_372 (char *source, char *msg) +plexus_cmd_372 (const char *source, const char *msg) { send_cmd (ServerName, "372 %s :- %s", source, msg); } void -plexus_cmd_372_error (char *source) +plexus_cmd_372_error (const char *source) { send_cmd (ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } void -plexus_cmd_375 (char *source) +plexus_cmd_375 (const char *source) { send_cmd (ServerName, "375 %s :- %s Message of the Day", source, ServerName); } void -plexus_cmd_376 (char *source) +plexus_cmd_376 (const char *source) { send_cmd (ServerName, "376 %s :End of /MOTD command.", source); } /* 391 */ void -plexus_cmd_391 (char *source, char *timestr) +plexus_cmd_391 (const char *source, const char *timestr) { if (!timestr) { @@ -1212,7 +1212,7 @@ plexus_cmd_391 (char *source, char *timestr) /* 250 */ void -plexus_cmd_250 (char *buf) +plexus_cmd_250 (const char *buf) { if (!buf) { @@ -1224,7 +1224,7 @@ plexus_cmd_250 (char *buf) /* 307 */ void -plexus_cmd_307 (char *buf) +plexus_cmd_307 (const char *buf) { if (!buf) { @@ -1236,7 +1236,7 @@ plexus_cmd_307 (char *buf) /* 311 */ void -plexus_cmd_311 (char *buf) +plexus_cmd_311 (const char *buf) { if (!buf) { @@ -1248,7 +1248,7 @@ plexus_cmd_311 (char *buf) /* 312 */ void -plexus_cmd_312 (char *buf) +plexus_cmd_312 (const char *buf) { if (!buf) { @@ -1260,7 +1260,7 @@ plexus_cmd_312 (char *buf) /* 317 */ void -plexus_cmd_317 (char *buf) +plexus_cmd_317 (const char *buf) { if (!buf) { @@ -1272,7 +1272,7 @@ plexus_cmd_317 (char *buf) /* 219 */ void -plexus_cmd_219 (char *source, char *letter) +plexus_cmd_219 (const char *source, const char *letter) { if (!source) { @@ -1291,7 +1291,7 @@ plexus_cmd_219 (char *source, char *letter) /* 401 */ void -plexus_cmd_401 (char *source, char *who) +plexus_cmd_401 (const char *source, const char *who) { if (!source || !who) { @@ -1302,7 +1302,7 @@ plexus_cmd_401 (char *source, char *who) /* 318 */ void -plexus_cmd_318 (char *source, char *who) +plexus_cmd_318 (const char *source, const char *who) { if (!source || !who) { @@ -1314,7 +1314,7 @@ plexus_cmd_318 (char *source, char *who) /* 242 */ void -plexus_cmd_242 (char *buf) +plexus_cmd_242 (const char *buf) { if (!buf) { @@ -1326,7 +1326,7 @@ plexus_cmd_242 (char *buf) /* 243 */ void -plexus_cmd_243 (char *buf) +plexus_cmd_243 (const char *buf) { if (!buf) { @@ -1338,7 +1338,7 @@ plexus_cmd_243 (char *buf) /* 211 */ void -plexus_cmd_211 (char *buf) +plexus_cmd_211 (const char *buf) { if (!buf) { @@ -1349,7 +1349,7 @@ plexus_cmd_211 (char *buf) } void -plexus_cmd_mode (char *source, char *dest, char *buf) +plexus_cmd_mode (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1360,7 +1360,7 @@ plexus_cmd_mode (char *source, char *dest, char *buf) } void -plexus_cmd_nick (char *nick, char *name, char *mode) +plexus_cmd_nick (const char *nick, const char *name, const char *mode) { EnforceQlinedNick (nick, NULL); send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s %s 0 :%s", nick, @@ -1370,7 +1370,7 @@ plexus_cmd_nick (char *nick, char *name, char *mode) } void -plexus_cmd_kick (char *source, char *chan, char *user, char *buf) +plexus_cmd_kick (const char *source, const char *chan, const char *user, const char *buf) { if (buf) { @@ -1383,7 +1383,7 @@ plexus_cmd_kick (char *source, char *chan, char *user, char *buf) } void -plexus_cmd_notice_ops (char *source, char *dest, char *buf) +plexus_cmd_notice_ops (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1394,14 +1394,14 @@ plexus_cmd_notice_ops (char *source, char *dest, char *buf) } void -plexus_cmd_bot_chan_mode (char *nick, char *chan) +plexus_cmd_bot_chan_mode (const char *nick, const char *chan) { anope_cmd_mode (nick, chan, "%s %s", ircd->botchanumode, nick); } /* QUIT */ void -plexus_cmd_quit (char *source, char *buf) +plexus_cmd_quit (const char *source, const char *buf) { if (buf) { @@ -1415,14 +1415,14 @@ plexus_cmd_quit (char *source, char *buf) /* PONG */ void -plexus_cmd_pong (char *servname, char *who) +plexus_cmd_pong (const char *servname, const char *who) { send_cmd (servname, "PONG %s", who); } /* INVITE */ void -plexus_cmd_invite (char *source, char *chan, char *nick) +plexus_cmd_invite (const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { @@ -1434,7 +1434,7 @@ plexus_cmd_invite (char *source, char *chan, char *nick) /* SQUIT */ void -plexus_cmd_squit (char *servname, char *message) +plexus_cmd_squit (const char *servname, const char *message) { if (!servname || !message) { @@ -1445,7 +1445,7 @@ plexus_cmd_squit (char *servname, char *message) } int -anope_event_mode (char *source, int ac, char **av) +anope_event_mode (const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1472,7 +1472,7 @@ anope_event_mode (char *source, int ac, char **av) } void -plexus_cmd_351 (char *source) +plexus_cmd_351 (const char *source) { send_cmd (ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1481,23 +1481,23 @@ plexus_cmd_351 (char *source) /* Event: PROTOCTL */ int -anope_event_capab (char *source, int ac, char **av) +anope_event_capab (const char *source, int ac, const char **av) { int argvsize = 8; int argc; - char **argv; + const char **argv; char *str; if (ac < 1) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = scalloc(argvsize, sizeof(char *)); + argv = (const char **)scalloc(argvsize, sizeof(const char *)); argc = 0; while ((str = myStrGetToken(av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = srealloc(argv, argvsize * sizeof(char *)); + argv = (const char **)srealloc(argv, argvsize * sizeof(const char *)); } argv[argc] = str; argc++; @@ -1507,30 +1507,30 @@ anope_event_capab (char *source, int ac, char **av) /* Free our built ac/av */ for (argvsize = 0; argvsize < argc; argvsize++) { - free(argv[argvsize]); + free((char *)argv[argvsize]); } - free(argv); + free((char **)argv); return MOD_CONT; } /* SVSHOLD - set */ void -plexus_cmd_svshold (char *nick) +plexus_cmd_svshold (const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ void -plexus_cmd_release_svshold (char *nick) +plexus_cmd_release_svshold (const char *nick) { /* Not Supported by this IRCD */ } /* SVSNICK */ void -plexus_cmd_svsnick (char *nick, char *newnick, time_t when) +plexus_cmd_svsnick (const char *nick, const char *newnick, time_t when) { if (!nick || !newnick) { @@ -1540,21 +1540,21 @@ plexus_cmd_svsnick (char *nick, char *newnick, time_t when) } void -plexus_cmd_guest_nick (char *nick, char *user, char *host, char *real, - char *modes) +plexus_cmd_guest_nick (const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s %s 0 :%s", nick, (long int) time (NULL), modes, user, host, "*", ServerName, real); } void -plexus_cmd_svso (char *source, char *nick, char *flag) +plexus_cmd_svso (const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } void -plexus_cmd_unban (char *name, char *nick) +plexus_cmd_unban (const char *name, const char *nick) { /* Not Supported by this IRCD */ } @@ -1562,7 +1562,7 @@ plexus_cmd_unban (char *name, char *nick) /* SVSMODE channel modes */ void -plexus_cmd_svsmode_chan (char *name, char *mode, char *nick) +plexus_cmd_svsmode_chan (const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1570,7 +1570,7 @@ plexus_cmd_svsmode_chan (char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ void -plexus_cmd_svid_umode (char *nick, time_t ts) +plexus_cmd_svid_umode (const char *nick, time_t ts) { send_cmd (ServerName, "SVSID %s 1", nick); } @@ -1585,7 +1585,7 @@ plexus_cmd_nc_change (User * u) /* SVSMODE +d */ void -plexus_cmd_svid_umode2 (User * u, char *ts) +plexus_cmd_svid_umode2 (User * u, const char *ts) { if (u->svid != u->timestamp) { @@ -1598,14 +1598,14 @@ plexus_cmd_svid_umode2 (User * u, char *ts) } void -plexus_cmd_svid_umode3 (User * u, char *ts) +plexus_cmd_svid_umode3 (User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ void -plexus_cmd_chg_nick (char *oldnick, char *newnick) +plexus_cmd_chg_nick (const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { @@ -1624,63 +1624,63 @@ plexus_cmd_chg_nick (char *oldnick, char *newnick) * parv[4] = server's idea of UTC time */ int -anope_event_svinfo (char *source, int ac, char **av) +anope_event_svinfo (const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } int -anope_event_pass (char *source, int ac, char **av) +anope_event_pass (const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } void -plexus_cmd_svsjoin (char *source, char *nick, char *chan, char *param) +plexus_cmd_svsjoin (const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } void -plexus_cmd_svspart (char *source, char *nick, char *chan) +plexus_cmd_svspart (const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } void -plexus_cmd_swhois (char *source, char *who, char *mask) +plexus_cmd_swhois (const char *source, const char *who, const char *mask) { /* not supported */ } int -anope_event_notice (char *source, int ac, char **av) +anope_event_notice (const char *source, int ac, const char **av) { return MOD_CONT; } int -anope_event_admin (char *source, int ac, char **av) +anope_event_admin (const char *source, int ac, const char **av) { return MOD_CONT; } int -anope_event_invite (char *source, int ac, char **av) +anope_event_invite (const char *source, int ac, const char **av) { return MOD_CONT; } int -plexus_flood_mode_check (char *value) +plexus_flood_mode_check (const char *value) { return 0; } int -anope_event_error (char *source, int ac, char **av) +anope_event_error (const char *source, int ac, const char **av) { if (ac >= 1) { @@ -1693,7 +1693,7 @@ anope_event_error (char *source, int ac, char **av) } void -plexus_cmd_jupe (char *jserver, char *who, char *reason) +plexus_cmd_jupe (const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1711,7 +1711,7 @@ plexus_cmd_jupe (char *jserver, char *who, char *reason) 0 = nick is in valid */ int -plexus_valid_nick (char *nick) +plexus_valid_nick (const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1722,7 +1722,7 @@ plexus_valid_nick (char *nick) 0 = chan is in valid */ int -plexus_valid_chan (char *chan) +plexus_valid_chan (const char *chan) { /* no hard coded invalid chan */ return 1; @@ -1730,7 +1730,7 @@ plexus_valid_chan (char *chan) void -plexus_cmd_ctcp (char *source, char *dest, char *buf) +plexus_cmd_ctcp (const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/plexus2.h b/src/protocol/plexus2.h index e7d2097a4..867fca9a7 100644 --- a/src/protocol/plexus2.h +++ b/src/protocol/plexus2.h @@ -52,74 +52,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -void plexus_set_umode(User * user, int ac, char **av); -void plexus_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void plexus_set_umode(User * user, int ac, const char **av); +void plexus_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void plexus_cmd_vhost_off(User * u); -void plexus_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void plexus_cmd_svskill(char *source, char *user, char *buf); -void plexus_cmd_svsmode(User * u, int ac, char **av); -void plexus_cmd_372(char *source, char *msg); -void plexus_cmd_372_error(char *source); -void plexus_cmd_375(char *source); -void plexus_cmd_376(char *source); -void plexus_cmd_nick(char *nick, char *name, char *modes); -void plexus_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void plexus_cmd_mode(char *source, char *dest, char *buf); -void plexus_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void plexus_cmd_kick(char *source, char *chan, char *user, char *buf); -void plexus_cmd_notice_ops(char *source, char *dest, char *buf); -void plexus_cmd_notice(char *source, char *dest, char *buf); -void plexus_cmd_notice2(char *source, char *dest, char *msg); -void plexus_cmd_privmsg(char *source, char *dest, char *buf); -void plexus_cmd_privmsg2(char *source, char *dest, char *msg); -void plexus_cmd_serv_notice(char *source, char *dest, char *msg); -void plexus_cmd_serv_privmsg(char *source, char *dest, char *msg); -void plexus_cmd_bot_chan_mode(char *nick, char *chan); -void plexus_cmd_351(char *source); -void plexus_cmd_quit(char *source, char *buf); -void plexus_cmd_pong(char *servname, char *who); -void plexus_cmd_join(char *user, char *channel, time_t chantime); -void plexus_cmd_unsqline(char *user); -void plexus_cmd_invite(char *source, char *chan, char *nick); -void plexus_cmd_part(char *nick, char *chan, char *buf); -void plexus_cmd_391(char *source, char *timestr); -void plexus_cmd_250(char *buf); -void plexus_cmd_307(char *buf); -void plexus_cmd_311(char *buf); -void plexus_cmd_312(char *buf); -void plexus_cmd_317(char *buf); -void plexus_cmd_219(char *source, char *letter); -void plexus_cmd_401(char *source, char *who); -void plexus_cmd_318(char *source, char *who); -void plexus_cmd_242(char *buf); -void plexus_cmd_243(char *buf); -void plexus_cmd_211(char *buf); -void plexus_cmd_global(char *source, char *buf); -void plexus_cmd_global_legacy(char *source, char *fmt); -void plexus_cmd_sqline(char *mask, char *reason); -void plexus_cmd_squit(char *servname, char *message); -void plexus_cmd_svso(char *source, char *nick, char *flag); -void plexus_cmd_chg_nick(char *oldnick, char *newnick); -void plexus_cmd_svsnick(char *source, char *guest, time_t when); -void plexus_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void plexus_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void plexus_cmd_svskill(const char *source, const char *user, const char *buf); +void plexus_cmd_svsmode(User * u, int ac, const char **av); +void plexus_cmd_372(const char *source, const char *msg); +void plexus_cmd_372_error(const char *source); +void plexus_cmd_375(const char *source); +void plexus_cmd_376(const char *source); +void plexus_cmd_nick(const char *nick, const char *name, const char *modes); +void plexus_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void plexus_cmd_mode(const char *source, const char *dest, const char *buf); +void plexus_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void plexus_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void plexus_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void plexus_cmd_notice(const char *source, const char *dest, const char *buf); +void plexus_cmd_notice2(const char *source, const char *dest, const char *msg); +void plexus_cmd_privmsg(const char *source, const char *dest, const char *buf); +void plexus_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void plexus_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void plexus_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void plexus_cmd_bot_chan_mode(const char *nick, const char *chan); +void plexus_cmd_351(const char *source); +void plexus_cmd_quit(const char *source, const char *buf); +void plexus_cmd_pong(const char *servname, const char *who); +void plexus_cmd_join(const char *user, const char *channel, time_t chantime); +void plexus_cmd_unsqline(const char *user); +void plexus_cmd_invite(const char *source, const char *chan, const char *nick); +void plexus_cmd_part(const char *nick, const char *chan, const char *buf); +void plexus_cmd_391(const char *source, const char *timestr); +void plexus_cmd_250(const char *buf); +void plexus_cmd_307(const char *buf); +void plexus_cmd_311(const char *buf); +void plexus_cmd_312(const char *buf); +void plexus_cmd_317(const char *buf); +void plexus_cmd_219(const char *source, const char *letter); +void plexus_cmd_401(const char *source, const char *who); +void plexus_cmd_318(const char *source, const char *who); +void plexus_cmd_242(const char *buf); +void plexus_cmd_243(const char *buf); +void plexus_cmd_211(const char *buf); +void plexus_cmd_global(const char *source, const char *buf); +void plexus_cmd_global_legacy(const char *source, const char *fmt); +void plexus_cmd_sqline(const char *mask, const char *reason); +void plexus_cmd_squit(const char *servname, const char *message); +void plexus_cmd_svso(const char *source, const char *nick, const char *flag); +void plexus_cmd_chg_nick(const char *oldnick, const char *newnick); +void plexus_cmd_svsnick(const char *source, const char *guest, time_t when); +void plexus_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void plexus_cmd_connect(int servernum); -void plexus_cmd_svshold(char *nick); -void plexus_cmd_release_svshold(char *nick); -void plexus_cmd_unsgline(char *mask); -void plexus_cmd_unszline(char *mask); -void plexus_cmd_szline(char *mask, char *reason, char *whom); -void plexus_cmd_sgline(char *mask, char *reason); -void plexus_cmd_unban(char *name, char *nick); -void plexus_cmd_svsmode_chan(char *name, char *mode, char *nick); -void plexus_cmd_svid_umode(char *nick, time_t ts); +void plexus_cmd_svshold(const char *nick); +void plexus_cmd_release_svshold(const char *nick); +void plexus_cmd_unsgline(const char *mask); +void plexus_cmd_unszline(const char *mask); +void plexus_cmd_szline(const char *mask, const char *reason, const char *whom); +void plexus_cmd_sgline(const char *mask, const char *reason); +void plexus_cmd_unban(const char *name, const char *nick); +void plexus_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void plexus_cmd_svid_umode(const char *nick, time_t ts); void plexus_cmd_nc_change(User * u); -void plexus_cmd_svid_umode2(User * u, char *ts); -void plexus_cmd_svid_umode3(User * u, char *ts); +void plexus_cmd_svid_umode2(User * u, const char *ts); +void plexus_cmd_svid_umode3(User * u, const char *ts); void plexus_cmd_eob(); -int plexus_flood_mode_check(char *value); -void plexus_cmd_jupe(char *jserver, char *who, char *reason); -int plexus_valid_nick(char *nick); -void plexus_cmd_ctcp(char *source, char *dest, char *buf); +int plexus_flood_mode_check(const char *value); +void plexus_cmd_jupe(const char *jserver, const char *who, const char *reason); +int plexus_valid_nick(const char *nick); +void plexus_cmd_ctcp(const char *source, const char *dest, const char *buf); class PleXusIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/plexus3.c b/src/protocol/plexus3.c index 242f8e5ed..a376e11c7 100644 --- a/src/protocol/plexus3.c +++ b/src/protocol/plexus3.c @@ -145,10 +145,10 @@ IRCDCAPAB myIrcdcap[] = { void -plexus_set_umode (User * user, int ac, char **av) +plexus_set_umode (User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -476,7 +476,7 @@ CUMode myCumodes[128] = { void -plexus_cmd_notice (char *source, char *dest, char *buf) +plexus_cmd_notice (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -494,13 +494,13 @@ plexus_cmd_notice (char *source, char *dest, char *buf) } void -plexus_cmd_notice2 (char *source, char *dest, char *msg) +plexus_cmd_notice2 (const char *source, const char *dest, const char *msg) { send_cmd (source, "NOTICE %s :%s", dest, msg); } void -plexus_cmd_privmsg (char *source, char *dest, char *buf) +plexus_cmd_privmsg (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -511,26 +511,26 @@ plexus_cmd_privmsg (char *source, char *dest, char *buf) } void -plexus_cmd_privmsg2 (char *source, char *dest, char *msg) +plexus_cmd_privmsg2 (const char *source, const char *dest, const char *msg) { send_cmd (source, "PRIVMSG %s :%s", dest, msg); } void -plexus_cmd_serv_notice (char *source, char *dest, char *msg) +plexus_cmd_serv_notice (const char *source, const char *dest, const char *msg) { send_cmd (source, "NOTICE $$%s :%s", dest, msg); } void -plexus_cmd_serv_privmsg (char *source, char *dest, char *msg) +plexus_cmd_serv_privmsg (const char *source, const char *dest, const char *msg) { send_cmd (source, "PRIVMSG $$%s :%s", dest, msg); } void -plexus_cmd_global (char *source, char *buf) +plexus_cmd_global (const char *source, const char *buf) { if (!buf) { @@ -542,20 +542,20 @@ plexus_cmd_global (char *source, char *buf) /* GLOBOPS - to handle old WALLOPS */ void -plexus_cmd_global_legacy (char *source, char *fmt) +plexus_cmd_global_legacy (const char *source, const char *fmt) { send_cmd (source ? source : ServerName, "OPERWALL :%s", fmt); } int -anope_event_sjoin (char *source, int ac, char **av) +anope_event_sjoin (const char *source, int ac, const char **av) { do_sjoin (source, ac, av); return MOD_CONT; } int -anope_event_nick (char *source, int ac, char **av) +anope_event_nick (const char *source, int ac, const char **av) { if (ac != 2) { @@ -574,7 +574,7 @@ anope_event_nick (char *source, int ac, char **av) } int -anope_event_topic (char *source, int ac, char **av) +anope_event_topic (const char *source, int ac, const char **av) { if (ac == 4) { @@ -621,7 +621,7 @@ anope_event_topic (char *source, int ac, char **av) } int -anope_event_tburst (char *source, int ac, char **av) +anope_event_tburst (const char *source, int ac, const char **av) { if (ac != 5) return MOD_CONT; @@ -640,7 +640,7 @@ anope_event_tburst (char *source, int ac, char **av) * av[2] and beyond are dynamic. */ int -anope_event_encap (char *source, int ac, char **av) +anope_event_encap (const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -662,14 +662,14 @@ anope_event_encap (char *source, int ac, char **av) return MOD_CONT; } - change_user_host (u, av[3]); + u->SetDisplayedHost(av[3]); return MOD_CONT; } return MOD_CONT; } int -anope_event_436 (char *source, int ac, char **av) +anope_event_436 (const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -753,25 +753,25 @@ moduleAddIRCDMsgs (void) } void -plexus_cmd_sqline (char *mask, char *reason) +plexus_cmd_sqline (const char *mask, const char *reason) { send_cmd (s_OperServ, "RESV * %s :%s", mask, reason); } void -plexus_cmd_unsgline (char *mask) +plexus_cmd_unsgline (const char *mask) { send_cmd (s_OperServ, "UNXLINE * %s", mask); } void -plexus_cmd_unszline (char *mask) +plexus_cmd_unszline (const char *mask) { /* Does not support */ } void -plexus_cmd_szline (char *mask, char *reason, char *whom) +plexus_cmd_szline (const char *mask, const char *reason, const char *whom) { /* Does not support */ } @@ -782,13 +782,13 @@ void PleXusIRCdProto::cmd_svsnoop(const char *server, int set) } void -plexus_cmd_svsadmin (char *server, int set) +plexus_cmd_svsadmin (const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } void -plexus_cmd_sgline (char *mask, char *reason) +plexus_cmd_sgline (const char *mask, const char *reason) { send_cmd (s_OperServ, "XLINE * %s 0 :%s", mask, reason); } @@ -799,8 +799,8 @@ void PleXusIRCdProto::cmd_remove_akill(const char *user, const char *host) } void -plexus_cmd_topic (char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +plexus_cmd_topic (const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd (whosets, "ENCAP * TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -813,7 +813,7 @@ plexus_cmd_vhost_off (User * u) } void -plexus_cmd_vhost_on (char *nick, char *vIdent, char *vhost) +plexus_cmd_vhost_on (const char *nick, const char *vIdent, const char *vhost) { User *u; @@ -833,13 +833,13 @@ plexus_cmd_vhost_on (char *nick, char *vIdent, char *vhost) } void -plexus_cmd_unsqline (char *user) +plexus_cmd_unsqline (const char *user) { send_cmd (s_OperServ, "UNRESV * %s", user); } void -plexus_cmd_join (char *user, char *channel, time_t chantime) +plexus_cmd_join (const char *user, const char *channel, time_t chantime) { send_cmd (ServerName, "SJOIN %ld %s + :%s", (long int) chantime, channel, user); @@ -855,15 +855,15 @@ reason: the reason for the kline. */ void -plexus_cmd_akill (char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +plexus_cmd_akill (const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd (s_OperServ, "KLINE * %ld %s %s :%s", (long int) (expires - (long) time (NULL)), user, host, reason); } void -plexus_cmd_svskill (char *source, char *user, char *buf) +plexus_cmd_svskill (const char *source, const char *user, const char *buf) { if (!buf) { @@ -879,7 +879,7 @@ plexus_cmd_svskill (char *source, char *user, char *buf) } void -plexus_cmd_svsmode (User * u, int ac, char **av) +plexus_cmd_svsmode (User * u, int ac, const char **av) { send_cmd (ServerName, "ENCAP * SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), @@ -931,14 +931,14 @@ plexus_cmd_capab () /* PASS */ void -plexus_cmd_pass (char *pass) +plexus_cmd_pass (const char *pass) { send_cmd (NULL, "PASS %s :TS", pass); } /* SERVER name hop descript */ void -plexus_cmd_server (char *servname, int hop, char *descript) +plexus_cmd_server (const char *servname, int hop, const char *descript) { send_cmd (NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -969,8 +969,8 @@ plexus_cmd_svsinfo () void -plexus_cmd_bot_nick (char *nick, char *user, char *host, char *real, - char *modes) +plexus_cmd_bot_nick (const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick (nick, NULL); send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s 0 %s :%s", nick, @@ -981,7 +981,7 @@ plexus_cmd_bot_nick (char *nick, char *user, char *host, char *real, } void -plexus_cmd_part (char *nick, char *chan, char *buf) +plexus_cmd_part (const char *nick, const char *chan, const char *buf) { if (buf) { @@ -994,7 +994,7 @@ plexus_cmd_part (char *nick, char *chan, char *buf) } int -anope_event_ping (char *source, int ac, char **av) +anope_event_ping (const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1003,7 +1003,7 @@ anope_event_ping (char *source, int ac, char **av) } int -anope_event_away (char *source, int ac, char **av) +anope_event_away (const char *source, int ac, const char **av) { if (!source) { @@ -1014,7 +1014,7 @@ anope_event_away (char *source, int ac, char **av) } int -anope_event_kill (char *source, int ac, char **av) +anope_event_kill (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1024,7 +1024,7 @@ anope_event_kill (char *source, int ac, char **av) } int -anope_event_kick (char *source, int ac, char **av) +anope_event_kick (const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1033,7 +1033,7 @@ anope_event_kick (char *source, int ac, char **av) } int -anope_event_eob (char *source, int ac, char **av) +anope_event_eob (const char *source, int ac, const char **av) { Server *s; s = findserver (servlist, source); @@ -1056,7 +1056,7 @@ plexus_cmd_eob () int -anope_event_join (char *source, int ac, char **av) +anope_event_join (const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1065,7 +1065,7 @@ anope_event_join (char *source, int ac, char **av) } int -anope_event_motd (char *source, int ac, char **av) +anope_event_motd (const char *source, int ac, const char **av) { if (!source) { @@ -1077,7 +1077,7 @@ anope_event_motd (char *source, int ac, char **av) } int -anope_event_privmsg (char *source, int ac, char **av) +anope_event_privmsg (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1086,7 +1086,7 @@ anope_event_privmsg (char *source, int ac, char **av) } int -anope_event_part (char *source, int ac, char **av) +anope_event_part (const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1095,7 +1095,7 @@ anope_event_part (char *source, int ac, char **av) } int -anope_event_whois (char *source, int ac, char **av) +anope_event_whois (const char *source, int ac, const char **av) { if (source && ac >= 1) { @@ -1106,7 +1106,7 @@ anope_event_whois (char *source, int ac, char **av) /* EVENT: SERVER */ int -anope_event_server (char *source, int ac, char **av) +anope_event_server (const char *source, int ac, const char **av) { if (!stricmp (av[1], "1")) { @@ -1117,7 +1117,7 @@ anope_event_server (char *source, int ac, char **av) } int -anope_event_squit (char *source, int ac, char **av) +anope_event_squit (const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1126,7 +1126,7 @@ anope_event_squit (char *source, int ac, char **av) } int -anope_event_quit (char *source, int ac, char **av) +anope_event_quit (const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1135,34 +1135,34 @@ anope_event_quit (char *source, int ac, char **av) } void -plexus_cmd_372 (char *source, char *msg) +plexus_cmd_372 (const char *source, const char *msg) { send_cmd (ServerName, "372 %s :- %s", source, msg); } void -plexus_cmd_372_error (char *source) +plexus_cmd_372_error (const char *source) { send_cmd (ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } void -plexus_cmd_375 (char *source) +plexus_cmd_375 (const char *source) { send_cmd (ServerName, "375 %s :- %s Message of the Day", source, ServerName); } void -plexus_cmd_376 (char *source) +plexus_cmd_376 (const char *source) { send_cmd (ServerName, "376 %s :End of /MOTD command.", source); } /* 391 */ void -plexus_cmd_391 (char *source, char *timestr) +plexus_cmd_391 (const char *source, const char *timestr) { if (!timestr) { @@ -1173,7 +1173,7 @@ plexus_cmd_391 (char *source, char *timestr) /* 250 */ void -plexus_cmd_250 (char *buf) +plexus_cmd_250 (const char *buf) { if (!buf) { @@ -1185,7 +1185,7 @@ plexus_cmd_250 (char *buf) /* 307 */ void -plexus_cmd_307 (char *buf) +plexus_cmd_307 (const char *buf) { if (!buf) { @@ -1197,7 +1197,7 @@ plexus_cmd_307 (char *buf) /* 311 */ void -plexus_cmd_311 (char *buf) +plexus_cmd_311 (const char *buf) { if (!buf) { @@ -1209,7 +1209,7 @@ plexus_cmd_311 (char *buf) /* 312 */ void -plexus_cmd_312 (char *buf) +plexus_cmd_312 (const char *buf) { if (!buf) { @@ -1221,7 +1221,7 @@ plexus_cmd_312 (char *buf) /* 317 */ void -plexus_cmd_317 (char *buf) +plexus_cmd_317 (const char *buf) { if (!buf) { @@ -1233,7 +1233,7 @@ plexus_cmd_317 (char *buf) /* 219 */ void -plexus_cmd_219 (char *source, char *letter) +plexus_cmd_219 (const char *source, const char *letter) { if (!source) { @@ -1253,7 +1253,7 @@ plexus_cmd_219 (char *source, char *letter) /* 401 */ void -plexus_cmd_401 (char *source, char *who) +plexus_cmd_401 (const char *source, const char *who) { if (!source || !who) { @@ -1264,7 +1264,7 @@ plexus_cmd_401 (char *source, char *who) /* 318 */ void -plexus_cmd_318 (char *source, char *who) +plexus_cmd_318 (const char *source, const char *who) { if (!source || !who) { @@ -1276,7 +1276,7 @@ plexus_cmd_318 (char *source, char *who) /* 242 */ void -plexus_cmd_242 (char *buf) +plexus_cmd_242 (const char *buf) { if (!buf) { @@ -1288,7 +1288,7 @@ plexus_cmd_242 (char *buf) /* 243 */ void -plexus_cmd_243 (char *buf) +plexus_cmd_243 (const char *buf) { if (!buf) { @@ -1300,7 +1300,7 @@ plexus_cmd_243 (char *buf) /* 211 */ void -plexus_cmd_211 (char *buf) +plexus_cmd_211 (const char *buf) { if (!buf) { @@ -1311,7 +1311,7 @@ plexus_cmd_211 (char *buf) } void -plexus_cmd_mode (char *source, char *dest, char *buf) +plexus_cmd_mode (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1322,7 +1322,7 @@ plexus_cmd_mode (char *source, char *dest, char *buf) } void -plexus_cmd_nick (char *nick, char *name, char *mode) +plexus_cmd_nick (const char *nick, const char *name, const char *mode) { EnforceQlinedNick (nick, NULL); send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s 0 %s :%s", nick, @@ -1332,7 +1332,7 @@ plexus_cmd_nick (char *nick, char *name, char *mode) } void -plexus_cmd_kick (char *source, char *chan, char *user, char *buf) +plexus_cmd_kick (const char *source, const char *chan, const char *user, const char *buf) { if (buf) { @@ -1345,7 +1345,7 @@ plexus_cmd_kick (char *source, char *chan, char *user, char *buf) } void -plexus_cmd_notice_ops (char *source, char *dest, char *buf) +plexus_cmd_notice_ops (const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1356,14 +1356,14 @@ plexus_cmd_notice_ops (char *source, char *dest, char *buf) } void -plexus_cmd_bot_chan_mode (char *nick, char *chan) +plexus_cmd_bot_chan_mode (const char *nick, const char *chan) { anope_cmd_mode (nick, chan, "%s %s %s", myIrcd->botchanumode, nick, nick); } /* QUIT */ void -plexus_cmd_quit (char *source, char *buf) +plexus_cmd_quit (const char *source, const char *buf) { if (buf) { @@ -1377,14 +1377,14 @@ plexus_cmd_quit (char *source, char *buf) /* PONG */ void -plexus_cmd_pong (char *servname, char *who) +plexus_cmd_pong (const char *servname, const char *who) { send_cmd (servname, "PONG %s", who); } /* INVITE */ void -plexus_cmd_invite (char *source, char *chan, char *nick) +plexus_cmd_invite (const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { @@ -1396,7 +1396,7 @@ plexus_cmd_invite (char *source, char *chan, char *nick) /* SQUIT */ void -plexus_cmd_squit (char *servname, char *message) +plexus_cmd_squit (const char *servname, const char *message) { if (!servname || !message) { @@ -1407,7 +1407,7 @@ plexus_cmd_squit (char *servname, char *message) } int -anope_event_mode (char *source, int ac, char **av) +anope_event_mode (const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1434,7 +1434,7 @@ anope_event_mode (char *source, int ac, char **av) } void -plexus_cmd_351 (char *source) +plexus_cmd_351 (const char *source) { send_cmd (ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1443,25 +1443,25 @@ plexus_cmd_351 (char *source) /* Event: PROTOCTL */ int -anope_event_capab (char *source, int ac, char **av) +anope_event_capab (const char *source, int ac, const char **av) { int argvsize = 8; int argc; - char **argv; + const char **argv; char *str; if (ac < 1) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = scalloc (argvsize, sizeof (char *)); + argv = (const char **)scalloc (argvsize, sizeof (const char *)); argc = 0; while ((str = myStrGetToken (av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = srealloc (argv, argvsize * sizeof (char *)); + argv = (const char **)srealloc (argv, argvsize * sizeof (const char *)); } argv[argc] = str; argc++; @@ -1472,16 +1472,16 @@ anope_event_capab (char *source, int ac, char **av) /* Free our built ac/av */ for (argvsize = 0; argvsize < argc; argvsize++) { - free (argv[argvsize]); + free ((char *)argv[argvsize]); } - free (argv); + free ((char **)argv); return MOD_CONT; } /* SVSHOLD - set */ void -plexus_cmd_svshold (char *nick) +plexus_cmd_svshold (const char *nick) { send_cmd (s_OperServ, "ENCAP * RESV %d %s 0 :%s", NSReleaseTimeout, nick, "This nick is being held for a registered user. " @@ -1490,14 +1490,14 @@ plexus_cmd_svshold (char *nick) /* SVSHOLD - release */ void -plexus_cmd_release_svshold (char *nick) +plexus_cmd_release_svshold (const char *nick) { send_cmd (s_OperServ, "UNRESV * %s", nick); } /* SVSNICK */ void -plexus_cmd_svsnick (char *nick, char *newnick, time_t when) +plexus_cmd_svsnick (const char *nick, const char *newnick, time_t when) { User *u; @@ -1511,8 +1511,8 @@ plexus_cmd_svsnick (char *nick, char *newnick, time_t when) } void -plexus_cmd_guest_nick (char *nick, char *user, char *host, char *real, - char *modes) +plexus_cmd_guest_nick (const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s 0 %s :%s", nick, (long int) time (NULL), modes, user, host, ServerName, host, @@ -1520,13 +1520,13 @@ plexus_cmd_guest_nick (char *nick, char *user, char *host, char *real, } void -plexus_cmd_svso (char *source, char *nick, char *flag) +plexus_cmd_svso (const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } void -plexus_cmd_unban (char *name, char *nick) +plexus_cmd_unban (const char *name, const char *nick) { /* Not Supported by this IRCD */ } @@ -1534,7 +1534,7 @@ plexus_cmd_unban (char *name, char *nick) /* SVSMODE channel modes */ void -plexus_cmd_svsmode_chan (char *name, char *mode, char *nick) +plexus_cmd_svsmode_chan (const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1542,7 +1542,7 @@ plexus_cmd_svsmode_chan (char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ void -plexus_cmd_svid_umode (char *nick, time_t ts) +plexus_cmd_svid_umode (const char *nick, time_t ts) { send_cmd (ServerName, "ENCAP * SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1558,13 +1558,13 @@ plexus_cmd_nc_change (User * u) /* SVSMODE +d */ void -plexus_cmd_svid_umode2 (User * u, char *ts) +plexus_cmd_svid_umode2 (User * u, const char *ts) { /* not used */ } void -plexus_cmd_svid_umode3 (User * u, char *ts) +plexus_cmd_svid_umode3 (User * u, const char *ts) { char modes[512]; @@ -1587,7 +1587,7 @@ plexus_cmd_svid_umode3 (User * u, char *ts) /* NICK <newnick> */ void -plexus_cmd_chg_nick (char *oldnick, char *newnick) +plexus_cmd_chg_nick (const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { @@ -1606,63 +1606,63 @@ plexus_cmd_chg_nick (char *oldnick, char *newnick) * parv[4] = server's idea of UTC time */ int -anope_event_svinfo (char *source, int ac, char **av) +anope_event_svinfo (const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } int -anope_event_pass (char *source, int ac, char **av) +anope_event_pass (const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } void -plexus_cmd_svsjoin (char *source, char *nick, char *chan, char *param) +plexus_cmd_svsjoin (const char *source, const char *nick, const char *chan, const char *param) { send_cmd(ServerName, "ENCAP * SVSJOIN %s %s", nick, chan); } void -plexus_cmd_svspart (char *source, char *nick, char *chan) +plexus_cmd_svspart (const char *source, const char *nick, const char *chan) { send_cmd(ServerName, "ENCAP * SVSPART %s %s", nick, chan); } void -plexus_cmd_swhois (char *source, char *who, char *mask) +plexus_cmd_swhois (const char *source, const char *who, const char *mask) { /* not supported */ } int -anope_event_notice (char *source, int ac, char **av) +anope_event_notice (const char *source, int ac, const char **av) { return MOD_CONT; } int -anope_event_admin (char *source, int ac, char **av) +anope_event_admin (const char *source, int ac, const char **av) { return MOD_CONT; } int -anope_event_invite (char *source, int ac, char **av) +anope_event_invite (const char *source, int ac, const char **av) { return MOD_CONT; } int -plexus_flood_mode_check (char *value) +plexus_flood_mode_check (const char *value) { return 0; } int -anope_event_error (char *source, int ac, char **av) +anope_event_error (const char *source, int ac, const char **av) { if (ac >= 1) { @@ -1675,7 +1675,7 @@ anope_event_error (char *source, int ac, char **av) } void -plexus_cmd_jupe (char *jserver, char *who, char *reason) +plexus_cmd_jupe (const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1693,7 +1693,7 @@ plexus_cmd_jupe (char *jserver, char *who, char *reason) 0 = nick is in valid */ int -plexus_valid_nick (char *nick) +plexus_valid_nick (const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1704,7 +1704,7 @@ plexus_valid_nick (char *nick) 0 = chan is in valid */ int -plexus_valid_chan (char *chan) +plexus_valid_chan (const char *chan) { /* no hard coded invalid chan */ return 1; @@ -1712,7 +1712,7 @@ plexus_valid_chan (char *chan) void -plexus_cmd_ctcp (char *source, char *dest, char *buf) +plexus_cmd_ctcp (const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/plexus3.h b/src/protocol/plexus3.h index b3990f075..9c8cba453 100644 --- a/src/protocol/plexus3.h +++ b/src/protocol/plexus3.h @@ -39,74 +39,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -void plexus_set_umode(User * user, int ac, char **av); -void plexus_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void plexus_set_umode(User * user, int ac, const char **av); +void plexus_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void plexus_cmd_vhost_off(User * u); -void plexus_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void plexus_cmd_svskill(char *source, char *user, char *buf); -void plexus_cmd_svsmode(User * u, int ac, char **av); -void plexus_cmd_372(char *source, char *msg); -void plexus_cmd_372_error(char *source); -void plexus_cmd_375(char *source); -void plexus_cmd_376(char *source); -void plexus_cmd_nick(char *nick, char *name, char *modes); -void plexus_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void plexus_cmd_mode(char *source, char *dest, char *buf); -void plexus_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void plexus_cmd_kick(char *source, char *chan, char *user, char *buf); -void plexus_cmd_notice_ops(char *source, char *dest, char *buf); -void plexus_cmd_notice(char *source, char *dest, char *buf); -void plexus_cmd_notice2(char *source, char *dest, char *msg); -void plexus_cmd_privmsg(char *source, char *dest, char *buf); -void plexus_cmd_privmsg2(char *source, char *dest, char *msg); -void plexus_cmd_serv_notice(char *source, char *dest, char *msg); -void plexus_cmd_serv_privmsg(char *source, char *dest, char *msg); -void plexus_cmd_bot_chan_mode(char *nick, char *chan); -void plexus_cmd_351(char *source); -void plexus_cmd_quit(char *source, char *buf); -void plexus_cmd_pong(char *servname, char *who); -void plexus_cmd_join(char *user, char *channel, time_t chantime); -void plexus_cmd_unsqline(char *user); -void plexus_cmd_invite(char *source, char *chan, char *nick); -void plexus_cmd_part(char *nick, char *chan, char *buf); -void plexus_cmd_391(char *source, char *timestr); -void plexus_cmd_250(char *buf); -void plexus_cmd_307(char *buf); -void plexus_cmd_311(char *buf); -void plexus_cmd_312(char *buf); -void plexus_cmd_317(char *buf); -void plexus_cmd_219(char *source, char *letter); -void plexus_cmd_401(char *source, char *who); -void plexus_cmd_318(char *source, char *who); -void plexus_cmd_242(char *buf); -void plexus_cmd_243(char *buf); -void plexus_cmd_211(char *buf); -void plexus_cmd_global(char *source, char *buf); -void plexus_cmd_global_legacy(char *source, char *fmt); -void plexus_cmd_sqline(char *mask, char *reason); -void plexus_cmd_squit(char *servname, char *message); -void plexus_cmd_svso(char *source, char *nick, char *flag); -void plexus_cmd_chg_nick(char *oldnick, char *newnick); -void plexus_cmd_svsnick(char *source, char *guest, time_t when); -void plexus_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void plexus_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void plexus_cmd_svskill(const char *source, const char *user, const char *buf); +void plexus_cmd_svsmode(User * u, int ac, const char **av); +void plexus_cmd_372(const char *source, const char *msg); +void plexus_cmd_372_error(const char *source); +void plexus_cmd_375(const char *source); +void plexus_cmd_376(const char *source); +void plexus_cmd_nick(const char *nick, const char *name, const char *modes); +void plexus_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void plexus_cmd_mode(const char *source, const char *dest, const char *buf); +void plexus_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void plexus_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void plexus_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void plexus_cmd_notice(const char *source, const char *dest, const char *buf); +void plexus_cmd_notice2(const char *source, const char *dest, const char *msg); +void plexus_cmd_privmsg(const char *source, const char *dest, const char *buf); +void plexus_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void plexus_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void plexus_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void plexus_cmd_bot_chan_mode(const char *nick, const char *chan); +void plexus_cmd_351(const char *source); +void plexus_cmd_quit(const char *source, const char *buf); +void plexus_cmd_pong(const char *servname, const char *who); +void plexus_cmd_join(const char *user, const char *channel, time_t chantime); +void plexus_cmd_unsqline(const char *user); +void plexus_cmd_invite(const char *source, const char *chan, const char *nick); +void plexus_cmd_part(const char *nick, const char *chan, const char *buf); +void plexus_cmd_391(const char *source, const char *timestr); +void plexus_cmd_250(const char *buf); +void plexus_cmd_307(const char *buf); +void plexus_cmd_311(const char *buf); +void plexus_cmd_312(const char *buf); +void plexus_cmd_317(const char *buf); +void plexus_cmd_219(const char *source, const char *letter); +void plexus_cmd_401(const char *source, const char *who); +void plexus_cmd_318(const char *source, const char *who); +void plexus_cmd_242(const char *buf); +void plexus_cmd_243(const char *buf); +void plexus_cmd_211(const char *buf); +void plexus_cmd_global(const char *source, const char *buf); +void plexus_cmd_global_legacy(const char *source, const char *fmt); +void plexus_cmd_sqline(const char *mask, const char *reason); +void plexus_cmd_squit(const char *servname, const char *message); +void plexus_cmd_svso(const char *source, const char *nick, const char *flag); +void plexus_cmd_chg_nick(const char *oldnick, const char *newnick); +void plexus_cmd_svsnick(const char *source, const char *guest, time_t when); +void plexus_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void plexus_cmd_connect(int servernum); -void plexus_cmd_svshold(char *nick); -void plexus_cmd_release_svshold(char *nick); -void plexus_cmd_unsgline(char *mask); -void plexus_cmd_unszline(char *mask); -void plexus_cmd_szline(char *mask, char *reason, char *whom); -void plexus_cmd_sgline(char *mask, char *reason); -void plexus_cmd_unban(char *name, char *nick); -void plexus_cmd_svsmode_chan(char *name, char *mode, char *nick); -void plexus_cmd_svid_umode(char *nick, time_t ts); +void plexus_cmd_svshold(const char *nick); +void plexus_cmd_release_svshold(const char *nick); +void plexus_cmd_unsgline(const char *mask); +void plexus_cmd_unszline(const char *mask); +void plexus_cmd_szline(const char *mask, const char *reason, const char *whom); +void plexus_cmd_sgline(const char *mask, const char *reason); +void plexus_cmd_unban(const char *name, const char *nick); +void plexus_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void plexus_cmd_svid_umode(const char *nick, time_t ts); void plexus_cmd_nc_change(User * u); -void plexus_cmd_svid_umode2(User * u, char *ts); -void plexus_cmd_svid_umode3(User * u, char *ts); +void plexus_cmd_svid_umode2(User * u, const char *ts); +void plexus_cmd_svid_umode3(User * u, const char *ts); void plexus_cmd_eob(); -int plexus_flood_mode_check(char *value); -void plexus_cmd_jupe(char *jserver, char *who, char *reason); -int plexus_valid_nick(char *nick); -void plexus_cmd_ctcp(char *source, char *dest, char *buf); +int plexus_flood_mode_check(const char *value); +void plexus_cmd_jupe(const char *jserver, const char *who, const char *reason); +int plexus_valid_nick(const char *nick); +void plexus_cmd_ctcp(const char *source, const char *dest, const char *buf); class PleXusIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/ptlink.c b/src/protocol/ptlink.c index be1c3e3b1..78c200c2d 100644 --- a/src/protocol/ptlink.c +++ b/src/protocol/ptlink.c @@ -385,7 +385,7 @@ CUMode myCumodes[128] = { -void ptlink_cmd_bot_chan_mode(char *nick, char *chan) +void ptlink_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(s_ChanServ, chan, "%s %s %s", ircd->botchanumode, nick, nick); @@ -401,7 +401,7 @@ void ptlink_cmd_bot_chan_mode(char *nick, char *chan) parv[4+n] = flags+nick list (all in one parameter) NOTE: ignore channel modes if we already have the channel with a gr */ -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -418,10 +418,10 @@ int anope_event_sjoin(char *source, int ac, char **av) parv[0] = sender parv[1] = new mask (if no '@', hostname is assumed) */ -int anope_event_newmask(char *source, int ac, char **av) +int anope_event_newmask(const char *source, int ac, const char **av) { User *u; - char *newhost = NULL, *newuser = NULL; + const char *newhost = NULL, *newuser = NULL; int tofree = 0; if (ac != 1) @@ -451,8 +451,8 @@ int anope_event_newmask(char *source, int ac, char **av) if (newuser) { newhost = myStrGetTokenRemainder(av[0], '@', 1); tofree = 1; - change_user_username(u, newuser); - free(newuser); + u->SetIdent(newuser); + free((char *)newuser); } else { newhost = av[0]; } @@ -463,10 +463,10 @@ int anope_event_newmask(char *source, int ac, char **av) u->mode |= UMODE_VH; if (newhost) - change_user_host(u, newhost); + u->SetDisplayedHost(newhost); if (tofree) - free(newhost); + free((char *)newhost); return MOD_CONT; } @@ -494,7 +494,7 @@ int anope_event_newmask(char *source, int ac, char **av) 0 1 2 3 4 5 6 7 8 */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -518,7 +518,7 @@ int anope_event_nick(char *source, int ac, char **av) parv[3] = server version parv[4] = server description */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -527,7 +527,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -644,18 +644,18 @@ void moduleAddIRCDMsgs(void) addCoreMessage(IRCD, m); } -int anope_event_svsinfo(char *source, int ac, char **av) +int anope_event_svsinfo(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { return MOD_CONT; } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; @@ -667,7 +667,7 @@ int anope_event_capab(char *source, int ac, char **av) parv[1] = sqlined nick/mask parv[2] = reason */ -void ptlink_cmd_sqline(char *mask, char *reason) +void ptlink_cmd_sqline(const char *mask, const char *reason) { send_cmd(ServerName, "SQLINE %s :%s", mask, reason); } @@ -685,7 +685,7 @@ void PTlinkProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSADMIN %s :%s", server, set ? "noopers" : "rehash"); } -void ptlink_cmd_svsadmin(char *server, int set) +void ptlink_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } @@ -717,12 +717,12 @@ void anope_topic(char *whosets, char *chan, char *whosetit, char *topic, parv[0] = sender parv[1] = sqlined nick/mask */ -void ptlink_cmd_unsqline(char *user) +void ptlink_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } -void ptlink_cmd_join(char *user, char *channel, time_t chantime) +void ptlink_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(ServerName, "SJOIN %ld %s + :%s", (long int) chantime, channel, user); @@ -736,15 +736,15 @@ void ptlink_cmd_join(char *user, char *channel, time_t chantime) parv[3] = who added the gline parv[4] = reason */ -void ptlink_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void ptlink_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(ServerName, "GLINE %s@%s %i %s :%s", user, host, 86400 * 2, who, reason); } -void ptlink_cmd_svskill(char *source, char *user, char *buf) +void ptlink_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -765,7 +765,7 @@ void ptlink_cmd_svskill(char *source, char *user, char *buf) parv[3] = extra parameter ( if news setting mode(+n) ) e.g.: :NickServ SVSMODE Lamego +rn 1991234 */ -void ptlink_cmd_svsmode(User * u, int ac, char **av) +void ptlink_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); @@ -782,7 +782,7 @@ void ptlink_cmd_svsmode(User * u, int ac, char **av) u->mode |= UMODE_NM; } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -792,13 +792,13 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void ptlink_cmd_squit(char *servname, char *message) +void ptlink_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } /* PONG */ -void ptlink_cmd_pong(char *servname, char *who) +void ptlink_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -841,7 +841,7 @@ void ptlink_cmd_svsinfo() (TS indicates this is server uses TS protocol and SVINFO will be sent for protocol compatibility checking) */ -void ptlink_cmd_pass(char *pass) +void ptlink_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } @@ -856,7 +856,7 @@ void ptlink_cmd_capab() } -void ptlink_cmd_server(char *servname, int hop, char *descript) +void ptlink_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d Anope.Services%s :%s", servname, hop, version_number_dotted, descript); @@ -881,7 +881,7 @@ void ptlink_cmd_connect(int servernum) -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -889,7 +889,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -897,7 +897,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -913,7 +913,7 @@ int anope_event_whois(char *source, int ac, char **av) parv[3] = topic time parv[4] = topic text */ -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -921,7 +921,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -929,7 +929,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -943,7 +943,7 @@ int anope_event_quit(char *source, int ac, char **av) parv[1] = target nick (==sender) parv[2] = mode change string */ -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -957,7 +957,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -966,7 +966,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -975,7 +975,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -983,7 +983,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -993,7 +993,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -void ptlink_cmd_notice_ops(char *source, char *dest, char *buf) +void ptlink_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1003,7 +1003,7 @@ void ptlink_cmd_notice_ops(char *source, char *dest, char *buf) } -void ptlink_cmd_notice(char *source, char *dest, char *buf) +void ptlink_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1016,12 +1016,12 @@ void ptlink_cmd_notice(char *source, char *dest, char *buf) } } -void ptlink_cmd_notice2(char *source, char *dest, char *msg) +void ptlink_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void ptlink_cmd_privmsg(char *source, char *dest, char *buf) +void ptlink_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1030,23 +1030,23 @@ void ptlink_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void ptlink_cmd_privmsg2(char *source, char *dest, char *msg) +void ptlink_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void ptlink_cmd_serv_notice(char *source, char *dest, char *msg) +void ptlink_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void ptlink_cmd_serv_privmsg(char *source, char *dest, char *msg) +void ptlink_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } /* GLOBOPS */ -void ptlink_cmd_global(char *source, char *buf) +void ptlink_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1056,7 +1056,7 @@ void ptlink_cmd_global(char *source, char *buf) } /* 391 */ -void ptlink_cmd_391(char *source, char *timestr) +void ptlink_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1065,7 +1065,7 @@ void ptlink_cmd_391(char *source, char *timestr) } /* 250 */ -void ptlink_cmd_250(char *buf) +void ptlink_cmd_250(const char *buf) { if (!buf) { return; @@ -1075,7 +1075,7 @@ void ptlink_cmd_250(char *buf) } /* 307 */ -void ptlink_cmd_307(char *buf) +void ptlink_cmd_307(const char *buf) { if (!buf) { return; @@ -1085,7 +1085,7 @@ void ptlink_cmd_307(char *buf) } /* 311 */ -void ptlink_cmd_311(char *buf) +void ptlink_cmd_311(const char *buf) { if (!buf) { return; @@ -1095,7 +1095,7 @@ void ptlink_cmd_311(char *buf) } /* 312 */ -void ptlink_cmd_312(char *buf) +void ptlink_cmd_312(const char *buf) { if (!buf) { return; @@ -1105,7 +1105,7 @@ void ptlink_cmd_312(char *buf) } /* 317 */ -void ptlink_cmd_317(char *buf) +void ptlink_cmd_317(const char *buf) { if (!buf) { return; @@ -1115,7 +1115,7 @@ void ptlink_cmd_317(char *buf) } /* 219 */ -void ptlink_cmd_219(char *source, char *letter) +void ptlink_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1130,7 +1130,7 @@ void ptlink_cmd_219(char *source, char *letter) } /* 401 */ -void ptlink_cmd_401(char *source, char *who) +void ptlink_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1139,7 +1139,7 @@ void ptlink_cmd_401(char *source, char *who) } /* 318 */ -void ptlink_cmd_318(char *source, char *who) +void ptlink_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1149,7 +1149,7 @@ void ptlink_cmd_318(char *source, char *who) } /* 242 */ -void ptlink_cmd_242(char *buf) +void ptlink_cmd_242(const char *buf) { if (!buf) { return; @@ -1159,7 +1159,7 @@ void ptlink_cmd_242(char *buf) } /* 243 */ -void ptlink_cmd_243(char *buf) +void ptlink_cmd_243(const char *buf) { if (!buf) { return; @@ -1169,7 +1169,7 @@ void ptlink_cmd_243(char *buf) } /* 211 */ -void ptlink_cmd_211(char *buf) +void ptlink_cmd_211(const char *buf) { if (!buf) { return; @@ -1178,7 +1178,7 @@ void ptlink_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void ptlink_cmd_mode(char *source, char *dest, char *buf) +void ptlink_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1199,7 +1199,7 @@ void ptlink_cmd_mode(char *source, char *dest, char *buf) parv[8] = server parv[9] = nick info */ -void ptlink_cmd_nick(char *nick, char *name, char *mode) +void ptlink_cmd_nick(const char *nick, const char *name, const char *mode) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %lu %s %s %s %s %s :%s", nick, @@ -1208,7 +1208,7 @@ void ptlink_cmd_nick(char *nick, char *name, char *mode) ptlink_cmd_sqline(nick, "Reserved for services"); } -void ptlink_cmd_kick(char *source, char *chan, char *user, char *buf) +void ptlink_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (!buf) { return; @@ -1222,7 +1222,7 @@ void ptlink_cmd_kick(char *source, char *chan, char *user, char *buf) } /* QUIT */ -void ptlink_cmd_quit(char *source, char *buf) +void ptlink_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -1231,7 +1231,7 @@ void ptlink_cmd_quit(char *source, char *buf) } } -void ptlink_cmd_part(char *nick, char *chan, char *buf) +void ptlink_cmd_part(const char *nick, const char *chan, const char *buf) { if (buf) { send_cmd(nick, "PART %s :%s", chan, buf); @@ -1248,8 +1248,8 @@ void ptlink_cmd_part(char *nick, char *chan, char *buf) parv[3] = topic time parv[4] = topic text */ -void ptlink_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void ptlink_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (long int) time(NULL), topic); @@ -1260,7 +1260,7 @@ void ptlink_cmd_vhost_off(User * u) /* does not support vhosting */ } -void ptlink_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void ptlink_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { User *u; @@ -1275,7 +1275,7 @@ void ptlink_cmd_vhost_on(char *nick, char *vIdent, char *vhost) } /* INVITE */ -void ptlink_cmd_invite(char *source, char *chan, char *nick) +void ptlink_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1284,33 +1284,33 @@ void ptlink_cmd_invite(char *source, char *chan, char *nick) send_cmd(source, "INVITE %s %s", nick, chan); } -void ptlink_cmd_372(char *source, char *msg) +void ptlink_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void ptlink_cmd_372_error(char *source) +void ptlink_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void ptlink_cmd_375(char *source) +void ptlink_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void ptlink_cmd_376(char *source) +void ptlink_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void ptlink_set_umode(User * user, int ac, char **av) +void ptlink_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -1362,7 +1362,7 @@ void ptlink_set_umode(User * user, int ac, char **av) } } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1370,7 +1370,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1379,7 +1379,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -void ptlink_cmd_bot_nick(char *nick, char *user, char *host, char *real, +void ptlink_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, char *modes) { EnforceQlinedNick(nick, s_BotServ); @@ -1390,7 +1390,7 @@ void ptlink_cmd_bot_nick(char *nick, char *user, char *host, char *real, } -void ptlink_cmd_351(char *source) +void ptlink_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1400,13 +1400,13 @@ void ptlink_cmd_351(char *source) } /* SVSHOLD - set */ -void ptlink_cmd_svshold(char *nick) +void ptlink_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void ptlink_cmd_release_svshold(char *nick) +void ptlink_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } @@ -1416,7 +1416,7 @@ void ptlink_cmd_release_svshold(char *nick) parv[0] = sender parv[1] = zlined host */ -void ptlink_cmd_unszline(char *mask) +void ptlink_cmd_unszline(const char *mask) { send_cmd(s_OperServ, "UNZLINE %s", mask); } @@ -1428,7 +1428,7 @@ void ptlink_cmd_unszline(char *mask) parv[2] = time parv[3] = reason */ -void ptlink_cmd_szline(char *mask, char *reason, char *whom) +void ptlink_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(s_OperServ, "ZLINE %s %ld :%s", mask, (long int) time(NULL) + 86400 * 2, reason); @@ -1439,7 +1439,7 @@ void ptlink_cmd_szline(char *mask, char *reason, char *whom) parv[0] = sender parv[1] = info ban mask */ -void ptlink_cmd_unsgline(char *mask) +void ptlink_cmd_unsgline(const char *mask) { send_cmd(ServerName, "UNSXLINE :%s", mask); } @@ -1452,7 +1452,7 @@ void ptlink_cmd_unsgline(char *mask) * parv[1] = mask length * parv[2] = real name banned mask:reason */ -void ptlink_cmd_sgline(char *mask, char *reason) +void ptlink_cmd_sgline(const char *mask, const char *reason) { send_cmd(ServerName, "SXLINE %d :%s:%s", (int) strlen(mask), mask, reason); @@ -1466,7 +1466,7 @@ void ptlink_cmd_sgline(char *mask, char *reason) parv[2] = new nick e.g.: :NickServ SVSNICK Smiler 67455223 _Smiler- */ -void ptlink_cmd_svsnick(char *source, char *guest, time_t when) +void ptlink_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1474,8 +1474,8 @@ void ptlink_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void ptlink_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void ptlink_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "NICK %s 1 %lu %s %s %s %s %s :%s", nick, (unsigned long int) time(NULL), modes, user, host, host, @@ -1483,19 +1483,19 @@ void ptlink_cmd_guest_nick(char *nick, char *user, char *host, char *real, } -void ptlink_cmd_unban(char *name, char *nick) +void ptlink_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void ptlink_cmd_svsmode_chan(char *name, char *mode, char *nick) +void ptlink_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } -void ptlink_cmd_svso(char *source, char *nick, char *flag) +void ptlink_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } @@ -1503,7 +1503,7 @@ void ptlink_cmd_svso(char *source, char *nick, char *flag) /* SVSMODE +d */ /* sent if svid is something weird */ -void ptlink_cmd_svid_umode(char *nick, time_t ts) +void ptlink_cmd_svid_umode(const char *nick, time_t ts) { /* Not Supported by this ircd */ } @@ -1517,12 +1517,12 @@ void ptlink_cmd_nc_change(User * u) /* SVSMODE +d */ /* sent if svid is something weird */ -void ptlink_cmd_svid_umode2(User * u, char *ts) +void ptlink_cmd_svid_umode2(User * u, const char *ts) { common_svsmode(u, "+r", NULL); } -void ptlink_cmd_svid_umode3(User * u, char *ts) +void ptlink_cmd_svid_umode3(User * u, const char *ts) { /* Bahamuts have this extra one, since they can check on even nick changes */ } @@ -1534,7 +1534,7 @@ void ptlink_cmd_svid_umode3(User * u, char *ts) parv[1] = new nick parv[2] = TS (timestamp from user's server when nick changed was received) */ -void ptlink_cmd_chg_nick(char *oldnick, char *newnick) +void ptlink_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1550,7 +1550,7 @@ void ptlink_cmd_chg_nick(char *oldnick, char *newnick) parv[2] = channels list :OperServ SVSJOIN Trystan #Admin */ -void ptlink_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void ptlink_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SVSJOIN %s %s", nick, chan); } @@ -1562,47 +1562,47 @@ void ptlink_cmd_svsjoin(char *source, char *nick, char *chan, char *param) parv[2] = channels list e.g.: :ChanServ SVSPART mynick 4163321 #Chan1,#Chan2 */ -void ptlink_cmd_svspart(char *source, char *nick, char *chan) +void ptlink_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SVSPART %s :%s", nick, chan); } -void ptlink_cmd_swhois(char *source, char *who, char *mask) +void ptlink_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int ptlink_flood_mode_check(char *value) +int ptlink_flood_mode_check(const char *value) { char *dp, *end; @@ -1621,7 +1621,7 @@ void ptlink_cmd_eob() /* not supported */ } -void ptlink_cmd_jupe(char *jserver, char *who, char *reason) +void ptlink_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1635,7 +1635,7 @@ void ptlink_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void ptlink_cmd_global_legacy(char *source, char *fmt) +void ptlink_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1644,7 +1644,7 @@ void ptlink_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int ptlink_valid_nick(char *nick) +int ptlink_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1654,14 +1654,14 @@ int ptlink_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int ptlink_valid_chan(char *cahn) +int ptlink_valid_chan(const char *cahn) { /* no hard coded invalid chan */ return 1; } -void ptlink_cmd_ctcp(char *source, char *dest, char *buf) +void ptlink_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/ptlink.h b/src/protocol/ptlink.h index 5c949670c..65b3aeb4c 100644 --- a/src/protocol/ptlink.h +++ b/src/protocol/ptlink.h @@ -78,74 +78,74 @@ #define PTLINK_TS_CURRENT 9 #define PTLINK_TS_MIN 3 -void ptlink_set_umode(User * user, int ac, char **av); -void ptlink_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void ptlink_set_umode(User * user, int ac, const char **av); +void ptlink_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void ptlink_cmd_vhost_off(User * u); -void ptlink_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void ptlink_cmd_svskill(char *source, char *user, char *buf); -void ptlink_cmd_svsmode(User * u, int ac, char **av); -void ptlink_cmd_372(char *source, char *msg); -void ptlink_cmd_372_error(char *source); -void ptlink_cmd_375(char *source); -void ptlink_cmd_376(char *source); -void ptlink_cmd_nick(char *nick, char *name, char *modes); -void ptlink_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void ptlink_cmd_mode(char *source, char *dest, char *buf); -void ptlink_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void ptlink_cmd_kick(char *source, char *chan, char *user, char *buf); -void ptlink_cmd_notice_ops(char *source, char *dest, char *buf); -void ptlink_cmd_notice(char *source, char *dest, char *buf); -void ptlink_cmd_notice2(char *source, char *dest, char *msg); -void ptlink_cmd_privmsg(char *source, char *dest, char *buf); -void ptlink_cmd_privmsg2(char *source, char *dest, char *msg); -void ptlink_cmd_serv_notice(char *source, char *dest, char *msg); -void ptlink_cmd_serv_privmsg(char *source, char *dest, char *msg); -void ptlink_cmd_bot_chan_mode(char *nick, char *chan); -void ptlink_cmd_351(char *source); -void ptlink_cmd_quit(char *source, char *buf); -void ptlink_cmd_pong(char *servname, char *who); -void ptlink_cmd_join(char *user, char *channel, time_t chantime); -void ptlink_cmd_unsqline(char *user); -void ptlink_cmd_invite(char *source, char *chan, char *nick); -void ptlink_cmd_part(char *nick, char *chan, char *buf); -void ptlink_cmd_391(char *source, char *timestr); -void ptlink_cmd_250(char *buf); -void ptlink_cmd_307(char *buf); -void ptlink_cmd_311(char *buf); -void ptlink_cmd_312(char *buf); -void ptlink_cmd_317(char *buf); -void ptlink_cmd_219(char *source, char *letter); -void ptlink_cmd_401(char *source, char *who); -void ptlink_cmd_318(char *source, char *who); -void ptlink_cmd_242(char *buf); -void ptlink_cmd_243(char *buf); -void ptlink_cmd_211(char *buf); -void ptlink_cmd_global(char *source, char *buf); -void ptlink_cmd_global_legacy(char *source, char *fmt); -void ptlink_cmd_sqline(char *mask, char *reason); -void ptlink_cmd_squit(char *servname, char *message); -void ptlink_cmd_svso(char *source, char *nick, char *flag); -void ptlink_cmd_chg_nick(char *oldnick, char *newnick); -void ptlink_cmd_svsnick(char *source, char *guest, time_t when); -void ptlink_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void ptlink_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void ptlink_cmd_svskill(const char *source, const char *user, const char *buf); +void ptlink_cmd_svsmode(User * u, int ac, const char **av); +void ptlink_cmd_372(const char *source, const char *msg); +void ptlink_cmd_372_error(const char *source); +void ptlink_cmd_375(const char *source); +void ptlink_cmd_376(const char *source); +void ptlink_cmd_nick(const char *nick, const char *name, const char *modes); +void ptlink_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ptlink_cmd_mode(const char *source, const char *dest, const char *buf); +void ptlink_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ptlink_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void ptlink_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void ptlink_cmd_notice(const char *source, const char *dest, const char *buf); +void ptlink_cmd_notice2(const char *source, const char *dest, const char *msg); +void ptlink_cmd_privmsg(const char *source, const char *dest, const char *buf); +void ptlink_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void ptlink_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void ptlink_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void ptlink_cmd_bot_chan_mode(const char *nick, const char *chan); +void ptlink_cmd_351(const char *source); +void ptlink_cmd_quit(const char *source, const char *buf); +void ptlink_cmd_pong(const char *servname, const char *who); +void ptlink_cmd_join(const char *user, const char *channel, time_t chantime); +void ptlink_cmd_unsqline(const char *user); +void ptlink_cmd_invite(const char *source, const char *chan, const char *nick); +void ptlink_cmd_part(const char *nick, const char *chan, const char *buf); +void ptlink_cmd_391(const char *source, const char *timestr); +void ptlink_cmd_250(const char *buf); +void ptlink_cmd_307(const char *buf); +void ptlink_cmd_311(const char *buf); +void ptlink_cmd_312(const char *buf); +void ptlink_cmd_317(const char *buf); +void ptlink_cmd_219(const char *source, const char *letter); +void ptlink_cmd_401(const char *source, const char *who); +void ptlink_cmd_318(const char *source, const char *who); +void ptlink_cmd_242(const char *buf); +void ptlink_cmd_243(const char *buf); +void ptlink_cmd_211(const char *buf); +void ptlink_cmd_global(const char *source, const char *buf); +void ptlink_cmd_global_legacy(const char *source, const char *fmt); +void ptlink_cmd_sqline(const char *mask, const char *reason); +void ptlink_cmd_squit(const char *servname, const char *message); +void ptlink_cmd_svso(const char *source, const char *nick, const char *flag); +void ptlink_cmd_chg_nick(const char *oldnick, const char *newnick); +void ptlink_cmd_svsnick(const char *source, const char *guest, time_t when); +void ptlink_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void ptlink_cmd_connect(int servernum); -void ptlink_cmd_svshold(char *nick); -void ptlink_cmd_release_svshold(char *nick); -void ptlink_cmd_unsgline(char *mask); -void ptlink_cmd_unszline(char *mask); -void ptlink_cmd_szline(char *mask, char *reason, char *whom); -void ptlink_cmd_sgline(char *mask, char *reason); -void ptlink_cmd_unban(char *name, char *nick); -void ptlink_cmd_svsmode_chan(char *name, char *mode, char *nick); -void ptlink_cmd_svid_umode(char *nick, time_t ts); +void ptlink_cmd_svshold(const char *nick); +void ptlink_cmd_release_svshold(const char *nick); +void ptlink_cmd_unsgline(const char *mask); +void ptlink_cmd_unszline(const char *mask); +void ptlink_cmd_szline(const char *mask, const char *reason, const char *whom); +void ptlink_cmd_sgline(const char *mask, const char *reason); +void ptlink_cmd_unban(const char *name, const char *nick); +void ptlink_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void ptlink_cmd_svid_umode(const char *nick, time_t ts); void ptlink_cmd_nc_change(User * u); -void ptlink_cmd_svid_umode2(User * u, char *ts); -void ptlink_cmd_svid_umode3(User * u, char *ts); +void ptlink_cmd_svid_umode2(User * u, const char *ts); +void ptlink_cmd_svid_umode3(User * u, const char *ts); void ptlink_cmd_eob(); -int ptlink_flood_mode_check(char *value); -void ptlink_cmd_jupe(char *jserver, char *who, char *reason); -int ptlink_valid_nick(char *nick); -void ptlink_cmd_ctcp(char *source, char *dest, char *buf); +int ptlink_flood_mode_check(const char *value); +void ptlink_cmd_jupe(const char *jserver, const char *who, const char *reason); +int ptlink_valid_nick(const char *nick); +void ptlink_cmd_ctcp(const char *source, const char *dest, const char *buf); class PTlinkProto : public IRCDProtoNew { public: diff --git a/src/protocol/rageircd.c b/src/protocol/rageircd.c index bbc3541a1..cb5ef0af4 100644 --- a/src/protocol/rageircd.c +++ b/src/protocol/rageircd.c @@ -402,18 +402,18 @@ CUMode myCumodes[128] = { -void rageircd_cmd_bot_unban(ChannelInfo * ci, char *nick) +void rageircd_cmd_bot_unban(ChannelInfo * ci, const char *nick) { send_cmd(ServerName, "SVSMODE %s -b %s", ci->name, nick); } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -431,13 +431,13 @@ int anope_event_nick(char *source, int ac, char **av) } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } -int anope_event_vhost(char *source, int ac, char **av) +int anope_event_vhost(const char *source, int ac, const char **av) { User *u; @@ -452,7 +452,7 @@ int anope_event_vhost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } @@ -472,7 +472,7 @@ int anope_event_vhost(char *source, int ac, char **av) ** parv[10] = info Dreams are answers to questions not yet asked */ -int anope_event_snick(char *source, int ac, char **av) +int anope_event_snick(const char *source, int ac, const char **av) { User *user; @@ -487,7 +487,7 @@ int anope_event_snick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -565,7 +565,7 @@ void moduleAddIRCDMsgs(void) { } /* *INDENT-ON* */ -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -576,7 +576,7 @@ int anope_event_error(char *source, int ac, char **av) } -int anope_event_burst(char *source, int ac, char **av) +int anope_event_burst(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -596,7 +596,7 @@ int anope_event_burst(char *source, int ac, char **av) return MOD_CONT; } -void rageircd_cmd_sqline(char *mask, char *reason) +void rageircd_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -605,17 +605,17 @@ void rageircd_cmd_sqline(char *mask, char *reason) send_cmd(NULL, "SQLINE %s :%s", mask, reason); } -void rageircd_cmd_unsgline(char *mask) +void rageircd_cmd_unsgline(const char *mask) { send_cmd(NULL, "UNSGLINE 0 :%s", mask); } -void rageircd_cmd_unszline(char *mask) +void rageircd_cmd_unszline(const char *mask) { send_cmd(NULL, "UNSZLINE 0 %s", mask); } -void rageircd_cmd_szline(char *mask, char *reason, char *whom) +void rageircd_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "SZLINE %s :%s", mask, reason); } @@ -625,12 +625,12 @@ void RageIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void rageircd_cmd_svsadmin(char *server, int set) +void rageircd_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } -void rageircd_cmd_sgline(char *mask, char *reason) +void rageircd_cmd_sgline(const char *mask, const char *reason) { send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason); @@ -643,7 +643,7 @@ void RageIRCdProto::cmd_remove_akill(const char *user, const char *host) /* PART */ -void rageircd_cmd_part(char *nick, char *chan, char *buf) +void rageircd_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -656,8 +656,8 @@ void rageircd_cmd_part(char *nick, char *chan, char *buf) } } -void rageircd_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void rageircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -669,7 +669,7 @@ void rageircd_cmd_vhost_off(User * u) notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar); } -void rageircd_cmd_chghost(char *nick, char *vhost) +void rageircd_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -677,30 +677,30 @@ void rageircd_cmd_chghost(char *nick, char *vhost) send_cmd(ServerName, "VHOST %s %s", nick, vhost); } -void rageircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void rageircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { send_cmd(s_HostServ, "SVSMODE %s +x", nick); rageircd_cmd_chghost(nick, vhost); } -void rageircd_cmd_unsqline(char *user) +void rageircd_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } -void rageircd_cmd_join(char *user, char *channel, time_t chantime) +void rageircd_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel); } -void rageircd_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void rageircd_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who, (long int) time(NULL), reason); } -void rageircd_cmd_svskill(char *source, char *user, char *buf) +void rageircd_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -713,20 +713,20 @@ void rageircd_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "SVSKILL %s :%s", user, buf); } -void rageircd_cmd_svsmode(User * u, int ac, char **av) +void rageircd_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); } -void rageircd_cmd_squit(char *servname, char *message) +void rageircd_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } /* PONG */ -void rageircd_cmd_pong(char *servname, char *who) +void rageircd_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -742,13 +742,13 @@ void rageircd_cmd_capab() send_cmd(NULL, "CAPAB BURST UNCONNECT SSJ3 SN2 VHOST TSMODE"); } -void rageircd_cmd_server(char *servname, int hop, char *descript) +void rageircd_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } /* PASS */ -void rageircd_cmd_pass(char *pass) +void rageircd_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } @@ -783,10 +783,10 @@ void rageircd_cmd_connect(int servernum) rageircd_cmd_burst(); } -void rageircd_set_umode(User * user, int ac, char **av) +void rageircd_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -852,7 +852,7 @@ void rageircd_set_umode(User * user, int ac, char **av) } /* GLOBOPS */ -void rageircd_cmd_global(char *source, char *buf) +void rageircd_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -861,7 +861,7 @@ void rageircd_cmd_global(char *source, char *buf) send_cmd(source ? source : ServerName, "GLOBOPS :%s", buf); } -void rageircd_cmd_notice_ops(char *source, char *dest, char *buf) +void rageircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -871,7 +871,7 @@ void rageircd_cmd_notice_ops(char *source, char *dest, char *buf) } -void rageircd_cmd_notice(char *source, char *dest, char *buf) +void rageircd_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -884,12 +884,12 @@ void rageircd_cmd_notice(char *source, char *dest, char *buf) } } -void rageircd_cmd_notice2(char *source, char *dest, char *msg) +void rageircd_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void rageircd_cmd_privmsg(char *source, char *dest, char *buf) +void rageircd_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -898,22 +898,22 @@ void rageircd_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void rageircd_cmd_privmsg2(char *source, char *dest, char *msg) +void rageircd_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void rageircd_cmd_serv_notice(char *source, char *dest, char *msg) +void rageircd_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void rageircd_cmd_serv_privmsg(char *source, char *dest, char *msg) +void rageircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -922,7 +922,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -930,14 +930,14 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void rageircd_cmd_351(char *source) +void rageircd_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, EncModule, version_build); } -void rageircd_cmd_mode(char *source, char *dest, char *buf) +void rageircd_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -955,7 +955,7 @@ void rageircd_cmd_mode(char *source, char *dest, char *buf) } -void rageircd_cmd_kick(char *source, char *chan, char *user, char *buf) +void rageircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -964,30 +964,30 @@ void rageircd_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void rageircd_cmd_372(char *source, char *msg) +void rageircd_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void rageircd_cmd_372_error(char *source) +void rageircd_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void rageircd_cmd_375(char *source) +void rageircd_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void rageircd_cmd_376(char *source) +void rageircd_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* INVITE */ -void rageircd_cmd_invite(char *source, char *chan, char *nick) +void rageircd_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -997,7 +997,7 @@ void rageircd_cmd_invite(char *source, char *chan, char *nick) } /* 391 */ -void rageircd_cmd_391(char *source, char *timestr) +void rageircd_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1006,7 +1006,7 @@ void rageircd_cmd_391(char *source, char *timestr) } /* 250 */ -void rageircd_cmd_250(char *buf) +void rageircd_cmd_250(const char *buf) { if (!buf) { return; @@ -1016,7 +1016,7 @@ void rageircd_cmd_250(char *buf) } /* 307 */ -void rageircd_cmd_307(char *buf) +void rageircd_cmd_307(const char *buf) { if (!buf) { return; @@ -1026,7 +1026,7 @@ void rageircd_cmd_307(char *buf) } /* 311 */ -void rageircd_cmd_311(char *buf) +void rageircd_cmd_311(const char *buf) { if (!buf) { return; @@ -1036,7 +1036,7 @@ void rageircd_cmd_311(char *buf) } /* 312 */ -void rageircd_cmd_312(char *buf) +void rageircd_cmd_312(const char *buf) { if (!buf) { return; @@ -1046,7 +1046,7 @@ void rageircd_cmd_312(char *buf) } /* 317 */ -void rageircd_cmd_317(char *buf) +void rageircd_cmd_317(const char *buf) { if (!buf) { return; @@ -1056,7 +1056,7 @@ void rageircd_cmd_317(char *buf) } /* 219 */ -void rageircd_cmd_219(char *source, char *letter) +void rageircd_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1071,7 +1071,7 @@ void rageircd_cmd_219(char *source, char *letter) } /* 401 */ -void rageircd_cmd_401(char *source, char *who) +void rageircd_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1080,7 +1080,7 @@ void rageircd_cmd_401(char *source, char *who) } /* 318 */ -void rageircd_cmd_318(char *source, char *who) +void rageircd_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1090,7 +1090,7 @@ void rageircd_cmd_318(char *source, char *who) } /* 242 */ -void rageircd_cmd_242(char *buf) +void rageircd_cmd_242(const char *buf) { if (!buf) { return; @@ -1100,7 +1100,7 @@ void rageircd_cmd_242(char *buf) } /* 243 */ -void rageircd_cmd_243(char *buf) +void rageircd_cmd_243(const char *buf) { if (!buf) { return; @@ -1110,7 +1110,7 @@ void rageircd_cmd_243(char *buf) } /* 211 */ -void rageircd_cmd_211(char *buf) +void rageircd_cmd_211(const char *buf) { if (!buf) { return; @@ -1119,7 +1119,7 @@ void rageircd_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void rageircd_cmd_nick(char *nick, char *name, char *modes) +void rageircd_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", nick, @@ -1129,7 +1129,7 @@ void rageircd_cmd_nick(char *nick, char *name, char *modes) } /* EVENT : OS */ -int anope_event_os(char *source, int ac, char **av) +int anope_event_os(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1138,7 +1138,7 @@ int anope_event_os(char *source, int ac, char **av) } /* EVENT : NS */ -int anope_event_ns(char *source, int ac, char **av) +int anope_event_ns(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1147,7 +1147,7 @@ int anope_event_ns(char *source, int ac, char **av) } /* EVENT : MS */ -int anope_event_ms(char *source, int ac, char **av) +int anope_event_ms(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1156,7 +1156,7 @@ int anope_event_ms(char *source, int ac, char **av) } /* EVENT : HS */ -int anope_event_hs(char *source, int ac, char **av) +int anope_event_hs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1165,7 +1165,7 @@ int anope_event_hs(char *source, int ac, char **av) } /* EVENT : CS */ -int anope_event_cs(char *source, int ac, char **av) +int anope_event_cs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1174,7 +1174,7 @@ int anope_event_cs(char *source, int ac, char **av) } /* QUIT */ -void rageircd_cmd_quit(char *source, char *buf) +void rageircd_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -1183,8 +1183,8 @@ void rageircd_cmd_quit(char *source, char *buf) } } -void rageircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void rageircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", nick, @@ -1193,7 +1193,7 @@ void rageircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, } /* SVSMODE -b */ -void rageircd_cmd_unban(char *name, char *nick) +void rageircd_cmd_unban(const char *name, const char *nick) { rageircd_cmd_svsmode_chan(name, "-b", nick); } @@ -1201,7 +1201,7 @@ void rageircd_cmd_unban(char *name, char *nick) /* SVSMODE channel modes */ -void rageircd_cmd_svsmode_chan(char *name, char *mode, char *nick) +void rageircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "SVSMODE %s %s %s", name, mode, nick); @@ -1210,12 +1210,12 @@ void rageircd_cmd_svsmode_chan(char *name, char *mode, char *nick) } } -void rageircd_cmd_bot_chan_mode(char *nick, char *chan) +void rageircd_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); } -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1225,7 +1225,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1233,7 +1233,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1241,7 +1241,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1250,12 +1250,12 @@ int anope_event_whois(char *source, int ac, char **av) } -int anope_event_482(char *source, int ac, char **av) +int anope_event_482(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -1263,7 +1263,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1271,7 +1271,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1280,7 +1280,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1294,7 +1294,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1303,7 +1303,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1312,7 +1312,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1320,7 +1320,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1331,19 +1331,19 @@ int anope_event_motd(char *source, int ac, char **av) } /* SVSHOLD - set */ -void rageircd_cmd_svshold(char *nick) +void rageircd_cmd_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s %d :%s", nick, NSReleaseTimeout, "Being held for registered user"); } /* SVSHOLD - release */ -void rageircd_cmd_release_svshold(char *nick) +void rageircd_cmd_release_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s 0", nick); } -void rageircd_cmd_svsnick(char *source, char *guest, time_t when) +void rageircd_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1351,15 +1351,15 @@ void rageircd_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void rageircd_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +void rageircd_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { send_cmd(NULL, "SNICK %s %ld 1 %s %s 0 * %s 0 %s :%s", nick, (long int) time(NULL), user, host, ServerName, modes, real); } -void rageircd_cmd_svso(char *source, char *nick, char *flag) +void rageircd_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } @@ -1367,7 +1367,7 @@ void rageircd_cmd_svso(char *source, char *nick, char *flag) /* SVSMODE +d */ /* sent if svid is something weird */ -void rageircd_cmd_svid_umode(char *nick, time_t ts) +void rageircd_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1381,12 +1381,12 @@ void rageircd_cmd_nc_change(User * u) } /* SVSMODE +d */ -void rageircd_cmd_svid_umode2(User * u, char *ts) +void rageircd_cmd_svid_umode2(User * u, const char *ts) { /* not used by bahamut ircds */ } -void rageircd_cmd_svid_umode3(User * u, char *ts) +void rageircd_cmd_svid_umode3(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1396,7 +1396,7 @@ void rageircd_cmd_svid_umode3(User * u, char *ts) } /* NICK <newnick> */ -void rageircd_cmd_chg_nick(char *oldnick, char *newnick) +void rageircd_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1405,13 +1405,13 @@ void rageircd_cmd_chg_nick(char *oldnick, char *newnick) send_cmd(oldnick, "NICK %s", newnick); } -int anope_event_myid(char *source, int ac, char **av) +int anope_event_myid(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; @@ -1432,66 +1432,66 @@ int anope_event_pass(char *source, int ac, char **av) * parv[5] = ircd codename * parv[6] = masking keys */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_gnotice(char *source, int ac, char **av) +int anope_event_gnotice(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -void rageircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void rageircd_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Find no reference to it in the code and docs */ } -void rageircd_cmd_svspart(char *source, char *nick, char *chan) +void rageircd_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Find no reference to it in the code and docs */ } -void rageircd_cmd_swhois(char *source, char *who, char *mask) +void rageircd_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_globops(char *source, int ac, char **av) +int anope_event_globops(const char *source, int ac, const char **av) { return MOD_CONT; } -int rageircd_flood_mode_check(char *value) +int rageircd_flood_mode_check(const char *value) { return 0; } @@ -1501,7 +1501,7 @@ void rageircd_cmd_eob() send_cmd(NULL, "BURST 0"); } -void rageircd_cmd_jupe(char *jserver, char *who, char *reason) +void rageircd_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1515,7 +1515,7 @@ void rageircd_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void rageircd_cmd_global_legacy(char *source, char *fmt) +void rageircd_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1524,7 +1524,7 @@ void rageircd_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int rageircd_valid_nick(char *nick) +int rageircd_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1534,14 +1534,14 @@ int rageircd_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int rageircd_valid_chan(char *chan) +int rageircd_valid_chan(const char *chan) { /* no hard coded invalid nicks */ return 1; } -void rageircd_cmd_ctcp(char *source, char *dest, char *buf) +void rageircd_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/rageircd.h b/src/protocol/rageircd.h index 3db80a60e..620ab53ec 100644 --- a/src/protocol/rageircd.h +++ b/src/protocol/rageircd.h @@ -41,74 +41,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void rageircd_set_umode(User * user, int ac, char **av); -void rageircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void rageircd_set_umode(User * user, int ac, const char **av); +void rageircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void rageircd_cmd_vhost_off(User * u); -void rageircd_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void rageircd_cmd_svskill(char *source, char *user, char *buf); -void rageircd_cmd_svsmode(User * u, int ac, char **av); -void rageircd_cmd_372(char *source, char *msg); -void rageircd_cmd_372_error(char *source); -void rageircd_cmd_375(char *source); -void rageircd_cmd_376(char *source); -void rageircd_cmd_nick(char *nick, char *name, char *modes); -void rageircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void rageircd_cmd_mode(char *source, char *dest, char *buf); -void rageircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void rageircd_cmd_kick(char *source, char *chan, char *user, char *buf); -void rageircd_cmd_notice_ops(char *source, char *dest, char *buf); -void rageircd_cmd_notice(char *source, char *dest, char *buf); -void rageircd_cmd_notice2(char *source, char *dest, char *msg); -void rageircd_cmd_privmsg(char *source, char *dest, char *buf); -void rageircd_cmd_privmsg2(char *source, char *dest, char *msg); -void rageircd_cmd_serv_notice(char *source, char *dest, char *msg); -void rageircd_cmd_serv_privmsg(char *source, char *dest, char *msg); -void rageircd_cmd_bot_chan_mode(char *nick, char *chan); -void rageircd_cmd_351(char *source); -void rageircd_cmd_quit(char *source, char *buf); -void rageircd_cmd_pong(char *servname, char *who); -void rageircd_cmd_join(char *user, char *channel, time_t chantime); -void rageircd_cmd_unsqline(char *user); -void rageircd_cmd_invite(char *source, char *chan, char *nick); -void rageircd_cmd_part(char *nick, char *chan, char *buf); -void rageircd_cmd_391(char *source, char *timestr); -void rageircd_cmd_250(char *buf); -void rageircd_cmd_307(char *buf); -void rageircd_cmd_311(char *buf); -void rageircd_cmd_312(char *buf); -void rageircd_cmd_317(char *buf); -void rageircd_cmd_219(char *source, char *letter); -void rageircd_cmd_401(char *source, char *who); -void rageircd_cmd_318(char *source, char *who); -void rageircd_cmd_242(char *buf); -void rageircd_cmd_243(char *buf); -void rageircd_cmd_211(char *buf); -void rageircd_cmd_global(char *source, char *buf); -void rageircd_cmd_global_legacy(char *source, char *fmt); -void rageircd_cmd_sqline(char *mask, char *reason); -void rageircd_cmd_squit(char *servname, char *message); -void rageircd_cmd_svso(char *source, char *nick, char *flag); -void rageircd_cmd_chg_nick(char *oldnick, char *newnick); -void rageircd_cmd_svsnick(char *source, char *guest, time_t when); -void rageircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void rageircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void rageircd_cmd_svskill(const char *source, const char *user, const char *buf); +void rageircd_cmd_svsmode(User * u, int ac, const char **av); +void rageircd_cmd_372(const char *source, const char *msg); +void rageircd_cmd_372_error(const char *source); +void rageircd_cmd_375(const char *source); +void rageircd_cmd_376(const char *source); +void rageircd_cmd_nick(const char *nick, const char *name, const char *modes); +void rageircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void rageircd_cmd_mode(const char *source, const char *dest, const char *buf); +void rageircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void rageircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void rageircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void rageircd_cmd_notice(const char *source, const char *dest, const char *buf); +void rageircd_cmd_notice2(const char *source, const char *dest, const char *msg); +void rageircd_cmd_privmsg(const char *source, const char *dest, const char *buf); +void rageircd_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void rageircd_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void rageircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void rageircd_cmd_bot_chan_mode(const char *nick, const char *chan); +void rageircd_cmd_351(const char *source); +void rageircd_cmd_quit(const char *source, const char *buf); +void rageircd_cmd_pong(const char *servname, const char *who); +void rageircd_cmd_join(const char *user, const char *channel, time_t chantime); +void rageircd_cmd_unsqline(const char *user); +void rageircd_cmd_invite(const char *source, const char *chan, const char *nick); +void rageircd_cmd_part(const char *nick, const char *chan, const char *buf); +void rageircd_cmd_391(const char *source, const char *timestr); +void rageircd_cmd_250(const char *buf); +void rageircd_cmd_307(const char *buf); +void rageircd_cmd_311(const char *buf); +void rageircd_cmd_312(const char *buf); +void rageircd_cmd_317(const char *buf); +void rageircd_cmd_219(const char *source, const char *letter); +void rageircd_cmd_401(const char *source, const char *who); +void rageircd_cmd_318(const char *source, const char *who); +void rageircd_cmd_242(const char *buf); +void rageircd_cmd_243(const char *buf); +void rageircd_cmd_211(const char *buf); +void rageircd_cmd_global(const char *source, const char *buf); +void rageircd_cmd_global_legacy(const char *source, const char *fmt); +void rageircd_cmd_sqline(const char *mask, const char *reason); +void rageircd_cmd_squit(const char *servname, const char *message); +void rageircd_cmd_svso(const char *source, const char *nick, const char *flag); +void rageircd_cmd_chg_nick(const char *oldnick, const char *newnick); +void rageircd_cmd_svsnick(const char *source, const char *guest, time_t when); +void rageircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void rageircd_cmd_connect(int servernum); -void rageircd_cmd_svshold(char *nick); -void rageircd_cmd_release_svshold(char *nick); -void rageircd_cmd_unsgline(char *mask); -void rageircd_cmd_unszline(char *mask); -void rageircd_cmd_szline(char *mask, char *reason, char *whom); -void rageircd_cmd_sgline(char *mask, char *reason); -void rageircd_cmd_unban(char *name, char *nick); -void rageircd_cmd_svsmode_chan(char *name, char *mode, char *nick); -void rageircd_cmd_svid_umode(char *nick, time_t ts); +void rageircd_cmd_svshold(const char *nick); +void rageircd_cmd_release_svshold(const char *nick); +void rageircd_cmd_unsgline(const char *mask); +void rageircd_cmd_unszline(const char *mask); +void rageircd_cmd_szline(const char *mask, const char *reason, const char *whom); +void rageircd_cmd_sgline(const char *mask, const char *reason); +void rageircd_cmd_unban(const char *name, const char *nick); +void rageircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void rageircd_cmd_svid_umode(const char *nick, time_t ts); void rageircd_cmd_nc_change(User * u); -void rageircd_cmd_svid_umode2(User * u, char *ts); -void rageircd_cmd_svid_umode3(User * u, char *ts); +void rageircd_cmd_svid_umode2(User * u, const char *ts); +void rageircd_cmd_svid_umode3(User * u, const char *ts); void rageircd_cmd_eob(); -int rageircd_flood_mode_check(char *value); -void rageircd_cmd_jupe(char *jserver, char *who, char *reason); -int rageircd_valid_nick(char *nick); -void rageircd_cmd_ctcp(char *source, char *dest, char *buf); +int rageircd_flood_mode_check(const char *value); +void rageircd_cmd_jupe(const char *jserver, const char *who, const char *reason); +int rageircd_valid_nick(const char *nick); +void rageircd_cmd_ctcp(const char *source, const char *dest, const char *buf); class RageIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index edeebd12f..9f527732e 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -144,10 +144,10 @@ IRCDCAPAB myIrcdcap[] = { 0, 0, 0} }; -void ratbox_set_umode(User * user, int ac, char **av) +void ratbox_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -440,7 +440,7 @@ CUMode myCumodes[128] = { -void ratbox_cmd_notice(char *source, char *dest, char *buf) +void ratbox_cmd_notice(const char *source, const char *dest, const char *buf) { Uid *ud; User *u; @@ -460,7 +460,7 @@ void ratbox_cmd_notice(char *source, char *dest, char *buf) } } -void ratbox_cmd_notice2(char *source, char *dest, char *msg) +void ratbox_cmd_notice2(const char *source, const char *dest, const char *msg) { Uid *ud; User *u; @@ -471,7 +471,7 @@ void ratbox_cmd_notice2(char *source, char *dest, char *msg) (UseTS6 ? (u ? u->uid : dest) : dest), msg); } -void ratbox_cmd_privmsg(char *source, char *dest, char *buf) +void ratbox_cmd_privmsg(const char *source, const char *dest, const char *buf) { Uid *ud, *ud2; @@ -485,7 +485,7 @@ void ratbox_cmd_privmsg(char *source, char *dest, char *buf) (UseTS6 ? (ud2 ? ud2->uid : dest) : dest), buf); } -void ratbox_cmd_privmsg2(char *source, char *dest, char *msg) +void ratbox_cmd_privmsg2(const char *source, const char *dest, const char *msg) { Uid *ud, *ud2; @@ -496,18 +496,18 @@ void ratbox_cmd_privmsg2(char *source, char *dest, char *msg) (UseTS6 ? (ud2 ? ud2->uid : dest) : dest), msg); } -void ratbox_cmd_serv_notice(char *source, char *dest, char *msg) +void ratbox_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $$%s :%s", dest, msg); } -void ratbox_cmd_serv_privmsg(char *source, char *dest, char *msg) +void ratbox_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); } -void ratbox_cmd_global(char *source, char *buf) +void ratbox_cmd_global(const char *source, const char *buf) { Uid *u; @@ -528,7 +528,7 @@ void ratbox_cmd_global(char *source, char *buf) } /* GLOBOPS - to handle old WALLOPS */ -void ratbox_cmd_global_legacy(char *source, char *fmt) +void ratbox_cmd_global_legacy(const char *source, const char *fmt) { Uid *u; @@ -546,7 +546,7 @@ void ratbox_cmd_global_legacy(char *source, char *fmt) send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt); } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -576,7 +576,7 @@ int anope_event_sjoin(char *source, int ac, char **av) av[8] = info */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { Server *s; User *user; @@ -584,8 +584,7 @@ int anope_event_nick(char *source, int ac, char **av) if (UseTS6 && ac == 9) { s = findserver_uid(servlist, source); /* Source is always the server */ - *source = '\0'; - user = do_nick(source, av[0], av[4], av[5], s->name, av[8], + user = do_nick("", av[0], av[4], av[5], s->name, av[8], strtoul(av[2], NULL, 10), 0, 0, "*", av[7]); if (user) { anope_set_umode(user, 1, &av[3]); @@ -604,7 +603,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { User *u; @@ -654,7 +653,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tburst(char *source, int ac, char **av) +int anope_event_tburst(const char *source, int ac, const char **av) { char *setter; Channel *c; @@ -701,7 +700,7 @@ int anope_event_tburst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -765,7 +764,7 @@ void moduleAddIRCDMsgs(void) /* *INDENT-ON* */ -void ratbox_cmd_sqline(char *mask, char *reason) +void ratbox_cmd_sqline(const char *mask, const char *reason) { Uid *ud; @@ -774,7 +773,7 @@ void ratbox_cmd_sqline(char *mask, char *reason) "RESV * %s :%s", mask, reason); } -void ratbox_cmd_unsgline(char *mask) +void ratbox_cmd_unsgline(const char *mask) { Uid *ud; @@ -783,21 +782,21 @@ void ratbox_cmd_unsgline(char *mask) "UNXLINE * %s", mask); } -void ratbox_cmd_unszline(char *mask) +void ratbox_cmd_unszline(const char *mask) { /* Does not support */ } -void ratbox_cmd_szline(char *mask, char *reason, char *whom) +void ratbox_cmd_szline(const char *mask, const char *reason, const char *whom) { /* Does not support */ } -void ratbox_cmd_svsadmin(char *server, int set) +void ratbox_cmd_svsadmin(const char *server, int set) { } -void ratbox_cmd_sgline(char *mask, char *reason) +void ratbox_cmd_sgline(const char *mask, const char *reason) { Uid *ud; @@ -812,8 +811,8 @@ void RatboxProto::cmd_remove_akill(const char *user, const char *host) send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); } -void ratbox_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void ratbox_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { Uid *ud; @@ -827,12 +826,12 @@ void ratbox_cmd_vhost_off(User * u) /* not supported */ } -void ratbox_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void ratbox_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { /* not supported */ } -void ratbox_cmd_unsqline(char *user) +void ratbox_cmd_unsqline(const char *user) { Uid *ud; @@ -841,7 +840,7 @@ void ratbox_cmd_unsqline(char *user) "UNRESV * %s", user); } -void ratbox_cmd_join(char *user, char *channel, time_t chantime) +void ratbox_cmd_join(const char *user, const char *channel, time_t chantime) { Uid *ud; @@ -859,8 +858,8 @@ host: the 'host' portion of the kline reason: the reason for the kline. */ -void ratbox_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void ratbox_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { Uid *ud; @@ -871,7 +870,7 @@ void ratbox_cmd_akill(char *user, char *host, char *who, time_t when, (long int) (expires - (long) time(NULL)), user, host, reason); } -void ratbox_cmd_svskill(char *source, char *user, char *buf) +void ratbox_cmd_svskill(const char *source, const char *user, const char *buf) { Uid *ud, *ud2; @@ -889,7 +888,7 @@ void ratbox_cmd_svskill(char *source, char *user, char *buf) (UseTS6 ? (ud2 ? ud2->uid : user) : user), buf); } -void ratbox_cmd_svsmode(User * u, int ac, char **av) +void ratbox_cmd_svsmode(User * u, int ac, const char **av) { send_cmd((UseTS6 ? TS6SID : ServerName), "SVSMODE %s %s", u->nick, av[0]); @@ -939,7 +938,7 @@ void ratbox_cmd_capab() } /* PASS */ -void ratbox_cmd_pass(char *pass) +void ratbox_cmd_pass(const char *pass) { if (UseTS6) { send_cmd(NULL, "PASS %s TS 6 :%s", pass, TS6SID); @@ -949,7 +948,7 @@ void ratbox_cmd_pass(char *pass) } /* SERVER name hop descript */ -void ratbox_cmd_server(char *servname, int hop, char *descript) +void ratbox_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -976,8 +975,8 @@ void ratbox_cmd_connect(int servernum) ratbox_cmd_svinfo(); } -void ratbox_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void ratbox_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, NULL); if (UseTS6) { @@ -994,7 +993,7 @@ void ratbox_cmd_bot_nick(char *nick, char *user, char *host, char *real, ratbox_cmd_sqline(nick, "Reserved for services"); } -void ratbox_cmd_part(char *nick, char *chan, char *buf) +void ratbox_cmd_part(const char *nick, const char *chan, const char *buf) { Uid *ud; @@ -1007,7 +1006,7 @@ void ratbox_cmd_part(char *nick, char *chan, char *buf) } } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1015,7 +1014,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { User *u = NULL; @@ -1028,7 +1027,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1037,7 +1036,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1050,7 +1049,7 @@ void ratbox_cmd_eob() /* doesn't support EOB */ } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) { do_sjoin(source, ac, av); @@ -1061,7 +1060,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1071,7 +1070,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { User *u; Uid *ud; @@ -1087,7 +1086,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { User *u; @@ -1101,7 +1100,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { Uid *ud; @@ -1113,7 +1112,7 @@ int anope_event_whois(char *source, int ac, char **av) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1128,7 +1127,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sid(char *source, int ac, char **av) +int anope_event_sid(const char *source, int ac, const char **av) { Server *s; @@ -1140,7 +1139,7 @@ int anope_event_sid(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1148,7 +1147,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { User *u; @@ -1162,32 +1161,32 @@ int anope_event_quit(char *source, int ac, char **av) return MOD_CONT; } -void ratbox_cmd_372(char *source, char *msg) +void ratbox_cmd_372(const char *source, const char *msg) { send_cmd((UseTS6 ? TS6SID : ServerName), "372 %s :- %s", source, msg); } -void ratbox_cmd_372_error(char *source) +void ratbox_cmd_372_error(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void ratbox_cmd_375(char *source) +void ratbox_cmd_375(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "375 %s :- %s Message of the Day", source, ServerName); } -void ratbox_cmd_376(char *source) +void ratbox_cmd_376(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "376 %s :End of /MOTD command.", source); } /* 391 */ -void ratbox_cmd_391(char *source, char *timestr) +void ratbox_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1196,7 +1195,7 @@ void ratbox_cmd_391(char *source, char *timestr) } /* 250 */ -void ratbox_cmd_250(char *buf) +void ratbox_cmd_250(const char *buf) { if (!buf) { return; @@ -1206,7 +1205,7 @@ void ratbox_cmd_250(char *buf) } /* 307 */ -void ratbox_cmd_307(char *buf) +void ratbox_cmd_307(const char *buf) { if (!buf) { return; @@ -1216,7 +1215,7 @@ void ratbox_cmd_307(char *buf) } /* 311 */ -void ratbox_cmd_311(char *buf) +void ratbox_cmd_311(const char *buf) { if (!buf) { return; @@ -1226,7 +1225,7 @@ void ratbox_cmd_311(char *buf) } /* 312 */ -void ratbox_cmd_312(char *buf) +void ratbox_cmd_312(const char *buf) { if (!buf) { return; @@ -1236,7 +1235,7 @@ void ratbox_cmd_312(char *buf) } /* 317 */ -void ratbox_cmd_317(char *buf) +void ratbox_cmd_317(const char *buf) { if (!buf) { return; @@ -1246,7 +1245,7 @@ void ratbox_cmd_317(char *buf) } /* 219 */ -void ratbox_cmd_219(char *source, char *letter) +void ratbox_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1261,7 +1260,7 @@ void ratbox_cmd_219(char *source, char *letter) } /* 401 */ -void ratbox_cmd_401(char *source, char *who) +void ratbox_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1271,7 +1270,7 @@ void ratbox_cmd_401(char *source, char *who) } /* 318 */ -void ratbox_cmd_318(char *source, char *who) +void ratbox_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1282,7 +1281,7 @@ void ratbox_cmd_318(char *source, char *who) } /* 242 */ -void ratbox_cmd_242(char *buf) +void ratbox_cmd_242(const char *buf) { if (!buf) { return; @@ -1292,7 +1291,7 @@ void ratbox_cmd_242(char *buf) } /* 243 */ -void ratbox_cmd_243(char *buf) +void ratbox_cmd_243(const char *buf) { if (!buf) { return; @@ -1302,7 +1301,7 @@ void ratbox_cmd_243(char *buf) } /* 211 */ -void ratbox_cmd_211(char *buf) +void ratbox_cmd_211(const char *buf) { if (!buf) { return; @@ -1311,7 +1310,7 @@ void ratbox_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void ratbox_cmd_mode(char *source, char *dest, char *buf) +void ratbox_cmd_mode(const char *source, const char *dest, const char *buf) { Uid *ud; if (!buf) { @@ -1327,7 +1326,7 @@ void ratbox_cmd_mode(char *source, char *dest, char *buf) } } -void ratbox_cmd_tmode(char *source, char *dest, const char *fmt, ...) +void ratbox_cmd_tmode(const char *source, const char *dest, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; @@ -1345,7 +1344,7 @@ void ratbox_cmd_tmode(char *source, char *dest, const char *fmt, ...) send_cmd(NULL, "MODE %s %s", dest, buf); } -void ratbox_cmd_nick(char *nick, char *name, char *mode) +void ratbox_cmd_nick(const char *nick, const char *name, const char *mode) { EnforceQlinedNick(nick, NULL); if (UseTS6) { @@ -1362,7 +1361,7 @@ void ratbox_cmd_nick(char *nick, char *name, char *mode) ratbox_cmd_sqline(nick, "Reserved for services"); } -void ratbox_cmd_kick(char *source, char *chan, char *user, char *buf) +void ratbox_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { Uid *ud; User *u; @@ -1380,7 +1379,7 @@ void ratbox_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void ratbox_cmd_notice_ops(char *source, char *dest, char *buf) +void ratbox_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1389,7 +1388,7 @@ void ratbox_cmd_notice_ops(char *source, char *dest, char *buf) send_cmd(NULL, "NOTICE @%s :%s", dest, buf); } -void ratbox_cmd_bot_chan_mode(char *nick, char *chan) +void ratbox_cmd_bot_chan_mode(const char *nick, const char *chan) { Uid *u; @@ -1403,7 +1402,7 @@ void ratbox_cmd_bot_chan_mode(char *nick, char *chan) } /* QUIT */ -void ratbox_cmd_quit(char *source, char *buf) +void ratbox_cmd_quit(const char *source, const char *buf) { Uid *ud; ud = find_uid(source); @@ -1417,7 +1416,7 @@ void ratbox_cmd_quit(char *source, char *buf) } /* PONG */ -void ratbox_cmd_pong(char *servname, char *who) +void ratbox_cmd_pong(const char *servname, const char *who) { if (UseTS6) { send_cmd(TS6SID, "PONG %s", who); @@ -1427,7 +1426,7 @@ void ratbox_cmd_pong(char *servname, char *who) } /* INVITE */ -void ratbox_cmd_invite(char *source, char *chan, char *nick) +void ratbox_cmd_invite(const char *source, const char *chan, const char *nick) { Uid *ud; User *u; @@ -1444,7 +1443,7 @@ void ratbox_cmd_invite(char *source, char *chan, char *nick) } /* SQUIT */ -void ratbox_cmd_squit(char *servname, char *message) +void ratbox_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1453,7 +1452,7 @@ void ratbox_cmd_squit(char *servname, char *message) send_cmd(NULL, "SQUIT %s :%s", servname, message); } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { User *u, *u2; @@ -1476,7 +1475,7 @@ int anope_event_mode(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tmode(char *source, int ac, char **av) +int anope_event_tmode(const char *source, int ac, const char **av) { if (*av[1] == '#' || *av[1] == '&') { do_cmode(source, ac, av); @@ -1484,7 +1483,7 @@ int anope_event_tmode(char *source, int ac, char **av) return MOD_CONT; } -void ratbox_cmd_351(char *source) +void ratbox_cmd_351(const char *source) { send_cmd((UseTS6 ? TS6SID : ServerName), "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, @@ -1493,23 +1492,23 @@ void ratbox_cmd_351(char *source) } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { int argvsize = 8; int argc; - char **argv; + const char **argv; char *str; if (ac < 1) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = scalloc(argvsize, sizeof(char *)); + argv = (const char **)scalloc(argvsize, sizeof(const char *)); argc = 0; while ((str = myStrGetToken(av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = srealloc(argv, argvsize * sizeof(char *)); + argv = (const char **)srealloc(argv, argvsize * sizeof(const char *)); } argv[argc] = str; argc++; @@ -1519,57 +1518,57 @@ int anope_event_capab(char *source, int ac, char **av) /* Free our built ac/av */ for (argvsize = 0; argvsize < argc; argvsize++) { - free(argv[argvsize]); + free((char *)argv[argvsize]); } - free(argv); + free((char **)argv); return MOD_CONT; } /* SVSHOLD - set */ -void ratbox_cmd_svshold(char *nick) +void ratbox_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void ratbox_cmd_release_svshold(char *nick) +void ratbox_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* SVSNICK */ -void ratbox_cmd_svsnick(char *nick, char *newnick, time_t when) +void ratbox_cmd_svsnick(const char *nick, const char *newnick, time_t when) { /* not supported */ } -void ratbox_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void ratbox_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { /* not supported */ } -void ratbox_cmd_svso(char *source, char *nick, char *flag) +void ratbox_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void ratbox_cmd_unban(char *name, char *nick) +void ratbox_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void ratbox_cmd_svsmode_chan(char *name, char *mode, char *nick) +void ratbox_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void ratbox_cmd_svid_umode(char *nick, time_t ts) +void ratbox_cmd_svid_umode(const char *nick, time_t ts) { /* not supported */ } @@ -1582,18 +1581,18 @@ void ratbox_cmd_nc_change(User * u) } /* SVSMODE +d */ -void ratbox_cmd_svid_umode2(User * u, char *ts) +void ratbox_cmd_svid_umode2(User * u, const char *ts) { /* not supported */ } -void ratbox_cmd_svid_umode3(User * u, char *ts) +void ratbox_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ -void ratbox_cmd_chg_nick(char *oldnick, char *newnick) +void ratbox_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1610,13 +1609,13 @@ void ratbox_cmd_chg_nick(char *oldnick, char *newnick) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { if (UseTS6) { TS6UPLINK = sstrdup(av[3]); @@ -1624,37 +1623,37 @@ int anope_event_pass(char *source, int ac, char **av) return MOD_CONT; } -void ratbox_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void ratbox_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void ratbox_cmd_svspart(char *source, char *nick, char *chan) +void ratbox_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void ratbox_cmd_swhois(char *source, char *who, char *mask) +void ratbox_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_bmask(char *source, int ac, char **av) +int anope_event_bmask(const char *source, int ac, const char **av) { Channel *c; char *bans; @@ -1687,12 +1686,12 @@ int anope_event_bmask(char *source, int ac, char **av) return MOD_CONT; } -int ratbox_flood_mode_check(char *value) +int ratbox_flood_mode_check(const char *value) { return 0; } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1702,7 +1701,7 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void ratbox_cmd_jupe(char *jserver, char *who, char *reason) +void ratbox_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1719,7 +1718,7 @@ void ratbox_cmd_jupe(char *jserver, char *who, char *reason) 1 = valid nick 0 = nick is in valid */ -int ratbox_valid_nick(char *nick) +int ratbox_valid_nick(const char *nick) { /* TS6 Save extension -Certus */ if (isdigit(*nick)) @@ -1731,14 +1730,14 @@ int ratbox_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int ratbox_valid_chan(char *chan) +int ratbox_valid_chan(const char *chan) { /* no hard coded invalid chans */ return 1; } -void ratbox_cmd_ctcp(char *source, char *dest, char *buf) +void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/ratbox.h b/src/protocol/ratbox.h index 81af922bc..a94ee7105 100644 --- a/src/protocol/ratbox.h +++ b/src/protocol/ratbox.h @@ -45,74 +45,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t -void ratbox_set_umode(User * user, int ac, char **av); -void ratbox_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void ratbox_set_umode(User * user, int ac, const char **av); +void ratbox_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void ratbox_cmd_vhost_off(User * u); -void ratbox_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void ratbox_cmd_svskill(char *source, char *user, char *buf); -void ratbox_cmd_svsmode(User * u, int ac, char **av); -void ratbox_cmd_372(char *source, char *msg); -void ratbox_cmd_372_error(char *source); -void ratbox_cmd_375(char *source); -void ratbox_cmd_376(char *source); -void ratbox_cmd_nick(char *nick, char *name, char *modes); -void ratbox_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void ratbox_cmd_mode(char *source, char *dest, char *buf); -void ratbox_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void ratbox_cmd_kick(char *source, char *chan, char *user, char *buf); -void ratbox_cmd_notice_ops(char *source, char *dest, char *buf); -void ratbox_cmd_notice(char *source, char *dest, char *buf); -void ratbox_cmd_notice2(char *source, char *dest, char *msg); -void ratbox_cmd_privmsg(char *source, char *dest, char *buf); -void ratbox_cmd_privmsg2(char *source, char *dest, char *msg); -void ratbox_cmd_serv_notice(char *source, char *dest, char *msg); -void ratbox_cmd_serv_privmsg(char *source, char *dest, char *msg); -void ratbox_cmd_bot_chan_mode(char *nick, char *chan); -void ratbox_cmd_351(char *source); -void ratbox_cmd_quit(char *source, char *buf); -void ratbox_cmd_pong(char *servname, char *who); -void ratbox_cmd_join(char *user, char *channel, time_t chantime); -void ratbox_cmd_unsqline(char *user); -void ratbox_cmd_invite(char *source, char *chan, char *nick); -void ratbox_cmd_part(char *nick, char *chan, char *buf); -void ratbox_cmd_391(char *source, char *timestr); -void ratbox_cmd_250(char *buf); -void ratbox_cmd_307(char *buf); -void ratbox_cmd_311(char *buf); -void ratbox_cmd_312(char *buf); -void ratbox_cmd_317(char *buf); -void ratbox_cmd_219(char *source, char *letter); -void ratbox_cmd_401(char *source, char *who); -void ratbox_cmd_318(char *source, char *who); -void ratbox_cmd_242(char *buf); -void ratbox_cmd_243(char *buf); -void ratbox_cmd_211(char *buf); -void ratbox_cmd_global(char *source, char *buf); -void ratbox_cmd_global_legacy(char *source, char *fmt); -void ratbox_cmd_sqline(char *mask, char *reason); -void ratbox_cmd_squit(char *servname, char *message); -void ratbox_cmd_svso(char *source, char *nick, char *flag); -void ratbox_cmd_chg_nick(char *oldnick, char *newnick); -void ratbox_cmd_svsnick(char *source, char *guest, time_t when); -void ratbox_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void ratbox_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void ratbox_cmd_svskill(const char *source, const char *user, const char *buf); +void ratbox_cmd_svsmode(User * u, int ac, const char **av); +void ratbox_cmd_372(const char *source, const char *msg); +void ratbox_cmd_372_error(const char *source); +void ratbox_cmd_375(const char *source); +void ratbox_cmd_376(const char *source); +void ratbox_cmd_nick(const char *nick, const char *name, const char *modes); +void ratbox_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ratbox_cmd_mode(const char *source, const char *dest, const char *buf); +void ratbox_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ratbox_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void ratbox_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void ratbox_cmd_notice(const char *source, const char *dest, const char *buf); +void ratbox_cmd_notice2(const char *source, const char *dest, const char *msg); +void ratbox_cmd_privmsg(const char *source, const char *dest, const char *buf); +void ratbox_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void ratbox_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void ratbox_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void ratbox_cmd_bot_chan_mode(const char *nick, const char *chan); +void ratbox_cmd_351(const char *source); +void ratbox_cmd_quit(const char *source, const char *buf); +void ratbox_cmd_pong(const char *servname, const char *who); +void ratbox_cmd_join(const char *user, const char *channel, time_t chantime); +void ratbox_cmd_unsqline(const char *user); +void ratbox_cmd_invite(const char *source, const char *chan, const char *nick); +void ratbox_cmd_part(const char *nick, const char *chan, const char *buf); +void ratbox_cmd_391(const char *source, const char *timestr); +void ratbox_cmd_250(const char *buf); +void ratbox_cmd_307(const char *buf); +void ratbox_cmd_311(const char *buf); +void ratbox_cmd_312(const char *buf); +void ratbox_cmd_317(const char *buf); +void ratbox_cmd_219(const char *source, const char *letter); +void ratbox_cmd_401(const char *source, const char *who); +void ratbox_cmd_318(const char *source, const char *who); +void ratbox_cmd_242(const char *buf); +void ratbox_cmd_243(const char *buf); +void ratbox_cmd_211(const char *buf); +void ratbox_cmd_global(const char *source, const char *buf); +void ratbox_cmd_global_legacy(const char *source, const char *fmt); +void ratbox_cmd_sqline(const char *mask, const char *reason); +void ratbox_cmd_squit(const char *servname, const char *message); +void ratbox_cmd_svso(const char *source, const char *nick, const char *flag); +void ratbox_cmd_chg_nick(const char *oldnick, const char *newnick); +void ratbox_cmd_svsnick(const char *source, const char *guest, time_t when); +void ratbox_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void ratbox_cmd_connect(int servernum); -void ratbox_cmd_svshold(char *nick); -void ratbox_cmd_release_svshold(char *nick); -void ratbox_cmd_unsgline(char *mask); -void ratbox_cmd_unszline(char *mask); -void ratbox_cmd_szline(char *mask, char *reason, char *whom); -void ratbox_cmd_sgline(char *mask, char *reason); -void ratbox_cmd_unban(char *name, char *nick); -void ratbox_cmd_svsmode_chan(char *name, char *mode, char *nick); -void ratbox_cmd_svid_umode(char *nick, time_t ts); +void ratbox_cmd_svshold(const char *nick); +void ratbox_cmd_release_svshold(const char *nick); +void ratbox_cmd_unsgline(const char *mask); +void ratbox_cmd_unszline(const char *mask); +void ratbox_cmd_szline(const char *mask, const char *reason, const char *whom); +void ratbox_cmd_sgline(const char *mask, const char *reason); +void ratbox_cmd_unban(const char *name, const char *nick); +void ratbox_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void ratbox_cmd_svid_umode(const char *nick, time_t ts); void ratbox_cmd_nc_change(User * u); -void ratbox_cmd_svid_umode2(User * u, char *ts); -void ratbox_cmd_svid_umode3(User * u, char *ts); +void ratbox_cmd_svid_umode2(User * u, const char *ts); +void ratbox_cmd_svid_umode3(User * u, const char *ts); void ratbox_cmd_eob(); -int ratbox_flood_mode_check(char *value); -void ratbox_cmd_jupe(char *jserver, char *who, char *reason); -int ratbox_valid_nick(char *nick); -void ratbox_cmd_ctcp(char *source, char *dest, char *buf); +int ratbox_flood_mode_check(const char *value); +void ratbox_cmd_jupe(const char *jserver, const char *who, const char *reason); +int ratbox_valid_nick(const char *nick); +void ratbox_cmd_ctcp(const char *source, const char *dest, const char *buf); class RatboxProto : public IRCDProtoNew { public: diff --git a/src/protocol/shadowircd.c b/src/protocol/shadowircd.c index b8325c976..d315cd618 100644 --- a/src/protocol/shadowircd.c +++ b/src/protocol/shadowircd.c @@ -146,10 +146,10 @@ IRCDCAPAB myIrcdcap[] = { 0, 0, 0} }; -void shadowircd_set_umode(User * user, int ac, char **av) +void shadowircd_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -457,7 +457,7 @@ CUMode myCumodes[128] = { -void shadowircd_cmd_notice(char *source, char *dest, char *buf) +void shadowircd_cmd_notice(const char *source, const char *dest, const char *buf) { Uid *ud; User *u; @@ -476,7 +476,7 @@ void shadowircd_cmd_notice(char *source, char *dest, char *buf) } } -void shadowircd_cmd_notice2(char *source, char *dest, char *msg) +void shadowircd_cmd_notice2(const char *source, const char *dest, const char *msg) { Uid *ud; User *u; @@ -487,7 +487,7 @@ void shadowircd_cmd_notice2(char *source, char *dest, char *msg) msg); } -void shadowircd_cmd_privmsg(char *source, char *dest, char *buf) +void shadowircd_cmd_privmsg(const char *source, const char *dest, const char *buf) { Uid *ud, *ud2; @@ -501,7 +501,7 @@ void shadowircd_cmd_privmsg(char *source, char *dest, char *buf) (ud2 ? ud2->uid : dest), buf); } -void shadowircd_cmd_privmsg2(char *source, char *dest, char *msg) +void shadowircd_cmd_privmsg2(const char *source, const char *dest, const char *msg) { Uid *ud, *ud2; @@ -512,18 +512,18 @@ void shadowircd_cmd_privmsg2(char *source, char *dest, char *msg) (ud2 ? ud2->uid : dest), msg); } -void shadowircd_cmd_serv_notice(char *source, char *dest, char *msg) +void shadowircd_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $$%s :%s", dest, msg); } -void shadowircd_cmd_serv_privmsg(char *source, char *dest, char *msg) +void shadowircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $$%s :%s", dest, msg); } -void shadowircd_cmd_global(char *source, char *buf) +void shadowircd_cmd_global(const char *source, const char *buf) { Uid *u; @@ -544,7 +544,7 @@ void shadowircd_cmd_global(char *source, char *buf) } /* GLOBOPS - to handle old WALLOPS */ -void shadowircd_cmd_global_legacy(char *source, char *fmt) +void shadowircd_cmd_global_legacy(const char *source, const char *fmt) { Uid *u; @@ -562,7 +562,7 @@ void shadowircd_cmd_global_legacy(char *source, char *fmt) send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt); } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -593,7 +593,7 @@ int anope_event_sjoin(char *source, int ac, char **av) av[9] = info */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { Server *s = NULL; User *user, *u2; @@ -601,8 +601,7 @@ int anope_event_nick(char *source, int ac, char **av) if (ac == 10) { s = findserver_uid(servlist, source); /* Source is always the server */ - *source = '\0'; - user = do_nick(source, av[0], av[4], av[5], s->name, av[9], + user = do_nick("", av[0], av[4], av[5], s->name, av[9], strtoul(av[2], NULL, 10), 0, 0, av[8], av[7]); if (user) { anope_set_umode(user, 1, &av[3]); @@ -627,7 +626,7 @@ int anope_event_nick(char *source, int ac, char **av) } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -642,11 +641,11 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { User *u; @@ -692,7 +691,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tburst(char *source, int ac, char **av) +int anope_event_tburst(const char *source, int ac, const char **av) { char *setter; Channel *c; @@ -746,7 +745,7 @@ int anope_event_tburst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -813,31 +812,31 @@ void moduleAddIRCDMsgs(void) /* *INDENT-ON* */ -void shadowircd_cmd_sqline(char *mask, char *reason) +void shadowircd_cmd_sqline(const char *mask, const char *reason) { send_cmd(NULL, "RESV * %s :%s", mask, reason); } -void shadowircd_cmd_unsgline(char *mask) +void shadowircd_cmd_unsgline(const char *mask) { /* Does not support */ } -void shadowircd_cmd_unszline(char *mask) +void shadowircd_cmd_unszline(const char *mask) { /* Does not support */ } -void shadowircd_cmd_szline(char *mask, char *reason, char *whom) +void shadowircd_cmd_szline(const char *mask, const char *reason, const char *whom) { /* Does not support */ } -void shadowircd_cmd_svsadmin(char *server, int set) +void shadowircd_cmd_svsadmin(const char *server, int set) { } -void shadowircd_cmd_sgline(char *mask, char *reason) +void shadowircd_cmd_sgline(const char *mask, const char *reason) { /* does not support */ } @@ -848,8 +847,8 @@ void ShadowIRCdProto::cmd_remove_akill(const char *user, const char *host) send_cmd(ud ? ud->uid : s_OperServ, "UNKLINE * %s %s", user, host); } -void shadowircd_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void shadowircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { Uid *ud; @@ -863,7 +862,7 @@ void shadowircd_cmd_vhost_off(User * u) send_cmd(NULL, "MODE %s -v", (u->uid ? u->uid : u->nick)); } -void shadowircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void shadowircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { send_cmd(NULL, "SVSCLOAK %s %s", nick, vhost); @@ -871,12 +870,12 @@ void shadowircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) send_cmd(NULL, "SVSIDENT %s %s", nick, vIdent); } -void shadowircd_cmd_unsqline(char *user) +void shadowircd_cmd_unsqline(const char *user) { send_cmd(NULL, "UNRESV * %s", user); } -void shadowircd_cmd_join(char *user, char *channel, time_t chantime) +void shadowircd_cmd_join(const char *user, const char *channel, time_t chantime) { Uid *ud; @@ -894,8 +893,8 @@ host: the 'host' portion of the kline reason: the reason for the kline. */ -void shadowircd_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void shadowircd_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { Uid *ud; @@ -905,7 +904,7 @@ void shadowircd_cmd_akill(char *user, char *host, char *who, time_t when, (long int) (expires - (long) time(NULL)), user, host, reason); } -void shadowircd_cmd_svskill(char *source, char *user, char *buf) +void shadowircd_cmd_svskill(const char *source, const char *user, const char *buf) { Uid *ud; @@ -921,7 +920,7 @@ void shadowircd_cmd_svskill(char *source, char *user, char *buf) send_cmd(NULL, "SVSKILL %s :%s", (ud ? ud->uid : user), buf); } -void shadowircd_cmd_svsmode(User * u, int ac, char **av) +void shadowircd_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(TS6SID, "MODE %s %s", u->uid, av[0]); } @@ -950,13 +949,13 @@ void shadowircd_cmd_capab() } /* PASS */ -void shadowircd_cmd_pass(char *pass) +void shadowircd_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s TS 6 %s", pass, TS6SID); } /* SERVER name protocol hop descript */ -void shadowircd_cmd_server(char *servname, int hop, char *descript) +void shadowircd_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d %d :%s", servname, hop, PROTOCOL_REVISION, descript); @@ -979,8 +978,8 @@ void shadowircd_cmd_connect(int servernum) shadowircd_cmd_svinfo(); } -void shadowircd_cmd_bot_nick(char *nick, char *user, char *host, - char *real, char *modes) +void shadowircd_cmd_bot_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { char *uidbuf = ts6_uid_retrieve(); @@ -992,7 +991,7 @@ void shadowircd_cmd_bot_nick(char *nick, char *user, char *host, shadowircd_cmd_sqline(nick, "Reserved for services"); } -void shadowircd_cmd_part(char *nick, char *chan, char *buf) +void shadowircd_cmd_part(const char *nick, const char *chan, const char *buf) { Uid *ud; @@ -1005,7 +1004,7 @@ void shadowircd_cmd_part(char *nick, char *chan, char *buf) } } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1013,7 +1012,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { User *u = NULL; @@ -1023,7 +1022,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1032,7 +1031,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1045,7 +1044,7 @@ void shadowircd_cmd_eob() send_cmd(TS6SID, "EOB"); } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) { do_sjoin(source, ac, av); @@ -1056,7 +1055,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1066,7 +1065,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { User *u; Uid *ud; @@ -1082,7 +1081,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { User *u; @@ -1096,7 +1095,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { Uid *ud; @@ -1108,7 +1107,7 @@ int anope_event_whois(char *source, int ac, char **av) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1123,7 +1122,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sid(char *source, int ac, char **av) +int anope_event_sid(const char *source, int ac, const char **av) { Server *s; @@ -1134,7 +1133,7 @@ int anope_event_sid(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_eos(char *source, int ac, char **av) +int anope_event_eos(const char *source, int ac, const char **av) { Server *s; s = findserver_uid(servlist, source); @@ -1149,7 +1148,7 @@ int anope_event_eos(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1157,7 +1156,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { User *u; @@ -1171,31 +1170,31 @@ int anope_event_quit(char *source, int ac, char **av) return MOD_CONT; } -void shadowircd_cmd_372(char *source, char *msg) +void shadowircd_cmd_372(const char *source, const char *msg) { send_cmd(TS6SID, "372 %s :- %s", source, msg); } -void shadowircd_cmd_372_error(char *source) +void shadowircd_cmd_372_error(const char *source) { send_cmd(TS6SID, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void shadowircd_cmd_375(char *source) +void shadowircd_cmd_375(const char *source) { send_cmd(TS6SID, "375 %s :- %s Message of the Day", source, ServerName); } -void shadowircd_cmd_376(char *source) +void shadowircd_cmd_376(const char *source) { send_cmd(TS6SID, "376 %s :End of /MOTD command.", source); } /* 391 */ -void shadowircd_cmd_391(char *source, char *timestr) +void shadowircd_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1204,7 +1203,7 @@ void shadowircd_cmd_391(char *source, char *timestr) } /* 250 */ -void shadowircd_cmd_250(char *buf) +void shadowircd_cmd_250(const char *buf) { if (!buf) { return; @@ -1214,7 +1213,7 @@ void shadowircd_cmd_250(char *buf) } /* 307 */ -void shadowircd_cmd_307(char *buf) +void shadowircd_cmd_307(const char *buf) { if (!buf) { return; @@ -1224,7 +1223,7 @@ void shadowircd_cmd_307(char *buf) } /* 311 */ -void shadowircd_cmd_311(char *buf) +void shadowircd_cmd_311(const char *buf) { if (!buf) { return; @@ -1234,7 +1233,7 @@ void shadowircd_cmd_311(char *buf) } /* 312 */ -void shadowircd_cmd_312(char *buf) +void shadowircd_cmd_312(const char *buf) { if (!buf) { return; @@ -1244,7 +1243,7 @@ void shadowircd_cmd_312(char *buf) } /* 317 */ -void shadowircd_cmd_317(char *buf) +void shadowircd_cmd_317(const char *buf) { if (!buf) { return; @@ -1254,7 +1253,7 @@ void shadowircd_cmd_317(char *buf) } /* 219 */ -void shadowircd_cmd_219(char *source, char *letter) +void shadowircd_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1269,7 +1268,7 @@ void shadowircd_cmd_219(char *source, char *letter) } /* 401 */ -void shadowircd_cmd_401(char *source, char *who) +void shadowircd_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1278,7 +1277,7 @@ void shadowircd_cmd_401(char *source, char *who) } /* 318 */ -void shadowircd_cmd_318(char *source, char *who) +void shadowircd_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1288,7 +1287,7 @@ void shadowircd_cmd_318(char *source, char *who) } /* 242 */ -void shadowircd_cmd_242(char *buf) +void shadowircd_cmd_242(const char *buf) { if (!buf) { return; @@ -1298,7 +1297,7 @@ void shadowircd_cmd_242(char *buf) } /* 243 */ -void shadowircd_cmd_243(char *buf) +void shadowircd_cmd_243(const char *buf) { if (!buf) { return; @@ -1308,7 +1307,7 @@ void shadowircd_cmd_243(char *buf) } /* 211 */ -void shadowircd_cmd_211(char *buf) +void shadowircd_cmd_211(const char *buf) { if (!buf) { return; @@ -1317,7 +1316,7 @@ void shadowircd_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void shadowircd_cmd_mode(char *source, char *dest, char *buf) +void shadowircd_cmd_mode(const char *source, const char *dest, const char *buf) { Uid *ud; if (!buf) { @@ -1332,7 +1331,7 @@ void shadowircd_cmd_mode(char *source, char *dest, char *buf) } } -void shadowircd_cmd_tmode(char *source, char *dest, char *buf) +void shadowircd_cmd_tmode(const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1342,7 +1341,7 @@ void shadowircd_cmd_tmode(char *source, char *dest, char *buf) send_cmd(NULL, "MODE %s %s", dest, buf); } -void shadowircd_cmd_nick(char *nick, char *name, char *mode) +void shadowircd_cmd_nick(const char *nick, const char *name, const char *mode) { char *uidbuf = ts6_uid_retrieve(); @@ -1354,7 +1353,7 @@ void shadowircd_cmd_nick(char *nick, char *name, char *mode) shadowircd_cmd_sqline(nick, "Reserved for services"); } -void shadowircd_cmd_kick(char *source, char *chan, char *user, char *buf) +void shadowircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { Uid *ud; User *u; @@ -1371,7 +1370,7 @@ void shadowircd_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void shadowircd_cmd_notice_ops(char *source, char *dest, char *buf) +void shadowircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1380,7 +1379,7 @@ void shadowircd_cmd_notice_ops(char *source, char *dest, char *buf) send_cmd(NULL, "NOTICE @%s :%s", dest, buf); } -void shadowircd_cmd_bot_chan_mode(char *nick, char *chan) +void shadowircd_cmd_bot_chan_mode(const char *nick, const char *chan) { Uid *u; @@ -1390,7 +1389,7 @@ void shadowircd_cmd_bot_chan_mode(char *nick, char *chan) } /* QUIT */ -void shadowircd_cmd_quit(char *source, char *buf) +void shadowircd_cmd_quit(const char *source, const char *buf) { Uid *ud; @@ -1404,13 +1403,13 @@ void shadowircd_cmd_quit(char *source, char *buf) } /* PONG */ -void shadowircd_cmd_pong(char *servname, char *who) +void shadowircd_cmd_pong(const char *servname, const char *who) { send_cmd(TS6SID, "PONG %s", who); } /* INVITE */ -void shadowircd_cmd_invite(char *source, char *chan, char *nick) +void shadowircd_cmd_invite(const char *source, const char *chan, const char *nick) { Uid *ud; User *u; @@ -1427,7 +1426,7 @@ void shadowircd_cmd_invite(char *source, char *chan, char *nick) } /* SQUIT */ -void shadowircd_cmd_squit(char *servname, char *message) +void shadowircd_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1436,7 +1435,7 @@ void shadowircd_cmd_squit(char *servname, char *message) send_cmd(NULL, "SQUIT %s :%s", servname, message); } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { User *u, *u2; @@ -1455,7 +1454,7 @@ int anope_event_mode(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tmode(char *source, int ac, char **av) +int anope_event_tmode(const char *source, int ac, const char **av) { if (*av[1] == '#' || *av[1] == '&') { do_cmode(source, ac, av); @@ -1463,7 +1462,7 @@ int anope_event_tmode(char *source, int ac, char **av) return MOD_CONT; } -void shadowircd_cmd_351(char *source) +void shadowircd_cmd_351(const char *source) { send_cmd(TS6SID, "351 %s Anope-%s %s :%s (ShadowProtocol %d) - %s (%s) -- %s", @@ -1472,26 +1471,26 @@ void shadowircd_cmd_351(char *source) } /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { /* Not supported by ShadowIRCd. */ return MOD_CONT; } /* SVSHOLD - set */ -void shadowircd_cmd_svshold(char *nick) +void shadowircd_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void shadowircd_cmd_release_svshold(char *nick) +void shadowircd_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* SVSNICK */ -void shadowircd_cmd_svsnick(char *nick, char *newnick, time_t when) +void shadowircd_cmd_svsnick(const char *nick, const char *newnick, time_t when) { if (!nick || !newnick) { return; @@ -1499,32 +1498,32 @@ void shadowircd_cmd_svsnick(char *nick, char *newnick, time_t when) send_cmd(NULL, "SVSNICK %s %s %ld", nick, newnick, (long int) when); } -void shadowircd_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +void shadowircd_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { /* not supported */ } -void shadowircd_cmd_svso(char *source, char *nick, char *flag) +void shadowircd_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void shadowircd_cmd_unban(char *name, char *nick) +void shadowircd_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void shadowircd_cmd_svsmode_chan(char *name, char *mode, char *nick) +void shadowircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void shadowircd_cmd_svid_umode(char *nick, time_t ts) +void shadowircd_cmd_svid_umode(const char *nick, time_t ts) { /* not supported */ } @@ -1537,18 +1536,18 @@ void shadowircd_cmd_nc_change(User * u) } /* SVSMODE +d */ -void shadowircd_cmd_svid_umode2(User * u, char *ts) +void shadowircd_cmd_svid_umode2(User * u, const char *ts) { /* not supported */ } -void shadowircd_cmd_svid_umode3(User * u, char *ts) +void shadowircd_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } /* NICK <newnick> */ -void shadowircd_cmd_chg_nick(char *oldnick, char *newnick) +void shadowircd_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1565,49 +1564,49 @@ void shadowircd_cmd_chg_nick(char *oldnick, char *newnick) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { TS6UPLINK = sstrdup(av[3]); return MOD_CONT; } -void shadowircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void shadowircd_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void shadowircd_cmd_svspart(char *source, char *nick, char *chan) +void shadowircd_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void shadowircd_cmd_swhois(char *source, char *who, char *mask) +void shadowircd_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_bmask(char *source, int ac, char **av) +int anope_event_bmask(const char *source, int ac, const char **av) { Channel *c; char *bans; @@ -1640,12 +1639,12 @@ int anope_event_bmask(char *source, int ac, char **av) return MOD_CONT; } -int shadowircd_flood_mode_check(char *value) +int shadowircd_flood_mode_check(const char *value) { return 0; } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1655,7 +1654,7 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void shadowircd_cmd_jupe(char *jserver, char *who, char *reason) +void shadowircd_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1672,7 +1671,7 @@ void shadowircd_cmd_jupe(char *jserver, char *who, char *reason) 1 = valid nick 0 = nick is in valid */ -int shadowircd_valid_nick(char *nick) +int shadowircd_valid_nick(const char *nick) { /* TS6 Save extension -Certus */ if (isdigit(*nick)) @@ -1684,14 +1683,14 @@ int shadowircd_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int shadowircd_valid_chan(char *chan) +int shadowircd_valid_chan(const char *chan) { /* no hard coded invalid chan */ return 1; } -void shadowircd_cmd_ctcp(char *source, char *dest, char *buf) +void shadowircd_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/shadowircd.h b/src/protocol/shadowircd.h index ab76b72f9..c3044026b 100644 --- a/src/protocol/shadowircd.h +++ b/src/protocol/shadowircd.h @@ -70,74 +70,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void shadowircd_set_umode(User * user, int ac, char **av); -void shadowircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void shadowircd_set_umode(User * user, int ac, const char **av); +void shadowircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void shadowircd_cmd_vhost_off(User * u); -void shadowircd_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void shadowircd_cmd_svskill(char *source, char *user, char *buf); -void shadowircd_cmd_svsmode(User * u, int ac, char **av); -void shadowircd_cmd_372(char *source, char *msg); -void shadowircd_cmd_372_error(char *source); -void shadowircd_cmd_375(char *source); -void shadowircd_cmd_376(char *source); -void shadowircd_cmd_nick(char *nick, char *name, char *modes); -void shadowircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void shadowircd_cmd_mode(char *source, char *dest, char *buf); -void shadowircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void shadowircd_cmd_kick(char *source, char *chan, char *user, char *buf); -void shadowircd_cmd_notice_ops(char *source, char *dest, char *buf); -void shadowircd_cmd_notice(char *source, char *dest, char *buf); -void shadowircd_cmd_notice2(char *source, char *dest, char *msg); -void shadowircd_cmd_privmsg(char *source, char *dest, char *buf); -void shadowircd_cmd_privmsg2(char *source, char *dest, char *msg); -void shadowircd_cmd_serv_notice(char *source, char *dest, char *msg); -void shadowircd_cmd_serv_privmsg(char *source, char *dest, char *msg); -void shadowircd_cmd_bot_chan_mode(char *nick, char *chan); -void shadowircd_cmd_351(char *source); -void shadowircd_cmd_quit(char *source, char *buf); -void shadowircd_cmd_pong(char *servname, char *who); -void shadowircd_cmd_join(char *user, char *channel, time_t chantime); -void shadowircd_cmd_unsqline(char *user); -void shadowircd_cmd_invite(char *source, char *chan, char *nick); -void shadowircd_cmd_part(char *nick, char *chan, char *buf); -void shadowircd_cmd_391(char *source, char *timestr); -void shadowircd_cmd_250(char *buf); -void shadowircd_cmd_307(char *buf); -void shadowircd_cmd_311(char *buf); -void shadowircd_cmd_312(char *buf); -void shadowircd_cmd_317(char *buf); -void shadowircd_cmd_219(char *source, char *letter); -void shadowircd_cmd_401(char *source, char *who); -void shadowircd_cmd_318(char *source, char *who); -void shadowircd_cmd_242(char *buf); -void shadowircd_cmd_243(char *buf); -void shadowircd_cmd_211(char *buf); -void shadowircd_cmd_global(char *source, char *buf); -void shadowircd_cmd_global_legacy(char *source, char *fmt); -void shadowircd_cmd_sqline(char *mask, char *reason); -void shadowircd_cmd_squit(char *servname, char *message); -void shadowircd_cmd_svso(char *source, char *nick, char *flag); -void shadowircd_cmd_chg_nick(char *oldnick, char *newnick); -void shadowircd_cmd_svsnick(char *source, char *guest, time_t when); -void shadowircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void shadowircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void shadowircd_cmd_svskill(const char *source, const char *user, const char *buf); +void shadowircd_cmd_svsmode(User * u, int ac, const char **av); +void shadowircd_cmd_372(const char *source, const char *msg); +void shadowircd_cmd_372_error(const char *source); +void shadowircd_cmd_375(const char *source); +void shadowircd_cmd_376(const char *source); +void shadowircd_cmd_nick(const char *nick, const char *name, const char *modes); +void shadowircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void shadowircd_cmd_mode(const char *source, const char *dest, const char *buf); +void shadowircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void shadowircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void shadowircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void shadowircd_cmd_notice(const char *source, const char *dest, const char *buf); +void shadowircd_cmd_notice2(const char *source, const char *dest, const char *msg); +void shadowircd_cmd_privmsg(const char *source, const char *dest, const char *buf); +void shadowircd_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void shadowircd_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void shadowircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void shadowircd_cmd_bot_chan_mode(const char *nick, const char *chan); +void shadowircd_cmd_351(const char *source); +void shadowircd_cmd_quit(const char *source, const char *buf); +void shadowircd_cmd_pong(const char *servname, const char *who); +void shadowircd_cmd_join(const char *user, const char *channel, time_t chantime); +void shadowircd_cmd_unsqline(const char *user); +void shadowircd_cmd_invite(const char *source, const char *chan, const char *nick); +void shadowircd_cmd_part(const char *nick, const char *chan, const char *buf); +void shadowircd_cmd_391(const char *source, const char *timestr); +void shadowircd_cmd_250(const char *buf); +void shadowircd_cmd_307(const char *buf); +void shadowircd_cmd_311(const char *buf); +void shadowircd_cmd_312(const char *buf); +void shadowircd_cmd_317(const char *buf); +void shadowircd_cmd_219(const char *source, const char *letter); +void shadowircd_cmd_401(const char *source, const char *who); +void shadowircd_cmd_318(const char *source, const char *who); +void shadowircd_cmd_242(const char *buf); +void shadowircd_cmd_243(const char *buf); +void shadowircd_cmd_211(const char *buf); +void shadowircd_cmd_global(const char *source, const char *buf); +void shadowircd_cmd_global_legacy(const char *source, const char *fmt); +void shadowircd_cmd_sqline(const char *mask, const char *reason); +void shadowircd_cmd_squit(const char *servname, const char *message); +void shadowircd_cmd_svso(const char *source, const char *nick, const char *flag); +void shadowircd_cmd_chg_nick(const char *oldnick, const char *newnick); +void shadowircd_cmd_svsnick(const char *source, const char *guest, time_t when); +void shadowircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void shadowircd_cmd_connect(int servernum); -void shadowircd_cmd_svshold(char *nick); -void shadowircd_cmd_release_svshold(char *nick); -void shadowircd_cmd_unsgline(char *mask); -void shadowircd_cmd_unszline(char *mask); -void shadowircd_cmd_szline(char *mask, char *reason, char *whom); -void shadowircd_cmd_sgline(char *mask, char *reason); -void shadowircd_cmd_unban(char *name, char *nick); -void shadowircd_cmd_svsmode_chan(char *name, char *mode, char *nick); -void shadowircd_cmd_svid_umode(char *nick, time_t ts); +void shadowircd_cmd_svshold(const char *nick); +void shadowircd_cmd_release_svshold(const char *nick); +void shadowircd_cmd_unsgline(const char *mask); +void shadowircd_cmd_unszline(const char *mask); +void shadowircd_cmd_szline(const char *mask, const char *reason, const char *whom); +void shadowircd_cmd_sgline(const char *mask, const char *reason); +void shadowircd_cmd_unban(const char *name, const char *nick); +void shadowircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void shadowircd_cmd_svid_umode(const char *nick, time_t ts); void shadowircd_cmd_nc_change(User * u); -void shadowircd_cmd_svid_umode2(User * u, char *ts); -void shadowircd_cmd_svid_umode3(User * u, char *ts); +void shadowircd_cmd_svid_umode2(User * u, const char *ts); +void shadowircd_cmd_svid_umode3(User * u, const char *ts); void shadowircd_cmd_eob(); -int shadowircd_flood_mode_check(char *value); -void shadowircd_cmd_jupe(char *jserver, char *who, char *reason); -int shadowircd_valid_nick(char *nick); -void shadowircd_cmd_ctcp(char *source, char *dest, char *buf); +int shadowircd_flood_mode_check(const char *value); +void shadowircd_cmd_jupe(const char *jserver, const char *who, const char *reason); +int shadowircd_valid_nick(const char *nick); +void shadowircd_cmd_ctcp(const char *source, const char *dest, const char *buf); class ShadowIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/solidircd.c b/src/protocol/solidircd.c index 8e7df31b9..f9909072d 100644 --- a/src/protocol/solidircd.c +++ b/src/protocol/solidircd.c @@ -147,10 +147,10 @@ IRCDCAPAB myIrcdcap[] = { }; -void solidircd_set_umode(User * user, int ac, char **av) +void solidircd_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -480,7 +480,7 @@ CUMode myCumodes[128] = { {0}, {0}, {0}, {0}, {0} }; -void solidircd_cmd_mode(char *source, char *dest, char *buf) +void solidircd_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -498,20 +498,20 @@ void solidircd_cmd_mode(char *source, char *dest, char *buf) } /* SVSHOLD - set */ -void solidircd_cmd_svshold(char *nick) +void solidircd_cmd_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s %d :%s", nick, NSReleaseTimeout, "Being held for registered user"); } /* SVSHOLD - release */ -void solidircd_cmd_release_svshold(char *nick) +void solidircd_cmd_release_svshold(const char *nick) { send_cmd(ServerName, "SVSHOLD %s 0", nick); } /* SVSMODE -b */ -void solidircd_cmd_unban(char *name, char *nick) +void solidircd_cmd_unban(const char *name, const char *nick) { solidircd_cmd_svsmode_chan(name, "-b", nick); } @@ -519,7 +519,7 @@ void solidircd_cmd_unban(char *name, char *nick) /* SVSMODE channel modes */ -void solidircd_cmd_svsmode_chan(char *name, char *mode, char *nick) +void solidircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "SVSMODE %s %s %s", name, mode, nick); @@ -528,13 +528,13 @@ void solidircd_cmd_svsmode_chan(char *name, char *mode, char *nick) } } -void solidircd_cmd_bot_chan_mode(char *nick, char *chan) +void solidircd_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); } /* EVENT: SJOIN */ -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -558,7 +558,7 @@ int anope_event_sjoin(char *source, int ac, char **av) ** parv[0] = new nickname ** parv[1] = hopcount */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -577,14 +577,14 @@ int anope_event_nick(char *source, int ac, char **av) } /* EVENT : CAPAB */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } /* EVENT : OS */ -int anope_event_os(char *source, int ac, char **av) +int anope_event_os(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -593,7 +593,7 @@ int anope_event_os(char *source, int ac, char **av) } /* EVENT : NS */ -int anope_event_ns(char *source, int ac, char **av) +int anope_event_ns(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -602,7 +602,7 @@ int anope_event_ns(char *source, int ac, char **av) } /* EVENT : MS */ -int anope_event_ms(char *source, int ac, char **av) +int anope_event_ms(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -611,7 +611,7 @@ int anope_event_ms(char *source, int ac, char **av) } /* EVENT : HS */ -int anope_event_hs(char *source, int ac, char **av) +int anope_event_hs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -620,7 +620,7 @@ int anope_event_hs(char *source, int ac, char **av) } /* EVENT : CS */ -int anope_event_cs(char *source, int ac, char **av) +int anope_event_cs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -628,7 +628,7 @@ int anope_event_cs(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -706,7 +706,7 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -int anope_event_vs(char *source, int ac, char **av) +int anope_event_vs(const char *source, int ac, const char **av) { User *u; @@ -721,13 +721,13 @@ int anope_event_vs(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } /* SQLINE */ -void solidircd_cmd_sqline(char *mask, char *reason) +void solidircd_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -737,19 +737,19 @@ void solidircd_cmd_sqline(char *mask, char *reason) } /* UNSGLINE */ -void solidircd_cmd_unsgline(char *mask) +void solidircd_cmd_unsgline(const char *mask) { send_cmd(NULL, "UNSGLINE 0 :%s", mask); } /* UNSZLINE */ -void solidircd_cmd_unszline(char *mask) +void solidircd_cmd_unszline(const char *mask) { send_cmd(NULL, "UNSZLINE 0 %s", mask); } /* SZLINE */ -void solidircd_cmd_szline(char *mask, char *reason, char *whom) +void solidircd_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "SZLINE %s :%s", mask, reason); } @@ -760,13 +760,13 @@ void SolidIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void solidircd_cmd_svsadmin(char *server, int set) +void solidircd_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } /* SGLINE */ -void solidircd_cmd_sgline(char *mask, char *reason) +void solidircd_cmd_sgline(const char *mask, const char *reason) { send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason); } @@ -778,7 +778,7 @@ void SolidIRCdProto::cmd_remove_akill(const char *user, const char *host) } /* PART */ -void solidircd_cmd_part(char *nick, char *chan, char *buf) +void solidircd_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -792,21 +792,21 @@ void solidircd_cmd_part(char *nick, char *chan, char *buf) } /* TOPIC */ -void solidircd_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void solidircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); } /* UNSQLINE */ -void solidircd_cmd_unsqline(char *user) +void solidircd_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } /* JOIN - SJOIN */ -void solidircd_cmd_join(char *user, char *channel, time_t chantime) +void solidircd_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel); } @@ -819,8 +819,8 @@ void solidircd_cmd_join(char *user, char *channel, time_t chantime) * parv[5]=time set * parv[6]=reason */ -void solidircd_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void solidircd_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who, (long int) time(NULL), reason); @@ -835,7 +835,7 @@ void solidircd_cmd_akill(char *user, char *host, char *who, time_t when, /* Note: if the stamp is null 0, the below usage is correct of Bahamut */ -void solidircd_cmd_svskill(char *source, char *user, char *buf) +void solidircd_cmd_svskill(const char *source, const char *user, const char *buf) { if (!source || !user || !buf) { @@ -852,7 +852,7 @@ void solidircd_cmd_svskill(char *source, char *user, char *buf) * parv[3] - mode (or services id if old svs version) * parv[4] - optional arguement (services id) */ -void solidircd_cmd_svsmode(User * u, int ac, char **av) +void solidircd_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), @@ -865,13 +865,13 @@ void solidircd_cmd_svsmode(User * u, int ac, char **av) * parv[1] = server name * parv[2] = comment */ -void solidircd_cmd_squit(char *servname, char *message) +void solidircd_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } /* PONG */ -void solidircd_cmd_pong(char *servname, char *who) +void solidircd_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -896,13 +896,13 @@ void solidircd_cmd_svinfo() } /* PASS */ -void solidircd_cmd_pass(char *pass) +void solidircd_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } /* SERVER */ -void solidircd_cmd_server(char *servname, int hop, char *descript) +void solidircd_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, ServerDesc); } @@ -933,7 +933,7 @@ void solidircd_cmd_connect(int servernum) } /* EVENT : SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { char *uplink; @@ -946,7 +946,7 @@ int anope_event_server(char *source, int ac, char **av) } /* EVENT : PRIVMSG */ -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -962,13 +962,13 @@ int anope_event_privmsg(char *source, int ac, char **av) * parv[3] = server is standalone or connected to non-TS only * parv[4] = server's idea of UTC time */ -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -976,7 +976,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -984,7 +984,7 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -992,7 +992,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1000,7 +1000,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1009,7 +1009,7 @@ int anope_event_quit(char *source, int ac, char **av) } /* EVENT: MODE */ -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1023,7 +1023,7 @@ int anope_event_mode(char *source, int ac, char **av) } /* EVENT: KILL */ -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1033,7 +1033,7 @@ int anope_event_kill(char *source, int ac, char **av) } /* EVENT: KICK */ -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1042,7 +1042,7 @@ int anope_event_kick(char *source, int ac, char **av) } /* EVENT: JOIN */ -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1051,7 +1051,7 @@ int anope_event_join(char *source, int ac, char **av) } /* EVENT: MOTD */ -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1061,7 +1061,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -void solidircd_cmd_notice_ops(char *source, char *dest, char *buf) +void solidircd_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { @@ -1071,7 +1071,7 @@ void solidircd_cmd_notice_ops(char *source, char *dest, char *buf) } /* NOTICE */ -void solidircd_cmd_notice(char *source, char *dest, char *buf) +void solidircd_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1084,12 +1084,12 @@ void solidircd_cmd_notice(char *source, char *dest, char *buf) } } -void solidircd_cmd_notice2(char *source, char *dest, char *msg) +void solidircd_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void solidircd_cmd_privmsg(char *source, char *dest, char *buf) +void solidircd_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1098,23 +1098,23 @@ void solidircd_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void solidircd_cmd_privmsg2(char *source, char *dest, char *msg) +void solidircd_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void solidircd_cmd_serv_notice(char *source, char *dest, char *msg) +void solidircd_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void solidircd_cmd_serv_privmsg(char *source, char *dest, char *msg) +void solidircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } /* GLOBOPS */ -void solidircd_cmd_global(char *source, char *buf) +void solidircd_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1124,7 +1124,7 @@ void solidircd_cmd_global(char *source, char *buf) } /* 391 */ -void solidircd_cmd_391(char *source, char *timestr) +void solidircd_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1133,7 +1133,7 @@ void solidircd_cmd_391(char *source, char *timestr) } /* 250 */ -void solidircd_cmd_250(char *buf) +void solidircd_cmd_250(const char *buf) { if (!buf) { return; @@ -1143,7 +1143,7 @@ void solidircd_cmd_250(char *buf) } /* 307 */ -void solidircd_cmd_307(char *buf) +void solidircd_cmd_307(const char *buf) { if (!buf) { return; @@ -1153,7 +1153,7 @@ void solidircd_cmd_307(char *buf) } /* 311 */ -void solidircd_cmd_311(char *buf) +void solidircd_cmd_311(const char *buf) { if (!buf) { return; @@ -1163,7 +1163,7 @@ void solidircd_cmd_311(char *buf) } /* 312 */ -void solidircd_cmd_312(char *buf) +void solidircd_cmd_312(const char *buf) { if (!buf) { return; @@ -1173,7 +1173,7 @@ void solidircd_cmd_312(char *buf) } /* 317 */ -void solidircd_cmd_317(char *buf) +void solidircd_cmd_317(const char *buf) { if (!buf) { return; @@ -1183,7 +1183,7 @@ void solidircd_cmd_317(char *buf) } /* 219 */ -void solidircd_cmd_219(char *source, char *letter) +void solidircd_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1198,7 +1198,7 @@ void solidircd_cmd_219(char *source, char *letter) } /* 401 */ -void solidircd_cmd_401(char *source, char *who) +void solidircd_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1207,7 +1207,7 @@ void solidircd_cmd_401(char *source, char *who) } /* 318 */ -void solidircd_cmd_318(char *source, char *who) +void solidircd_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1217,7 +1217,7 @@ void solidircd_cmd_318(char *source, char *who) } /* 242 */ -void solidircd_cmd_242(char *buf) +void solidircd_cmd_242(const char *buf) { if (!buf) { return; @@ -1227,7 +1227,7 @@ void solidircd_cmd_242(char *buf) } /* 243 */ -void solidircd_cmd_243(char *buf) +void solidircd_cmd_243(const char *buf) { if (!buf) { return; @@ -1237,7 +1237,7 @@ void solidircd_cmd_243(char *buf) } /* 211 */ -void solidircd_cmd_211(char *buf) +void solidircd_cmd_211(const char *buf) { if (!buf) { return; @@ -1246,7 +1246,7 @@ void solidircd_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void solidircd_cmd_nick(char *nick, char *name, char *modes) +void solidircd_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1255,7 +1255,7 @@ void solidircd_cmd_nick(char *nick, char *name, char *modes) solidircd_cmd_sqline(nick, "Reserved for services"); } -void solidircd_cmd_kick(char *source, char *chan, char *user, char *buf) +void solidircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1264,30 +1264,30 @@ void solidircd_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void solidircd_cmd_372(char *source, char *msg) +void solidircd_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void solidircd_cmd_372_error(char *source) +void solidircd_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void solidircd_cmd_375(char *source) +void solidircd_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void solidircd_cmd_376(char *source) +void solidircd_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* INVITE */ -void solidircd_cmd_invite(char *source, char *chan, char *nick) +void solidircd_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1297,7 +1297,7 @@ void solidircd_cmd_invite(char *source, char *chan, char *nick) } /* QUIT */ -void solidircd_cmd_quit(char *source, char *buf) +void solidircd_cmd_quit(const char *source, const char *buf) { if (buf) { @@ -1307,7 +1307,7 @@ void solidircd_cmd_quit(char *source, char *buf) } } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1316,7 +1316,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1324,7 +1324,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void solidircd_cmd_351(char *source) +void solidircd_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s)-- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1333,8 +1333,8 @@ void solidircd_cmd_351(char *source) } -void solidircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void solidircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1348,7 +1348,7 @@ void solidircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, * parv[2] = new nickname * parv[3] = timestamp */ -void solidircd_cmd_svsnick(char *source, char *guest, time_t when) +void solidircd_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1356,19 +1356,19 @@ void solidircd_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void solidircd_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +void solidircd_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, (long int) time(NULL), modes, user, host, ServerName, real); } -void solidircd_cmd_svso(char *source, char *nick, char *flag) +void solidircd_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } -void solidircd_cmd_chghost(char *nick, char *vhost) +void solidircd_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -1377,7 +1377,7 @@ void solidircd_cmd_chghost(char *nick, char *vhost) } -void solidircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void solidircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { send_cmd(s_HostServ, "SVSMODE %s +v", nick); solidircd_cmd_chghost(nick, vhost); @@ -1391,7 +1391,7 @@ void solidircd_cmd_vhost_off(User * u) /* SVSMODE +d */ /* sent if svid is something weird */ -void solidircd_cmd_svid_umode(char *nick, time_t ts) +void solidircd_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1406,13 +1406,13 @@ void solidircd_cmd_nc_change(User * u) } /* SVSMODE +d */ -void solidircd_cmd_svid_umode2(User * u, char *ts) +void solidircd_cmd_svid_umode2(User * u, const char *ts) { /* not used by bahamut ircds */ } -void solidircd_cmd_svid_umode3(User * u, char *ts) +void solidircd_cmd_svid_umode3(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1422,7 +1422,7 @@ void solidircd_cmd_svid_umode3(User * u, char *ts) } /* NICK <newnick> */ -void solidircd_cmd_chg_nick(char *oldnick, char *newnick) +void solidircd_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1431,7 +1431,7 @@ void solidircd_cmd_chg_nick(char *oldnick, char *newnick) send_cmd(oldnick, "NICK %s :%ld", newnick, (long int) time(NULL)); } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1441,38 +1441,38 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_gnotice(char *source, int ac, char **av) +int anope_event_gnotice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -void solidircd_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void solidircd_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Can not find any reference to these in Bahamut */ } -void solidircd_cmd_svspart(char *source, char *nick, char *chan) +void solidircd_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Can not find any reference to these in Bahamut */ } -void solidircd_cmd_swhois(char *source, char *who, char *mask) +void solidircd_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } @@ -1482,7 +1482,7 @@ void solidircd_cmd_eob() send_cmd(NULL, "BURST 0"); } -int anope_event_burst(char *source, int ac, char **av) +int anope_event_burst(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -1500,27 +1500,27 @@ int anope_event_burst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_luserslock(char *source, int ac, char **av) +int anope_event_luserslock(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int solidircd_flood_mode_check(char *value) +int solidircd_flood_mode_check(const char *value) { char *dp, *end; @@ -1534,7 +1534,7 @@ int solidircd_flood_mode_check(char *value) } } -void solidircd_cmd_jupe(char *jserver, char *who, char *reason) +void solidircd_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1548,7 +1548,7 @@ void solidircd_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void solidircd_cmd_global_legacy(char *source, char *fmt) +void solidircd_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1557,7 +1557,7 @@ void solidircd_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int solidircd_valid_nick(char *nick) +int solidircd_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1567,14 +1567,14 @@ int solidircd_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int solidircd_valid_chan(char *chan) +int solidircd_valid_chan(const char *chan) { /* no hard coded invalid chan*/ return 1; } -void solidircd_cmd_ctcp(char *source, char *dest, char *buf) +void solidircd_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/solidircd.h b/src/protocol/solidircd.h index 5ed772ff0..03686afd4 100644 --- a/src/protocol/solidircd.h +++ b/src/protocol/solidircd.h @@ -65,74 +65,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void solidircd_set_umode(User * user, int ac, char **av); -void solidircd_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void solidircd_set_umode(User * user, int ac, const char **av); +void solidircd_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void solidircd_cmd_vhost_off(User * u); -void solidircd_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void solidircd_cmd_svskill(char *source, char *user, char *buf); -void solidircd_cmd_svsmode(User * u, int ac, char **av); -void solidircd_cmd_372(char *source, char *msg); -void solidircd_cmd_372_error(char *source); -void solidircd_cmd_375(char *source); -void solidircd_cmd_376(char *source); -void solidircd_cmd_nick(char *nick, char *name, char *modes); -void solidircd_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void solidircd_cmd_mode(char *source, char *dest, char *buf); -void solidircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void solidircd_cmd_kick(char *source, char *chan, char *user, char *buf); -void solidircd_cmd_notice_ops(char *source, char *dest, char *buf); -void solidircd_cmd_notice(char *source, char *dest, char *buf); -void solidircd_cmd_notice2(char *source, char *dest, char *msg); -void solidircd_cmd_privmsg(char *source, char *dest, char *buf); -void solidircd_cmd_privmsg2(char *source, char *dest, char *msg); -void solidircd_cmd_serv_notice(char *source, char *dest, char *msg); -void solidircd_cmd_serv_privmsg(char *source, char *dest, char *msg); -void solidircd_cmd_bot_chan_mode(char *nick, char *chan); -void solidircd_cmd_351(char *source); -void solidircd_cmd_quit(char *source, char *buf); -void solidircd_cmd_pong(char *servname, char *who); -void solidircd_cmd_join(char *user, char *channel, time_t chantime); -void solidircd_cmd_unsqline(char *user); -void solidircd_cmd_invite(char *source, char *chan, char *nick); -void solidircd_cmd_part(char *nick, char *chan, char *buf); -void solidircd_cmd_391(char *source, char *timestr); -void solidircd_cmd_250(char *buf); -void solidircd_cmd_307(char *buf); -void solidircd_cmd_311(char *buf); -void solidircd_cmd_312(char *buf); -void solidircd_cmd_317(char *buf); -void solidircd_cmd_219(char *source, char *letter); -void solidircd_cmd_401(char *source, char *who); -void solidircd_cmd_318(char *source, char *who); -void solidircd_cmd_242(char *buf); -void solidircd_cmd_243(char *buf); -void solidircd_cmd_211(char *buf); -void solidircd_cmd_global(char *source, char *buf); -void solidircd_cmd_global_legacy(char *source, char *fmt); -void solidircd_cmd_sqline(char *mask, char *reason); -void solidircd_cmd_squit(char *servname, char *message); -void solidircd_cmd_svso(char *source, char *nick, char *flag); -void solidircd_cmd_chg_nick(char *oldnick, char *newnick); -void solidircd_cmd_svsnick(char *source, char *guest, time_t when); -void solidircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void solidircd_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void solidircd_cmd_svskill(const char *source, const char *user, const char *buf); +void solidircd_cmd_svsmode(User * u, int ac, const char **av); +void solidircd_cmd_372(const char *source, const char *msg); +void solidircd_cmd_372_error(const char *source); +void solidircd_cmd_375(const char *source); +void solidircd_cmd_376(const char *source); +void solidircd_cmd_nick(const char *nick, const char *name, const char *modes); +void solidircd_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void solidircd_cmd_mode(const char *source, const char *dest, const char *buf); +void solidircd_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void solidircd_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void solidircd_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void solidircd_cmd_notice(const char *source, const char *dest, const char *buf); +void solidircd_cmd_notice2(const char *source, const char *dest, const char *msg); +void solidircd_cmd_privmsg(const char *source, const char *dest, const char *buf); +void solidircd_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void solidircd_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void solidircd_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void solidircd_cmd_bot_chan_mode(const char *nick, const char *chan); +void solidircd_cmd_351(const char *source); +void solidircd_cmd_quit(const char *source, const char *buf); +void solidircd_cmd_pong(const char *servname, const char *who); +void solidircd_cmd_join(const char *user, const char *channel, time_t chantime); +void solidircd_cmd_unsqline(const char *user); +void solidircd_cmd_invite(const char *source, const char *chan, const char *nick); +void solidircd_cmd_part(const char *nick, const char *chan, const char *buf); +void solidircd_cmd_391(const char *source, const char *timestr); +void solidircd_cmd_250(const char *buf); +void solidircd_cmd_307(const char *buf); +void solidircd_cmd_311(const char *buf); +void solidircd_cmd_312(const char *buf); +void solidircd_cmd_317(const char *buf); +void solidircd_cmd_219(const char *source, const char *letter); +void solidircd_cmd_401(const char *source, const char *who); +void solidircd_cmd_318(const char *source, const char *who); +void solidircd_cmd_242(const char *buf); +void solidircd_cmd_243(const char *buf); +void solidircd_cmd_211(const char *buf); +void solidircd_cmd_global(const char *source, const char *buf); +void solidircd_cmd_global_legacy(const char *source, const char *fmt); +void solidircd_cmd_sqline(const char *mask, const char *reason); +void solidircd_cmd_squit(const char *servname, const char *message); +void solidircd_cmd_svso(const char *source, const char *nick, const char *flag); +void solidircd_cmd_chg_nick(const char *oldnick, const char *newnick); +void solidircd_cmd_svsnick(const char *source, const char *guest, time_t when); +void solidircd_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void solidircd_cmd_connect(int servernum); -void solidircd_cmd_svshold(char *nick); -void solidircd_cmd_release_svshold(char *nick); -void solidircd_cmd_unsgline(char *mask); -void solidircd_cmd_unszline(char *mask); -void solidircd_cmd_szline(char *mask, char *reason, char *whom); -void solidircd_cmd_sgline(char *mask, char *reason); -void solidircd_cmd_unban(char *name, char *nick); -void solidircd_cmd_svsmode_chan(char *name, char *mode, char *nick); -void solidircd_cmd_svid_umode(char *nick, time_t ts); +void solidircd_cmd_svshold(const char *nick); +void solidircd_cmd_release_svshold(const char *nick); +void solidircd_cmd_unsgline(const char *mask); +void solidircd_cmd_unszline(const char *mask); +void solidircd_cmd_szline(const char *mask, const char *reason, const char *whom); +void solidircd_cmd_sgline(const char *mask, const char *reason); +void solidircd_cmd_unban(const char *name, const char *nick); +void solidircd_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void solidircd_cmd_svid_umode(const char *nick, time_t ts); void solidircd_cmd_nc_change(User * u); -void solidircd_cmd_svid_umode2(User * u, char *ts); -void solidircd_cmd_svid_umode3(User * u, char *ts); +void solidircd_cmd_svid_umode2(User * u, const char *ts); +void solidircd_cmd_svid_umode3(User * u, const char *ts); void solidircd_cmd_eob(); -int solidircd_flood_mode_check(char *value); -void solidircd_cmd_jupe(char *jserver, char *who, char *reason); -int solidircd_valid_nick(char *nick); -void solidircd_cmd_ctcp(char *source, char *dest, char *buf); +int solidircd_flood_mode_check(const char *value); +void solidircd_cmd_jupe(const char *jserver, const char *who, const char *reason); +int solidircd_valid_nick(const char *nick); +void solidircd_cmd_ctcp(const char *source, const char *dest, const char *buf); class SolidIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/ultimate2.c b/src/protocol/ultimate2.c index 9c5ce5ca9..b235e545e 100644 --- a/src/protocol/ultimate2.c +++ b/src/protocol/ultimate2.c @@ -146,10 +146,10 @@ IRCDCAPAB myIrcdcap[] = { 0, 0} }; -void ultiamte2_set_umode(User * user, int ac, char **av) +void ultiamte2_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -445,7 +445,7 @@ CUMode myCumodes[128] = { }; -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -460,11 +460,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -479,11 +479,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[1]); + u->SetRealname(av[1]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -498,11 +498,11 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -517,11 +517,11 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -536,11 +536,11 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { if (ac != 2) { if (ac == 7) { @@ -558,7 +558,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -573,11 +573,11 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -771,13 +771,13 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } -void ultimate2_cmd_sqline(char *mask, char *reason) +void ultimate2_cmd_sqline(const char *mask, const char *reason) { send_cmd(NULL, "SQLINE %s :%s", mask, reason); } @@ -787,7 +787,7 @@ void UltimateIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void ultimate2_cmd_svsadmin(char *server, int set) +void ultimate2_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } @@ -798,8 +798,8 @@ void UltimateIRCdProto::cmd_remove_akill(const char *user, const char *host) } -void ultimate2_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void ultimate2_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -810,7 +810,7 @@ void ultimate2_cmd_vhost_off(User * u) /* does not support removing vhosting */ } -void ultimate2_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void ultimate2_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (vIdent) { send_cmd(ServerName, "CHGIDENT %s %s", nick, vIdent); @@ -819,23 +819,23 @@ void ultimate2_cmd_vhost_on(char *nick, char *vIdent, char *vhost) send_cmd(ServerName, "CHGHOST %s %s", nick, vhost); } -void ultimate2_cmd_unsqline(char *user) +void ultimate2_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } -void ultimate2_cmd_join(char *user, char *channel, time_t chantime) +void ultimate2_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "JOIN %s", channel); } -void ultimate2_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void ultimate2_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s :%s", host, user, reason); } -void ultimate2_cmd_svskill(char *source, char *user, char *buf) +void ultimate2_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -844,7 +844,7 @@ void ultimate2_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "KILL %s :%s", user, buf); } -void ultimate2_cmd_svsmode(User * u, int ac, char **av) +void ultimate2_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); @@ -861,19 +861,19 @@ void ultimate2_cmd_capab() /* PASS */ -void ultimate2_cmd_pass(char *pass) +void ultimate2_cmd_pass(const char *pass) { send_cmd(NULL, "PASS :%s", pass); } /* SERVER name hop descript */ -void ultimate2_cmd_server(char *servname, int hop, char *descript) +void ultimate2_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } /* PONG */ -void ultimate2_cmd_pong(char *servname, char *who) +void ultimate2_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -894,7 +894,7 @@ void ultimate2_cmd_connect(int servernum) } /* CHGHOST */ -void ultimate2_cmd_chghost(char *nick, char *vhost) +void ultimate2_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -903,7 +903,7 @@ void ultimate2_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void ultimate2_cmd_chgident(char *nick, char *vIdent) +void ultimate2_cmd_chgident(const char *nick, const char *vIdent) { if (!nick || !vIdent) { return; @@ -912,7 +912,7 @@ void ultimate2_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void ultimate2_cmd_invite(char *source, char *chan, char *nick) +void ultimate2_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -922,7 +922,7 @@ void ultimate2_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void ultimate2_cmd_part(char *nick, char *chan, char *buf) +void ultimate2_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -936,7 +936,7 @@ void ultimate2_cmd_part(char *nick, char *chan, char *buf) } /* 391 */ -void ultimate2_cmd_391(char *source, char *timestr) +void ultimate2_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -945,7 +945,7 @@ void ultimate2_cmd_391(char *source, char *timestr) } /* 250 */ -void ultimate2_cmd_250(char *buf) +void ultimate2_cmd_250(const char *buf) { if (!buf) { return; @@ -955,7 +955,7 @@ void ultimate2_cmd_250(char *buf) } /* 307 */ -void ultimate2_cmd_307(char *buf) +void ultimate2_cmd_307(const char *buf) { if (!buf) { return; @@ -965,7 +965,7 @@ void ultimate2_cmd_307(char *buf) } /* 311 */ -void ultimate2_cmd_311(char *buf) +void ultimate2_cmd_311(const char *buf) { if (!buf) { return; @@ -975,7 +975,7 @@ void ultimate2_cmd_311(char *buf) } /* 312 */ -void ultimate2_cmd_312(char *buf) +void ultimate2_cmd_312(const char *buf) { if (!buf) { return; @@ -985,7 +985,7 @@ void ultimate2_cmd_312(char *buf) } /* 317 */ -void ultimate2_cmd_317(char *buf) +void ultimate2_cmd_317(const char *buf) { if (!buf) { return; @@ -995,7 +995,7 @@ void ultimate2_cmd_317(char *buf) } /* 219 */ -void ultimate2_cmd_219(char *source, char *letter) +void ultimate2_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1010,7 +1010,7 @@ void ultimate2_cmd_219(char *source, char *letter) } /* 401 */ -void ultimate2_cmd_401(char *source, char *who) +void ultimate2_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1019,7 +1019,7 @@ void ultimate2_cmd_401(char *source, char *who) } /* 318 */ -void ultimate2_cmd_318(char *source, char *who) +void ultimate2_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1029,7 +1029,7 @@ void ultimate2_cmd_318(char *source, char *who) } /* 242 */ -void ultimate2_cmd_242(char *buf) +void ultimate2_cmd_242(const char *buf) { if (!buf) { return; @@ -1039,7 +1039,7 @@ void ultimate2_cmd_242(char *buf) } /* 243 */ -void ultimate2_cmd_243(char *buf) +void ultimate2_cmd_243(const char *buf) { if (!buf) { return; @@ -1049,7 +1049,7 @@ void ultimate2_cmd_243(char *buf) } /* 211 */ -void ultimate2_cmd_211(char *buf) +void ultimate2_cmd_211(const char *buf) { if (!buf) { return; @@ -1059,7 +1059,7 @@ void ultimate2_cmd_211(char *buf) } /* GLOBOPS */ -void ultimate2_cmd_global(char *source, char *buf) +void ultimate2_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1069,7 +1069,7 @@ void ultimate2_cmd_global(char *source, char *buf) } /* SQUIT */ -void ultimate2_cmd_squit(char *servname, char *message) +void ultimate2_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1079,7 +1079,7 @@ void ultimate2_cmd_squit(char *servname, char *message) } /* SVSO */ -void ultimate2_cmd_svso(char *source, char *nick, char *flag) +void ultimate2_cmd_svso(const char *source, const char *nick, const char *flag) { if (!source || !nick || !flag) { return; @@ -1089,7 +1089,7 @@ void ultimate2_cmd_svso(char *source, char *nick, char *flag) } /* NICK <newnick> */ -void ultimate2_cmd_chg_nick(char *oldnick, char *newnick) +void ultimate2_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1099,7 +1099,7 @@ void ultimate2_cmd_chg_nick(char *oldnick, char *newnick) } /* SVSNICK */ -void ultimate2_cmd_svsnick(char *source, char *guest, time_t when) +void ultimate2_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1109,7 +1109,7 @@ void ultimate2_cmd_svsnick(char *source, char *guest, time_t when) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1117,7 +1117,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1126,7 +1126,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -1134,7 +1134,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1142,7 +1142,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1151,7 +1151,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1165,7 +1165,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1174,7 +1174,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1183,7 +1183,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1191,7 +1191,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1202,7 +1202,7 @@ int anope_event_motd(char *source, int ac, char **av) } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1212,7 +1212,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1220,7 +1220,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1228,7 +1228,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1236,7 +1236,7 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -void ultimate2_cmd_kick(char *source, char *chan, char *user, char *buf) +void ultimate2_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1245,7 +1245,7 @@ void ultimate2_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void ultimate2_cmd_notice_ops(char *source, char *dest, char *buf) +void ultimate2_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1255,7 +1255,7 @@ void ultimate2_cmd_notice_ops(char *source, char *dest, char *buf) } -void ultimate2_cmd_notice(char *source, char *dest, char *buf) +void ultimate2_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1268,12 +1268,12 @@ void ultimate2_cmd_notice(char *source, char *dest, char *buf) } } -void ultimate2_cmd_notice2(char *source, char *dest, char *msg) +void ultimate2_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void ultimate2_cmd_privmsg(char *source, char *dest, char *buf) +void ultimate2_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1282,22 +1282,22 @@ void ultimate2_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void ultimate2_cmd_privmsg2(char *source, char *dest, char *msg) +void ultimate2_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void ultimate2_cmd_serv_notice(char *source, char *dest, char *msg) +void ultimate2_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void ultimate2_cmd_serv_privmsg(char *source, char *dest, char *msg) +void ultimate2_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void ultimate2_cmd_nick(char *nick, char *name, char *mode) +void ultimate2_cmd_nick(const char *nick, const char *name, const char *mode) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, @@ -1307,7 +1307,7 @@ void ultimate2_cmd_nick(char *nick, char *name, char *mode) ultimate2_cmd_sqline(nick, "Reserved for services"); } -void ultimate2_cmd_351(char *source) +void ultimate2_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1315,7 +1315,7 @@ void ultimate2_cmd_351(char *source) } /* QUIT */ -void ultimate2_cmd_quit(char *source, char *buf) +void ultimate2_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -1324,7 +1324,7 @@ void ultimate2_cmd_quit(char *source, char *buf) } } -void ultimate2_cmd_mode(char *source, char *dest, char *buf) +void ultimate2_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1333,8 +1333,8 @@ void ultimate2_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "MODE %s %s", dest, buf); } -void ultimate2_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void ultimate2_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, @@ -1343,70 +1343,70 @@ void ultimate2_cmd_bot_nick(char *nick, char *user, char *host, char *real, ultimate2_cmd_sqline(nick, "Reserved for services"); } -void ultimate2_cmd_372(char *source, char *msg) +void ultimate2_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void ultimate2_cmd_372_error(char *source) +void ultimate2_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void ultimate2_cmd_375(char *source) +void ultimate2_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void ultimate2_cmd_376(char *source) +void ultimate2_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void ultimate2_cmd_bot_chan_mode(char *nick, char *chan) +void ultimate2_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } /* SVSHOLD - set */ -void ultimate2_cmd_svshold(char *nick) +void ultimate2_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void ultimate2_cmd_release_svshold(char *nick) +void ultimate2_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* UNSGLINE */ -void ultimate2_cmd_unsgline(char *mask) +void ultimate2_cmd_unsgline(const char *mask) { /* Not Supported by this IRCD */ } /* UNSZLINE */ -void ultimate2_cmd_unszline(char *mask) +void ultimate2_cmd_unszline(const char *mask) { /* Not Supported by this IRCD */ } /* SZLINE */ -void ultimate2_cmd_szline(char *mask, char *reason, char *whom) +void ultimate2_cmd_szline(const char *mask, const char *reason, const char *whom) { /* Not Supported by this IRCD */ } /* SGLINE */ -void ultimate2_cmd_sgline(char *mask, char *reason) +void ultimate2_cmd_sgline(const char *mask, const char *reason) { /* Not Supported by this IRCD */ } -void ultimate2_cmd_guest_nick(char *nick, char *user, char *host, +void ultimate2_cmd_guest_nick(const char *nick, const char *user, const char *host, char *real, char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 :%s", nick, @@ -1415,21 +1415,21 @@ void ultimate2_cmd_guest_nick(char *nick, char *user, char *host, } -void ultimate2_cmd_unban(char *name, char *nick) +void ultimate2_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void ultimate2_cmd_svsmode_chan(char *name, char *mode, char *nick) +void ultimate2_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void ultimate2_cmd_svid_umode(char *nick, time_t ts) +void ultimate2_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s +d 1", nick); } @@ -1442,7 +1442,7 @@ void ultimate2_cmd_nc_change(User * u) } /* SVSMODE +r */ -void ultimate2_cmd_svid_umode2(User * u, char *ts) +void ultimate2_cmd_svid_umode2(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1451,37 +1451,37 @@ void ultimate2_cmd_svid_umode2(User * u, char *ts) } } -void ultimate2_cmd_svid_umode3(User * u, char *ts) +void ultimate2_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_vctrl(char *source, int ac, char **av) +int anope_event_vctrl(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_netinfo(char *source, int ac, char **av) +int anope_event_netinfo(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_snetinfo(char *source, int ac, char **av) +int anope_event_snetinfo(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -1493,7 +1493,7 @@ int anope_event_sqline(char *source, int ac, char **av) ** parv[1] - nick to make join ** parv[2] - channel(s) to join */ -void ultimate2_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void ultimate2_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SVSJOIN %s %s", nick, chan); } @@ -1505,12 +1505,12 @@ void ultimate2_cmd_svsjoin(char *source, char *nick, char *chan, char *param) ** parv[1] - nick to make part ** parv[2] - channel(s) to part */ -void ultimate2_cmd_svspart(char *source, char *nick, char *chan) +void ultimate2_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SVSPART %s %s", nick, chan); } -void ultimate2_cmd_swhois(char *source, char *who, char *mask) +void ultimate2_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } @@ -1520,22 +1520,22 @@ void ultimate2_cmd_eob() /* not supported */ } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int ultiamte2_flood_mode_check(char *value) +int ultiamte2_flood_mode_check(const char *value) { char *dp, *end; @@ -1549,7 +1549,7 @@ int ultiamte2_flood_mode_check(char *value) } } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (av[0]) { if (debug) { @@ -1559,7 +1559,7 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -void ultimate2_cmd_jupe(char *jserver, char *who, char *reason) +void ultimate2_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1573,7 +1573,7 @@ void ultimate2_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void ultimate2_cmd_global_legacy(char *source, char *fmt) +void ultimate2_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1582,7 +1582,7 @@ void ultimate2_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int ultiamte2_valid_nick(char *nick) +int ultiamte2_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1592,14 +1592,14 @@ int ultiamte2_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int ultiamte2_valid_chan(char *chan) +int ultiamte2_valid_chan(const char *chan) { /* no hard coded invalid chans */ return 1; } -void ultimate2_cmd_ctcp(char *source, char *dest, char *buf) +void ultimate2_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/ultimate2.h b/src/protocol/ultimate2.h index a3e847653..ea43a8576 100644 --- a/src/protocol/ultimate2.h +++ b/src/protocol/ultimate2.h @@ -46,74 +46,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void ultimate2_set_umode(User * user, int ac, char **av); -void ultimate2_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void ultimate2_set_umode(User * user, int ac, const char **av); +void ultimate2_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void ultimate2_cmd_vhost_off(User * u); -void ultimate2_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void ultimate2_cmd_svskill(char *source, char *user, char *buf); -void ultimate2_cmd_svsmode(User * u, int ac, char **av); -void ultimate2_cmd_372(char *source, char *msg); -void ultimate2_cmd_372_error(char *source); -void ultimate2_cmd_375(char *source); -void ultimate2_cmd_376(char *source); -void ultimate2_cmd_nick(char *nick, char *name, char *modes); -void ultimate2_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void ultimate2_cmd_mode(char *source, char *dest, char *buf); -void ultimate2_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void ultimate2_cmd_kick(char *source, char *chan, char *user, char *buf); -void ultimate2_cmd_notice_ops(char *source, char *dest, char *buf); -void ultimate2_cmd_notice(char *source, char *dest, char *buf); -void ultimate2_cmd_notice2(char *source, char *dest, char *msg); -void ultimate2_cmd_privmsg(char *source, char *dest, char *buf); -void ultimate2_cmd_privmsg2(char *source, char *dest, char *msg); -void ultimate2_cmd_serv_notice(char *source, char *dest, char *msg); -void ultimate2_cmd_serv_privmsg(char *source, char *dest, char *msg); -void ultimate2_cmd_bot_chan_mode(char *nick, char *chan); -void ultimate2_cmd_351(char *source); -void ultimate2_cmd_quit(char *source, char *buf); -void ultimate2_cmd_pong(char *servname, char *who); -void ultimate2_cmd_join(char *user, char *channel, time_t chantime); -void ultimate2_cmd_unsqline(char *user); -void ultimate2_cmd_invite(char *source, char *chan, char *nick); -void ultimate2_cmd_part(char *nick, char *chan, char *buf); -void ultimate2_cmd_391(char *source, char *timestr); -void ultimate2_cmd_250(char *buf); -void ultimate2_cmd_307(char *buf); -void ultimate2_cmd_311(char *buf); -void ultimate2_cmd_312(char *buf); -void ultimate2_cmd_317(char *buf); -void ultimate2_cmd_219(char *source, char *letter); -void ultimate2_cmd_401(char *source, char *who); -void ultimate2_cmd_318(char *source, char *who); -void ultimate2_cmd_242(char *buf); -void ultimate2_cmd_243(char *buf); -void ultimate2_cmd_211(char *buf); -void ultimate2_cmd_global(char *source, char *buf); -void ultimate2_cmd_global_legacy(char *source, char *fmt); -void ultimate2_cmd_sqline(char *mask, char *reason); -void ultimate2_cmd_squit(char *servname, char *message); -void ultimate2_cmd_svso(char *source, char *nick, char *flag); -void ultimate2_cmd_chg_nick(char *oldnick, char *newnick); -void ultimate2_cmd_svsnick(char *source, char *guest, time_t when); -void ultimate2_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void ultimate2_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void ultimate2_cmd_svskill(const char *source, const char *user, const char *buf); +void ultimate2_cmd_svsmode(User * u, int ac, const char **av); +void ultimate2_cmd_372(const char *source, const char *msg); +void ultimate2_cmd_372_error(const char *source); +void ultimate2_cmd_375(const char *source); +void ultimate2_cmd_376(const char *source); +void ultimate2_cmd_nick(const char *nick, const char *name, const char *modes); +void ultimate2_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ultimate2_cmd_mode(const char *source, const char *dest, const char *buf); +void ultimate2_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ultimate2_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void ultimate2_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void ultimate2_cmd_notice(const char *source, const char *dest, const char *buf); +void ultimate2_cmd_notice2(const char *source, const char *dest, const char *msg); +void ultimate2_cmd_privmsg(const char *source, const char *dest, const char *buf); +void ultimate2_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void ultimate2_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void ultimate2_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void ultimate2_cmd_bot_chan_mode(const char *nick, const char *chan); +void ultimate2_cmd_351(const char *source); +void ultimate2_cmd_quit(const char *source, const char *buf); +void ultimate2_cmd_pong(const char *servname, const char *who); +void ultimate2_cmd_join(const char *user, const char *channel, time_t chantime); +void ultimate2_cmd_unsqline(const char *user); +void ultimate2_cmd_invite(const char *source, const char *chan, const char *nick); +void ultimate2_cmd_part(const char *nick, const char *chan, const char *buf); +void ultimate2_cmd_391(const char *source, const char *timestr); +void ultimate2_cmd_250(const char *buf); +void ultimate2_cmd_307(const char *buf); +void ultimate2_cmd_311(const char *buf); +void ultimate2_cmd_312(const char *buf); +void ultimate2_cmd_317(const char *buf); +void ultimate2_cmd_219(const char *source, const char *letter); +void ultimate2_cmd_401(const char *source, const char *who); +void ultimate2_cmd_318(const char *source, const char *who); +void ultimate2_cmd_242(const char *buf); +void ultimate2_cmd_243(const char *buf); +void ultimate2_cmd_211(const char *buf); +void ultimate2_cmd_global(const char *source, const char *buf); +void ultimate2_cmd_global_legacy(const char *source, const char *fmt); +void ultimate2_cmd_sqline(const char *mask, const char *reason); +void ultimate2_cmd_squit(const char *servname, const char *message); +void ultimate2_cmd_svso(const char *source, const char *nick, const char *flag); +void ultimate2_cmd_chg_nick(const char *oldnick, const char *newnick); +void ultimate2_cmd_svsnick(const char *source, const char *guest, time_t when); +void ultimate2_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void ultimate2_cmd_connect(int servernum); -void ultimate2_cmd_svshold(char *nick); -void ultimate2_cmd_release_svshold(char *nick); -void ultimate2_cmd_unsgline(char *mask); -void ultimate2_cmd_unszline(char *mask); -void ultimate2_cmd_szline(char *mask, char *reason, char *whom); -void ultimate2_cmd_sgline(char *mask, char *reason); -void ultimate2_cmd_unban(char *name, char *nick); -void ultimate2_cmd_svsmode_chan(char *name, char *mode, char *nick); -void ultimate2_cmd_svid_umode(char *nick, time_t ts); +void ultimate2_cmd_svshold(const char *nick); +void ultimate2_cmd_release_svshold(const char *nick); +void ultimate2_cmd_unsgline(const char *mask); +void ultimate2_cmd_unszline(const char *mask); +void ultimate2_cmd_szline(const char *mask, const char *reason, const char *whom); +void ultimate2_cmd_sgline(const char *mask, const char *reason); +void ultimate2_cmd_unban(const char *name, const char *nick); +void ultimate2_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void ultimate2_cmd_svid_umode(const char *nick, time_t ts); void ultimate2_cmd_nc_change(User * u); -void ultimate2_cmd_svid_umode2(User * u, char *ts); -void ultimate2_cmd_svid_umode3(User * u, char *ts); +void ultimate2_cmd_svid_umode2(User * u, const char *ts); +void ultimate2_cmd_svid_umode3(User * u, const char *ts); void ultimate2_cmd_eob(); -int ultimate2_flood_mode_check(char *value); -void ultimate2_cmd_jupe(char *jserver, char *who, char *reason); -int ultimate2_valid_nick(char *nick); -void ultimate2_cmd_ctcp(char *source, char *dest, char *buf); +int ultimate2_flood_mode_check(const char *value); +void ultimate2_cmd_jupe(const char *jserver, const char *who, const char *reason); +int ultimate2_valid_nick(const char *nick); +void ultimate2_cmd_ctcp(const char *source, const char *dest, const char *buf); class UltimateIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/ultimate3.c b/src/protocol/ultimate3.c index 21b9f82d4..e3a516ed3 100644 --- a/src/protocol/ultimate3.c +++ b/src/protocol/ultimate3.c @@ -144,10 +144,10 @@ IRCDCAPAB myIrcdcap[] = { 0, 0, 0} }; -void ultimate3_set_umode(User * user, int ac, char **av) +void ultimate3_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -475,7 +475,7 @@ CUMode myCumodes[128] = { }; /* SVSMODE -b */ -void ultimate3_cmd_unban(char *name, char *nick) +void ultimate3_cmd_unban(const char *name, const char *nick) { ultimate3_cmd_svsmode_chan(name, "-b", nick); } @@ -483,7 +483,7 @@ void ultimate3_cmd_unban(char *name, char *nick) /* SVSMODE channel modes */ -void ultimate3_cmd_svsmode_chan(char *name, char *mode, char *nick) +void ultimate3_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "SVSMODE %s %s %s", name, mode, nick); @@ -492,7 +492,7 @@ void ultimate3_cmd_svsmode_chan(char *name, char *mode, char *nick) } } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; @@ -517,7 +517,7 @@ int anope_event_sjoin(char *source, int ac, char **av) ** parv[0] = new nickname ** parv[1] = hopcount */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { if (ac != 2) { User *user = do_nick(source, av[0], av[4], av[5], av[6], av[9], @@ -533,7 +533,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -548,11 +548,11 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; @@ -574,7 +574,7 @@ int anope_event_capab(char *source, int ac, char **av) ** parv[10] = ip 402810339 ** parv[11] = info Dreams are answers to questions not yet asked */ -int anope_event_client(char *source, int ac, char **av) +int anope_event_client(const char *source, int ac, const char **av) { if (ac != 2) { User *user = do_nick(source, av[0], av[5], av[6], av[8], av[11], @@ -663,7 +663,7 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ -void ultimate3_cmd_sqline(char *mask, char *reason) +void ultimate3_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -672,12 +672,12 @@ void ultimate3_cmd_sqline(char *mask, char *reason) send_cmd(NULL, "SQLINE %s :%s", mask, reason); } -void ultimate3_cmd_unsgline(char *mask) +void ultimate3_cmd_unsgline(const char *mask) { send_cmd(NULL, "UNSGLINE 0 :%s", mask); } -void ultimate3_cmd_unszline(char *mask) +void ultimate3_cmd_unszline(const char *mask) { send_cmd(NULL, "UNSZLINE 0 %s", mask); } @@ -687,7 +687,7 @@ void ultimate3_cmd_unszline(char *mask) Complete rewrite of the kline/akill/zline system. (s)zlines no longer exist. K: lines set on IP addresses without username portions (or *) are treated as Z: lines used to be. */ -void ultimate3_cmd_szline(char *mask, char *reason, char *whom) +void ultimate3_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "AKILL %s * %d %s %ld :%s", mask, 86400 * 2, whom, (long int) time(NULL), reason); @@ -700,12 +700,12 @@ void UltimateIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void ultimate3_cmd_svsadmin(char *server, int set) +void ultimate3_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } -void ultimate3_cmd_sgline(char *mask, char *reason) +void ultimate3_cmd_sgline(const char *mask, const char *reason) { send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason); } @@ -721,25 +721,25 @@ void ultimate3_cmd_vhost_off(User * u) notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar); } -void ultimate3_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void ultimate3_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { send_cmd(s_HostServ, "SVSMODE %s +x", nick); send_cmd(ServerName, "SETHOST %s %s", nick, vhost); } -void ultimate3_cmd_join(char *user, char *channel, time_t chantime) +void ultimate3_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel); } -void ultimate3_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void ultimate3_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who, (long int) time(NULL), reason); } -void ultimate3_cmd_svskill(char *source, char *user, char *buf) +void ultimate3_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -749,7 +749,7 @@ void ultimate3_cmd_svskill(char *source, char *user, char *buf) } -void ultimate3_cmd_svsmode(User * u, int ac, char **av) +void ultimate3_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), @@ -768,7 +768,7 @@ void anope_pong(char *servname) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -776,7 +776,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -785,7 +785,7 @@ int anope_event_436(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -794,7 +794,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -802,7 +802,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -810,7 +810,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -819,7 +819,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -833,7 +833,7 @@ int anope_event_mode(char *source, int ac, char **av) } /* EVENT : OS */ -int anope_event_os(char *source, int ac, char **av) +int anope_event_os(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -842,7 +842,7 @@ int anope_event_os(char *source, int ac, char **av) } /* EVENT : NS */ -int anope_event_ns(char *source, int ac, char **av) +int anope_event_ns(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -851,7 +851,7 @@ int anope_event_ns(char *source, int ac, char **av) } /* EVENT : MS */ -int anope_event_ms(char *source, int ac, char **av) +int anope_event_ms(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -860,7 +860,7 @@ int anope_event_ms(char *source, int ac, char **av) } /* EVENT : HS */ -int anope_event_hs(char *source, int ac, char **av) +int anope_event_hs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -869,7 +869,7 @@ int anope_event_hs(char *source, int ac, char **av) } /* EVENT : CS */ -int anope_event_cs(char *source, int ac, char **av) +int anope_event_cs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -878,7 +878,7 @@ int anope_event_cs(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -887,7 +887,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -896,7 +896,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -904,7 +904,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -914,7 +914,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -929,11 +929,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -948,11 +948,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[1]); + u->SetRealname(av[1]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -967,10 +967,10 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -985,12 +985,12 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1000,7 +1000,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1008,7 +1008,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1016,7 +1016,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1024,36 +1024,36 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -void ultimate3_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void ultimate3_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); } -void ultimate3_cmd_372(char *source, char *msg) +void ultimate3_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void ultimate3_cmd_372_error(char *source) +void ultimate3_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void ultimate3_cmd_375(char *source) +void ultimate3_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void ultimate3_cmd_376(char *source) +void ultimate3_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void ultimate3_cmd_nick(char *nick, char *name, char *modes) +void ultimate3_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", nick, @@ -1062,14 +1062,14 @@ void ultimate3_cmd_nick(char *nick, char *name, char *modes) ultimate3_cmd_sqline(nick, "Reserved for services"); } -void ultimate3_cmd_guest_nick(char *nick, char *user, char *host, - char *real, char *modes) +void ultimate3_cmd_guest_nick(const char *nick, const char *user, const char *host, + const char *real, const char *modes) { send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", nick, (long int) time(NULL), modes, user, host, ServerName, real); } -void ultimate3_cmd_mode(char *source, char *dest, char *buf) +void ultimate3_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1078,8 +1078,8 @@ void ultimate3_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "MODE %s %s", dest, buf); } -void ultimate3_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void ultimate3_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "CLIENT %s 1 %ld %s + %s %s * %s 0 0 :%s", nick, @@ -1087,7 +1087,7 @@ void ultimate3_cmd_bot_nick(char *nick, char *user, char *host, char *real, ultimate3_cmd_sqline(nick, "Reserved for services"); } -void ultimate3_cmd_kick(char *source, char *chan, char *user, char *buf) +void ultimate3_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1096,7 +1096,7 @@ void ultimate3_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void ultimate3_cmd_notice_ops(char *source, char *dest, char *buf) +void ultimate3_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1106,7 +1106,7 @@ void ultimate3_cmd_notice_ops(char *source, char *dest, char *buf) } -void ultimate3_cmd_notice(char *source, char *dest, char *buf) +void ultimate3_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1119,12 +1119,12 @@ void ultimate3_cmd_notice(char *source, char *dest, char *buf) } } -void ultimate3_cmd_notice2(char *source, char *dest, char *msg) +void ultimate3_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void ultimate3_cmd_privmsg(char *source, char *dest, char *buf) +void ultimate3_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1133,27 +1133,27 @@ void ultimate3_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void ultimate3_cmd_privmsg2(char *source, char *dest, char *msg) +void ultimate3_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void ultimate3_cmd_serv_notice(char *source, char *dest, char *msg) +void ultimate3_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void ultimate3_cmd_serv_privmsg(char *source, char *dest, char *msg) +void ultimate3_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void ultimate3_cmd_bot_chan_mode(char *nick, char *chan) +void ultimate3_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } -void ultimate3_cmd_351(char *source) +void ultimate3_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -1162,7 +1162,7 @@ void ultimate3_cmd_351(char *source) } /* QUIT */ -void ultimate3_cmd_quit(char *source, char *buf) +void ultimate3_cmd_quit(const char *source, const char *buf) { if (!buf) { return; @@ -1183,26 +1183,26 @@ void ultimate3_cmd_capab() } /* PASS */ -void ultimate3_cmd_pass(char *pass) +void ultimate3_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } /* SERVER name hop descript */ /* Unreal 3.2 actually sends some info about itself in the descript area */ -void ultimate3_cmd_server(char *servname, int hop, char *descript) +void ultimate3_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } /* PONG */ -void ultimate3_cmd_pong(char *servname, char *who) +void ultimate3_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } /* UNSQLINE */ -void ultimate3_cmd_unsqline(char *user) +void ultimate3_cmd_unsqline(const char *user) { if (!user) { return; @@ -1211,7 +1211,7 @@ void ultimate3_cmd_unsqline(char *user) } /* CHGHOST */ -void ultimate3_cmd_chghost(char *nick, char *vhost) +void ultimate3_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -1220,7 +1220,7 @@ void ultimate3_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void ultimate3_cmd_chgident(char *nick, char *vIdent) +void ultimate3_cmd_chgident(const char *nick, const char *vIdent) { if (!nick || !vIdent) { return; @@ -1229,7 +1229,7 @@ void ultimate3_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void ultimate3_cmd_invite(char *source, char *chan, char *nick) +void ultimate3_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1239,7 +1239,7 @@ void ultimate3_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void ultimate3_cmd_part(char *nick, char *chan, char *buf) +void ultimate3_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { @@ -1254,7 +1254,7 @@ void ultimate3_cmd_part(char *nick, char *chan, char *buf) } /* 391 */ -void ultimate3_cmd_391(char *source, char *timestr) +void ultimate3_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1263,7 +1263,7 @@ void ultimate3_cmd_391(char *source, char *timestr) } /* 250 */ -void ultimate3_cmd_250(char *buf) +void ultimate3_cmd_250(const char *buf) { if (!buf) { return; @@ -1273,7 +1273,7 @@ void ultimate3_cmd_250(char *buf) } /* 307 */ -void ultimate3_cmd_307(char *buf) +void ultimate3_cmd_307(const char *buf) { if (!buf) { return; @@ -1283,7 +1283,7 @@ void ultimate3_cmd_307(char *buf) } /* 311 */ -void ultimate3_cmd_311(char *buf) +void ultimate3_cmd_311(const char *buf) { if (!buf) { return; @@ -1293,7 +1293,7 @@ void ultimate3_cmd_311(char *buf) } /* 312 */ -void ultimate3_cmd_312(char *buf) +void ultimate3_cmd_312(const char *buf) { if (!buf) { return; @@ -1303,7 +1303,7 @@ void ultimate3_cmd_312(char *buf) } /* 317 */ -void ultimate3_cmd_317(char *buf) +void ultimate3_cmd_317(const char *buf) { if (!buf) { return; @@ -1313,7 +1313,7 @@ void ultimate3_cmd_317(char *buf) } /* 219 */ -void ultimate3_cmd_219(char *source, char *letter) +void ultimate3_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1328,7 +1328,7 @@ void ultimate3_cmd_219(char *source, char *letter) } /* 401 */ -void ultimate3_cmd_401(char *source, char *who) +void ultimate3_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1337,7 +1337,7 @@ void ultimate3_cmd_401(char *source, char *who) } /* 318 */ -void ultimate3_cmd_318(char *source, char *who) +void ultimate3_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1347,7 +1347,7 @@ void ultimate3_cmd_318(char *source, char *who) } /* 242 */ -void ultimate3_cmd_242(char *buf) +void ultimate3_cmd_242(const char *buf) { if (!buf) { return; @@ -1357,7 +1357,7 @@ void ultimate3_cmd_242(char *buf) } /* 243 */ -void ultimate3_cmd_243(char *buf) +void ultimate3_cmd_243(const char *buf) { if (!buf) { return; @@ -1367,7 +1367,7 @@ void ultimate3_cmd_243(char *buf) } /* 211 */ -void ultimate3_cmd_211(char *buf) +void ultimate3_cmd_211(const char *buf) { if (!buf) { return; @@ -1377,7 +1377,7 @@ void ultimate3_cmd_211(char *buf) } /* GLOBOPS */ -void ultimate3_cmd_global(char *source, char *buf) +void ultimate3_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1387,7 +1387,7 @@ void ultimate3_cmd_global(char *source, char *buf) } /* SQUIT */ -void ultimate3_cmd_squit(char *servname, char *message) +void ultimate3_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1397,7 +1397,7 @@ void ultimate3_cmd_squit(char *servname, char *message) } /* SVSO */ -void ultimate3_cmd_svso(char *source, char *nick, char *flag) +void ultimate3_cmd_svso(const char *source, const char *nick, const char *flag) { if (!source || !nick || !flag) { return; @@ -1407,7 +1407,7 @@ void ultimate3_cmd_svso(char *source, char *nick, char *flag) } /* NICK <newnick> */ -void ultimate3_cmd_chg_nick(char *oldnick, char *newnick) +void ultimate3_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1417,7 +1417,7 @@ void ultimate3_cmd_chg_nick(char *oldnick, char *newnick) } /* SVSNICK */ -void ultimate3_cmd_svsnick(char *source, char *guest, time_t when) +void ultimate3_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1466,20 +1466,20 @@ void ultimate3_cmd_connect(int servernum) } /* SVSHOLD - set */ -void ultimate3_cmd_svshold(char *nick) +void ultimate3_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void ultimate3_cmd_release_svshold(char *nick) +void ultimate3_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE +d */ /* sent if svid is something weird */ -void ultimate3_cmd_svid_umode(char *nick, time_t ts) +void ultimate3_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1493,12 +1493,12 @@ void ultimate3_cmd_nc_change(User * u) } /* SVSMODE +d */ -void ultimate3_cmd_svid_umode2(User * u, char *ts) +void ultimate3_cmd_svid_umode2(User * u, const char *ts) { /* not used by bahamut ircds */ } -void ultimate3_cmd_svid_umode3(User * u, char *ts) +void ultimate3_cmd_svid_umode3(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1508,53 +1508,53 @@ void ultimate3_cmd_svid_umode3(User * u, char *ts) } -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_gnotice(char *source, int ac, char **av) +int anope_event_gnotice(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_netctrl(char *source, int ac, char **av) +int anope_event_netctrl(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { /* currently not used but removes the message : unknown message from server */ return MOD_CONT; } -void ultimate3_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void ultimate3_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { /* Not Supported by this IRCD */ } -void ultimate3_cmd_svspart(char *source, char *nick, char *chan) +void ultimate3_cmd_svspart(const char *source, const char *nick, const char *chan) { /* Not Supported by this IRCD */ } -void ultimate3_cmd_swhois(char *source, char *who, char *mask) +void ultimate3_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } @@ -1565,7 +1565,7 @@ void ultimate3_cmd_eob() send_cmd(NULL, "BURST 0"); } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -1576,7 +1576,7 @@ int anope_event_error(char *source, int ac, char **av) } -int anope_event_eob(char *source, int ac, char **av) +int anope_event_eob(const char *source, int ac, const char **av) { Server *s; @@ -1594,7 +1594,7 @@ int anope_event_eob(char *source, int ac, char **av) } -int anope_event_burst(char *source, int ac, char **av) +int anope_event_burst(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -1612,7 +1612,7 @@ int anope_event_burst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -1622,27 +1622,27 @@ int anope_event_credits(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_netglobal(char *source, int ac, char **av) +int anope_event_netglobal(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } -int ultiamte3_flood_mode_check(char *value) +int ultiamte3_flood_mode_check(const char *value) { return 0; } -void ultimate3_cmd_jupe(char *jserver, char *who, char *reason) +void ultimate3_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1656,7 +1656,7 @@ void ultimate3_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void ultimate3_cmd_global_legacy(char *source, char *fmt) +void ultimate3_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1665,7 +1665,7 @@ void ultimate3_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int ultiamte3_valid_nick(char *nick) +int ultiamte3_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1675,14 +1675,14 @@ int ultiamte3_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int ultiamte3_valid_chan(char *chan) +int ultiamte3_valid_chan(const char *chan) { /* no hard coded invalid chans */ return 1; } -void ultimate3_cmd_ctcp(char *source, char *dest, char *buf) +void ultimate3_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/ultimate3.h b/src/protocol/ultimate3.h index deb31d496..b14133765 100644 --- a/src/protocol/ultimate3.h +++ b/src/protocol/ultimate3.h @@ -51,74 +51,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void ultimate3_set_umode(User * user, int ac, char **av); -void ultimate3_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void ultimate3_set_umode(User * user, int ac, const char **av); +void ultimate3_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void ultimate3_cmd_vhost_off(User * u); -void ultimate3_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void ultimate3_cmd_svskill(char *source, char *user, char *buf); -void ultimate3_cmd_svsmode(User * u, int ac, char **av); -void ultimate3_cmd_372(char *source, char *msg); -void ultimate3_cmd_372_error(char *source); -void ultimate3_cmd_375(char *source); -void ultimate3_cmd_376(char *source); -void ultimate3_cmd_nick(char *nick, char *name, char *modes); -void ultimate3_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void ultimate3_cmd_mode(char *source, char *dest, char *buf); -void ultimate3_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void ultimate3_cmd_kick(char *source, char *chan, char *user, char *buf); -void ultimate3_cmd_notice_ops(char *source, char *dest, char *buf); -void ultimate3_cmd_notice(char *source, char *dest, char *buf); -void ultimate3_cmd_notice2(char *source, char *dest, char *msg); -void ultimate3_cmd_privmsg(char *source, char *dest, char *buf); -void ultimate3_cmd_privmsg2(char *source, char *dest, char *msg); -void ultimate3_cmd_serv_notice(char *source, char *dest, char *msg); -void ultimate3_cmd_serv_privmsg(char *source, char *dest, char *msg); -void ultimate3_cmd_bot_chan_mode(char *nick, char *chan); -void ultimate3_cmd_351(char *source); -void ultimate3_cmd_quit(char *source, char *buf); -void ultimate3_cmd_pong(char *servname, char *who); -void ultimate3_cmd_join(char *user, char *channel, time_t chantime); -void ultimate3_cmd_unsqline(char *user); -void ultimate3_cmd_invite(char *source, char *chan, char *nick); -void ultimate3_cmd_part(char *nick, char *chan, char *buf); -void ultimate3_cmd_391(char *source, char *timestr); -void ultimate3_cmd_250(char *buf); -void ultimate3_cmd_307(char *buf); -void ultimate3_cmd_311(char *buf); -void ultimate3_cmd_312(char *buf); -void ultimate3_cmd_317(char *buf); -void ultimate3_cmd_219(char *source, char *letter); -void ultimate3_cmd_401(char *source, char *who); -void ultimate3_cmd_318(char *source, char *who); -void ultimate3_cmd_242(char *buf); -void ultimate3_cmd_243(char *buf); -void ultimate3_cmd_211(char *buf); -void ultimate3_cmd_global(char *source, char *buf); -void ultimate3_cmd_global_legacy(char *source, char *fmt); -void ultimate3_cmd_sqline(char *mask, char *reason); -void ultimate3_cmd_squit(char *servname, char *message); -void ultimate3_cmd_svso(char *source, char *nick, char *flag); -void ultimate3_cmd_chg_nick(char *oldnick, char *newnick); -void ultimate3_cmd_svsnick(char *source, char *guest, time_t when); -void ultimate3_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void ultimate3_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void ultimate3_cmd_svskill(const char *source, const char *user, const char *buf); +void ultimate3_cmd_svsmode(User * u, int ac, const char **av); +void ultimate3_cmd_372(const char *source, const char *msg); +void ultimate3_cmd_372_error(const char *source); +void ultimate3_cmd_375(const char *source); +void ultimate3_cmd_376(const char *source); +void ultimate3_cmd_nick(const char *nick, const char *name, const char *modes); +void ultimate3_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ultimate3_cmd_mode(const char *source, const char *dest, const char *buf); +void ultimate3_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void ultimate3_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void ultimate3_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void ultimate3_cmd_notice(const char *source, const char *dest, const char *buf); +void ultimate3_cmd_notice2(const char *source, const char *dest, const char *msg); +void ultimate3_cmd_privmsg(const char *source, const char *dest, const char *buf); +void ultimate3_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void ultimate3_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void ultimate3_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void ultimate3_cmd_bot_chan_mode(const char *nick, const char *chan); +void ultimate3_cmd_351(const char *source); +void ultimate3_cmd_quit(const char *source, const char *buf); +void ultimate3_cmd_pong(const char *servname, const char *who); +void ultimate3_cmd_join(const char *user, const char *channel, time_t chantime); +void ultimate3_cmd_unsqline(const char *user); +void ultimate3_cmd_invite(const char *source, const char *chan, const char *nick); +void ultimate3_cmd_part(const char *nick, const char *chan, const char *buf); +void ultimate3_cmd_391(const char *source, const char *timestr); +void ultimate3_cmd_250(const char *buf); +void ultimate3_cmd_307(const char *buf); +void ultimate3_cmd_311(const char *buf); +void ultimate3_cmd_312(const char *buf); +void ultimate3_cmd_317(const char *buf); +void ultimate3_cmd_219(const char *source, const char *letter); +void ultimate3_cmd_401(const char *source, const char *who); +void ultimate3_cmd_318(const char *source, const char *who); +void ultimate3_cmd_242(const char *buf); +void ultimate3_cmd_243(const char *buf); +void ultimate3_cmd_211(const char *buf); +void ultimate3_cmd_global(const char *source, const char *buf); +void ultimate3_cmd_global_legacy(const char *source, const char *fmt); +void ultimate3_cmd_sqline(const char *mask, const char *reason); +void ultimate3_cmd_squit(const char *servname, const char *message); +void ultimate3_cmd_svso(const char *source, const char *nick, const char *flag); +void ultimate3_cmd_chg_nick(const char *oldnick, const char *newnick); +void ultimate3_cmd_svsnick(const char *source, const char *guest, time_t when); +void ultimate3_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void ultimate3_cmd_connect(int servernum); -void ultimate3_cmd_svshold(char *nick); -void ultimate3_cmd_release_svshold(char *nick); -void ultimate3_cmd_unsgline(char *mask); -void ultimate3_cmd_unszline(char *mask); -void ultimate3_cmd_szline(char *mask, char *reason, char *whom); -void ultimate3_cmd_sgline(char *mask, char *reason); -void ultimate3_cmd_unban(char *name, char *nick); -void ultimate3_cmd_svsmode_chan(char *name, char *mode, char *nick); -void ultimate3_cmd_svid_umode(char *nick, time_t ts); +void ultimate3_cmd_svshold(const char *nick); +void ultimate3_cmd_release_svshold(const char *nick); +void ultimate3_cmd_unsgline(const char *mask); +void ultimate3_cmd_unszline(const char *mask); +void ultimate3_cmd_szline(const char *mask, const char *reason, const char *whom); +void ultimate3_cmd_sgline(const char *mask, const char *reason); +void ultimate3_cmd_unban(const char *name, const char *nick); +void ultimate3_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void ultimate3_cmd_svid_umode(const char *nick, time_t ts); void ultimate3_cmd_nc_change(User * u); -void ultimate3_cmd_svid_umode2(User * u, char *ts); -void ultimate3_cmd_svid_umode3(User * u, char *ts); +void ultimate3_cmd_svid_umode2(User * u, const char *ts); +void ultimate3_cmd_svid_umode3(User * u, const char *ts); void ultimate3_cmd_eob(); -int ultimate3_flood_mode_check(char *value); -void ultimate3_cmd_jupe(char *jserver, char *who, char *reason); -int ultimate3_valid_nick(char *nick); -void ultimate3_cmd_ctcp(char *source, char *dest, char *buf); +int ultimate3_flood_mode_check(const char *value); +void ultimate3_cmd_jupe(const char *jserver, const char *who, const char *reason); +int ultimate3_valid_nick(const char *nick); +void ultimate3_cmd_ctcp(const char *source, const char *dest, const char *buf); class UltimateIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/unreal31.c b/src/protocol/unreal31.c index 4978017f1..3b3feb39c 100644 --- a/src/protocol/unreal31.c +++ b/src/protocol/unreal31.c @@ -365,10 +365,10 @@ CUMode myCumodes[128] = { }; -void unreal_set_umode(User * user, int ac, char **av) +void unreal_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -485,7 +485,7 @@ void moduleAddIRCDMsgs(void) { /* *INDENT-ON* */ /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; @@ -496,7 +496,7 @@ void UnrealIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void unreal_cmd_svsadmin(char *server, int set) +void unreal_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } @@ -506,8 +506,8 @@ void UnrealIRCdProto::cmd_remove_akill(const char *user, const char *host) send_cmd(NULL, "TKL - G %s %s %s", user, host, s_OperServ); } -void unreal_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void unreal_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -519,14 +519,14 @@ void unreal_cmd_vhost_off(User * u) notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar); } -void unreal_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "TKL + G %s %s %s %ld %ld :%s", user, host, who, (long int) time(NULL) + 86400 * 2, (long int) when, reason); } -void unreal_cmd_svskill(char *source, char *user, char *buf) +void unreal_cmd_svskill(const char *source, const char *user, const char *buf) { if (!buf) { return; @@ -539,36 +539,36 @@ void unreal_cmd_svskill(char *source, char *user, char *buf) send_cmd(source, "SVSKILL %s :%s", user, buf); } -void unreal_cmd_svsmode(User * u, int ac, char **av) +void unreal_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %s%s%s", u->nick, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); } -void unreal_cmd_372(char *source, char *msg) +void unreal_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void unreal_cmd_372_error(char *source) +void unreal_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void unreal_cmd_375(char *source) +void unreal_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void unreal_cmd_376(char *source) +void unreal_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void unreal_cmd_nick(char *nick, char *name, char *modes) +void unreal_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, @@ -577,14 +577,14 @@ void unreal_cmd_nick(char *nick, char *name, char *modes) unreal_cmd_sqline(nick, "Reserved for services"); } -void unreal_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void unreal_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, (long int) time(NULL), user, host, ServerName, modes, real); } -void unreal_cmd_mode(char *source, char *dest, char *buf) +void unreal_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -593,8 +593,8 @@ void unreal_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "MODE %s %s", dest, buf); } -void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s 0 %s * :%s", nick, @@ -602,7 +602,7 @@ void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, unreal_cmd_sqline(nick, "Reserved for services"); } -void unreal_cmd_kick(char *source, char *chan, char *user, char *buf) +void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -611,7 +611,7 @@ void unreal_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void unreal_cmd_notice_ops(char *source, char *dest, char *buf) +void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -621,7 +621,7 @@ void unreal_cmd_notice_ops(char *source, char *dest, char *buf) } -void unreal_cmd_notice(char *source, char *dest, char *buf) +void unreal_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -634,12 +634,12 @@ void unreal_cmd_notice(char *source, char *dest, char *buf) } } -void unreal_cmd_notice2(char *source, char *dest, char *msg) +void unreal_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void unreal_cmd_privmsg(char *source, char *dest, char *buf) +void unreal_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -648,28 +648,28 @@ void unreal_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void unreal_cmd_privmsg2(char *source, char *dest, char *msg) +void unreal_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void unreal_cmd_serv_notice(char *source, char *dest, char *msg) +void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void unreal_cmd_serv_privmsg(char *source, char *dest, char *msg) +void unreal_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } -void unreal_cmd_bot_chan_mode(char *nick, char *chan) +void unreal_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", ircd->botchanumode, nick, nick); } -void unreal_cmd_351(char *source) +void unreal_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, @@ -677,7 +677,7 @@ void unreal_cmd_351(char *source) } /* QUIT */ -void unreal_cmd_quit(char *source, char *buf) +void unreal_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -697,20 +697,20 @@ void unreal_cmd_protoctl() } /* PASS */ -void unreal_cmd_pass(char *pass) +void unreal_cmd_pass(const char *pass) { send_cmd(NULL, "PASS :%s", pass); } /* SERVER name hop descript */ /* Unreal 3.2 actually sends some info about itself in the descript area */ -void unreal_cmd_server(char *servname, int hop, char *descript) +void unreal_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } /* PONG */ -void unreal_cmd_pong(char *servname, char *who) +void unreal_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -718,13 +718,13 @@ void unreal_cmd_pong(char *servname, char *who) /* JOIN */ /* Althought Unreal 3.2 does not need the timestamp others do so we get it in the common function call */ -void unreal_cmd_join(char *user, char *channel, time_t chantime) +void unreal_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "JOIN %s", channel); } /* UNSQLINE */ -void unreal_cmd_unsqline(char *user) +void unreal_cmd_unsqline(const char *user) { if (!user) { return; @@ -733,7 +733,7 @@ void unreal_cmd_unsqline(char *user) } /* CHGHOST */ -void unreal_cmd_chghost(char *nick, char *vhost) +void unreal_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -742,7 +742,7 @@ void unreal_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void unreal_cmd_chgident(char *nick, char *vIdent) +void unreal_cmd_chgident(const char *nick, const char *vIdent) { if (!nick || !vIdent) { return; @@ -751,7 +751,7 @@ void unreal_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void unreal_cmd_invite(char *source, char *chan, char *nick) +void unreal_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -761,7 +761,7 @@ void unreal_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void unreal_cmd_part(char *nick, char *chan, char *buf) +void unreal_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -775,7 +775,7 @@ void unreal_cmd_part(char *nick, char *chan, char *buf) } /* 391 */ -void unreal_cmd_391(char *source, char *timestr) +void unreal_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -784,7 +784,7 @@ void unreal_cmd_391(char *source, char *timestr) } /* 250 */ -void unreal_cmd_250(char *buf) +void unreal_cmd_250(const char *buf) { if (!buf) { return; @@ -794,7 +794,7 @@ void unreal_cmd_250(char *buf) } /* 307 */ -void unreal_cmd_307(char *buf) +void unreal_cmd_307(const char *buf) { if (!buf) { return; @@ -804,7 +804,7 @@ void unreal_cmd_307(char *buf) } /* 311 */ -void unreal_cmd_311(char *buf) +void unreal_cmd_311(const char *buf) { if (!buf) { return; @@ -814,7 +814,7 @@ void unreal_cmd_311(char *buf) } /* 312 */ -void unreal_cmd_312(char *buf) +void unreal_cmd_312(const char *buf) { if (!buf) { return; @@ -824,7 +824,7 @@ void unreal_cmd_312(char *buf) } /* 317 */ -void unreal_cmd_317(char *buf) +void unreal_cmd_317(const char *buf) { if (!buf) { return; @@ -834,7 +834,7 @@ void unreal_cmd_317(char *buf) } /* 219 */ -void unreal_cmd_219(char *source, char *letter) +void unreal_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -849,7 +849,7 @@ void unreal_cmd_219(char *source, char *letter) } /* 401 */ -void unreal_cmd_401(char *source, char *who) +void unreal_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -858,7 +858,7 @@ void unreal_cmd_401(char *source, char *who) } /* 318 */ -void unreal_cmd_318(char *source, char *who) +void unreal_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -868,7 +868,7 @@ void unreal_cmd_318(char *source, char *who) } /* 242 */ -void unreal_cmd_242(char *buf) +void unreal_cmd_242(const char *buf) { if (!buf) { return; @@ -878,7 +878,7 @@ void unreal_cmd_242(char *buf) } /* 243 */ -void unreal_cmd_243(char *buf) +void unreal_cmd_243(const char *buf) { if (!buf) { return; @@ -888,7 +888,7 @@ void unreal_cmd_243(char *buf) } /* 211 */ -void unreal_cmd_211(char *buf) +void unreal_cmd_211(const char *buf) { if (!buf) { return; @@ -898,7 +898,7 @@ void unreal_cmd_211(char *buf) } /* GLOBOPS */ -void unreal_cmd_global(char *source, char *buf) +void unreal_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -908,7 +908,7 @@ void unreal_cmd_global(char *source, char *buf) } /* SQLINE */ -void unreal_cmd_sqline(char *mask, char *reason) +void unreal_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -918,7 +918,7 @@ void unreal_cmd_sqline(char *mask, char *reason) } /* SQUIT */ -void unreal_cmd_squit(char *servname, char *message) +void unreal_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -928,7 +928,7 @@ void unreal_cmd_squit(char *servname, char *message) } /* SVSO */ -void unreal_cmd_svso(char *source, char *nick, char *flag) +void unreal_cmd_svso(const char *source, const char *nick, const char *flag) { if (!source || !nick || !flag) { return; @@ -938,7 +938,7 @@ void unreal_cmd_svso(char *source, char *nick, char *flag) } /* NICK <newnick> */ -void unreal_cmd_chg_nick(char *oldnick, char *newnick) +void unreal_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -948,7 +948,7 @@ void unreal_cmd_chg_nick(char *oldnick, char *newnick) } /* SVSNICK */ -void unreal_cmd_svsnick(char *source, char *guest, time_t when) +void unreal_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -958,7 +958,7 @@ void unreal_cmd_svsnick(char *source, char *guest, time_t when) /* Functions that use serval cmd functions */ -void unreal_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void unreal_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (!nick) { return; @@ -989,7 +989,7 @@ void unreal_cmd_connect(int servernum) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -997,7 +997,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1006,7 +1006,7 @@ int anope_event_436(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1015,7 +1015,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -1023,7 +1023,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1031,7 +1031,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1040,7 +1040,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1054,7 +1054,7 @@ int anope_event_mode(char *source, int ac, char **av) } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1063,7 +1063,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1072,7 +1072,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1080,7 +1080,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1090,7 +1090,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -1105,11 +1105,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -1124,11 +1124,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[1]); + u->SetRealname(av[1]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -1143,10 +1143,10 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -1161,11 +1161,11 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -1180,12 +1180,12 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -1215,7 +1215,7 @@ int anope_event_nick(char *source, int ac, char **av) } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -1230,12 +1230,12 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1245,7 +1245,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1253,7 +1253,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1261,7 +1261,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1270,32 +1270,32 @@ int anope_event_whois(char *source, int ac, char **av) } /* SVSHOLD - set */ -void unreal_cmd_svshold(char *nick) +void unreal_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void unreal_cmd_release_svshold(char *nick) +void unreal_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* UNSGLINE */ -void unreal_cmd_unsgline(char *mask) +void unreal_cmd_unsgline(const char *mask) { /* Not Supported by this IRCD */ } /* UNSZLINE */ -void unreal_cmd_unszline(char *mask) +void unreal_cmd_unszline(const char *mask) { send_cmd(NULL, "%s - Z * %s %s", send_token("TKL", "BD"), mask, s_OperServ); } /* SZLINE */ -void unreal_cmd_szline(char *mask, char *reason, char *whom) +void unreal_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "%s + Z * %s %s %ld %ld :%s", send_token("TKL", "BD"), mask, whom, (long int) time(NULL) + 86400 * 2, @@ -1303,19 +1303,19 @@ void unreal_cmd_szline(char *mask, char *reason, char *whom) } /* SGLINE */ -void unreal_cmd_sgline(char *mask, char *reason) +void unreal_cmd_sgline(const char *mask, const char *reason) { /* Not Supported by this IRCD */ } -void unreal_cmd_unban(char *name, char *nick) +void unreal_cmd_unban(const char *name, const char *nick) { /* Not Supported by this IRCD */ } /* SVSMODE channel modes */ -void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick) +void unreal_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { /* Not Supported by this IRCD */ } @@ -1323,7 +1323,7 @@ void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ -void unreal_cmd_svid_umode(char *nick, time_t ts) +void unreal_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s +d 1", nick); } @@ -1336,7 +1336,7 @@ void unreal_cmd_nc_change(User * u) } /* SVSMODE +r */ -void unreal_cmd_svid_umode2(User * u, char *ts) +void unreal_cmd_svid_umode2(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1345,7 +1345,7 @@ void unreal_cmd_svid_umode2(User * u, char *ts) } } -void unreal_cmd_svid_umode3(User * u, char *ts) +void unreal_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } @@ -1356,7 +1356,7 @@ void unreal_cmd_svid_umode3(User * u, char *ts) parv[2] - channel(s) to join parv[3] - (optional) channel key(s) */ -void unreal_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void unreal_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { if (param) { send_cmd(source, "SVSJOIN %s %s :%s", nick, chan, param); @@ -1370,12 +1370,12 @@ void unreal_cmd_svsjoin(char *source, char *nick, char *chan, char *param) parv[1] - nick to make part parv[2] - channel(s) to part */ -void unreal_cmd_svspart(char *source, char *nick, char *chan) +void unreal_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SVSPART %s :%s", nick, chan); } -void unreal_cmd_swhois(char *source, char *who, char *mask) +void unreal_cmd_swhois(const char *source, const char *who, const char *mask) { /* Can anyone tell me if 3.1 has this? */ } @@ -1386,22 +1386,22 @@ void unreal_cmd_eob() } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int unreal_flood_mode_check(char *value) +int unreal_flood_mode_check(const char *value) { char *dp, *end; @@ -1415,7 +1415,7 @@ int unreal_flood_mode_check(char *value) } } -void unreal_cmd_jupe(char *jserver, char *who, char *reason) +void unreal_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1429,7 +1429,7 @@ void unreal_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void unreal_cmd_global_legacy(char *source, char *fmt) +void unreal_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "%s :%s", send_token("GLOBOPS", "]"), fmt); @@ -1439,7 +1439,7 @@ void unreal_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int unreal_valid_nick(char *nick) +int unreal_valid_nick(const char *nick) { if (!stricmp("ircd", nick)) { return 0; @@ -1450,14 +1450,14 @@ int unreal_valid_nick(char *nick) return 1; } -int unreal_valid_chan(char *chan) { +int unreal_valid_chan(const char *chan) { if (strchr(chan, ':')) { return 0; } return 1; } -void unreal_cmd_ctcp(char *source, char *dest, char *buf) +void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/unreal31.h b/src/protocol/unreal31.h index e35d3376b..46c5f4b73 100644 --- a/src/protocol/unreal31.h +++ b/src/protocol/unreal31.h @@ -51,74 +51,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void unreal_set_umode(User * user, int ac, char **av); -void unreal_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void unreal_set_umode(User * user, int ac, const char **av); +void unreal_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void unreal_cmd_vhost_off(User * u); -void unreal_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void unreal_cmd_svskill(char *source, char *user, char *buf); -void unreal_cmd_svsmode(User * u, int ac, char **av); -void unreal_cmd_372(char *source, char *msg); -void unreal_cmd_372_error(char *source); -void unreal_cmd_375(char *source); -void unreal_cmd_376(char *source); -void unreal_cmd_nick(char *nick, char *name, char *modes); -void unreal_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void unreal_cmd_mode(char *source, char *dest, char *buf); -void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void unreal_cmd_kick(char *source, char *chan, char *user, char *buf); -void unreal_cmd_notice_ops(char *source, char *dest, char *buf); -void unreal_cmd_notice(char *source, char *dest, char *buf); -void unreal_cmd_notice2(char *source, char *dest, char *msg); -void unreal_cmd_privmsg(char *source, char *dest, char *buf); -void unreal_cmd_privmsg2(char *source, char *dest, char *msg); -void unreal_cmd_serv_notice(char *source, char *dest, char *msg); -void unreal_cmd_serv_privmsg(char *source, char *dest, char *msg); -void unreal_cmd_bot_chan_mode(char *nick, char *chan); -void unreal_cmd_351(char *source); -void unreal_cmd_quit(char *source, char *buf); -void unreal_cmd_pong(char *servname, char *who); -void unreal_cmd_join(char *user, char *channel, time_t chantime); -void unreal_cmd_unsqline(char *user); -void unreal_cmd_invite(char *source, char *chan, char *nick); -void unreal_cmd_part(char *nick, char *chan, char *buf); -void unreal_cmd_391(char *source, char *timestr); -void unreal_cmd_250(char *buf); -void unreal_cmd_307(char *buf); -void unreal_cmd_311(char *buf); -void unreal_cmd_312(char *buf); -void unreal_cmd_317(char *buf); -void unreal_cmd_219(char *source, char *letter); -void unreal_cmd_401(char *source, char *who); -void unreal_cmd_318(char *source, char *who); -void unreal_cmd_242(char *buf); -void unreal_cmd_243(char *buf); -void unreal_cmd_211(char *buf); -void unreal_cmd_global(char *source, char *buf); -void unreal_cmd_global_legacy(char *source, char *fmt); -void unreal_cmd_sqline(char *mask, char *reason); -void unreal_cmd_squit(char *servname, char *message); -void unreal_cmd_svso(char *source, char *nick, char *flag); -void unreal_cmd_chg_nick(char *oldnick, char *newnick); -void unreal_cmd_svsnick(char *source, char *guest, time_t when); -void unreal_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void unreal_cmd_svskill(const char *source, const char *user, const char *buf); +void unreal_cmd_svsmode(User * u, int ac, const char **av); +void unreal_cmd_372(const char *source, const char *msg); +void unreal_cmd_372_error(const char *source); +void unreal_cmd_375(const char *source); +void unreal_cmd_376(const char *source); +void unreal_cmd_nick(const char *nick, const char *name, const char *modes); +void unreal_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void unreal_cmd_mode(const char *source, const char *dest, const char *buf); +void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void unreal_cmd_notice(const char *source, const char *dest, const char *buf); +void unreal_cmd_notice2(const char *source, const char *dest, const char *msg); +void unreal_cmd_privmsg(const char *source, const char *dest, const char *buf); +void unreal_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void unreal_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void unreal_cmd_bot_chan_mode(const char *nick, const char *chan); +void unreal_cmd_351(const char *source); +void unreal_cmd_quit(const char *source, const char *buf); +void unreal_cmd_pong(const char *servname, const char *who); +void unreal_cmd_join(const char *user, const char *channel, time_t chantime); +void unreal_cmd_unsqline(const char *user); +void unreal_cmd_invite(const char *source, const char *chan, const char *nick); +void unreal_cmd_part(const char *nick, const char *chan, const char *buf); +void unreal_cmd_391(const char *source, const char *timestr); +void unreal_cmd_250(const char *buf); +void unreal_cmd_307(const char *buf); +void unreal_cmd_311(const char *buf); +void unreal_cmd_312(const char *buf); +void unreal_cmd_317(const char *buf); +void unreal_cmd_219(const char *source, const char *letter); +void unreal_cmd_401(const char *source, const char *who); +void unreal_cmd_318(const char *source, const char *who); +void unreal_cmd_242(const char *buf); +void unreal_cmd_243(const char *buf); +void unreal_cmd_211(const char *buf); +void unreal_cmd_global(const char *source, const char *buf); +void unreal_cmd_global_legacy(const char *source, const char *fmt); +void unreal_cmd_sqline(const char *mask, const char *reason); +void unreal_cmd_squit(const char *servname, const char *message); +void unreal_cmd_svso(const char *source, const char *nick, const char *flag); +void unreal_cmd_chg_nick(const char *oldnick, const char *newnick); +void unreal_cmd_svsnick(const char *source, const char *guest, time_t when); +void unreal_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void unreal_cmd_connect(int servernum); -void unreal_cmd_svshold(char *nick); -void unreal_cmd_release_svshold(char *nick); -void unreal_cmd_unsgline(char *mask); -void unreal_cmd_unszline(char *mask); -void unreal_cmd_szline(char *mask, char *reason, char *whom); -void unreal_cmd_sgline(char *mask, char *reason); -void unreal_cmd_unban(char *name, char *nick); -void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick); -void unreal_cmd_svid_umode(char *nick, time_t ts); +void unreal_cmd_svshold(const char *nick); +void unreal_cmd_release_svshold(const char *nick); +void unreal_cmd_unsgline(const char *mask); +void unreal_cmd_unszline(const char *mask); +void unreal_cmd_szline(const char *mask, const char *reason, const char *whom); +void unreal_cmd_sgline(const char *mask, const char *reason); +void unreal_cmd_unban(const char *name, const char *nick); +void unreal_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void unreal_cmd_svid_umode(const char *nick, time_t ts); void unreal_cmd_nc_change(User * u); -void unreal_cmd_svid_umode2(User * u, char *ts); -void unreal_cmd_svid_umode3(User * u, char *ts); +void unreal_cmd_svid_umode2(User * u, const char *ts); +void unreal_cmd_svid_umode3(User * u, const char *ts); void unreal_cmd_eob(); -int unreal_flood_mode_check(char *value); -void unreal_cmd_jupe(char *jserver, char *who, char *reason); -int unreal_valid_nick(char *nick); -void unreal_cmd_ctcp(char *source, char *dest, char *buf); +int unreal_flood_mode_check(const char *value); +void unreal_cmd_jupe(const char *jserver, const char *who, const char *reason); +int unreal_valid_nick(const char *nick); +void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf); class UnrealIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 8411cd2c2..cababc270 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -414,10 +414,10 @@ CUMode myCumodes[128] = { }; -void unreal_set_umode(User * user, int ac, char **av) +void unreal_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -495,7 +495,7 @@ void unreal_set_umode(User * user, int ac, char **av) /* Event: PROTOCTL */ -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; @@ -507,7 +507,7 @@ void UnrealIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "%s %s %s", send_token("SVSNOOP", "f"), server, set ? "+" : "-"); } -void unreal_cmd_svsadmin(char *server, int set) +void unreal_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } @@ -517,8 +517,8 @@ void UnrealIRCdProto::cmd_remove_akill(const char *user, const char *host) send_cmd(NULL, "%s - G %s %s %s", send_token("TKL", "BD"), user, host, s_OperServ); } -void unreal_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void unreal_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "%s %s %s %lu :%s", send_token("TOPIC", ")"), chan, whosetit, (unsigned long int) when, topic); @@ -537,8 +537,8 @@ void unreal_cmd_vhost_off(User * u) myIrcd->vhostchar); } -void unreal_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "%s + G %s %s %s %ld %ld :%s", send_token("TKL", "BD"), user, host, who, (long int) time(NULL) + 86400 * 2, @@ -551,7 +551,7 @@ void unreal_cmd_akill(char *user, char *host, char *who, time_t when, ** parv[1] = client ** parv[2] = kill message */ -void unreal_cmd_svskill(char *source, char *user, char *buf) +void unreal_cmd_svskill(const char *source, const char *user, const char *buf) { if (!source || !user || !buf) { return; @@ -566,7 +566,7 @@ void unreal_cmd_svskill(char *source, char *user, char *buf) * parv[2] - modes to change * parv[3] - Service Stamp (if mode == d) */ -void unreal_cmd_svsmode(User * u, int ac, char **av) +void unreal_cmd_svsmode(User * u, int ac, const char **av) { if (ac >= 1) { if (!u || !av[0]) { @@ -585,29 +585,29 @@ void unreal_cmd_svsmode(User * u, int ac, char **av) } /* 372 */ -void unreal_cmd_372(char *source, char *msg) +void unreal_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void unreal_cmd_372_error(char *source) +void unreal_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void unreal_cmd_375(char *source) +void unreal_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void unreal_cmd_376(char *source) +void unreal_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } -void unreal_cmd_nick(char *nick, char *name, char *modes) +void unreal_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s %s%s :%s", @@ -617,8 +617,8 @@ void unreal_cmd_nick(char *nick, char *name, char *modes) unreal_cmd_sqline(nick, "Reserved for services"); } -void unreal_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void unreal_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s %s%s :%s", send_token("NICK", "&"), nick, (long int) time(NULL), user, @@ -626,7 +626,7 @@ void unreal_cmd_guest_nick(char *nick, char *user, char *host, char *real, real); } -void unreal_cmd_mode(char *source, char *dest, char *buf) +void unreal_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -635,8 +635,8 @@ void unreal_cmd_mode(char *source, char *dest, char *buf) send_cmd(source, "%s %s %s", send_token("MODE", "G"), dest, buf); } -void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "%s %s 1 %ld %s %s %s 0 %s %s%s :%s", @@ -646,7 +646,7 @@ void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, unreal_cmd_sqline(nick, "Reserved for services"); } -void unreal_cmd_kick(char *source, char *chan, char *user, char *buf) +void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "%s %s %s :%s", send_token("KICK", "H"), chan, @@ -656,7 +656,7 @@ void unreal_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void unreal_cmd_notice_ops(char *source, char *dest, char *buf) +void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -666,7 +666,7 @@ void unreal_cmd_notice_ops(char *source, char *dest, char *buf) } -void unreal_cmd_notice(char *source, char *dest, char *buf) +void unreal_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -680,12 +680,12 @@ void unreal_cmd_notice(char *source, char *dest, char *buf) } } -void unreal_cmd_notice2(char *source, char *dest, char *msg) +void unreal_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "%s %s :%s", send_token("NOTICE", "B"), dest, msg); } -void unreal_cmd_privmsg(char *source, char *dest, char *buf) +void unreal_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -694,28 +694,28 @@ void unreal_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "%s %s :%s", send_token("PRIVMSG", "!"), dest, buf); } -void unreal_cmd_privmsg2(char *source, char *dest, char *msg) +void unreal_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "%s %s :%s", send_token("PRIVMSG", "!"), dest, msg); } -void unreal_cmd_serv_notice(char *source, char *dest, char *msg) +void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "%s $%s :%s", send_token("NOTICE", "B"), dest, msg); } -void unreal_cmd_serv_privmsg(char *source, char *dest, char *msg) +void unreal_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "%s $%s :%s", send_token("PRIVMSG", "!"), dest, msg); } -void unreal_cmd_bot_chan_mode(char *nick, char *chan) +void unreal_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s %s", myIrcd->botchanumode, nick, nick); } -void unreal_cmd_351(char *source) +void unreal_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, myIrcd->name, @@ -723,7 +723,7 @@ void unreal_cmd_351(char *source) } /* QUIT */ -void unreal_cmd_quit(char *source, char *buf) +void unreal_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "%s :%s", send_token("QUIT", ","), buf); @@ -769,14 +769,14 @@ void unreal_cmd_capab() } /* PASS */ -void unreal_cmd_pass(char *pass) +void unreal_cmd_pass(const char *pass) { send_cmd(NULL, "PASS :%s", pass); } /* SERVER name hop descript */ /* Unreal 3.2 actually sends some info about itself in the descript area */ -void unreal_cmd_server(char *servname, int hop, char *descript) +void unreal_cmd_server(const char *servname, int hop, const char *descript) { if (Numeric) { send_cmd(NULL, "SERVER %s %d :U0-*-%s %s", servname, hop, Numeric, @@ -787,13 +787,13 @@ void unreal_cmd_server(char *servname, int hop, char *descript) } /* PONG */ -void unreal_cmd_pong(char *servname, char *who) +void unreal_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "%s %s", send_token("PONG", "9"), who); } /* JOIN */ -void unreal_cmd_join(char *user, char *channel, time_t chantime) +void unreal_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(ServerName, "%s !%s %s :%s", send_token("SJOIN", "~"), base64enc((long int) chantime), @@ -805,7 +805,7 @@ void unreal_cmd_join(char *user, char *channel, time_t chantime) ** parv[0] = sender ** parv[1] = nickmask */ -void unreal_cmd_unsqline(char *user) +void unreal_cmd_unsqline(const char *user) { if (!user) { return; @@ -814,7 +814,7 @@ void unreal_cmd_unsqline(char *user) } /* CHGHOST */ -void unreal_cmd_chghost(char *nick, char *vhost) +void unreal_cmd_chghost(const char *nick, const char *vhost) { if (!nick || !vhost) { return; @@ -824,7 +824,7 @@ void unreal_cmd_chghost(char *nick, char *vhost) } /* CHGIDENT */ -void unreal_cmd_chgident(char *nick, char *vIdent) +void unreal_cmd_chgident(const char *nick, const char *vIdent) { if (!nick || !vIdent) { return; @@ -834,7 +834,7 @@ void unreal_cmd_chgident(char *nick, char *vIdent) } /* INVITE */ -void unreal_cmd_invite(char *source, char *chan, char *nick) +void unreal_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -844,7 +844,7 @@ void unreal_cmd_invite(char *source, char *chan, char *nick) } /* PART */ -void unreal_cmd_part(char *nick, char *chan, char *buf) +void unreal_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -858,7 +858,7 @@ void unreal_cmd_part(char *nick, char *chan, char *buf) } /* 391 RPL_TIME ":%s 391 %s %s :%s" */ -void unreal_cmd_391(char *source, char *timestr) +void unreal_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -867,7 +867,7 @@ void unreal_cmd_391(char *source, char *timestr) } /* 250 */ -void unreal_cmd_250(char *buf) +void unreal_cmd_250(const char *buf) { if (!buf) { return; @@ -877,7 +877,7 @@ void unreal_cmd_250(char *buf) } /* 307 */ -void unreal_cmd_307(char *buf) +void unreal_cmd_307(const char *buf) { if (!buf) { return; @@ -887,7 +887,7 @@ void unreal_cmd_307(char *buf) } /* 311 */ -void unreal_cmd_311(char *buf) +void unreal_cmd_311(const char *buf) { if (!buf) { return; @@ -897,7 +897,7 @@ void unreal_cmd_311(char *buf) } /* 312 */ -void unreal_cmd_312(char *buf) +void unreal_cmd_312(const char *buf) { if (!buf) { return; @@ -907,7 +907,7 @@ void unreal_cmd_312(char *buf) } /* 317 */ -void unreal_cmd_317(char *buf) +void unreal_cmd_317(const char *buf) { if (!buf) { return; @@ -917,7 +917,7 @@ void unreal_cmd_317(char *buf) } /* 219 */ -void unreal_cmd_219(char *source, char *letter) +void unreal_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -932,7 +932,7 @@ void unreal_cmd_219(char *source, char *letter) } /* 401 */ -void unreal_cmd_401(char *source, char *who) +void unreal_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -941,7 +941,7 @@ void unreal_cmd_401(char *source, char *who) } /* 318 */ -void unreal_cmd_318(char *source, char *who) +void unreal_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -951,7 +951,7 @@ void unreal_cmd_318(char *source, char *who) } /* 242 */ -void unreal_cmd_242(char *buf) +void unreal_cmd_242(const char *buf) { if (!buf) { return; @@ -961,7 +961,7 @@ void unreal_cmd_242(char *buf) } /* 243 */ -void unreal_cmd_243(char *buf) +void unreal_cmd_243(const char *buf) { if (!buf) { return; @@ -971,7 +971,7 @@ void unreal_cmd_243(char *buf) } /* 211 */ -void unreal_cmd_211(char *buf) +void unreal_cmd_211(const char *buf) { if (!buf) { return; @@ -981,7 +981,7 @@ void unreal_cmd_211(char *buf) } /* GLOBOPS */ -void unreal_cmd_global(char *source, char *buf) +void unreal_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -992,7 +992,7 @@ void unreal_cmd_global(char *source, char *buf) } /* GLOBOPS - to handle old WALLOPS */ -void unreal_cmd_global_legacy(char *source, char *fmt) +void unreal_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "%s :%s", send_token("GLOBOPS", "]"), fmt); @@ -1007,7 +1007,7 @@ void unreal_cmd_global_legacy(char *source, char *fmt) ** - Unreal will translate this to TKL for us ** */ -void unreal_cmd_sqline(char *mask, char *reason) +void unreal_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -1017,7 +1017,7 @@ void unreal_cmd_sqline(char *mask, char *reason) } /* SQUIT */ -void unreal_cmd_squit(char *servname, char *message) +void unreal_cmd_squit(const char *servname, const char *message) { if (!servname || !message) { return; @@ -1033,7 +1033,7 @@ void unreal_cmd_squit(char *servname, char *message) ** parv[1] = nick ** parv[2] = options */ -void unreal_cmd_svso(char *source, char *nick, char *flag) +void unreal_cmd_svso(const char *source, const char *nick, const char *flag) { if (!source || !nick || !flag) { return; @@ -1043,7 +1043,7 @@ void unreal_cmd_svso(char *source, char *nick, char *flag) } /* NICK <newnick> */ -void unreal_cmd_chg_nick(char *oldnick, char *newnick) +void unreal_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1060,7 +1060,7 @@ void unreal_cmd_chg_nick(char *oldnick, char *newnick) ** parv[2] = new nickname ** parv[3] = timestamp */ -void unreal_cmd_svsnick(char *source, char *guest, time_t when) +void unreal_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1071,7 +1071,7 @@ void unreal_cmd_svsnick(char *source, char *guest, time_t when) /* Functions that use serval cmd functions */ -void unreal_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void unreal_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (!nick) { return; @@ -1107,7 +1107,7 @@ void unreal_cmd_connect(int servernum) /* Events */ -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1115,7 +1115,7 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void unreal_cmd_netinfo(int ac, char **av) +void unreal_cmd_netinfo(int ac, const char **av) { send_cmd(NULL, "%s %ld %ld %d %s 0 0 0 :%s", send_token("NETINFO", "AO"), (long int) maxusercnt, @@ -1132,7 +1132,7 @@ void unreal_cmd_netinfo(int ac, char **av) * argv[6] = free(**) * argv[7] = ircnet */ -int anope_event_netinfo(char *source, int ac, char **av) +int anope_event_netinfo(const char *source, int ac, const char **av) { unreal_cmd_netinfo(ac, av); return MOD_CONT; @@ -1153,12 +1153,12 @@ int anope_event_netinfo(char *source, int ac, char **av) * parv[10]: regex * */ -int anope_event_tkl(char *source, int ac, char **av) +int anope_event_tkl(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_eos(char *source, int ac, char **av) +int anope_event_eos(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -1172,7 +1172,7 @@ int anope_event_eos(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1186,7 +1186,7 @@ int anope_event_436(char *source, int ac, char **av) ** parv[0] = sender prefix ** parv[1] = away message */ -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1207,7 +1207,7 @@ int anope_event_away(char *source, int ac, char **av) ** parv[3] = topic time ** parv[4] = topic text */ -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -1215,7 +1215,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1223,7 +1223,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1231,13 +1231,13 @@ int anope_event_quit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1256,7 +1256,7 @@ int anope_event_mode(char *source, int ac, char **av) parv[0] - sender parv[1] - modes to change */ -int anope_event_umode2(char *source, int ac, char **av) +int anope_event_umode2(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1265,7 +1265,7 @@ int anope_event_umode2(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1274,7 +1274,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1283,7 +1283,7 @@ int anope_event_kick(char *source, int ac, char **av) } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1291,7 +1291,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1301,7 +1301,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -1316,11 +1316,11 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -1335,11 +1335,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[1]); + u->SetRealname(av[1]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -1354,10 +1354,10 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -1372,11 +1372,11 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -1391,7 +1391,7 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } @@ -1426,7 +1426,7 @@ int anope_event_sethost(char *source, int ac, char **av) char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid) */ -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -1466,7 +1466,7 @@ int anope_event_nick(char *source, int ac, char **av) } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -1481,12 +1481,12 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } /* EVENT: SERVER */ -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { char *desc; char *vl; @@ -1508,7 +1508,7 @@ int anope_event_server(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1516,7 +1516,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1524,7 +1524,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1533,7 +1533,7 @@ int anope_event_whois(char *source, int ac, char **av) } /* SVSHOLD - set */ -void unreal_cmd_svshold(char *nick) +void unreal_cmd_svshold(const char *nick) { send_cmd(NULL, "%s + Q H %s %s %ld %ld :%s", send_token("TKL", "BD"), nick, ServerName, (long int) time(NULL) + NSReleaseTimeout, @@ -1541,7 +1541,7 @@ void unreal_cmd_svshold(char *nick) } /* SVSHOLD - release */ -void unreal_cmd_release_svshold(char *nick) +void unreal_cmd_release_svshold(const char *nick) { send_cmd(NULL, "%s - Q * %s %s", send_token("TKL", "BD"), nick, ServerName); @@ -1551,20 +1551,20 @@ void unreal_cmd_release_svshold(char *nick) /* * SVSNLINE - :realname mask */ -void unreal_cmd_unsgline(char *mask) +void unreal_cmd_unsgline(const char *mask) { send_cmd(NULL, "%s - :%s", send_token("SVSNLINE", "BR"), mask); } /* UNSZLINE */ -void unreal_cmd_unszline(char *mask) +void unreal_cmd_unszline(const char *mask) { send_cmd(NULL, "%s - Z * %s %s", send_token("TKL", "BD"), mask, s_OperServ); } /* SZLINE */ -void unreal_cmd_szline(char *mask, char *reason, char *whom) +void unreal_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "%s + Z * %s %s %ld %ld :%s", send_token("TKL", "BD"), mask, whom, (long int) time(NULL) + 86400 * 2, @@ -1575,15 +1575,17 @@ void unreal_cmd_szline(char *mask, char *reason, char *whom) /* * SVSNLINE + reason_where_is_space :realname mask with spaces */ -void unreal_cmd_sgline(char *mask, char *reason) +void unreal_cmd_sgline(const char *mask, const char *reason) { - strnrepl(reason, BUFSIZE, " ", "_"); - send_cmd(NULL, "%s + %s :%s", send_token("SVSNLINE", "BR"), reason, + char edited_reason[BUFSIZE]; + strlcpy(edited_reason, reason, BUFSIZE); + strnrepl(edited_reason, BUFSIZE, " ", "_"); + send_cmd(NULL, "%s + %s :%s", send_token("SVSNLINE", "BR"), edited_reason, mask); } /* SVSMODE -b */ -void unreal_cmd_unban(char *name, char *nick) +void unreal_cmd_unban(const char *name, const char *nick) { unreal_cmd_svsmode_chan(name, "-b", nick); } @@ -1591,7 +1593,7 @@ void unreal_cmd_unban(char *name, char *nick) /* SVSMODE channel modes */ -void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick) +void unreal_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "%s %s %s %s", send_token("SVSMODE", "n"), @@ -1605,7 +1607,7 @@ void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ -void unreal_cmd_svid_umode(char *nick, time_t ts) +void unreal_cmd_svid_umode(const char *nick, time_t ts) { if (UseSVS2MODE) { send_cmd(ServerName, "%s %s +d 1", send_token("SVS2MODE", "v"), @@ -1624,7 +1626,7 @@ void unreal_cmd_nc_change(User * u) } /* SVSMODE +r */ -void unreal_cmd_svid_umode2(User * u, char *ts) +void unreal_cmd_svid_umode2(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1633,12 +1635,12 @@ void unreal_cmd_svid_umode2(User * u, char *ts) } } -void unreal_cmd_svid_umode3(User * u, char *ts) +void unreal_cmd_svid_umode3(User * u, const char *ts) { /* not used */ } -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (av[0]) { if (debug) { @@ -1651,12 +1653,12 @@ int anope_event_error(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_smo(char *source, int ac, char **av) +int anope_event_smo(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -1670,7 +1672,7 @@ int anope_event_smo(char *source, int ac, char **av) /* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken when coming from a none TOKEN'd server */ -void unreal_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void unreal_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { if (param) { send_cmd(source, "%s %s %s :%s", send_token("SVSJOIN", "BX"), nick, chan, param); @@ -1684,55 +1686,55 @@ void unreal_cmd_svsjoin(char *source, char *nick, char *chan, char *param) parv[1] - nick to make part parv[2] - channel(s) to part */ -void unreal_cmd_svspart(char *source, char *nick, char *chan) +void unreal_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "%s %s :%s", send_token("SVSPART", "BT"), nick, chan); } -int anope_event_globops(char *source, int ac, char **av) +int anope_event_globops(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_swhois(char *source, int ac, char **av) +int anope_event_swhois(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_credits(char *source, int ac, char **av) +int anope_event_credits(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_sdesc(char *source, int ac, char **av) +int anope_event_sdesc(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); if (s) { - s->desc = av[0]; + s->desc = (char *)av[0]; // XXX Unsafe cast -- CyberBotX } return MOD_CONT; } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; } -void unreal_cmd_swhois(char *source, char *who, char *mask) +void unreal_cmd_swhois(const char *source, const char *who, const char *mask) { send_cmd(source, "%s %s :%s", send_token("SWHOIS", "BA"), who, mask); } @@ -1747,7 +1749,7 @@ void unreal_cmd_eob() * parv[1] - target nick * parv[2] - parameters */ -void unreal_cmd_svswatch(char *sender, char *nick, char *parm) +void unreal_cmd_svswatch(const char *sender, const char *nick, const char *parm) { send_cmd(sender, "%s %s :%s", send_token("SVSWATCH", "Bw"), nick, parm); @@ -1755,7 +1757,7 @@ void unreal_cmd_svswatch(char *sender, char *nick, char *parm) /* check if +f mode is valid for the ircd */ /* borrowed part of the new check from channels.c in Unreal */ -int unreal_flood_mode_check(char *value) +int unreal_flood_mode_check(const char *value) { char *dp, *end; /* NEW +F */ @@ -1804,7 +1806,7 @@ int unreal_flood_mode_check(char *value) } } -void unreal_cmd_jupe(char *jserver, char *who, char *reason) +void unreal_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1821,7 +1823,7 @@ void unreal_cmd_jupe(char *jserver, char *who, char *reason) 1 = valid nick 0 = nick is in valid */ -int unreal_valid_nick(char *nick) +int unreal_valid_nick(const char *nick) { if (!stricmp("ircd", nick)) { return 0; @@ -1832,14 +1834,14 @@ int unreal_valid_nick(char *nick) return 1; } -int unreal_valid_chan(char *chan) { +int unreal_valid_chan(const char *chan) { if (strchr(chan, ':')) { return 0; } return 1; } -void unreal_cmd_ctcp(char *source, char *dest, char *buf) +void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; if (!buf) { diff --git a/src/protocol/unreal32.h b/src/protocol/unreal32.h index 070d62503..e36a4b86e 100644 --- a/src/protocol/unreal32.h +++ b/src/protocol/unreal32.h @@ -80,74 +80,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void unreal_set_umode(User * user, int ac, char **av); -void unreal_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void unreal_set_umode(User * user, int ac, const char **av); +void unreal_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void unreal_cmd_vhost_off(User * u); -void unreal_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void unreal_cmd_svskill(char *source, char *user, char *buf); -void unreal_cmd_svsmode(User * u, int ac, char **av); -void unreal_cmd_372(char *source, char *msg); -void unreal_cmd_372_error(char *source); -void unreal_cmd_375(char *source); -void unreal_cmd_376(char *source); -void unreal_cmd_nick(char *nick, char *name, char *modes); -void unreal_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void unreal_cmd_mode(char *source, char *dest, char *buf); -void unreal_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void unreal_cmd_kick(char *source, char *chan, char *user, char *buf); -void unreal_cmd_notice_ops(char *source, char *dest, char *buf); -void unreal_cmd_notice(char *source, char *dest, char *buf); -void unreal_cmd_notice2(char *source, char *dest, char *msg); -void unreal_cmd_privmsg(char *source, char *dest, char *buf); -void unreal_cmd_privmsg2(char *source, char *dest, char *msg); -void unreal_cmd_serv_notice(char *source, char *dest, char *msg); -void unreal_cmd_serv_privmsg(char *source, char *dest, char *msg); -void unreal_cmd_bot_chan_mode(char *nick, char *chan); -void unreal_cmd_351(char *source); -void unreal_cmd_quit(char *source, char *buf); -void unreal_cmd_pong(char *servname, char *who); -void unreal_cmd_join(char *user, char *channel, time_t chantime); -void unreal_cmd_unsqline(char *user); -void unreal_cmd_invite(char *source, char *chan, char *nick); -void unreal_cmd_part(char *nick, char *chan, char *buf); -void unreal_cmd_391(char *source, char *timestr); -void unreal_cmd_250(char *buf); -void unreal_cmd_307(char *buf); -void unreal_cmd_311(char *buf); -void unreal_cmd_312(char *buf); -void unreal_cmd_317(char *buf); -void unreal_cmd_219(char *source, char *letter); -void unreal_cmd_401(char *source, char *who); -void unreal_cmd_318(char *source, char *who); -void unreal_cmd_242(char *buf); -void unreal_cmd_243(char *buf); -void unreal_cmd_211(char *buf); -void unreal_cmd_global(char *source, char *buf); -void unreal_cmd_global_legacy(char *source, char *fmt); -void unreal_cmd_sqline(char *mask, char *reason); -void unreal_cmd_squit(char *servname, char *message); -void unreal_cmd_svso(char *source, char *nick, char *flag); -void unreal_cmd_chg_nick(char *oldnick, char *newnick); -void unreal_cmd_svsnick(char *source, char *guest, time_t when); -void unreal_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void unreal_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void unreal_cmd_svskill(const char *source, const char *user, const char *buf); +void unreal_cmd_svsmode(User * u, int ac, const char **av); +void unreal_cmd_372(const char *source, const char *msg); +void unreal_cmd_372_error(const char *source); +void unreal_cmd_375(const char *source); +void unreal_cmd_376(const char *source); +void unreal_cmd_nick(const char *nick, const char *name, const char *modes); +void unreal_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void unreal_cmd_mode(const char *source, const char *dest, const char *buf); +void unreal_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void unreal_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void unreal_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void unreal_cmd_notice(const char *source, const char *dest, const char *buf); +void unreal_cmd_notice2(const char *source, const char *dest, const char *msg); +void unreal_cmd_privmsg(const char *source, const char *dest, const char *buf); +void unreal_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void unreal_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void unreal_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void unreal_cmd_bot_chan_mode(const char *nick, const char *chan); +void unreal_cmd_351(const char *source); +void unreal_cmd_quit(const char *source, const char *buf); +void unreal_cmd_pong(const char *servname, const char *who); +void unreal_cmd_join(const char *user, const char *channel, time_t chantime); +void unreal_cmd_unsqline(const char *user); +void unreal_cmd_invite(const char *source, const char *chan, const char *nick); +void unreal_cmd_part(const char *nick, const char *chan, const char *buf); +void unreal_cmd_391(const char *source, const char *timestr); +void unreal_cmd_250(const char *buf); +void unreal_cmd_307(const char *buf); +void unreal_cmd_311(const char *buf); +void unreal_cmd_312(const char *buf); +void unreal_cmd_317(const char *buf); +void unreal_cmd_219(const char *source, const char *letter); +void unreal_cmd_401(const char *source, const char *who); +void unreal_cmd_318(const char *source, const char *who); +void unreal_cmd_242(const char *buf); +void unreal_cmd_243(const char *buf); +void unreal_cmd_211(const char *buf); +void unreal_cmd_global(const char *source, const char *buf); +void unreal_cmd_global_legacy(const char *source, const char *fmt); +void unreal_cmd_sqline(const char *mask, const char *reason); +void unreal_cmd_squit(const char *servname, const char *message); +void unreal_cmd_svso(const char *source, const char *nick, const char *flag); +void unreal_cmd_chg_nick(const char *oldnick, const char *newnick); +void unreal_cmd_svsnick(const char *source, const char *guest, time_t when); +void unreal_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void unreal_cmd_connect(int servernum); -void unreal_cmd_svshold(char *nick); -void unreal_cmd_release_svshold(char *nick); -void unreal_cmd_unsgline(char *mask); -void unreal_cmd_unszline(char *mask); -void unreal_cmd_szline(char *mask, char *reason, char *whom); -void unreal_cmd_sgline(char *mask, char *reason); -void unreal_cmd_unban(char *name, char *nick); -void unreal_cmd_svsmode_chan(char *name, char *mode, char *nick); -void unreal_cmd_svid_umode(char *nick, time_t ts); +void unreal_cmd_svshold(const char *nick); +void unreal_cmd_release_svshold(const char *nick); +void unreal_cmd_unsgline(const char *mask); +void unreal_cmd_unszline(const char *mask); +void unreal_cmd_szline(const char *mask, const char *reason, const char *whom); +void unreal_cmd_sgline(const char *mask, const char *reason); +void unreal_cmd_unban(const char *name, const char *nick); +void unreal_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void unreal_cmd_svid_umode(const char *nick, time_t ts); void unreal_cmd_nc_change(User * u); -void unreal_cmd_svid_umode2(User * u, char *ts); -void unreal_cmd_svid_umode3(User * u, char *ts); +void unreal_cmd_svid_umode2(User * u, const char *ts); +void unreal_cmd_svid_umode3(User * u, const char *ts); void unreal_cmd_eob(); -int unreal_flood_mode_check(char *value); -void unreal_cmd_jupe(char *jserver, char *who, char *reason); -int unreal_valid_nick(char *nick); -void unreal_cmd_ctcp(char *source, char *dest, char *buf); +int unreal_flood_mode_check(const char *value); +void unreal_cmd_jupe(const char *jserver, const char *who, const char *reason); +int unreal_valid_nick(const char *nick); +void unreal_cmd_ctcp(const char *source, const char *dest, const char *buf); class UnrealIRCdProto : public IRCDProtoNew { public: diff --git a/src/protocol/viagra.c b/src/protocol/viagra.c index 5c54b2955..69baf00c4 100644 --- a/src/protocol/viagra.c +++ b/src/protocol/viagra.c @@ -149,10 +149,10 @@ IRCDCAPAB myIrcdcap[] = { -void viagra_set_umode(User * user, int ac, char **av) +void viagra_set_umode(User * user, int ac, const char **av) { int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; + const char *modes = av[0]; ac--; @@ -424,12 +424,12 @@ CUMode myCumodes[128] = { }; -void viagra_cmd_bot_unban(ChannelInfo * ci, char *nick) +void viagra_cmd_bot_unban(ChannelInfo * ci, const char *nick) { send_cmd(ServerName, "SVSMODE %s -b %s", ci->name, nick); } -int anope_event_setname(char *source, int ac, char **av) +int anope_event_setname(const char *source, int ac, const char **av) { User *u; @@ -444,17 +444,17 @@ int anope_event_setname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[0]); + u->SetRealname(av[0]); return MOD_CONT; } -int anope_event_sjoin(char *source, int ac, char **av) +int anope_event_sjoin(const char *source, int ac, const char **av) { do_sjoin(source, ac, av); return MOD_CONT; } -int anope_event_chgname(char *source, int ac, char **av) +int anope_event_chgname(const char *source, int ac, const char **av) { User *u; @@ -469,11 +469,11 @@ int anope_event_chgname(char *source, int ac, char **av) return MOD_CONT; } - change_user_realname(u, av[1]); + u->SetRealname(av[1]); return MOD_CONT; } -int anope_event_setident(char *source, int ac, char **av) +int anope_event_setident(const char *source, int ac, const char **av) { User *u; @@ -488,11 +488,11 @@ int anope_event_setident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[0]); + u->SetIdent(av[0]); return MOD_CONT; } -int anope_event_chgident(char *source, int ac, char **av) +int anope_event_chgident(const char *source, int ac, const char **av) { User *u; @@ -507,7 +507,7 @@ int anope_event_chgident(char *source, int ac, char **av) return MOD_CONT; } - change_user_username(u, av[1]); + u->SetIdent(av[1]); return MOD_CONT; } @@ -516,7 +516,7 @@ int anope_event_chgident(char *source, int ac, char **av) * parv[0] = sender * parv[1] = newhost */ -int anope_event_sethost(char *source, int ac, char **av) +int anope_event_sethost(const char *source, int ac, const char **av) { User *u; @@ -531,11 +531,11 @@ int anope_event_sethost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[0]); + u->SetDisplayedHost(av[0]); return MOD_CONT; } -int anope_event_nick(char *source, int ac, char **av) +int anope_event_nick(const char *source, int ac, const char **av) { User *user; @@ -553,7 +553,7 @@ int anope_event_nick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_vs(char *source, int ac, char **av) +int anope_event_vs(const char *source, int ac, const char **av) { User *u; @@ -568,12 +568,12 @@ int anope_event_vs(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } -int anope_event_chghost(char *source, int ac, char **av) +int anope_event_chghost(const char *source, int ac, const char **av) { User *u; @@ -588,11 +588,11 @@ int anope_event_chghost(char *source, int ac, char **av) return MOD_CONT; } - change_user_host(u, av[1]); + u->SetDisplayedHost(av[1]); return MOD_CONT; } -int anope_event_436(char *source, int ac, char **av) +int anope_event_436(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -601,17 +601,17 @@ int anope_event_436(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_notice(char *source, int ac, char **av) +int anope_event_notice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_pass(char *source, int ac, char **av) +int anope_event_pass(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_svinfo(char *source, int ac, char **av) +int anope_event_svinfo(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -621,17 +621,17 @@ int anope_event_svinfo(char *source, int ac, char **av) * parv[0] = sender prefix * parv[1] = message text */ -int anope_event_gnotice(char *source, int ac, char **av) +int anope_event_gnotice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_sqline(char *source, int ac, char **av) +int anope_event_sqline(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_burst(char *source, int ac, char **av) +int anope_event_burst(const char *source, int ac, const char **av) { Server *s; s = findserver(servlist, source); @@ -649,7 +649,7 @@ int anope_event_burst(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_tctrl(char *source, int ac, char **av) +int anope_event_tctrl(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -659,7 +659,7 @@ int anope_event_tctrl(char *source, int ac, char **av) * parv[0] = sender prefix * parv[*] = parameters */ -int anope_event_error(char *source, int ac, char **av) +int anope_event_error(const char *source, int ac, const char **av) { if (ac >= 1) { if (debug) { @@ -742,7 +742,7 @@ void moduleAddIRCDMsgs(void) { /* SQLINE */ -void viagra_cmd_sqline(char *mask, char *reason) +void viagra_cmd_sqline(const char *mask, const char *reason) { if (!mask || !reason) { return; @@ -751,17 +751,17 @@ void viagra_cmd_sqline(char *mask, char *reason) send_cmd(NULL, "SQLINE %s :%s", mask, reason); } -void viagra_cmd_unsgline(char *mask) +void viagra_cmd_unsgline(const char *mask) { send_cmd(NULL, "UNSGLINE 0 :%s", mask); } -void viagra_cmd_unszline(char *mask) +void viagra_cmd_unszline(const char *mask) { send_cmd(NULL, "UNSZLINE 0 %s", mask); } -void viagra_cmd_szline(char *mask, char *reason, char *whom) +void viagra_cmd_szline(const char *mask, const char *reason, const char *whom) { send_cmd(NULL, "SZLINE %s :%s", mask, reason); } @@ -771,12 +771,12 @@ void ViagraIRCdProto::cmd_svsnoop(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void viagra_cmd_svsadmin(char *server, int set) +void viagra_cmd_svsadmin(const char *server, int set) { ircd_proto.cmd_svsnoop(server, set); } -void viagra_cmd_sgline(char *mask, char *reason) +void viagra_cmd_sgline(const char *mask, const char *reason) { send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason); } @@ -787,7 +787,7 @@ void ViagraIRCdProto::cmd_remove_akill(const char *user, const char *host) } /* PART */ -void viagra_cmd_part(char *nick, char *chan, char *buf) +void viagra_cmd_part(const char *nick, const char *chan, const char *buf) { if (!nick || !chan) { return; @@ -800,8 +800,8 @@ void viagra_cmd_part(char *nick, char *chan, char *buf) } } -void viagra_cmd_topic(char *whosets, char *chan, char *whosetit, - char *topic, time_t when) +void viagra_cmd_topic(const char *whosets, const char *chan, const char *whosetit, + const char *topic, time_t when) { send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, (unsigned long int) when, topic); @@ -813,7 +813,7 @@ void viagra_cmd_vhost_off(User * u) notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar); } -void viagra_cmd_vhost_on(char *nick, char *vIdent, char *vhost) +void viagra_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost) { if (vIdent) { send_cmd(NULL, "CHGIDENT %s %s", nick, vIdent); @@ -822,12 +822,12 @@ void viagra_cmd_vhost_on(char *nick, char *vIdent, char *vhost) send_cmd(NULL, "SVSCHGHOST %s %s", nick, vhost); } -void viagra_cmd_unsqline(char *user) +void viagra_cmd_unsqline(const char *user) { send_cmd(NULL, "UNSQLINE %s", user); } -void viagra_cmd_join(char *user, char *channel, time_t chantime) +void viagra_cmd_join(const char *user, const char *channel, time_t chantime) { send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel); } @@ -842,8 +842,8 @@ void viagra_cmd_join(char *user, char *channel, time_t chantime) * parv[5]=time set * parv[6]=reason */ -void viagra_cmd_akill(char *user, char *host, char *who, time_t when, - time_t expires, char *reason) +void viagra_cmd_akill(const char *user, const char *host, const char *who, time_t when, + time_t expires, const char *reason) { send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who, (long int) time(NULL), reason); @@ -857,7 +857,7 @@ void viagra_cmd_akill(char *user, char *host, char *who, time_t when, * parv[2] = nick stamp * parv[3] = kill message */ -void viagra_cmd_svskill(char *source, char *user, char *buf) +void viagra_cmd_svskill(const char *source, const char *user, const char *buf) { if (buf) { send_cmd(source, "SVSKILL %s :%s", user, buf); @@ -865,7 +865,7 @@ void viagra_cmd_svskill(char *source, char *user, char *buf) return; } -void viagra_cmd_mode(char *source, char *dest, char *buf) +void viagra_cmd_mode(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -883,7 +883,7 @@ void viagra_cmd_mode(char *source, char *dest, char *buf) } /* QUIT */ -void viagra_cmd_quit(char *source, char *buf) +void viagra_cmd_quit(const char *source, const char *buf) { if (buf) { send_cmd(source, "QUIT :%s", buf); @@ -892,7 +892,7 @@ void viagra_cmd_quit(char *source, char *buf) } } -int anope_event_away(char *source, int ac, char **av) +int anope_event_away(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -901,7 +901,7 @@ int anope_event_away(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_ping(char *source, int ac, char **av) +int anope_event_ping(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -909,20 +909,20 @@ int anope_event_ping(char *source, int ac, char **av) return MOD_CONT; } -void viagra_cmd_svsmode(User * u, int ac, char **av) +void viagra_cmd_svsmode(User * u, int ac, const char **av) { send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick, (long int) u->timestamp, av[0], (ac == 2 ? " " : ""), (ac == 2 ? av[1] : "")); } -void viagra_cmd_squit(char *servname, char *message) +void viagra_cmd_squit(const char *servname, const char *message) { send_cmd(NULL, "SQUIT %s :%s", servname, message); } /* PONG */ -void viagra_cmd_pong(char *servname, char *who) +void viagra_cmd_pong(const char *servname, const char *who) { send_cmd(servname, "PONG %s", who); } @@ -947,13 +947,13 @@ void viagra_cmd_capab() } /* PASS */ -void viagra_cmd_pass(char *pass) +void viagra_cmd_pass(const char *pass) { send_cmd(NULL, "PASS %s :TS", pass); } /* SERVER */ -void viagra_cmd_server(char *servname, int hop, char *descript) +void viagra_cmd_server(const char *servname, int hop, const char *descript) { send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript); } @@ -982,7 +982,7 @@ void viagra_cmd_connect(int servernum) } /* EVENT : OS */ -int anope_event_os(char *source, int ac, char **av) +int anope_event_os(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -991,7 +991,7 @@ int anope_event_os(char *source, int ac, char **av) } /* EVENT : NS */ -int anope_event_ns(char *source, int ac, char **av) +int anope_event_ns(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1000,7 +1000,7 @@ int anope_event_ns(char *source, int ac, char **av) } /* EVENT : MS */ -int anope_event_ms(char *source, int ac, char **av) +int anope_event_ms(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1009,7 +1009,7 @@ int anope_event_ms(char *source, int ac, char **av) } /* EVENT : HS */ -int anope_event_hs(char *source, int ac, char **av) +int anope_event_hs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1018,7 +1018,7 @@ int anope_event_hs(char *source, int ac, char **av) } /* EVENT : CS */ -int anope_event_cs(char *source, int ac, char **av) +int anope_event_cs(const char *source, int ac, const char **av) { if (ac < 1) return MOD_CONT; @@ -1026,7 +1026,7 @@ int anope_event_cs(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_server(char *source, int ac, char **av) +int anope_event_server(const char *source, int ac, const char **av) { if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); @@ -1036,7 +1036,7 @@ int anope_event_server(char *source, int ac, char **av) } -int anope_event_privmsg(char *source, int ac, char **av) +int anope_event_privmsg(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1044,7 +1044,7 @@ int anope_event_privmsg(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_part(char *source, int ac, char **av) +int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) return MOD_CONT; @@ -1052,7 +1052,7 @@ int anope_event_part(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_whois(char *source, int ac, char **av) +int anope_event_whois(const char *source, int ac, const char **av) { if (source && ac >= 1) { m_whois(source, av[0]); @@ -1060,7 +1060,7 @@ int anope_event_whois(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_topic(char *source, int ac, char **av) +int anope_event_topic(const char *source, int ac, const char **av) { if (ac != 4) return MOD_CONT; @@ -1068,7 +1068,7 @@ int anope_event_topic(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_squit(char *source, int ac, char **av) +int anope_event_squit(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1076,7 +1076,7 @@ int anope_event_squit(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_quit(char *source, int ac, char **av) +int anope_event_quit(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1085,7 +1085,7 @@ int anope_event_quit(char *source, int ac, char **av) } -int anope_event_mode(char *source, int ac, char **av) +int anope_event_mode(const char *source, int ac, const char **av) { if (ac < 2) return MOD_CONT; @@ -1098,7 +1098,7 @@ int anope_event_mode(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kill(char *source, int ac, char **av) +int anope_event_kill(const char *source, int ac, const char **av) { if (ac != 2) return MOD_CONT; @@ -1107,7 +1107,7 @@ int anope_event_kill(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_kick(char *source, int ac, char **av) +int anope_event_kick(const char *source, int ac, const char **av) { if (ac != 3) return MOD_CONT; @@ -1115,7 +1115,7 @@ int anope_event_kick(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_join(char *source, int ac, char **av) +int anope_event_join(const char *source, int ac, const char **av) { if (ac != 1) return MOD_CONT; @@ -1123,7 +1123,7 @@ int anope_event_join(char *source, int ac, char **av) return MOD_CONT; } -int anope_event_motd(char *source, int ac, char **av) +int anope_event_motd(const char *source, int ac, const char **av) { if (!source) { return MOD_CONT; @@ -1133,7 +1133,7 @@ int anope_event_motd(char *source, int ac, char **av) return MOD_CONT; } -void viagra_cmd_notice_ops(char *source, char *dest, char *buf) +void viagra_cmd_notice_ops(const char *source, const char *dest, const char *buf) { if (buf) { send_cmd(NULL, "NOTICE @%s :%s", dest, buf); @@ -1141,7 +1141,7 @@ void viagra_cmd_notice_ops(char *source, char *dest, char *buf) return; } -void viagra_cmd_notice(char *source, char *dest, char *buf) +void viagra_cmd_notice(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1154,12 +1154,12 @@ void viagra_cmd_notice(char *source, char *dest, char *buf) } } -void viagra_cmd_notice2(char *source, char *dest, char *msg) +void viagra_cmd_notice2(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE %s :%s", dest, msg); } -void viagra_cmd_privmsg(char *source, char *dest, char *buf) +void viagra_cmd_privmsg(const char *source, const char *dest, const char *buf) { if (!buf) { return; @@ -1168,23 +1168,23 @@ void viagra_cmd_privmsg(char *source, char *dest, char *buf) send_cmd(source, "PRIVMSG %s :%s", dest, buf); } -void viagra_cmd_privmsg2(char *source, char *dest, char *msg) +void viagra_cmd_privmsg2(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG %s :%s", dest, msg); } -void viagra_cmd_serv_notice(char *source, char *dest, char *msg) +void viagra_cmd_serv_notice(const char *source, const char *dest, const char *msg) { send_cmd(source, "NOTICE $%s :%s", dest, msg); } -void viagra_cmd_serv_privmsg(char *source, char *dest, char *msg) +void viagra_cmd_serv_privmsg(const char *source, const char *dest, const char *msg) { send_cmd(source, "PRIVMSG $%s :%s", dest, msg); } /* GLOBOPS */ -void viagra_cmd_global(char *source, char *buf) +void viagra_cmd_global(const char *source, const char *buf) { if (!buf) { return; @@ -1194,7 +1194,7 @@ void viagra_cmd_global(char *source, char *buf) } /* 391 */ -void viagra_cmd_391(char *source, char *timestr) +void viagra_cmd_391(const char *source, const char *timestr) { if (!timestr) { return; @@ -1203,7 +1203,7 @@ void viagra_cmd_391(char *source, char *timestr) } /* 250 */ -void viagra_cmd_250(char *buf) +void viagra_cmd_250(const char *buf) { if (!buf) { return; @@ -1213,7 +1213,7 @@ void viagra_cmd_250(char *buf) } /* 307 */ -void viagra_cmd_307(char *buf) +void viagra_cmd_307(const char *buf) { if (!buf) { return; @@ -1223,7 +1223,7 @@ void viagra_cmd_307(char *buf) } /* 311 */ -void viagra_cmd_311(char *buf) +void viagra_cmd_311(const char *buf) { if (!buf) { return; @@ -1233,7 +1233,7 @@ void viagra_cmd_311(char *buf) } /* 312 */ -void viagra_cmd_312(char *buf) +void viagra_cmd_312(const char *buf) { if (!buf) { return; @@ -1243,7 +1243,7 @@ void viagra_cmd_312(char *buf) } /* 317 */ -void viagra_cmd_317(char *buf) +void viagra_cmd_317(const char *buf) { if (!buf) { return; @@ -1253,7 +1253,7 @@ void viagra_cmd_317(char *buf) } /* 219 */ -void viagra_cmd_219(char *source, char *letter) +void viagra_cmd_219(const char *source, const char *letter) { if (!source) { return; @@ -1268,7 +1268,7 @@ void viagra_cmd_219(char *source, char *letter) } /* 401 */ -void viagra_cmd_401(char *source, char *who) +void viagra_cmd_401(const char *source, const char *who) { if (!source || !who) { return; @@ -1277,7 +1277,7 @@ void viagra_cmd_401(char *source, char *who) } /* 318 */ -void viagra_cmd_318(char *source, char *who) +void viagra_cmd_318(const char *source, const char *who) { if (!source || !who) { return; @@ -1287,7 +1287,7 @@ void viagra_cmd_318(char *source, char *who) } /* 242 */ -void viagra_cmd_242(char *buf) +void viagra_cmd_242(const char *buf) { if (!buf) { return; @@ -1297,7 +1297,7 @@ void viagra_cmd_242(char *buf) } /* 243 */ -void viagra_cmd_243(char *buf) +void viagra_cmd_243(const char *buf) { if (!buf) { return; @@ -1307,7 +1307,7 @@ void viagra_cmd_243(char *buf) } /* 211 */ -void viagra_cmd_211(char *buf) +void viagra_cmd_211(const char *buf) { if (!buf) { return; @@ -1316,15 +1316,15 @@ void viagra_cmd_211(char *buf) send_cmd(NULL, "211 %s", buf); } -void viagra_cmd_351(char *source) +void viagra_cmd_351(const char *source) { send_cmd(ServerName, "351 %s Anope-%s %s :%s - %s (%s) -- %s", source, version_number, ServerName, ircd->name, version_flags, EncModule, version_build); } -void viagra_cmd_bot_nick(char *nick, char *user, char *host, char *real, - char *modes) +void viagra_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1332,7 +1332,7 @@ void viagra_cmd_bot_nick(char *nick, char *user, char *host, char *real, viagra_cmd_sqline(nick, "Reserved for services"); } -void viagra_cmd_kick(char *source, char *chan, char *user, char *buf) +void viagra_cmd_kick(const char *source, const char *chan, const char *user, const char *buf) { if (buf) { send_cmd(source, "KICK %s %s :%s", chan, user, buf); @@ -1341,7 +1341,7 @@ void viagra_cmd_kick(char *source, char *chan, char *user, char *buf) } } -void viagra_cmd_nick(char *nick, char *name, char *modes) +void viagra_cmd_nick(const char *nick, const char *name, const char *modes) { EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, @@ -1350,30 +1350,30 @@ void viagra_cmd_nick(char *nick, char *name, char *modes) viagra_cmd_sqline(nick, "Reserved for services"); } -void viagra_cmd_372(char *source, char *msg) +void viagra_cmd_372(const char *source, const char *msg) { send_cmd(ServerName, "372 %s :- %s", source, msg); } -void viagra_cmd_372_error(char *source) +void viagra_cmd_372_error(const char *source) { send_cmd(ServerName, "422 %s :- MOTD file not found! Please " "contact your IRC administrator.", source); } -void viagra_cmd_375(char *source) +void viagra_cmd_375(const char *source) { send_cmd(ServerName, "375 %s :- %s Message of the Day", source, ServerName); } -void viagra_cmd_376(char *source) +void viagra_cmd_376(const char *source) { send_cmd(ServerName, "376 %s :End of /MOTD command.", source); } /* INVITE */ -void viagra_cmd_invite(char *source, char *chan, char *nick) +void viagra_cmd_invite(const char *source, const char *chan, const char *nick) { if (!source || !chan || !nick) { return; @@ -1382,31 +1382,31 @@ void viagra_cmd_invite(char *source, char *chan, char *nick) send_cmd(source, "INVITE %s %s", nick, chan); } -void viagra_cmd_bot_chan_mode(char *nick, char *chan) +void viagra_cmd_bot_chan_mode(const char *nick, const char *chan) { anope_cmd_mode(nick, chan, "%s %s", ircd->botchanumode, nick); } -int anope_event_capab(char *source, int ac, char **av) +int anope_event_capab(const char *source, int ac, const char **av) { capab_parse(ac, av); return MOD_CONT; } /* SVSHOLD - set */ -void viagra_cmd_svshold(char *nick) +void viagra_cmd_svshold(const char *nick) { /* Not supported by this IRCD */ } /* SVSHOLD - release */ -void viagra_cmd_release_svshold(char *nick) +void viagra_cmd_release_svshold(const char *nick) { /* Not Supported by this IRCD */ } /* SVSNICK */ -void viagra_cmd_svsnick(char *source, char *guest, time_t when) +void viagra_cmd_svsnick(const char *source, const char *guest, time_t when) { if (!source || !guest) { return; @@ -1414,28 +1414,28 @@ void viagra_cmd_svsnick(char *source, char *guest, time_t when) send_cmd(NULL, "SVSNICK %s %s :%ld", source, guest, (long int) when); } -void viagra_cmd_guest_nick(char *nick, char *user, char *host, char *real, - char *modes) +void viagra_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, + const char *modes) { send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, (long int) time(NULL), modes, user, host, ServerName, real); } -void viagra_cmd_svso(char *source, char *nick, char *flag) +void viagra_cmd_svso(const char *source, const char *nick, const char *flag) { /* Not Supported by this IRCD */ } /* SVSMODE -b */ -void viagra_cmd_unban(char *name, char *nick) +void viagra_cmd_unban(const char *name, const char *nick) { viagra_cmd_svsmode_chan(name, "-b", nick); } /* SVSMODE channel modes */ -void viagra_cmd_svsmode_chan(char *name, char *mode, char *nick) +void viagra_cmd_svsmode_chan(const char *name, const char *mode, const char *nick) { if (nick) { send_cmd(ServerName, "SVSMODE %s %s %s", name, mode, nick); @@ -1446,7 +1446,7 @@ void viagra_cmd_svsmode_chan(char *name, char *mode, char *nick) /* SVSMODE +d */ /* sent if svid is something weird */ -void viagra_cmd_svid_umode(char *nick, time_t ts) +void viagra_cmd_svid_umode(const char *nick, time_t ts) { send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, (unsigned long int) ts); @@ -1460,12 +1460,12 @@ void viagra_cmd_nc_change(User * u) } /* SVSMODE +d */ -void viagra_cmd_svid_umode2(User * u, char *ts) +void viagra_cmd_svid_umode2(User * u, const char *ts) { /* not used by bahamut ircds */ } -void viagra_cmd_svid_umode3(User * u, char *ts) +void viagra_cmd_svid_umode3(User * u, const char *ts) { if (u->svid != u->timestamp) { common_svsmode(u, "+rd", ts); @@ -1475,7 +1475,7 @@ void viagra_cmd_svid_umode3(User * u, char *ts) } /* NICK <newnick> */ -void viagra_cmd_chg_nick(char *oldnick, char *newnick) +void viagra_cmd_chg_nick(const char *oldnick, const char *newnick) { if (!oldnick || !newnick) { return; @@ -1490,7 +1490,7 @@ void viagra_cmd_chg_nick(char *oldnick, char *newnick) * parv[1] = nick to make join * parv[2] = channel(s) to join */ -void viagra_cmd_svsjoin(char *source, char *nick, char *chan, char *param) +void viagra_cmd_svsjoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SVSJOIN %s :%s", nick, chan); } @@ -1501,37 +1501,37 @@ void viagra_cmd_svsjoin(char *source, char *nick, char *chan, char *param) * parv[1] = nick to make part * parv[2] = channel(s) to part */ -void viagra_cmd_svspart(char *source, char *nick, char *chan) +void viagra_cmd_svspart(const char *source, const char *nick, const char *chan) { send_cmd(source, "SVSPART %s :%s", nick, chan); } -void viagra_cmd_swhois(char *source, char *who, char *mask) +void viagra_cmd_swhois(const char *source, const char *who, const char *mask) { /* not supported */ } -int viagra_flood_mode_check(char *value) +int viagra_flood_mode_check(const char *value) { return 0; } -int anope_event_rehash(char *source, int ac, char **av) +int anope_event_rehash(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_admin(char *source, int ac, char **av) +int anope_event_admin(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_snotice(char *source, int ac, char **av) +int anope_event_snotice(const char *source, int ac, const char **av) { return MOD_CONT; } -int anope_event_invite(char *source, int ac, char **av) +int anope_event_invite(const char *source, int ac, const char **av) { return MOD_CONT; } @@ -1541,7 +1541,7 @@ void viagra_cmd_eob() send_cmd(NULL, "BURST 0"); } -void viagra_cmd_jupe(char *jserver, char *who, char *reason) +void viagra_cmd_jupe(const char *jserver, const char *who, const char *reason) { char rbuf[256]; @@ -1555,7 +1555,7 @@ void viagra_cmd_jupe(char *jserver, char *who, char *reason) } /* GLOBOPS - to handle old WALLOPS */ -void viagra_cmd_global_legacy(char *source, char *fmt) +void viagra_cmd_global_legacy(const char *source, const char *fmt) { send_cmd(source ? source : ServerName, "GLOBOPS :%s", fmt); } @@ -1564,7 +1564,7 @@ void viagra_cmd_global_legacy(char *source, char *fmt) 1 = valid nick 0 = nick is in valid */ -int viagra_valid_nick(char *nick) +int viagra_valid_nick(const char *nick) { /* no hard coded invalid nicks */ return 1; @@ -1574,14 +1574,14 @@ int viagra_valid_nick(char *nick) 1 = valid chan 0 = chan is in valid */ -int viagra_valid_chan(char *chan) +int viagra_valid_chan(const char *chan) { /* no hard coded invalid chans */ return 1; } -void viagra_cmd_ctcp(char *source, char *dest, char *buf) +void viagra_cmd_ctcp(const char *source, const char *dest, const char *buf) { char *s; diff --git a/src/protocol/viagra.h b/src/protocol/viagra.h index be8c223cc..3bdfec1e1 100644 --- a/src/protocol/viagra.h +++ b/src/protocol/viagra.h @@ -60,74 +60,74 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r -void viagra_set_umode(User * user, int ac, char **av); -void viagra_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); +void viagra_set_umode(User * user, int ac, const char **av); +void viagra_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when); void viagra_cmd_vhost_off(User * u); -void viagra_cmd_akill(char *user, char *host, char *who, time_t when,time_t expires, char *reason); -void viagra_cmd_svskill(char *source, char *user, char *buf); -void viagra_cmd_svsmode(User * u, int ac, char **av); -void viagra_cmd_372(char *source, char *msg); -void viagra_cmd_372_error(char *source); -void viagra_cmd_375(char *source); -void viagra_cmd_376(char *source); -void viagra_cmd_nick(char *nick, char *name, char *modes); -void viagra_cmd_guest_nick(char *nick, char *user, char *host, char *real, char *modes); -void viagra_cmd_mode(char *source, char *dest, char *buf); -void viagra_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes); -void viagra_cmd_kick(char *source, char *chan, char *user, char *buf); -void viagra_cmd_notice_ops(char *source, char *dest, char *buf); -void viagra_cmd_notice(char *source, char *dest, char *buf); -void viagra_cmd_notice2(char *source, char *dest, char *msg); -void viagra_cmd_privmsg(char *source, char *dest, char *buf); -void viagra_cmd_privmsg2(char *source, char *dest, char *msg); -void viagra_cmd_serv_notice(char *source, char *dest, char *msg); -void viagra_cmd_serv_privmsg(char *source, char *dest, char *msg); -void viagra_cmd_bot_chan_mode(char *nick, char *chan); -void viagra_cmd_351(char *source); -void viagra_cmd_quit(char *source, char *buf); -void viagra_cmd_pong(char *servname, char *who); -void viagra_cmd_join(char *user, char *channel, time_t chantime); -void viagra_cmd_unsqline(char *user); -void viagra_cmd_invite(char *source, char *chan, char *nick); -void viagra_cmd_part(char *nick, char *chan, char *buf); -void viagra_cmd_391(char *source, char *timestr); -void viagra_cmd_250(char *buf); -void viagra_cmd_307(char *buf); -void viagra_cmd_311(char *buf); -void viagra_cmd_312(char *buf); -void viagra_cmd_317(char *buf); -void viagra_cmd_219(char *source, char *letter); -void viagra_cmd_401(char *source, char *who); -void viagra_cmd_318(char *source, char *who); -void viagra_cmd_242(char *buf); -void viagra_cmd_243(char *buf); -void viagra_cmd_211(char *buf); -void viagra_cmd_global(char *source, char *buf); -void viagra_cmd_global_legacy(char *source, char *fmt); -void viagra_cmd_sqline(char *mask, char *reason); -void viagra_cmd_squit(char *servname, char *message); -void viagra_cmd_svso(char *source, char *nick, char *flag); -void viagra_cmd_chg_nick(char *oldnick, char *newnick); -void viagra_cmd_svsnick(char *source, char *guest, time_t when); -void viagra_cmd_vhost_on(char *nick, char *vIdent, char *vhost); +void viagra_cmd_akill(const char *user, const char *host, const char *who, time_t when,time_t expires, const char *reason); +void viagra_cmd_svskill(const char *source, const char *user, const char *buf); +void viagra_cmd_svsmode(User * u, int ac, const char **av); +void viagra_cmd_372(const char *source, const char *msg); +void viagra_cmd_372_error(const char *source); +void viagra_cmd_375(const char *source); +void viagra_cmd_376(const char *source); +void viagra_cmd_nick(const char *nick, const char *name, const char *modes); +void viagra_cmd_guest_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void viagra_cmd_mode(const char *source, const char *dest, const char *buf); +void viagra_cmd_bot_nick(const char *nick, const char *user, const char *host, const char *real, const char *modes); +void viagra_cmd_kick(const char *source, const char *chan, const char *user, const char *buf); +void viagra_cmd_notice_ops(const char *source, const char *dest, const char *buf); +void viagra_cmd_notice(const char *source, const char *dest, const char *buf); +void viagra_cmd_notice2(const char *source, const char *dest, const char *msg); +void viagra_cmd_privmsg(const char *source, const char *dest, const char *buf); +void viagra_cmd_privmsg2(const char *source, const char *dest, const char *msg); +void viagra_cmd_serv_notice(const char *source, const char *dest, const char *msg); +void viagra_cmd_serv_privmsg(const char *source, const char *dest, const char *msg); +void viagra_cmd_bot_chan_mode(const char *nick, const char *chan); +void viagra_cmd_351(const char *source); +void viagra_cmd_quit(const char *source, const char *buf); +void viagra_cmd_pong(const char *servname, const char *who); +void viagra_cmd_join(const char *user, const char *channel, time_t chantime); +void viagra_cmd_unsqline(const char *user); +void viagra_cmd_invite(const char *source, const char *chan, const char *nick); +void viagra_cmd_part(const char *nick, const char *chan, const char *buf); +void viagra_cmd_391(const char *source, const char *timestr); +void viagra_cmd_250(const char *buf); +void viagra_cmd_307(const char *buf); +void viagra_cmd_311(const char *buf); +void viagra_cmd_312(const char *buf); +void viagra_cmd_317(const char *buf); +void viagra_cmd_219(const char *source, const char *letter); +void viagra_cmd_401(const char *source, const char *who); +void viagra_cmd_318(const char *source, const char *who); +void viagra_cmd_242(const char *buf); +void viagra_cmd_243(const char *buf); +void viagra_cmd_211(const char *buf); +void viagra_cmd_global(const char *source, const char *buf); +void viagra_cmd_global_legacy(const char *source, const char *fmt); +void viagra_cmd_sqline(const char *mask, const char *reason); +void viagra_cmd_squit(const char *servname, const char *message); +void viagra_cmd_svso(const char *source, const char *nick, const char *flag); +void viagra_cmd_chg_nick(const char *oldnick, const char *newnick); +void viagra_cmd_svsnick(const char *source, const char *guest, time_t when); +void viagra_cmd_vhost_on(const char *nick, const char *vIdent, const char *vhost); void viagra_cmd_connect(int servernum); -void viagra_cmd_svshold(char *nick); -void viagra_cmd_release_svshold(char *nick); -void viagra_cmd_unsgline(char *mask); -void viagra_cmd_unszline(char *mask); -void viagra_cmd_szline(char *mask, char *reason, char *whom); -void viagra_cmd_sgline(char *mask, char *reason); -void viagra_cmd_unban(char *name, char *nick); -void viagra_cmd_svsmode_chan(char *name, char *mode, char *nick); -void viagra_cmd_svid_umode(char *nick, time_t ts); +void viagra_cmd_svshold(const char *nick); +void viagra_cmd_release_svshold(const char *nick); +void viagra_cmd_unsgline(const char *mask); +void viagra_cmd_unszline(const char *mask); +void viagra_cmd_szline(const char *mask, const char *reason, const char *whom); +void viagra_cmd_sgline(const char *mask, const char *reason); +void viagra_cmd_unban(const char *name, const char *nick); +void viagra_cmd_svsmode_chan(const char *name, const char *mode, const char *nick); +void viagra_cmd_svid_umode(const char *nick, time_t ts); void viagra_cmd_nc_change(User * u); -void viagra_cmd_svid_umode2(User * u, char *ts); -void viagra_cmd_svid_umode3(User * u, char *ts); +void viagra_cmd_svid_umode2(User * u, const char *ts); +void viagra_cmd_svid_umode3(User * u, const char *ts); void viagra_cmd_eob(); -int viagra_flood_mode_check(char *value); -void viagra_cmd_jupe(char *jserver, char *who, char *reason); -int viagra_valid_nick(char *nick); -void viagra_cmd_ctcp(char *source, char *dest, char *buf); +int viagra_flood_mode_check(const char *value); +void viagra_cmd_jupe(const char *jserver, const char *who, const char *reason); +int viagra_valid_nick(const char *nick); +void viagra_cmd_ctcp(const char *source, const char *dest, const char *buf); class ViagraIRCdProto : public IRCDProtoNew { public: |