]> jfr.im git - solanum.git/blobdiff - include/msgbuf.h
Keep propagated bans in a dictionary, not a list
[solanum.git] / include / msgbuf.h
index 9bc34bf7018372b718169356b5a67839dc7df9e7..27e6d75d653e54bff6f6ba43cfad0d5ddce296a1 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * 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
@@ -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.