/*
- * charybdis - an advanced ircd.
- * Copyright (c) 2016 William Pitcock <nenolod@dereferenced.org>.
+ * solanum - an advanced ircd.
+ * Copyright (c) 2016 Ariadne Conill <ariadne@dereferenced.org>.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CHARYBDIS__MSGBUF_H
-#define CHARYBDIS__MSGBUF_H
+#ifndef SOLANUM__MSGBUF_H
+#define SOLANUM__MSGBUF_H
#define MAXPARA (15)
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]) */
*/
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.