summary refs log tree commit diff
path: root/bounce.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-28 00:39:16 -0400
committerJune McEnroe <june@causal.agency>2019-10-28 00:39:16 -0400
commit0c964f63c5e9362d856778b0abf81fdaff004d57 (patch)
treec356a244640731ba6e39137bbb3e90e6c75fc8c6 /bounce.h
parentWait for SASL success before sending CAP END (diff)
downloadpounce-0c964f63c5e9362d856778b0abf81fdaff004d57.tar.gz
pounce-0c964f63c5e9362d856778b0abf81fdaff004d57.zip
Move entire login flow to state and reorganize it
Diffstat (limited to 'bounce.h')
-rw-r--r--bounce.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/bounce.h b/bounce.h
index e412358..9221185 100644
--- a/bounce.h
+++ b/bounce.h
@@ -30,6 +30,8 @@
 
 #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
 
+typedef unsigned char byte;
+
 static const char *SourceURL = "https://code.causal.agency/june/pounce";
 static const char *Origin = "irc.invalid";
 
@@ -68,11 +70,6 @@ size_t listenBind(int fds[], size_t cap, const char *host, const char *port);
 struct tls *listenAccept(int *fd, int bind);
 
 int serverConnect(bool insecure, const char *host, const char *port);
-void serverLogin(
-	const char *pass, const char *auth,
-	const char *nick, const char *user, const char *real
-);
-void serverAuth(void);
 void serverRecv(void);
 void serverSend(const char *ptr, size_t len);
 void serverFormat(const char *format, ...)
@@ -90,7 +87,11 @@ size_t clientDiff(const struct Client *client);
 void clientConsume(struct Client *client);
 
 bool stateJoinNames;
+void stateLogin(
+	const char *pass, const char *auth,
+	const char *nick, const char *user, const char *real
+);
 bool stateReady(void);
 void stateParse(char *line);
 void stateSync(struct Client *client);
-const char *stateSelf(void);
+const char *stateEcho(void);