summaryrefslogtreecommitdiff
path: root/bounce.h
diff options
context:
space:
mode:
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;