Buf serializing code
This commit is contained in:
parent
b0d86c7e2c
commit
f8eed345ec
4 changed files with 220 additions and 0 deletions
12
buf/buf.h
Normal file
12
buf/buf.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
void buf_append_u8(uint8_t *buf, uint8_t value, size_t *index);
|
||||
void buf_append_i16(uint8_t *buf, int16_t value, size_t *index);
|
||||
void buf_append_i32(uint8_t *buf, int32_t value, size_t *index);
|
||||
void buf_append_f32(uint8_t *buf, float value, size_t *index);
|
||||
|
||||
uint8_t buf_read_u8(const uint8_t *buf, size_t *index);
|
||||
uint8_t buf_read_i16(const uint8_t *buf, size_t *index);
|
||||
int32_t buf_read_i32(const uint8_t *buf, size_t *index);
|
||||
float buf_read_f32(const uint8_t *buf, size_t *index);
|
||||
Loading…
Add table
Add a link
Reference in a new issue