Buffer integer finished with tests
This commit is contained in:
parent
3d45b8b472
commit
713d96d770
3 changed files with 258 additions and 30 deletions
44
buf/buf.h
44
buf/buf.h
|
|
@ -1,12 +1,48 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
void buf_append_i8(uint8_t *buf, int8_t value, size_t *index);
|
||||
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);
|
||||
|
||||
void buf_append_i16(uint8_t *buf, int16_t value, size_t *index);
|
||||
void buf_append_u16(uint8_t *buf, uint16_t value, size_t *index);
|
||||
|
||||
void buf_append_i32(uint8_t *buf, int32_t value, size_t *index);
|
||||
void buf_append_u32(uint8_t *buf, uint32_t value, size_t *index);
|
||||
|
||||
void buf_append_i64(uint8_t *buf, int64_t value, size_t *index);
|
||||
void buf_append_u64(uint8_t *buf, uint64_t value, size_t *index);
|
||||
|
||||
int8_t buf_read_i8(const uint8_t *buf, size_t *index);
|
||||
uint8_t buf_read_u8(const uint8_t *buf, size_t *index);
|
||||
|
||||
int16_t buf_read_i16(const uint8_t *buf, size_t *index);
|
||||
uint16_t buf_read_u16(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);
|
||||
uint32_t buf_read_u32(const uint8_t *buf, size_t *index);
|
||||
|
||||
int64_t buf_read_i64(const uint8_t *buf, size_t *index);
|
||||
uint64_t buf_read_u64(const uint8_t *buf, size_t *index);
|
||||
|
||||
/*
|
||||
* Float stuff
|
||||
*/
|
||||
|
||||
// void buf_append_f16(uint8_t *buf, float value, size_t *index);
|
||||
// void buf_append_f16(uint8_t *buf, float value, float scale, size_t *index);
|
||||
|
||||
// void buf_append_f32(uint8_t *buf, float value, size_t *index);
|
||||
// void buf_append_f32_auto(uint8_t *buf, float value, size_t *index);
|
||||
//
|
||||
// void buf_append_f64(uint8_t *buf, double value, size_t *index);
|
||||
// void buf_append_f64_auto(uint8_t *buf, double value, size_t *index);
|
||||
|
||||
// float buf_read_f16(const uint8_t *buf, size_t *index);
|
||||
// float buf_read_f16(const uint8_t *buf, float scale, size_t *index);
|
||||
//
|
||||
// float buf_read_f32(const uint8_t *buf, size_t *index);
|
||||
// float buf_read_f32_auto(const uint8_t *buf, size_t *index);
|
||||
//
|
||||
// double buf_read_f64(const uint8_t *buf, size_t *index);
|
||||
// double buf_read_f64_auto(const uint8_t *buf, size_t *index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue