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 18:03:06 -0400
commitee6062334b0d2ed391c8987b6219835e12860706 (patch)
tree421ccd25da3d9868f1c68df5e48c6111ec53495f /include/zaprus.h
parent683a2015b0a2d410d012bef404e891da5f6f261e (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);