Coverage Report

Created: 2025-03-15 06:58

/src/zstd/lib/common/zstd_common.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) Meta Platforms, Inc. and affiliates.
3
 * All rights reserved.
4
 *
5
 * This source code is licensed under both the BSD-style license (found in the
6
 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7
 * in the COPYING file in the root directory of this source tree).
8
 * You may select, at your option, one of the above-listed licenses.
9
 */
10
11
12
13
/*-*************************************
14
*  Dependencies
15
***************************************/
16
#define ZSTD_DEPS_NEED_MALLOC
17
#include "error_private.h"
18
#include "zstd_internal.h"
19
20
21
/*-****************************************
22
*  Version
23
******************************************/
24
0
unsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }
25
26
0
const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
27
28
29
/*-****************************************
30
*  ZSTD Error Management
31
******************************************/
32
#undef ZSTD_isError   /* defined within zstd_internal.h */
33
/*! ZSTD_isError() :
34
 *  tells if a return value is an error code
35
 *  symbol is required for external callers */
36
80.8k
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
37
38
/*! ZSTD_getErrorName() :
39
 *  provides error code string from function result (useful for debugging) */
40
36.1k
const char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }
41
42
/*! ZSTD_getError() :
43
 *  convert a `size_t` function result into a proper ZSTD_errorCode enum */
44
485
ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }
45
46
/*! ZSTD_getErrorString() :
47
 *  provides error code string from enum */
48
0
const char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }
49
50
int ZSTD_isDeterministicBuild(void)
51
0
{
52
0
#if ZSTD_IS_DETERMINISTIC_BUILD
53
0
    return 1;
54
#else
55
    return 0;
56
#endif
57
0
}