Initial C api

This commit is contained in:
2025-04-19 23:56:47 -04:00
parent c34748dab3
commit fe26cb002d
4 changed files with 102 additions and 2 deletions

24
include/zaprus.h Normal file
View File

@@ -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);