30 return pack->
endp - pack->
p;
33 #define PACK(pack, decl, sz) \
34 uint8_t *decl = pack->p; \
36 if (pack->p <= pack->endp)
56 p[1] = (s16 >> 8) & 0xff;
63 p[0] = (u16 >> 8) & 0xff;
72 p[1] = (u16 >> 8) & 0xff;
82 p[1] = (s32 >> 8) & 0xff;
83 p[2] = (s32 >> 16) & 0xff;
84 p[3] = (s32 >> 24) & 0xff;
93 p[1] = (u32 >> 8) & 0xff;
94 p[2] = (u32 >> 16) & 0xff;
95 p[3] = (u32 >> 24) & 0xff;
99 #define UNPACK(pack, decl, sz) \
100 uint8_t *decl = pack->p; \
102 if (pack->p > pack->endp) \
151 uint16_t u16 = p[0] | p[1] << 8;
162 uint32_t u32 = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
int16_t rf_unpack_s16be(rf_pack_t *pack)
void rf_pack_u16le(rf_pack_t *pack, uint16_t u16)
void rf_pack_s8(rf_pack_t *pack, int8_t s8)
void rf_pack_s16le(rf_pack_t *pack, int16_t s16)
uint16_t rf_unpack_u16be(rf_pack_t *pack)
void rf_pack_u32le(rf_pack_t *pack, uint32_t u32)
void rf_pack_u32be(rf_pack_t *pack, uint32_t u32)
int8_t rf_unpack_s8(rf_pack_t *pack)
void rf_pack_u16be(rf_pack_t *pack, uint16_t u16)
void rf_pack_bytes(rf_pack_t *pack, void *p, unsigned int sz)
void rf_pack_char(rf_pack_t *pack, char c)
#define UNPACK(pack, decl, sz)
int32_t rf_unpack_s32be(rf_pack_t *pack)
uint32_t rf_unpack_u32be(rf_pack_t *pack)
int rf_pack_remaining(rf_pack_t *pack)
int16_t rf_unpack_s16le(rf_pack_t *pack)
char rf_unpack_char(rf_pack_t *pack)
uint8_t rf_unpack_u8(rf_pack_t *pack)
void rf_pack_s16be(rf_pack_t *pack, int16_t s16)
uint32_t rf_unpack_u32le(rf_pack_t *pack)
#define PACK(pack, decl, sz)
uint16_t rf_unpack_u16le(rf_pack_t *pack)
void rf_pack_init(rf_pack_t *pack, void *p, unsigned int sz)
void rf_pack_s32be(rf_pack_t *pack, int32_t s32)
int32_t rf_unpack_s32le(rf_pack_t *pack)
void rf_unpack_bytes(rf_pack_t *pack, void *p, unsigned int sz)
void rf_pack_s32le(rf_pack_t *pack, int32_t s32)
void rf_pack_u8(rf_pack_t *pack, int16_t u8)