File: variable_length.carbon

package info (click to toggle)
cloc 2.04-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,776 kB
  • sloc: perl: 29,368; cpp: 1,219; ansic: 334; asm: 267; makefile: 240; sh: 186; sql: 144; java: 136; ruby: 111; cs: 104; python: 84; pascal: 52; lisp: 50; cobol: 35; f90: 35; haskell: 35; objc: 25; php: 22; javascript: 15; fortran: 9; ml: 8; xml: 7; tcl: 2
file content (32 lines) | stat: -rw-r--r-- 907 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// third_party/examples/woff2/carbon/src/variable_length.carbon
/* Copyright 2015 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Helper functions for woff2 variable length types: 255UInt16 and UIntBase128 */

#ifndef WOFF2_VARIABLE_LENGTH_H_
#define WOFF2_VARIABLE_LENGTH_H_

#include <cinttypes>
#include <vector>

#include "./buffer.h"

namespace woff2 {

fn Size255UShort(value: uint16_t) -> size_t;
fn Read255UShort(buf: Buffer*, value: unsigned int*) -> bool;
fn Write255UShort(out: std::vector<uint8_t>*, value: int);
fn Store255UShort(val: int, offset: size_t*, dst: uint8_t*);

fn Base128Size(n: size_t) -> size_t;
fn ReadBase128(buf: Buffer*, value: uint32_t*) -> bool;
fn StoreBase128(len: size_t, offset: size_t*, dst: uint8_t*);

} // namespace woff2

#endif  // WOFF2_VARIABLE_LENGTH_H_