webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
variable_length.h
Go to the documentation of this file.
1 // Copyright 2015 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // Helper functions for woff2 variable length types: 255UInt16 and UIntBase128
16 
17 #ifndef WOFF2_VARIABLE_LENGTH_H_
18 #define WOFF2_VARIABLE_LENGTH_H_
19 
20 #include <inttypes.h>
21 #include <vector>
22 #include "./buffer.h"
23 
24 namespace woff2 {
25 
27 bool Read255UShort(Buffer* buf, unsigned int* value);
28 void Write255UShort(std::vector<uint8_t>* out, int value);
29 void Store255UShort(int val, size_t* offset, uint8_t* dst);
30 
31 size_t Base128Size(size_t n);
33 void StoreBase128(size_t len, size_t* offset, uint8_t* dst);
34 
35 } // namespace woff2
36 
37 #endif // WOFF2_VARIABLE_LENGTH_H_
38 
void Store255UShort(int val, size_t *offset, uint8_t *dst)
Definition: variable_length.cc:49
size_t Base128Size(size_t n)
Definition: variable_length.cc:119
unsigned int uint32_t
Definition: ptypes.h:105
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: gl2ext.h:134
void StoreBase128(size_t len, size_t *offset, uint8_t *dst)
Definition: variable_length.cc:125
bool ReadBase128(Buffer *buf, uint32_t *value)
Definition: variable_length.cc:94
EGLStreamKHR EGLint n
Definition: eglext.h:984
GLenum GLenum dst
Definition: gl2ext.h:304
EGLStreamKHR EGLint EGLint offset
Definition: eglext.h:984
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char int len
Definition: x509.h:1053
BufferT< uint8_t > Buffer
Definition: buffer.h:370
int int * out
Definition: gcc-loops.cpp:206
EGLAttrib * value
Definition: eglext.h:120
unsigned char uint8_t
Definition: ptypes.h:89
size_t Size255UShort(uint16_t value)
Definition: variable_length.cc:21
unsigned short uint16_t
Definition: ptypes.h:97
void Write255UShort(std::vector< uint8_t > *out, int value)
Definition: variable_length.cc:33
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301
Definition: buffer.h:45
bool Read255UShort(Buffer *buf, unsigned int *value)
Definition: variable_length.cc:58