brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 96256ca Raw
38 lines · c
1//===-- Definition of mbstate-----------------------------------*-- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_SRC___SUPPORT_MBSTATE_H10#define LLVM_LIBC_SRC___SUPPORT_MBSTATE_H11 12#include "hdr/stdint_proxy.h"13#include "hdr/types/char32_t.h"14#include "src/__support/common.h"15 16namespace LIBC_NAMESPACE_DECL {17namespace internal {18 19struct mbstate {20  // store a partial codepoint (in UTF-32)21  char32_t partial = 0;22 23  /*24  Progress towards a conversion25    Increases with each push(...) until it reaches total_bytes26    Decreases with each pop(...) until it reaches 027  */28  uint8_t bytes_stored = 0;29 30  // Total number of bytes that will be needed to represent this character31  uint8_t total_bytes = 0;32};33 34} // namespace internal35} // namespace LIBC_NAMESPACE_DECL36 37#endif // LLVM_LIBC_SRC___SUPPORT_MBSTATE_H38