Path: blob/master/Utilities/cmzstd/lib/common/zstd_common.c
3158 views
/*1* Copyright (c) Meta Platforms, Inc. and affiliates.2* All rights reserved.3*4* This source code is licensed under both the BSD-style license (found in the5* LICENSE file in the root directory of this source tree) and the GPLv2 (found6* in the COPYING file in the root directory of this source tree).7* You may select, at your option, one of the above-listed licenses.8*/9101112/*-*************************************13* Dependencies14***************************************/15#define ZSTD_DEPS_NEED_MALLOC16#include "error_private.h"17#include "zstd_internal.h"181920/*-****************************************21* Version22******************************************/23unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }2425const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }262728/*-****************************************29* ZSTD Error Management30******************************************/31#undef ZSTD_isError /* defined within zstd_internal.h */32/*! ZSTD_isError() :33* tells if a return value is an error code34* symbol is required for external callers */35unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }3637/*! ZSTD_getErrorName() :38* provides error code string from function result (useful for debugging) */39const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }4041/*! ZSTD_getError() :42* convert a `size_t` function result into a proper ZSTD_errorCode enum */43ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }4445/*! ZSTD_getErrorString() :46* provides error code string from enum */47const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }484950