X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/4b1cce65ed584cc0fdc9f3c5ec84373fdf2566a8..28bcd75330ad1cedaf1f680b7a263ba5356bf752:/include/msgbuf.h diff --git a/include/msgbuf.h b/include/msgbuf.h index 9bc34bf7..27e6d75d 100644 --- a/include/msgbuf.h +++ b/include/msgbuf.h @@ -1,6 +1,6 @@ /* - * charybdis - an advanced ircd. - * Copyright (c) 2016 William Pitcock . + * solanum - an advanced ircd. + * Copyright (c) 2016 Ariadne Conill . * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -19,8 +19,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CHARYBDIS__MSGBUF_H -#define CHARYBDIS__MSGBUF_H +#ifndef SOLANUM__MSGBUF_H +#define SOLANUM__MSGBUF_H #define MAXPARA (15) @@ -38,6 +38,7 @@ struct MsgBuf { const char *origin; /* the origin of the message (or NULL) */ const char *target; /* the target of the message (either NULL, or custom defined) */ const char *cmd; /* the cmd/verb of the message (either NULL, or para[0]) */ + char *endp; /* one past the end of the original array */ size_t n_para; /* the number of parameters (always at least 1 if a full message) */ const char *para[MAXPARA]; /* parameters vector (starting with cmd as para[0]) */ @@ -76,6 +77,12 @@ struct MsgBuf_cache { */ int msgbuf_parse(struct MsgBuf *msgbuf, char *line); +/* + * Unparse the tail of a msgbuf perfectly, preserving framing details + * msgbuf->para[n] will reach to the end of the line + */ +void msgbuf_reconstruct_tail(struct MsgBuf *msgbuf, size_t n); + /* * unparse a pure MsgBuf into a buffer. * if origin is NULL, me.name will be used.