diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-05-06 01:29:04 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-05-06 01:29:04 (GMT) |
commit | efbebd2a9955c6a6eabc558f00643abb4690edac (patch) | |
tree | a0804e18c9594f2ee9c9c2ee933900fc991c67c1 /lib/lz4.h | |
parent | 1c3e633c48766c58df949887297dc5838170a33f (diff) | |
download | lz4-efbebd2a9955c6a6eabc558f00643abb4690edac.zip lz4-efbebd2a9955c6a6eabc558f00643abb4690edac.tar.gz lz4-efbebd2a9955c6a6eabc558f00643abb4690edac.tar.bz2 |
Added : LZ4_compress_destSize()
Diffstat (limited to 'lib/lz4.h')
-rw-r--r-- | lib/lz4.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -140,6 +140,21 @@ int LZ4_compress_fast_extState (void* state, const char* source, char* dest, int /* +LZ4_compress_destSize() : + Reverse the logic, by compressing as much data as possible from 'source' buffer + into already allocated buffer 'dest' of size 'targetDestSize'. + This function either compresses the entire 'source' content into 'dest' if it's large enough, + or fill 'dest' buffer completely with as much data as possible from 'source'. + Original idea by WiredTiger team. + *sourceSizePtr : will be modified to indicate how many bytes where read from 'source' to fill 'dest'. + New value is necessarily <= old value. + return : Nb bytes written into 'dest' (necessarily <= targetDestSize) + or 0 if compression fails +*/ +int LZ4_compress_destSize (const char* source, char* dest, int* sourceSizePtr, int targetDestSize); + + +/* LZ4_decompress_fast() : originalSize : is the original and therefore uncompressed size return : the number of bytes read from the source buffer (in other words, the compressed size) |