about summary refs log tree commit diff
path: root/bounce.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-07-16 21:23:33 -0400
committerJune McEnroe <june@causal.agency>2023-07-16 21:23:33 -0400
commita6c37817668f5b0e1d2cce3ee949470a0a440bfe (patch)
treef25fc1c5f8d98b3447f01faed185848c78f21d7a /bounce.h
parentFactor out caps pounce doesn't request from the server (diff)
downloadpounce-a6c37817668f5b0e1d2cce3ee949470a0a440bfe.tar.gz
pounce-a6c37817668f5b0e1d2cce3ee949470a0a440bfe.zip
Implement draft/read-marker
Diffstat (limited to 'bounce.h')
-rw-r--r--bounce.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/bounce.h b/bounce.h
index 8df85fc..e670ff3 100644
--- a/bounce.h
+++ b/bounce.h
@@ -25,6 +25,7 @@
  * covered work.
  */
 
+#include <err.h>
 #include <limits.h>
 #include <stdarg.h>
 #include <stdbool.h>
@@ -32,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/time.h>
+#include <sysexits.h>
 #include <tls.h>
 
 #ifndef OPENSSL_BIN
@@ -57,6 +59,12 @@ static inline char *seprintf(char *ptr, char *end, const char *fmt, ...) {
 	return ptr + n;
 }
 
+static inline void set(char **field, const char *value) {
+	if (*field) free(*field);
+	*field = strdup(value);
+	if (!*field) err(EX_OSERR, "strdup");
+}
+
 enum { MessageCap = 8191 + 512 };
 
 enum { ParamCap = 15 };
@@ -92,6 +100,7 @@ static inline struct Message parse(char *line) {
 	X("causal.agency/consumer", CapConsumer) \
 	X("causal.agency/passive", CapPassive) \
 	X("chghost", CapChghost) \
+	X("draft/read-marker", CapReadMarker) \
 	X("echo-message", CapEchoMessage) \
 	X("extended-join", CapExtendedJoin) \
 	X("extended-monitor", CapExtendedMonitor) \
@@ -238,6 +247,7 @@ void clientSend(struct Client *client, const char *ptr, size_t len);
 void clientFormat(struct Client *client, const char *format, ...)
 	__attribute__((format(printf, 2, 3)));
 void clientConsume(struct Client *client);
+void clientGetMarker(struct Client *client, const char *target);
 
 extern bool stateNoNames;
 extern enum Cap stateCaps;