Backed out 7 changesets (bug 1839993) for causing build bustages on DecoderTemplate...
[gecko.git] / modules / woff2 / src / variable_length.h
blob20801065357293a06afdfa826b86a8cca0629778
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
5 */
7 /* Helper functions for woff2 variable length types: 255UInt16 and UIntBase128 */
9 #ifndef WOFF2_VARIABLE_LENGTH_H_
10 #define WOFF2_VARIABLE_LENGTH_H_
12 #include <inttypes.h>
13 #include <vector>
14 #include "./buffer.h"
16 namespace woff2 {
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);
27 } // namespace woff2
29 #endif // WOFF2_VARIABLE_LENGTH_H_