summary refs log tree commit diff
path: root/bounce.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-25 02:27:05 -0400
committerJune McEnroe <june@causal.agency>2019-10-25 02:27:05 -0400
commit3f243081d85ca02188ccdd61ae3476ed9df933e1 (patch)
treee3adbde6da2c302255ee31d9db1f4fbe5ae45a37 /bounce.h
parentImplement ringDiff and ringRead (diff)
downloadpounce-3f243081d85ca02188ccdd61ae3476ed9df933e1.tar.gz
pounce-3f243081d85ca02188ccdd61ae3476ed9df933e1.zip
Implement client reading from ring buffer
It's still messy but it works!!
Diffstat (limited to '')
-rw-r--r--bounce.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/bounce.h b/bounce.h
index d81acf9..d4ec916 100644
--- a/bounce.h
+++ b/bounce.h
@@ -53,6 +53,11 @@ static inline struct Message parse(char *line) {
 	return msg;
 }
 
+void ringWrite(const char *line);
+size_t ringReader(const char *name);
+size_t ringDiff(size_t reader);
+const char *ringRead(time_t *time, size_t reader);
+
 void listenConfig(const char *cert, const char *priv);
 size_t listenBind(int fds[], size_t cap, const char *host, const char *port);
 int listenAccept(struct tls **client, int fd);
@@ -76,12 +81,9 @@ void clientRecv(struct Client *client);
 void clientSend(struct Client *client, const char *ptr, size_t len);
 void clientFormat(struct Client *client, const char *format, ...)
 	__attribute__((format(printf, 2, 3)));
+size_t clientDiff(const struct Client *client);
+void clientRead(struct Client *client);
 
 bool stateReady(void);
 void stateParse(char *line);
 void stateSync(struct Client *client);
-
-void ringWrite(const char *line);
-size_t ringReader(const char *name);
-size_t ringDiff(size_t reader);
-const char *ringRead(time_t *time, size_t reader);