summaryrefslogtreecommitdiff
path: root/include/zaprus.h
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2025-04-19 23:56:47 -0400
committerRobby Zambito <contact@robbyzambito.me>2025-04-27 16:18:48 -0400
commit247c6b44077bf9fa86e65b289db8a85fe461245b (patch)
tree03ad714e529209e77fb5026afd22414824be5da9 /include/zaprus.h
parente847989592f8744307a82953cd13b3c491eb889e (diff)
Initial C api
Diffstat (limited to 'include/zaprus.h')
-rw-r--r--include/zaprus.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/zaprus.h b/include/zaprus.h
new file mode 100644
index 0000000..31fe97c
--- /dev/null
+++ b/include/zaprus.h
@@ -0,0 +1,24 @@
+// client
+
+int zaprus_init(void);
+
+int zaprus_deinit(void);
+
+int zaprus_send_relay(const char* payload, usize len, char[4] dest);
+
+int zaprus_send_initial_connection(const char* payload, usize len, uint16_t initial_port);
+
+struct SaprusMessage* zaprus_connect(const char* payload, usize len);
+
+// message
+struct SaprusMessage {
+
+};
+
+// ptr should be freed by the caller.
+int zaprus_message_to_bytes(struct SaprusMessage msg, char** ptr, usize* len);
+
+// Return value should be destroyed with zaprus_message_deinit.
+struct SaprusMessage* zaprus_message_from_bytes(const char* bytes, usize len);
+
+void zaprus_message_deinit(struct SaprusMessage* msg);