mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
fa20edc44d
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
48 lines
1.7 KiB
C
48 lines
1.7 KiB
C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under both the BSD-style license (found in the
|
|
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
|
* in the COPYING file in the root directory of this source tree).
|
|
* You may select, at your option, one of the above-listed licenses.
|
|
*/
|
|
|
|
|
|
|
|
/*-*************************************
|
|
* Dependencies
|
|
***************************************/
|
|
#define ZSTD_DEPS_NEED_MALLOC
|
|
#include "third_party/zstd/lib/common/error_private.h"
|
|
#include "third_party/zstd/lib/common/zstd_internal.h"
|
|
|
|
|
|
/*-****************************************
|
|
* Version
|
|
******************************************/
|
|
unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
|
|
|
|
const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
|
|
|
|
|
|
/*-****************************************
|
|
* ZSTD Error Management
|
|
******************************************/
|
|
#undef ZSTD_isError /* defined within zstd_internal.h */
|
|
/*! ZSTD_isError() :
|
|
* tells if a return value is an error code
|
|
* symbol is required for external callers */
|
|
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
|
|
|
|
/*! ZSTD_getErrorName() :
|
|
* provides error code string from function result (useful for debugging) */
|
|
const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
|
|
|
|
/*! ZSTD_getError() :
|
|
* convert a `size_t` function result into a proper ZSTD_errorCode enum */
|
|
ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
|
|
|
|
/*! ZSTD_getErrorString() :
|
|
* provides error code string from enum */
|
|
const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
|