2 * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
10 #ifndef ZSTD_ERRORS_H_398273423
11 #define ZSTD_ERRORS_H_398273423
13 #if defined (__cplusplus)
17 /*===== dependency =====*/
18 #include <stddef.h> /* size_t */
21 /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */
22 #if defined(__GNUC__) && (__GNUC__ >= 4)
23 # define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default")))
25 # define ZSTDERRORLIB_VISIBILITY
27 #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
28 # define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY
29 #elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
30 # define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
32 # define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBILITY
35 /*-****************************************
37 ******************************************/
41 ZSTD_error_prefix_unknown,
42 ZSTD_error_version_unsupported,
43 ZSTD_error_parameter_unknown,
44 ZSTD_error_frameParameter_unsupported,
45 ZSTD_error_frameParameter_unsupportedBy32bits,
46 ZSTD_error_frameParameter_windowTooLarge,
47 ZSTD_error_compressionParameter_unsupported,
48 ZSTD_error_init_missing,
49 ZSTD_error_memory_allocation,
50 ZSTD_error_stage_wrong,
51 ZSTD_error_dstSize_tooSmall,
52 ZSTD_error_srcSize_wrong,
53 ZSTD_error_corruption_detected,
54 ZSTD_error_checksum_wrong,
55 ZSTD_error_tableLog_tooLarge,
56 ZSTD_error_maxSymbolValue_tooLarge,
57 ZSTD_error_maxSymbolValue_tooSmall,
58 ZSTD_error_dictionary_corrupted,
59 ZSTD_error_dictionary_wrong,
60 ZSTD_error_dictionaryCreation_failed,
64 /*! ZSTD_getErrorCode() :
65 convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
66 which can be used to compare directly with enum list published into "error_public.h" */
67 ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
68 ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
71 #if defined (__cplusplus)
75 #endif /* ZSTD_ERRORS_H_398273423 */