51 m_flags(0), m_data_length(0), m_data_zlength(0), m_data_checksum(0),
52 m_compression_type((uint16_t)-1), m_version(version) {
71 uint8_t *buf = base + 10;
105 const uint8_t *base = *bufp;
115 uint16_t header_checksum =
decode_i16(bufp, remainp);
117 if (header_checksum_computed != header_checksum)
119 "Header checksum mismatch: %u (computed) != %u (stored)",
120 (
unsigned)header_checksum_computed, (
unsigned)header_checksum);
124 uint16_t header_length =
decode_byte(bufp, remainp);
Declarations for BlockCompressionCodec.
uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
Decode a 32-bit integer in little-endian order.
uint32_t fletcher32(const void *data8, size_t len8)
Compute fletcher32 checksum for arbitary data.
uint16_t decode_i16(const uint8_t **bufp, size_t *remainp)
Decode a 16-bit integer in little-endian order.
Limit of compression types.
Logging routines and macros.
void encode_i32(uint8_t **bufp, uint32_t val)
Encode a 32-bit integer in little-endian order.
Compatibility Macros for C/C++.
void encode_i16(uint8_t **bufp, uint16_t val)
Encode a 16-bit integer in little-endian order.
Functions to serialize/deserialize primitives to/from a memory buffer.
Implementation of checksum routines.
#define HT_THROWF(_code_, _fmt_,...)
long unsigned int Lu
Shortcut for printf formats.
uint8_t decode_byte(const uint8_t **bufp, size_t *remainp)
Decodes a single byte from the given buffer.
Error codes, Exception handling, error logging.
#define HT_THROW(_code_, _msg_)