double twkb_parse_state_double(twkb_parse_state *s, double factor) { size_t size; int64_t val = varint_s64_decode(s->pos, s->twkb_end, &size); twkb_parse_state_advance(s, size); return val / factor; }
static inline uint64_t twkb_parse_state_uvarint(twkb_parse_state *s) { size_t size; uint64_t val = varint_u64_decode(s->pos, s->twkb_end, &size); twkb_parse_state_advance(s, size); return val; }
static inline void twkb_parse_state_varint_skip(twkb_parse_state *s) { size_t size = varint_size(s->pos, s->twkb_end); if ( ! size ) lwerror("%s: no varint to skip", __func__); twkb_parse_state_advance(s, size); return; }
/** * Byte * Read a byte and advance the parse state forward. */ static uint8_t byte_from_twkb_state(twkb_parse_state *s) { uint8_t val = *(s->pos); twkb_parse_state_advance(s, WKB_BYTE_SIZE); return val; }