You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

error_public.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef ERROR_PUBLIC_H_MODULE
  10. #define ERROR_PUBLIC_H_MODULE
  11. #if defined (__cplusplus)
  12. extern "C" {
  13. #endif
  14. /*===== dependency =====*/
  15. #include <stddef.h> /* size_t */
  16. /*-****************************************
  17. * error codes list
  18. ******************************************/
  19. typedef enum {
  20. ZSTD_error_no_error,
  21. ZSTD_error_GENERIC,
  22. ZSTD_error_prefix_unknown,
  23. ZSTD_error_version_unsupported,
  24. ZSTD_error_parameter_unknown,
  25. ZSTD_error_frameParameter_unsupported,
  26. ZSTD_error_frameParameter_unsupportedBy32bits,
  27. ZSTD_error_compressionParameter_unsupported,
  28. ZSTD_error_init_missing,
  29. ZSTD_error_memory_allocation,
  30. ZSTD_error_stage_wrong,
  31. ZSTD_error_dstSize_tooSmall,
  32. ZSTD_error_srcSize_wrong,
  33. ZSTD_error_corruption_detected,
  34. ZSTD_error_checksum_wrong,
  35. ZSTD_error_tableLog_tooLarge,
  36. ZSTD_error_maxSymbolValue_tooLarge,
  37. ZSTD_error_maxSymbolValue_tooSmall,
  38. ZSTD_error_dictionary_corrupted,
  39. ZSTD_error_dictionary_wrong,
  40. ZSTD_error_maxCode
  41. } ZSTD_ErrorCode;
  42. /*! ZSTD_getErrorCode() :
  43. convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
  44. which can be used to compare directly with enum list published into "error_public.h" */
  45. ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
  46. const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
  47. #if defined (__cplusplus)
  48. }
  49. #endif
  50. #endif /* ERROR_PUBLIC_H_MODULE */