1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 23:23:13 +02:00

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

This commit is contained in:
Adam
2010-10-04 13:59:30 -04:00
parent 632f8df76b
commit cf98cd3e06
19 changed files with 1417 additions and 1739 deletions
+1 -1
View File
@@ -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> &params));
/** 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
+7
View File
@@ -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
+9 -18
View File
@@ -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);
+1 -2
View File
@@ -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> &params);
};
#endif // MODULES_H
+2 -2
View File
@@ -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> &params);
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();