diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-19 23:56:47 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-19 23:59:06 -0400 |
commit | fe26cb002db4b7bd9a53265690aba19a54ebe50f (patch) | |
tree | e139cfef34ffef1b5f0d936100a4e412aa5bc342 /include/zaprus.h | |
parent | c34748dab3def4dbb1deea7240ab3d4ef17ef161 (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); |