diff options
| author | Adam <Adam@anope.org> | 2010-10-04 13:59:30 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-10-04 13:59:30 -0400 |
| commit | cf98cd3e06e4de0f9902824b0ef8239e947c5b6a (patch) | |
| tree | fad06aca79be531d306eb8bf096e0160d6323f9c /include | |
| parent | 632f8df76b31f1300e7ac72890567834eac5511e (diff) | |
Changed the protocol handling system to use a vector of strings instead of C style arrays. Burned the old process/split_buf/memory.c code
Diffstat (limited to 'include')
| -rw-r--r-- | include/anope.h | 2 | ||||
| -rw-r--r-- | include/channels.h | 7 | ||||
| -rw-r--r-- | include/extern.h | 27 | ||||
| -rw-r--r-- | include/modules.h | 3 | ||||
| -rw-r--r-- | include/servers.h | 4 |
5 files changed, 20 insertions, 23 deletions
diff --git a/include/anope.h b/include/anope.h index cbc87bf7b..ce206bc8e 100644 --- a/include/anope.h +++ b/include/anope.h @@ -309,7 +309,7 @@ namespace Anope * @param func A callback function that will be called when this message is received * @return The new message object */ - extern CoreExport Message *AddMessage(const string &name, int (*func)(const string &source, int ac, const char **av)); + extern CoreExport Message *AddMessage(const string &name, bool (*func)(const string &source, const std::vector<Anope::string> ¶ms)); /** Deletes a message from Anope * XXX Im not sure what will happen if this function is called indirectly from message function pointed to by this message.. must check diff --git a/include/channels.h b/include/channels.h index 41b252165..d0b0b9dd5 100644 --- a/include/channels.h +++ b/include/channels.h @@ -248,6 +248,13 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> */ void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...); + /** Set a string of modes internally on a channel + * @param setter the setter (if it is a user) + * @param mode the modes + * @param EnforceMLock true to enforce mlock + */ + void SetModesInternal(User *setter, const Anope::string &modes, bool EnforceMLock = false); + /** Kick a user from a channel internally * @param source The sender of the kick * @param nick The nick being kicked diff --git a/include/extern.h b/include/extern.h index 89f6f1e0a..86f4f9c8b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -61,18 +61,16 @@ E void get_channel_stats(long *nrec, long *memuse); E Channel *findchan(const Anope::string &chan); -E void ChanSetInternalModes(Channel *c, int ac, const char **av, User *setter = NULL); /* this is dieing soon anyway */ - E User *nc_on_chan(Channel *c, const NickCore *nc); E int get_access_level(ChannelInfo *ci, NickAlias *na); E int get_access_level(ChannelInfo *ci, NickCore *nc); E Anope::string get_xop_level(int level); -E void do_cmode(const Anope::string &source, int ac, const char **av); -E void do_join(const Anope::string &source, int ac, const char **av); -E void do_kick(const Anope::string &source, int ac, const char **av); -E void do_part(const Anope::string &source, int ac, const char **av); +E void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts); +E void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts); +E void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason); +E void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason); E void MassChannelModes(BotInfo *bi, const Anope::string &modes); E void chan_set_correct_modes(User *user, Channel *c, int give_modes); @@ -201,11 +199,6 @@ class UplinkSocket : public ConnectionSocket bool Read(const Anope::string &buf); }; -/**** memory.c ****/ - -E void *scalloc(long elsize, long els); -E void *srealloc(void *oldptr, long newsize); - /**** memoserv.c ****/ E void ms_init(); @@ -222,10 +215,10 @@ E int m_away(const Anope::string &source, const Anope::string &msg); E int m_kill(const Anope::string &nick, const Anope::string &msg); E int m_motd(const Anope::string &source); E int m_privmsg(const Anope::string &source, const Anope::string &receiver, const Anope::string &message); -E int m_stats(const Anope::string &source, int ac, const char **av); +E bool m_stats(const Anope::string &source, const std::vector<Anope::string> &); E int m_whois(const Anope::string &source, const Anope::string &who); -E int m_time(const Anope::string &source, int ac, const char **av); -E int m_version(const Anope::string &source, int ac, const char **av); +E bool m_time(const Anope::string &source, const std::vector<Anope::string> &); +E bool m_version(const Anope::string &source, const std::vector<Anope::string> &); /**** misc.c ****/ @@ -255,7 +248,6 @@ E bool isvalidchar(char c); E Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number); E Anope::string myStrGetTokenRemainder(const Anope::string &str, char dilim, int token_number); E int myNumToken(const Anope::string &str, char dilim); -E void doCleanBuffer(char *str); E void EnforceQlinedNick(const Anope::string &nick, const Anope::string &killer); E bool nickIsServices(const Anope::string &nick, bool bot); @@ -313,7 +305,6 @@ E IgnoreData *get_ignore(const Anope::string &nick); E int delete_ignore(const Anope::string &nick); E int clear_ignores(); -E int split_buf(char *buf, const char ***argv, int colon_special); E void process(const Anope::string &buf); /**** send.c ****/ @@ -361,8 +352,8 @@ E Anope::string TS6SID; E User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes); -E void do_umode(const Anope::string &source, int ac, const char **av); -E void do_quit(const Anope::string &source, int ac, const char **av); +E void do_umode(const Anope::string &, const Anope::string &user, const Anope::string &modes); +E void do_quit(const Anope::string &source, const Anope::string &reason); E void do_kill(const Anope::string &source, const Anope::string &reason); E bool is_oper(User *user); diff --git a/include/modules.h b/include/modules.h index a48e7385f..6d5b5d6e9 100644 --- a/include/modules.h +++ b/include/modules.h @@ -159,7 +159,6 @@ enum Priority { PRIORITY_FIRST, PRIORITY_DONTCARE, PRIORITY_LAST, PRIORITY_BEFOR /* Module types, in the order in which they are unloaded. The order these are in is IMPORTANT */ enum MODType { MT_BEGIN, THIRD, QATESTED, SUPPORTED, CORE, DATABASE, ENCRYPTION, PROTOCOL, SOCKETENGINE, MT_END }; -struct Message; typedef std::multimap<Anope::string, Message *> message_map; extern CoreExport message_map MessageMap; class Module; @@ -1269,7 +1268,7 @@ class service_reference : public dynamic_reference<T> struct Message { Anope::string name; - int (*func)(const Anope::string &source, int ac, const char **av); + bool (*func)(const Anope::string &source, const std::vector<Anope::string> ¶ms); }; #endif // MODULES_H diff --git a/include/servers.h b/include/servers.h index 514660286..2ba9510ba 100644 --- a/include/servers.h +++ b/include/servers.h @@ -4,10 +4,10 @@ /* Anope */ extern CoreExport Server *Me; -extern CoreExport void CapabParse(int ac, const char **av); +extern CoreExport void CapabParse(const std::vector<Anope::string> ¶ms); extern CoreExport void do_server(const Anope::string &source, const Anope::string &servername, unsigned int hops, const Anope::string &descript, const Anope::string &numeric); -extern CoreExport void do_squit(const Anope::string &source, int ac, const char **av); +extern CoreExport void do_squit(const Anope::string &source, const Anope::string &server); extern CoreExport const char *ts6_uid_retrieve(); extern CoreExport const char *ts6_sid_retrieve(); |
