| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #pragma once |
| |
| #if defined (__cplusplus) |
| extern "C" { |
| #endif |
| |
| |
| |
| |
| #include <stddef.h> /* size_t */ |
| |
| |
| |
| |
| |
| typedef size_t LZ4F_errorCode_t; |
| |
| unsigned LZ4F_isError(LZ4F_errorCode_t code); |
| const char* LZ4F_getErrorName(LZ4F_errorCode_t code); |
| |
| |
| |
| |
| |
| |
| #ifndef LZ4F_DISABLE_OBSOLETE_ENUMS |
| # define LZ4F_OBSOLETE_ENUM(x) ,x |
| #else |
| # define LZ4F_OBSOLETE_ENUM(x) |
| #endif |
| |
| typedef enum { |
| LZ4F_default=0, |
| LZ4F_max64KB=4, |
| LZ4F_max256KB=5, |
| LZ4F_max1MB=6, |
| LZ4F_max4MB=7 |
| LZ4F_OBSOLETE_ENUM(max64KB = LZ4F_max64KB) |
| LZ4F_OBSOLETE_ENUM(max256KB = LZ4F_max256KB) |
| LZ4F_OBSOLETE_ENUM(max1MB = LZ4F_max1MB) |
| LZ4F_OBSOLETE_ENUM(max4MB = LZ4F_max4MB) |
| } LZ4F_blockSizeID_t; |
| |
| typedef enum { |
| LZ4F_blockLinked=0, |
| LZ4F_blockIndependent |
| LZ4F_OBSOLETE_ENUM(blockLinked = LZ4F_blockLinked) |
| LZ4F_OBSOLETE_ENUM(blockIndependent = LZ4F_blockIndependent) |
| } LZ4F_blockMode_t; |
| |
| typedef enum { |
| LZ4F_noContentChecksum=0, |
| LZ4F_contentChecksumEnabled |
| LZ4F_OBSOLETE_ENUM(noContentChecksum = LZ4F_noContentChecksum) |
| LZ4F_OBSOLETE_ENUM(contentChecksumEnabled = LZ4F_contentChecksumEnabled) |
| } LZ4F_contentChecksum_t; |
| |
| typedef enum { |
| LZ4F_frame=0, |
| LZ4F_skippableFrame |
| LZ4F_OBSOLETE_ENUM(skippableFrame = LZ4F_skippableFrame) |
| } LZ4F_frameType_t; |
| |
| #ifndef LZ4F_DISABLE_OBSOLETE_ENUMS |
| typedef LZ4F_blockSizeID_t blockSizeID_t; |
| typedef LZ4F_blockMode_t blockMode_t; |
| typedef LZ4F_frameType_t frameType_t; |
| typedef LZ4F_contentChecksum_t contentChecksum_t; |
| #endif |
| |
| typedef struct { |
| LZ4F_blockSizeID_t blockSizeID; |
| LZ4F_blockMode_t blockMode; |
| LZ4F_contentChecksum_t contentChecksumFlag; |
| LZ4F_frameType_t frameType; |
| unsigned long long contentSize; |
| unsigned reserved[2]; |
| } LZ4F_frameInfo_t; |
| |
| typedef struct { |
| LZ4F_frameInfo_t frameInfo; |
| int compressionLevel; |
| unsigned autoFlush; |
| unsigned reserved[4]; |
| } LZ4F_preferences_t; |
| |
| |
| |
| |
| |
| size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr); |
| |
| size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct LZ4F_cctx_s* LZ4F_compressionContext_t; |
| |
| typedef struct { |
| unsigned stableSrc; |
| unsigned reserved[3]; |
| } LZ4F_compressOptions_t; |
| |
| |
| |
| #define LZ4F_VERSION 100 |
| LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_compressionContext_t* cctxPtr, unsigned version); |
| LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_compressionContext_t cctx); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_compressBegin(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_preferences_t* prefsPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* prefsPtr); |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_compressUpdate(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_compressOptions_t* cOptPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_flush(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* cOptPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_compressEnd(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* cOptPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| typedef struct LZ4F_dctx_s* LZ4F_decompressionContext_t; |
| |
| typedef struct { |
| unsigned stableDst; |
| unsigned reserved[3]; |
| } LZ4F_decompressOptions_t; |
| |
| |
| |
| |
| LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_decompressionContext_t* dctxPtr, unsigned version); |
| LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_decompressionContext_t dctx); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_getFrameInfo(LZ4F_decompressionContext_t dctx, |
| LZ4F_frameInfo_t* frameInfoPtr, |
| const void* srcBuffer, size_t* srcSizePtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| size_t LZ4F_decompress(LZ4F_decompressionContext_t dctx, |
| void* dstBuffer, size_t* dstSizePtr, |
| const void* srcBuffer, size_t* srcSizePtr, |
| const LZ4F_decompressOptions_t* dOptPtr); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #if defined (__cplusplus) |
| } |
| #endif |