Editor/Embedded/ZstdSharp/Unsafe/Methods.ZstdCommon.cs

P/Invoke-style wrapper methods for Zstandard error helpers, exposed in an unsafe partial Methods class. It forwards calls to ERR_* helpers: checks if a returned size_t is an error, returns the error name string, and converts a size_t to a ZSTD_ErrorCode enum.

Native Interop
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
namespace HumanoidRetargeter.EditorTools.Embedded.ZstdSharp.Unsafe;

    public static unsafe partial class Methods
    {

        /*! ZSTD_isError() :
         *  tells if a return value is an error code
         *  symbol is required for external callers */
        public static bool ZSTD_isError(nuint code)
        {
            return ERR_isError(code);
        }

        /*! ZSTD_getErrorName() :
         *  provides error code string from function result (useful for debugging) */
        public static string ZSTD_getErrorName(nuint code)
        {
            return ERR_getErrorName(code);
        }

        /*! ZSTD_getError() :
         *  convert a `size_t` function result into a proper ZSTD_errorCode enum */
        public static ZSTD_ErrorCode ZSTD_getErrorCode(nuint code)
        {
            return ERR_getErrorCode(code);
        }
    }