llvm/libc/src/stdio/printf_core/core_structs.h

//===-- Core Structures for printf ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H
#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H

#include "src/__support/macros/config.h"

#include "src/__support/CPP/string_view.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/stdio/printf_core/printf_config.h"

#include <inttypes.h>
#include <stddef.h>

namespace LIBC_NAMESPACE_DECL {
namespace printf_core {

// These length modifiers match the length modifiers in the format string, which
// is why they are formatted differently from the rest of the file.
enum class LengthModifier {};

struct LengthSpec {};

enum FormatFlags : uint8_t {};

struct FormatSection {};

enum PrimaryType : uint8_t {};

// TypeDesc stores the information about a type that is relevant to printf in
// a relatively compact manner.
struct TypeDesc {};

template <typename T> LIBC_INLINE constexpr TypeDesc type_desc_from_type() {}

// This is the value to be returned by conversions when no error has occurred.
constexpr int WRITE_OK =;
// These are the printf return values for when an error has occurred. They are
// all negative, and should be distinct.
constexpr int FILE_WRITE_ERROR =;
constexpr int FILE_STATUS_ERROR =;
constexpr int NULLPTR_WRITE_ERROR =;
constexpr int INT_CONVERSION_ERROR =;
constexpr int FIXED_POINT_CONVERSION_ERROR =;
constexpr int ALLOCATION_ERROR =;
} // namespace printf_core
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SRC_STDIO_PRINTF_CORE_CORE_STRUCTS_H