Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:32

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 /*===== dependency =====*/
0019 #include <stddef.h>   /* size_t */
0020 
0021 
0022 /* =====   ZSTDERRORLIB_API : control library symbols visibility   ===== */
0023 #ifndef ZSTDERRORLIB_VISIBLE
0024    /* Backwards compatibility with old macro name */
0025 #  ifdef ZSTDERRORLIB_VISIBILITY
0026 #    define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY
0027 #  elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
0028 #    define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default")))
0029 #  else
0030 #    define ZSTDERRORLIB_VISIBLE
0031 #  endif
0032 #endif
0033 
0034 #ifndef ZSTDERRORLIB_HIDDEN
0035 #  if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
0036 #    define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden")))
0037 #  else
0038 #    define ZSTDERRORLIB_HIDDEN
0039 #  endif
0040 #endif
0041 
0042 #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
0043 #  define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE
0044 #elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
0045 #  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.*/
0046 #else
0047 #  define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE
0048 #endif
0049 
0050 /*-*********************************************
0051  *  Error codes list
0052  *-*********************************************
0053  *  Error codes _values_ are pinned down since v1.3.1 only.
0054  *  Therefore, don't rely on values if you may link to any version < v1.3.1.
0055  *
0056  *  Only values < 100 are considered stable.
0057  *
0058  *  note 1 : this API shall be used with static linking only.
0059  *           dynamic linking is not yet officially supported.
0060  *  note 2 : Prefer relying on the enum than on its value whenever possible
0061  *           This is the only supported way to use the error list < v1.3.1
0062  *  note 3 : ZSTD_isError() is always correct, whatever the library version.
0063  **********************************************/
0064 typedef enum {
0065   ZSTD_error_no_error = 0,
0066   ZSTD_error_GENERIC  = 1,
0067   ZSTD_error_prefix_unknown                = 10,
0068   ZSTD_error_version_unsupported           = 12,
0069   ZSTD_error_frameParameter_unsupported    = 14,
0070   ZSTD_error_frameParameter_windowTooLarge = 16,
0071   ZSTD_error_corruption_detected = 20,
0072   ZSTD_error_checksum_wrong      = 22,
0073   ZSTD_error_literals_headerWrong = 24,
0074   ZSTD_error_dictionary_corrupted      = 30,
0075   ZSTD_error_dictionary_wrong          = 32,
0076   ZSTD_error_dictionaryCreation_failed = 34,
0077   ZSTD_error_parameter_unsupported   = 40,
0078   ZSTD_error_parameter_combination_unsupported = 41,
0079   ZSTD_error_parameter_outOfBound    = 42,
0080   ZSTD_error_tableLog_tooLarge       = 44,
0081   ZSTD_error_maxSymbolValue_tooLarge = 46,
0082   ZSTD_error_maxSymbolValue_tooSmall = 48,
0083   ZSTD_error_stabilityCondition_notRespected = 50,
0084   ZSTD_error_stage_wrong       = 60,
0085   ZSTD_error_init_missing      = 62,
0086   ZSTD_error_memory_allocation = 64,
0087   ZSTD_error_workSpace_tooSmall= 66,
0088   ZSTD_error_dstSize_tooSmall = 70,
0089   ZSTD_error_srcSize_wrong    = 72,
0090   ZSTD_error_dstBuffer_null   = 74,
0091   ZSTD_error_noForwardProgress_destFull = 80,
0092   ZSTD_error_noForwardProgress_inputEmpty = 82,
0093   /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */
0094   ZSTD_error_frameIndex_tooLarge = 100,
0095   ZSTD_error_seekableIO          = 102,
0096   ZSTD_error_dstBuffer_wrong     = 104,
0097   ZSTD_error_srcBuffer_wrong     = 105,
0098   ZSTD_error_sequenceProducer_failed = 106,
0099   ZSTD_error_externalSequences_invalid = 107,
0100   ZSTD_error_maxCode = 120  /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
0101 } ZSTD_ErrorCode;
0102 
0103 /*! ZSTD_getErrorCode() :
0104     convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
0105     which can be used to compare with enum list published above */
0106 ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
0107 ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);   /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */
0108 
0109 
0110 #if defined (__cplusplus)
0111 }
0112 #endif
0113 
0114 #endif /* ZSTD_ERRORS_H_398273423 */