1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

clarified streaming decompression inlined doc

This commit is contained in:
Yann Collet 2016-09-06 05:16:40 +02:00
parent 5e43b289bf
commit 1d4208c029

View File

@ -252,14 +252,15 @@ ZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
* *
* Use ZSTD_decompressStream() repetitively to consume your input. * Use ZSTD_decompressStream() repetitively to consume your input.
* The function will update both `pos` fields. * The function will update both `pos` fields.
* Note that it may not consume the entire input, in which case `pos < size`, * If `input.pos < input.size`, some input is not consumed.
* and it's up to the caller to present again remaining data. * It's up to the caller to present again remaining data.
* If `output.pos == output.size`, there is probably some more data to flush, still stored inside internal buffers.
* @return : 0 when a frame is completely decoded and fully flushed, * @return : 0 when a frame is completely decoded and fully flushed,
* an error code, which can be tested using ZSTD_isError(), * an error code, which can be tested using ZSTD_isError(),
* any value > 0, which means there is still some work to do to complete the frame. * any value > 0, which means there is still some work to do to complete the frame.
* In general, the return value is a suggested next input size (merely a hint, to help latency). * In general, the return value is a suggested next input size (merely a hint, to help latency).
* 1 is a special value, which means either "there is still some data to flush", or "need 1 more byte as input". * 1 is a special value, which means either "there is still some data to flush", or "need 1 more byte as input".
* To deduct the meaning of "1", start by flushing. If there is nothing left to flush and result is still "1", it means "need 1 more byte". * In which case, start by flushing. When flush is completed, if return value is still `1`, it means "need 1 more byte".
* *******************************************************************************/ * *******************************************************************************/
typedef struct ZSTD_DStream_s ZSTD_DStream; typedef struct ZSTD_DStream_s ZSTD_DStream;