Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:21:56

0001 /*
0002  * Copyright (c) Meta Platforms, Inc. and affiliates.
0003  * All rights reserved.
0004  *
0005  * This source code is licensed under both the BSD-style license (found in the
0006  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
0007  * in the COPYING file in the root directory of this source tree).
0008  * You may select, at your option, one of the above-listed licenses.
0009  */
0010 
0011 #ifndef ZSTD_ERRORS_H_398273423
0012 #define ZSTD_ERRORS_H_398273423
0013 
0014 #if defined (__cplusplus)
0015 extern "C" {
0016 #endif
0017 
0018 /* =====   ZSTDERRORLIB_API : control library symbols visibility   ===== */
0019 #ifndef ZSTDERRORLIB_VISIBLE
0020    /* Backwards compatibility with old macro name */
0021 #  ifdef ZSTDERRORLIB_VISIBILITY
0022 #    define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY
0023 #  elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
0024 #    define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default")))
0025 #  else
0026 #    define ZSTDERRORLIB_VISIBLE
0027 #  endif
0028 #endif
0029 
0030 #ifndef ZSTDERRORLIB_HIDDEN
0031 #  if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
0032 #    define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden")))
0033 #  else
0034 #    define ZSTDERRORLIB_HIDDEN
0035 #  endif
0036 #endif
0037 
0038 #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
0039 #  define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE
0040 #elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
0041 #  define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
0042 #else
0043 #  define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE
0044 #endif
0045 
0046 /*-*********************************************
0047  *  Error codes list
0048  *-*********************************************
0049  *  Error codes _values_ are pinned down since v1.3.1 only.
0050  *  Therefore, don't rely on values if you may link to any version < v1.3.1.
0051  *
0052  *  Only values < 100 are considered stable.
0053  *
0054  *  note 1 : this API shall be used with static linking only.
0055  *           dynamic linking is not yet officially supported.
0056  *  note 2 : Prefer relying on the enum than on its value whenever possible
0057  *           This is the only supported way to use the error list < v1.3.1
0058  *  note 3 : ZSTD_isError() is always correct, whatever the library version.
0059  **********************************************/
0060 typedef enum {
0061   ZSTD_error_no_error = 0,
0062   ZSTD_error_GENERIC  = 1,
0063   ZSTD_error_prefix_unknown                = 10,
0064   ZSTD_error_version_unsupported           = 12,
0065   ZSTD_error_frameParameter_unsupported    = 14,
0066   ZSTD_error_frameParameter_windowTooLarge = 16,
0067   ZSTD_error_corruption_detected = 20,
0068   ZSTD_error_checksum_wrong      = 22,
0069   ZSTD_error_literals_headerWrong = 24,
0070   ZSTD_error_dictionary_corrupted      = 30,
0071   ZSTD_error_dictionary_wrong          = 32,
0072   ZSTD_error_dictionaryCreation_failed = 34,
0073   ZSTD_error_parameter_unsupported   = 40,
0074   ZSTD_error_parameter_combination_unsupported = 41,
0075   ZSTD_error_parameter_outOfBound    = 42,
0076   ZSTD_error_tableLog_tooLarge       = 44,
0077   ZSTD_error_maxSymbolValue_tooLarge = 46,
0078   ZSTD_error_maxSymbolValue_tooSmall = 48,
0079   ZSTD_error_cannotProduce_uncompressedBlock = 49,
0080   ZSTD_error_stabilityCondition_notRespected = 50,
0081   ZSTD_error_stage_wrong       = 60,
0082   ZSTD_error_init_missing      = 62,
0083   ZSTD_error_memory_allocation = 64,
0084   ZSTD_error_workSpace_tooSmall= 66,
0085   ZSTD_error_dstSize_tooSmall = 70,
0086   ZSTD_error_srcSize_wrong    = 72,
0087   ZSTD_error_dstBuffer_null   = 74,
0088   ZSTD_error_noForwardProgress_destFull = 80,
0089   ZSTD_error_noForwardProgress_inputEmpty = 82,
0090   /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */
0091   ZSTD_error_frameIndex_tooLarge = 100,
0092   ZSTD_error_seekableIO          = 102,
0093   ZSTD_error_dstBuffer_wrong     = 104,
0094   ZSTD_error_srcBuffer_wrong     = 105,
0095   ZSTD_error_sequenceProducer_failed = 106,
0096   ZSTD_error_externalSequences_invalid = 107,
0097   ZSTD_error_maxCode = 120  /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
0098 } ZSTD_ErrorCode;
0099 
0100 ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);   /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */
0101 
0102 
0103 #if defined (__cplusplus)
0104 }
0105 #endif
0106 
0107 #endif /* ZSTD_ERRORS_H_398273423 */