// SPDX-License-Identifier: MIT // SPDX-FileCopyrightText: 2026 Martino Ferrari #pragma once #include namespace plot { enum class ErrorCode { Ok, InvalidArgument, OutOfMemory, GLFailure, Unsupported, NotImplemented, }; /// Never-null human-readable name of an error code. const char* to_string(ErrorCode code) noexcept; /// Result of a fallible operation. Falsy unless `code == ErrorCode::Ok`. struct Status { ErrorCode code = ErrorCode::Ok; const char* message = ""; constexpr explicit operator bool() const noexcept { return code == ErrorCode::Ok; } }; } // namespace plot