/* Copyright (c) 2018, Google Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <openssl/bytestring.h> #include "internal.h" static int is_valid_code_point(uint32_t v) { … } // BOTTOM_BITS returns a byte with the bottom |n| bits set. #define BOTTOM_BITS(n) … // TOP_BITS returns a byte with the top |n| bits set. #define TOP_BITS(n) … int CBS_get_utf8(CBS *cbs, uint32_t *out) { … } int CBS_get_latin1(CBS *cbs, uint32_t *out) { … } int CBS_get_ucs2_be(CBS *cbs, uint32_t *out) { … } int CBS_get_utf32_be(CBS *cbs, uint32_t *out) { … } size_t CBB_get_utf8_len(uint32_t u) { … } int CBB_add_utf8(CBB *cbb, uint32_t u) { … } int CBB_add_latin1(CBB *cbb, uint32_t u) { … } int CBB_add_ucs2_be(CBB *cbb, uint32_t u) { … } int CBB_add_utf32_be(CBB *cbb, uint32_t u) { … }