lizard_frame_static.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. Lizard auto-framing library
  3. Header File for static linking only
  4. Copyright (C) 2011-2015, Yann Collet.
  5. Copyright (C) 2016-2017, Przemyslaw Skibinski
  6. BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
  7. Redistribution and use in source and binary forms, with or without
  8. modification, are permitted provided that the following conditions are
  9. met:
  10. * Redistributions of source code must retain the above copyright
  11. notice, this list of conditions and the following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the following disclaimer
  14. in the documentation and/or other materials provided with the
  15. distribution.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  19. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  20. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. You can contact the author at :
  28. - Lizard source repository : https://github.com/inikep/lizard
  29. */
  30. #pragma once
  31. #if defined (__cplusplus)
  32. extern "C" {
  33. #endif
  34. /* lizard_frame_static.h should be used solely in the context of static linking.
  35. * It contains definitions which may still change overtime.
  36. * Never use it in the context of DLL linking.
  37. * */
  38. /**************************************
  39. * Includes
  40. **************************************/
  41. #include "lizard_frame.h"
  42. /**************************************
  43. * Error management
  44. * ************************************/
  45. #define LIZARDF_LIST_ERRORS(ITEM) \
  46. ITEM(OK_NoError) ITEM(ERROR_GENERIC) \
  47. ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \
  48. ITEM(ERROR_compressionLevel_invalid) \
  49. ITEM(ERROR_headerVersion_wrong) ITEM(ERROR_blockChecksum_unsupported) ITEM(ERROR_reservedFlag_set) \
  50. ITEM(ERROR_allocation_failed) \
  51. ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \
  52. ITEM(ERROR_frameHeader_incomplete) ITEM(ERROR_frameType_unknown) ITEM(ERROR_frameSize_wrong) \
  53. ITEM(ERROR_srcPtr_wrong) \
  54. ITEM(ERROR_decompressionFailed) \
  55. ITEM(ERROR_headerChecksum_invalid) ITEM(ERROR_contentChecksum_invalid) \
  56. ITEM(ERROR_maxCode)
  57. //#define LIZARDF_DISABLE_OLD_ENUMS
  58. #ifndef LIZARDF_DISABLE_OLD_ENUMS
  59. #define LIZARDF_GENERATE_ENUM(ENUM) LizardF_##ENUM, ENUM = LizardF_##ENUM,
  60. #else
  61. #define LIZARDF_GENERATE_ENUM(ENUM) LizardF_##ENUM,
  62. #endif
  63. typedef enum { LIZARDF_LIST_ERRORS(LIZARDF_GENERATE_ENUM) } LizardF_errorCodes; /* enum is exposed, to handle specific errors; compare function result to -enum value */
  64. #if defined (__cplusplus)
  65. }
  66. #endif