diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
commit | 8d3d1775aeec744d54b3acfacc01cc70eadb44be (patch) | |
tree | 705674939690af9afa2b2258bb15ad0b3064e95d /src/ircd.c | |
parent | c037e6a6e9f71f7209cda0342dcb0e9c332b6804 (diff) |
Core skeleton of IRCDProtoNew class created.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1195 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/ircd.c')
-rw-r--r-- | src/ircd.c | 72 |
1 files changed, 50 insertions, 22 deletions
diff --git a/src/ircd.c b/src/ircd.c index 6e267c872..1d9c46d96 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -16,10 +16,11 @@ #include "extern.h" IRCDProto ircdproto; +IRCDProtoNew *ircdprotonew; IRCDModes ircd_modes; /** - * Globals we want from the protocol file + * Globals we want from the protocol file **/ IRCDVar *ircd; IRCDCAPAB *ircdcap; @@ -33,6 +34,11 @@ CMMode cmmodes[128]; char csmodes[128]; int UseTSMODE; +void pmodule_ircd_proto(IRCDProtoNew *proto) +{ + ircdprotonew = proto; +} + /** * Initiate a protocol struct ready for use **/ @@ -268,27 +274,49 @@ void anope_cmd_notice2(const char *source, const char *dest, const char *msg) ircdproto.ircd_cmd_notice2(source, dest, msg); } -void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...)
-{ -
va_list args; -
char buf[BUFSIZE]; -
char actionbuf[BUFSIZE]; -
*buf = '\0'; -
*actionbuf = '\0'; -
if (fmt) { -
va_start(args, fmt); -
vsnprintf(buf, BUFSIZE - 1, fmt, args); -
va_end(args); -
} else { -
return; -
} -
if (!buf) { -
return; -
} -
snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s %c", 1, buf, 1); -
ircdproto.ircd_cmd_privmsg(source, dest, actionbuf); -
} -
void anope_cmd_privmsg(const char *source, const char *dest, const char *fmt, ...) +void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...) +{ + +va_list args; + +char buf[BUFSIZE]; + +char actionbuf[BUFSIZE]; + + +*buf = '\0'; + +*actionbuf = '\0'; + + +if (fmt) { + +va_start(args, fmt); + +vsnprintf(buf, BUFSIZE - 1, fmt, args); + +va_end(args); + +} else { + +return; + +} + + +if (!buf) { + +return; + +} + +snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s %c", 1, buf, 1); + +ircdproto.ircd_cmd_privmsg(source, dest, actionbuf); + +} + +void anope_cmd_privmsg(const char *source, const char *dest, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; |