summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-04 01:34:54 (GMT)
committerYann Collet <cyan@fb.com>2016-11-04 01:46:07 (GMT)
commiteda8c4eb1ced10c4f6f22bca88428ca9255f2bbe (patch)
treec88a6906de2131c3f927e2b1684f643f40a50fae /lib/lz4frame.h
parent4791cda04af2fdf19f1a1ea7c2d1187ad82cc547 (diff)
downloadlz4-eda8c4eb1ced10c4f6f22bca88428ca9255f2bbe.zip
lz4-eda8c4eb1ced10c4f6f22bca88428ca9255f2bbe.tar.gz
lz4-eda8c4eb1ced10c4f6f22bca88428ca9255f2bbe.tar.bz2
fix #198 : no longer requires to restart streaming decompression from where it stopped.
It permits relocating remaining data into another memory space. Still, the same content must be presented.
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r--lib/lz4frame.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 2dd3818..63abc60 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -276,13 +276,13 @@ LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_dctx* dctx);
* This function decodes frame header information (such as max blockSize, frame checksum, etc.).
* Its usage is optional. The objective is to extract frame header information, typically for allocation purposes.
* A header size is variable and can length from 7 to 15 bytes. It's possible to provide more input bytes than that.
- * The number of bytes read from srcBuffer will be updated within *srcSizePtr (necessarily <= original value).
- * (note that LZ4F_getFrameInfo() can also be used anytime *after* decompression is started, in which case 0 input byte is enough)
+ * The number of bytes consumed from srcBuffer will be updated within *srcSizePtr (necessarily <= original value).
+ * Decompression must resume from this point (srcBuffer + *srcSizePtr).
+ * Note that LZ4F_getFrameInfo() can also be used anytime *after* decompression is started, in which case 0 input byte can be enough.
* Frame header info is *copied into* an already allocated LZ4F_frameInfo_t structure.
* @return : an hint about how many srcSize bytes LZ4F_decompress() expects for next call,
* or an error code which can be tested using LZ4F_isError()
* (typically, when there is not enough src bytes to fully decode the frame header)
- * Decompression is expected to resume from where it stopped (srcBuffer + *srcSizePtr)
*/
LZ4FLIB_API size_t LZ4F_getFrameInfo(LZ4F_dctx* dctx,
LZ4F_frameInfo_t* frameInfoPtr,
@@ -297,18 +297,17 @@ LZ4FLIB_API size_t LZ4F_getFrameInfo(LZ4F_dctx* dctx,
* The number of bytes read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value).
* Number of bytes read can be < number of bytes provided, meaning there is some more data to decode.
* It typically happens when dstBuffer is not large enough to contain all decoded data.
- * In which case, LZ4F_decompress() must be called again, starting from where it stopped (srcBuffer + *srcSizePtr)
- * The function will check this condition, and refuse to continue if it is not respected.
+ * Remaining data will have to be presented again in a subsequent invocation.
*
- * `dstBuffer` is expected to be flushed between each call to the function, its content will be overwritten.
- * `dst` arguments can be changed at will at each consecutive call to the function.
+ * `dstBuffer` content is expected to be flushed between each invocation, as its content will be overwritten.
+ * `dstBuffer` can be changed at will between each consecutive function invocation.
*
- * The function result is an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call.
+ * @return is an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call.
* Schematically, it's the size of the current (or remaining) compressed block + header of next block.
* Respecting the hint provides some boost to performance, since it does skip intermediate buffers.
* This is just a hint though, it's always possible to provide any srcSize.
- * When a frame is fully decoded, the function result will be 0 (no more data expected).
- * If decompression failed, function result is an error code, which can be tested using LZ4F_isError().
+ * When a frame is fully decoded, @return will be 0 (no more data expected).
+ * If decompression failed, @return is an error code, which can be tested using LZ4F_isError().
*
* After a frame is fully decoded, dctx can be used again to decompress another frame.
*/