From e90fec914ecf19e45999249e63c56438b1427bcd Mon Sep 17 00:00:00 2001 From: powturbo Date: Thu, 28 May 2015 17:09:24 +0200 Subject: [PATCH] . --- ext/MaskedVByte/include/varintencode.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ext/MaskedVByte/include/varintencode.h diff --git a/ext/MaskedVByte/include/varintencode.h b/ext/MaskedVByte/include/varintencode.h new file mode 100644 index 0000000..2183968 --- /dev/null +++ b/ext/MaskedVByte/include/varintencode.h @@ -0,0 +1,18 @@ + +#ifndef VARINTENCODE_H_ +#define VARINTENCODE_H_ + +#include // please use a C99-compatible compiler +#include + +// Encode an array of a given length read from in to bout in varint format. +// Returns the number of bytes written. +size_t vbyte_encode(uint32_t *in, size_t length, uint8_t *bout); + +// Encode an array of a given length read from in to bout in varint format with differential +// coding starting at value prev. (Setting prev to 0 is a good default.) +// Returns the number of bytes written. +size_t vbyte_encode_delta(uint32_t *in, size_t length, uint8_t *bout, uint32_t prev); + + +#endif /* VARINTENCODE_H_ */