| 1 |
// third_party/examples/woff2/carbon/src/variable_length.carbon |
| 2 |
/* Copyright 2015 Google Inc. All Rights Reserved. |
| 3 |
|
| 4 |
Distributed under MIT license. |
| 5 |
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 6 |
*/ |
| 7 |
|
| 8 |
/* Helper functions for woff2 variable length types: 255UInt16 and UIntBase128 */ |
| 9 |
|
| 10 |
#ifndef WOFF2_VARIABLE_LENGTH_H_ |
| 11 |
#define WOFF2_VARIABLE_LENGTH_H_ |
| 12 |
|
| 13 |
#include <cinttypes> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
#include "./buffer.h" |
| 17 |
|
| 18 |
namespace woff2 { |
| 19 |
|
| 20 |
fn Size255UShort(value: uint16_t) -> size_t; |
| 21 |
fn Read255UShort(buf: Buffer*, value: unsigned int*) -> bool; |
| 22 |
fn Write255UShort(out: std::vector<uint8_t>*, value: int); |
| 23 |
fn Store255UShort(val: int, offset: size_t*, dst: uint8_t*); |
| 24 |
|
| 25 |
fn Base128Size(n: size_t) -> size_t; |
| 26 |
fn ReadBase128(buf: Buffer*, value: uint32_t*) -> bool; |
| 27 |
fn StoreBase128(len: size_t, offset: size_t*, dst: uint8_t*); |
| 28 |
|
| 29 |
} // namespace woff2 |
| 30 |
|
| 31 |
#endif // WOFF2_VARIABLE_LENGTH_H_ |
| 32 |
|