diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-26 10:01:56 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-26 10:02:32 -0400 |
commit | c490d4eec682a78bd79922fdfa582d6369cdf0bc (patch) | |
tree | a053dda4be6954021d5c5a17ee76954a2489f6c2 /include/zaprus.h | |
parent | a1b3c07f0e59f3f56ae76fe4a43df3170ac78606 (diff) |
Make C struct match the binary API more closelypush-xrxworrupytk
Also make the internal conversion function return errors properly
Diffstat (limited to 'include/zaprus.h')
-rw-r--r-- | include/zaprus.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/zaprus.h b/include/zaprus.h index 6856a5e..51ac70c 100644 --- a/include/zaprus.h +++ b/include/zaprus.h @@ -20,13 +20,12 @@ struct SaprusMessage* zaprus_connect(const char* payload, size_t len); struct SaprusMessage { uint16_t packet_type; + uint16_t payload_len; union { struct { struct { char dest[4]; }; - size_t payload_len; - char *payload; } relay; struct { struct { @@ -37,10 +36,10 @@ struct SaprusMessage { char _reserved; char options; }; - size_t payload_len; - char *payload; + } connection; - }; + } headers; + char *payload; }; // ptr should be freed by the caller. |