1 /* Copyright 2015 Google Inc. All Rights Reserved.
3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
7 /* Helper functions for woff2 variable length types: 255UInt16 and UIntBase128 */
9 #ifndef WOFF2_VARIABLE_LENGTH_H_
10 #define WOFF2_VARIABLE_LENGTH_H_
18 size_t Size255UShort(uint16_t value
);
19 bool Read255UShort(Buffer
* buf
, unsigned int* value
);
20 void Write255UShort(std::vector
<uint8_t>* out
, int value
);
21 void Store255UShort(int val
, size_t* offset
, uint8_t* dst
);
23 size_t Base128Size(size_t n
);
24 bool ReadBase128(Buffer
* buf
, uint32_t* value
);
25 void StoreBase128(size_t len
, size_t* offset
, uint8_t* dst
);
29 #endif // WOFF2_VARIABLE_LENGTH_H_