diff options
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r-- | lib/lz4frame.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h index 48fbf80..d73e3e2 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -45,11 +45,6 @@ extern "C" { #endif -/**************************************** - Note : experimental API. - Not yet integrated within liblz4 -****************************************/ - /************************************** Includes **************************************/ @@ -60,27 +55,14 @@ extern "C" { * Error management * ************************************/ typedef size_t LZ4F_errorCode_t; -#define LZ4F_LIST_ERRORS(ITEM) \ - ITEM(OK_NoError) ITEM(ERROR_GENERIC) \ - ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \ - ITEM(ERROR_compressionLevel_invalid) \ - ITEM(ERROR_allocation_failed) \ - ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \ - ITEM(ERROR_decompressionFailed) \ - ITEM(ERROR_checksum_invalid) \ - ITEM(ERROR_maxCode) - -#define LZ4F_GENERATE_ENUM(ENUM) ENUM, -typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM) } LZ4F_errorCodes; /* enum is exposed, to detect & handle specific errors; compare function result to -enum value */ - -int LZ4F_isError(LZ4F_errorCode_t code); /* Basically : code > -ERROR_maxCode */ + +unsigned LZ4F_isError(LZ4F_errorCode_t code); const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /* return error code string; useful for debugging */ /************************************** * Frame compression types * ************************************/ - typedef enum { LZ4F_default=0, max64KB=4, max256KB=5, max1MB=6, max4MB=7 } blockSizeID_t; typedef enum { blockLinked=0, blockIndependent} blockMode_t; typedef enum { noContentChecksum=0, contentChecksumEnabled } contentChecksum_t; @@ -100,7 +82,6 @@ typedef struct { } LZ4F_preferences_t; - /*********************************** * Simple compression function * *********************************/ @@ -108,7 +89,7 @@ size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* prefere size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr); /* LZ4F_compressFrame() - * Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.4.1, in a single step. + * Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.4.1. * The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case. * You can get the minimum value of dstMaxSize by using LZ4F_compressFrameBound() * If this condition is not respected, LZ4F_compressFrame() will fail (result is an errorCode) @@ -122,7 +103,6 @@ size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuf /********************************** * Advanced compression functions * ********************************/ - typedef void* LZ4F_compressionContext_t; typedef struct { |