diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-04 06:40:24 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-04 06:40:24 +0000 |
| commit | b462814760cb7c0830072275acc97291a9fb905b (patch) | |
| tree | 56cfe6caee408eb852f728cd8aaa2d18e4365228 /include | |
| parent | 2708eea5d13c249143b83fbaa8b552992f0ac8b6 (diff) | |
Changed 'char *' fields in BotInfo to 'std::string', cleanup of bots.cpp, changed many other functions to use 'const std::string &' arguments as a chain reaction.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2733 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
| -rw-r--r-- | include/bots.h | 16 | ||||
| -rw-r--r-- | include/commands.h | 4 | ||||
| -rw-r--r-- | include/extern.h | 16 | ||||
| -rw-r--r-- | include/modules.h | 4 | ||||
| -rw-r--r-- | include/services.h | 8 | ||||
| -rw-r--r-- | include/users.h | 9 |
6 files changed, 25 insertions, 32 deletions
diff --git a/include/bots.h b/include/bots.h index 80ac08c1f..4645ea3b0 100644 --- a/include/bots.h +++ b/include/bots.h @@ -41,10 +41,10 @@ class CoreExport BotInfo : public Extensible, public Flags<BotFlag> BotInfo *next, *prev; std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */ - char *nick; /* Nickname of the bot */ - char *user; /* Its user name */ - char *host; /* Its hostname */ - char *real; /* Its real name */ + std::string nick; /* Nickname of the bot */ + std::string user; /* Its user name */ + std::string host; /* Its hostname */ + std::string real; /* Its real name */ time_t created; /* Birth date ;) */ int16 chancount; /* Number of channels that use the bot. */ /* Dynamic data */ @@ -52,17 +52,12 @@ class CoreExport BotInfo : public Extensible, public Flags<BotFlag> CommandHash **cmdTable; /** Create a new bot. - * XXX: Note - this constructor is considered obsolete. Use the four parameter form. - * @param nick The nickname to assign to the bot. - */ - BotInfo(const char *nick); - /** Create a new bot. * @param nick The nickname to assign to the bot. * @param user The ident to give the bot. * @param host The hostname to give the bot. * @param real The realname to give the bot. */ - BotInfo(const char *nick, const char *user, const char *host, const char *real); + BotInfo(const std::string &nick, const std::string &user = "", const std::string &host = "", const std::string &real = ""); /** Destroy a bot, clearing up appropriately. */ @@ -90,4 +85,3 @@ class CoreExport BotInfo : public Extensible, public Flags<BotFlag> */ void UnAssign(User *u, ChannelInfo *ci); }; - diff --git a/include/commands.h b/include/commands.h index 408374cd2..5e40ad899 100644 --- a/include/commands.h +++ b/include/commands.h @@ -21,8 +21,8 @@ */ extern MDE Command *lookup_cmd(Command *list, char *name); -extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd); -extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd); +extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[], const char *cmd); +extern MDE void mod_run_cmd(const std::string &service, User *u, CommandHash *cmdTable[], const char *cmd); //extern MDE void do_help_limited(char *service, User * u, Command * c); /*************************************************************************/ diff --git a/include/extern.h b/include/extern.h index 473279de2..2a5a95bd4 100644 --- a/include/extern.h +++ b/include/extern.h @@ -95,7 +95,7 @@ E const char *get_xop_level(int level); E void do_cmode(const char *source, int ac, const char **av); E void do_join(const char *source, int ac, const char **av); -E void do_kick(const char *source, int ac, const char **av); +E void do_kick(const std::string &source, int ac, const char **av); E void do_part(const char *source, int ac, const char **av); E void do_sjoin(const char *source, int ac, const char **av); E void do_topic(const char *source, int ac, const char **av); @@ -108,7 +108,7 @@ E Entry *entry_create(char *mask); E Entry *entry_add(EList *list, const char *mask); E void entry_delete(EList *list, Entry *e); E EList *list_create(); -E int entry_match(Entry *e, const char *nick, const char *user, const char *host, uint32 ip); +E int entry_match(Entry *e, const std::string &nick, const std::string &user, const std::string &host, uint32 ip); E int entry_match_mask(Entry *e, const char *mask, uint32 ip); E Entry *elist_match(EList *list, const char *nick, const char *user, const char *host, uint32 ip); E Entry *elist_match_mask(EList *list, const char *mask, uint32 ip); @@ -146,7 +146,7 @@ E void record_topic(const char *chan); E void restore_topic(const char *chan); E int check_topiclock(Channel * c, time_t topic_time); -E ChannelInfo *cs_findchan(const char *chan); +E ChannelInfo *cs_findchan(const std::string &chan); E int check_access(User * user, ChannelInfo * ci, int what); E bool IsFounder(User *user, ChannelInfo *ci); E bool IsRealFounder(User *user, ChannelInfo *ci); @@ -199,7 +199,7 @@ E void hostserv_init(); /**** init.c ****/ -E void introduce_user(const char *user); +E void introduce_user(const std::string &user); E int init_primary(int ac, char **av); E int init_secondary(int ac, char **av); E Uplink *uplink_server; @@ -299,9 +299,9 @@ E int delmemo(MemoInfo * mi, int num); E int m_nickcoll(const char *user); E int m_away(const char *source, const char *msg); -E int m_kill(const char *nick, const char *msg); +E int m_kill(const std::string &nick, const char *msg); E int m_motd(const char *source); -E int m_privmsg(const char *source, const char *receiver, const char *msg); +E int m_privmsg(const char *source, const std::string &receiver, const char *msg); E int m_stats(const char *source, int ac, const char **av); E int m_whois(const char *source, const char *who); E int m_time(const char *source, int ac, const char **av); @@ -345,7 +345,7 @@ E char *myStrGetTokenRemainder(const char *str, const char dilim, E char *stripModePrefix(const char *str); E int myNumToken(const char *str, const char dilim); E void doCleanBuffer(char *str); -E void EnforceQlinedNick(const char *nick, const char *killer); +E void EnforceQlinedNick(const std::string &nick, const char *killer); E int nickIsServices(const char *nick, int bot); E void add_entropy_userkeys(); @@ -485,7 +485,7 @@ E void notice_server(char *source, Server * s, const char *fmt, ...) FORMAT(printf,3,4); E void notice_list(const char *source, const char *dest, char **text); // MARK_DEPRECATED; -E void notice_lang(const char *source, User *dest, int message, ...); // MARK_DEPRECATED; +E void notice_lang(const std::string &source, User *dest, int message, ...); // MARK_DEPRECATED; E void notice_help(const char *source, User *dest, int message, ...); // MARK_DEPRECATED; diff --git a/include/modules.h b/include/modules.h index bfd8b3928..c25016bdd 100644 --- a/include/modules.h +++ b/include/modules.h @@ -537,7 +537,7 @@ class CoreExport Module * @param c The command class (if it exists) * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it */ - virtual EventReturn OnPreCommandRun(const char *service, User *u, const char *cmd, Command *c) { return EVENT_CONTINUE; } + virtual EventReturn OnPreCommandRun(const std::string &service, User *u, const char *cmd, Command *c) { return EVENT_CONTINUE; } /** Called before a command is due to be executed. * @param u The user executing the command @@ -1101,7 +1101,7 @@ enum Implementation I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnLoadDatabase, I_OnBackupDatabase, I_OnDatabaseExpire, I_OnDatabaseWrite, I_OnDatabaseRead, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata, - + /* Modules */ I_OnModuleLoad, I_OnModuleUnload, diff --git a/include/services.h b/include/services.h index 0465fa631..d92f84f63 100644 --- a/include/services.h +++ b/include/services.h @@ -523,11 +523,11 @@ class HostInfo * @param time When the vhost was craated */ void SetVhost(const std::string &ident, const std::string &host, const std::string &creator, time_t time = time(NULL)); - + /** Remove a users vhost **/ void RemoveVhost(); - + /** Check if the user has a vhost * @return true or false */ @@ -1267,7 +1267,7 @@ class CoreExport IRCDProto virtual void SendSVSMode(User *, int, const char **) = 0; virtual void SendMode(BotInfo *bi, Channel *dest, const char *fmt, ...); virtual void SendMode(BotInfo *bi, User *u, const char *fmt, ...); - virtual void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *, const char *uid) = 0; + virtual void SendClientIntroduction(const std::string &, const std::string &, const std::string &, const std::string &, const char *, const std::string &uid) = 0; virtual void SendKick(BotInfo *bi, Channel *chan, User *user, const char *fmt, ...); virtual void SendNoticeChanops(BotInfo *bi, Channel *dest, const char *fmt, ...); virtual void SendMessage(BotInfo *bi, const char *dest, const char *fmt, ...); @@ -1286,7 +1286,7 @@ class CoreExport IRCDProto virtual void SendQuit(BotInfo *bi, const char *fmt, ...); virtual void SendPong(const char *servname, const char *who); virtual void SendJoin(BotInfo *bi, const char *, time_t) = 0; - virtual void SendSQLineDel(const char *) = 0; + virtual void SendSQLineDel(const std::string &) = 0; virtual void SendInvite(BotInfo *bi, const char *chan, const char *nick); virtual void SendPart(BotInfo *bi, Channel *chan, const char *fmt, ...); virtual void SendGlobops(BotInfo *source, const char *fmt, ...); diff --git a/include/users.h b/include/users.h index 0d702bb19..0458c0455 100644 --- a/include/users.h +++ b/include/users.h @@ -67,7 +67,7 @@ class CoreExport User : public Extensible /** Destroy a user. */ ~User(); - + /** Update the nickname of a user record accordingly, should be * called from ircd protocol. */ @@ -131,10 +131,9 @@ class CoreExport User : public Extensible * @param source Sender nick * @param fmt Format of the Message * @param ... any number of parameters - * @return void */ - void SendMessage(const char *source, const char *fmt, ...); - void SendMessage(const char *source, const std::string &msg); + void SendMessage(const std::string &source, const char *fmt, ...); + void SendMessage(const std::string &source, const std::string &msg); /** Check if the user should become identified because * their svid matches the one stored in their nickcore @@ -155,7 +154,7 @@ class CoreExport User : public Extensible /** Update the last usermask stored for a user, and check to see if they are recognized */ void UpdateHost(); - + /** Check if the user has a mode * @param Name Mode name * @return true or false |
