summaryrefslogtreecommitdiffstats
path: root/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-08-30 17:14:44 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-08-30 17:14:44 (GMT)
commitf66721d303a6141797ee1e04067a007aa0392daf (patch)
tree8788bf0b47258e12f04015fb7ae786094b8c41e2 /lz4frame.h
parentc39235f46e1e23b90a2bc6d6eec509c2c70f149f (diff)
downloadlz4-f66721d303a6141797ee1e04067a007aa0392daf.zip
lz4-f66721d303a6141797ee1e04067a007aa0392daf.tar.gz
lz4-f66721d303a6141797ee1e04067a007aa0392daf.tar.bz2
lz4frame compression API v1 completed
Added : test program frametest
Diffstat (limited to 'lz4frame.h')
-rw-r--r--lz4frame.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/lz4frame.h b/lz4frame.h
index c0fa4b4..851de45 100644
--- a/lz4frame.h
+++ b/lz4frame.h
@@ -58,8 +58,9 @@ typedef size_t LZ4F_errorCode_t;
typedef enum { OK_FrameEnd = 1 } LZ4F_successCodes;
typedef enum { OK_NoError = 0, ERROR_GENERIC = 1,
ERROR_maxBlockSize_invalid, ERROR_blockMode_invalid, ERROR_contentChecksumFlag_invalid,
+ ERROR_srcSize_tooLarge, ERROR_dstMaxSize_tooSmall,
+ ERROR_allocation_failed,
ERROR_compressionLevel_invalid,
- ERROR_srcSize_tooLarge, ERROR_maxDstSize_tooSmall,
ERROR_maxCode
} LZ4F_errorCodes; /* error codes are negative unsigned values.
Compare function result to (-specificCode) */
@@ -71,14 +72,14 @@ int LZ4F_isError(LZ4F_errorCode_t code); /* Basically : code > -ERROR_maxCode
Framing compression functions
**************************************/
-typedef enum { LZ4F_default=0, max64KB=4, max256KB=5, max1MB=6, max4MB=7} maxBlockSize_t;
+typedef enum { LZ4F_default=0, max64KB=4, max256KB=5, max1MB=6, max4MB=7} blockSizeID_t;
typedef enum { blockLinked=1, blockIndependent} blockMode_t;
typedef enum { contentChecksumEnabled, noContentChecksum} contentChecksum_t;
typedef struct {
- maxBlockSize_t maxBlockSizeID; /* max64KB, max256KB, max1MB, max4MB ; 0 == default */
- blockMode_t blockMode; /* blockLinked, blockIndependent ; 0 == default */
- contentChecksum_t contentChecksumFlag; /* contentChecksumEnabled (default), noContentChecksum ; */
+ blockSizeID_t blockSizeID; /* max64KB, max256KB, max1MB, max4MB ; 0 == default */
+ blockMode_t blockMode; /* blockLinked, blockIndependent ; 0 == default */
+ contentChecksum_t contentChecksumFlag; /* contentChecksumEnabled (default), noContentChecksum ; */
} LZ4F_frameInfo_t;
typedef struct {
@@ -89,7 +90,7 @@ typedef struct {
-/**********************************
+/***********************************
* Simple compression function
* *********************************/
size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_frameInfo_t* frameInfoPtr);
@@ -138,7 +139,7 @@ LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_compressionContext_t LZ4F_comp
size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize);
/* LZ4F_compressBegin() :
* will write the frame header into dstBuffer.
- * dstBuffer must be large enough to accomodate a header (dstMaxSize). Maximum header size is 15 bytes.
+ * dstBuffer must be large enough to accomodate a header (dstMaxSize). Maximum header size is 19 bytes.
* The result of the function is the number of bytes written into dstBuffer for the header
* or an error code (can be tested using LZ4F_isError())
*/
@@ -148,7 +149,7 @@ size_t LZ4F_getMaxSrcSize(size_t dstMaxSize, const LZ4F_frameInfo_t* frameInfoPt
/* LZ4F_compressBound() : gives the size of Dst buffer given a srcSize to handle worst case situations.
* LZ4F_getMaxSrcSize() : gives max allowed srcSize given dstMaxSize to handle worst case situations.
* You can use dstMaxSize==0 to know the "natural" srcSize instead (block size).
- * The LZ4F_preferences_t structure is optional : you can provide NULL as argument, all preferences will then be set to default.
+ * The LZ4F_frameInfo_t structure is optional : you can provide NULL as argument, all preferences will then be set to default.
*/
size_t LZ4F_compress(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_compressOptions_t* compressOptionsPtr);