contrib/python-zstandard/zstd/common/zstd_errors.h
changeset 30434 2e484bdea8c4
child 30895 c32454d69b85
equal deleted inserted replaced
30433:96f2f50d923f 30434:2e484bdea8c4
       
     1 /**
       
     2  * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
       
     3  * All rights reserved.
       
     4  *
       
     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.
       
     8  */
       
     9 
       
    10 #ifndef ZSTD_ERRORS_H_398273423
       
    11 #define ZSTD_ERRORS_H_398273423
       
    12 
       
    13 #if defined (__cplusplus)
       
    14 extern "C" {
       
    15 #endif
       
    16 
       
    17 /*===== dependency =====*/
       
    18 #include <stddef.h>   /* size_t */
       
    19 
       
    20 
       
    21 /*-****************************************
       
    22 *  error codes list
       
    23 ******************************************/
       
    24 typedef enum {
       
    25   ZSTD_error_no_error,
       
    26   ZSTD_error_GENERIC,
       
    27   ZSTD_error_prefix_unknown,
       
    28   ZSTD_error_version_unsupported,
       
    29   ZSTD_error_parameter_unknown,
       
    30   ZSTD_error_frameParameter_unsupported,
       
    31   ZSTD_error_frameParameter_unsupportedBy32bits,
       
    32   ZSTD_error_frameParameter_windowTooLarge,
       
    33   ZSTD_error_compressionParameter_unsupported,
       
    34   ZSTD_error_init_missing,
       
    35   ZSTD_error_memory_allocation,
       
    36   ZSTD_error_stage_wrong,
       
    37   ZSTD_error_dstSize_tooSmall,
       
    38   ZSTD_error_srcSize_wrong,
       
    39   ZSTD_error_corruption_detected,
       
    40   ZSTD_error_checksum_wrong,
       
    41   ZSTD_error_tableLog_tooLarge,
       
    42   ZSTD_error_maxSymbolValue_tooLarge,
       
    43   ZSTD_error_maxSymbolValue_tooSmall,
       
    44   ZSTD_error_dictionary_corrupted,
       
    45   ZSTD_error_dictionary_wrong,
       
    46   ZSTD_error_maxCode
       
    47 } ZSTD_ErrorCode;
       
    48 
       
    49 /*! ZSTD_getErrorCode() :
       
    50     convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
       
    51     which can be used to compare directly with enum list published into "error_public.h" */
       
    52 ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
       
    53 const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
       
    54 
       
    55 
       
    56 #if defined (__cplusplus)
       
    57 }
       
    58 #endif
       
    59 
       
    60 #endif /* ZSTD_ERRORS_H_398273423 */