#include "parse.h"
#include "modules.h"
-static int ms_encap(struct Client *client_p, struct Client *source_p,
+static int ms_encap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
int parc, const char *parv[]);
struct Message encap_msgtab = {
- "ENCAP", 0, 0, 0, MFLG_SLOW,
+ "ENCAP", 0, 0, 0, 0,
{mg_ignore, mg_ignore, {ms_encap, 3}, {ms_encap, 3}, mg_ignore, mg_ignore}
};
* parv[3] - parameters
*/
static int
-ms_encap(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+ms_encap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
char buffer[BUFSIZE];
char *ptr;
int i;
ptr = buffer;
-
+
for(i = 1; i < parc - 1; i++)
{
len = strlen(parv[i]) + 1;
if((size_t)(cur_len + len) >= sizeof(buffer))
return 0;
- rb_snprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]);
+ snprintf(ptr, sizeof(buffer) - cur_len, "%s ", parv[i]);
cur_len += len;
ptr += len;
}
/* if its a command without parameters, dont prepend a ':' */
if(parc == 3)
- rb_snprintf(ptr, sizeof(buffer) - cur_len, "%s", parv[2]);
+ snprintf(ptr, sizeof(buffer) - cur_len, "%s", parv[2]);
else
- rb_snprintf(ptr, sizeof(buffer) - cur_len, ":%s", parv[parc-1]);
+ snprintf(ptr, sizeof(buffer) - cur_len, ":%s", parv[parc-1]);
/* add a trailing \0 if it was too long */
if((cur_len + len) >= BUFSIZE)
/* if it matches us, find a matching handler and call it */
if(match(parv[1], me.name))
- handle_encap(client_p, source_p, parv[2], parc - 2, parv + 2);
+ handle_encap(msgbuf_p, client_p, source_p, parv[2], parc - 2, parv + 2);
return 0;
}
-
-