diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-19 23:56:47 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-27 18:03:06 -0400 |
commit | ee6062334b0d2ed391c8987b6219835e12860706 (patch) | |
tree | 421ccd25da3d9868f1c68df5e48c6111ec53495f /include/zaprus.h | |
parent | 683a2015b0a2d410d012bef404e891da5f6f261e (diff) |
Initial C api
Diffstat (limited to 'include/zaprus.h')
-rw-r--r-- | include/zaprus.h | 24 |
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); |