aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-19 21:16:33 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-19 21:16:33 +0200
commite141fe18950400faaa3503ff88ac20eacd73e88c (patch)
treeea976a691b778fc11c2c014fd8712b444ef7fe22 /src/liblzma/api
parentRevised the Delta filter implementation. The initialization (diff)
downloadxz-e141fe18950400faaa3503ff88ac20eacd73e88c.tar.xz
Implemented LZMA_SYNC_FLUSH support to the Subblock encoder.
The API for handing Subfilters was changed to make it consistent with LZMA_SYNC_FLUSH. A few sanity checks were added for Subfilter handling. Some small bugs were fixed. More comments were added.
Diffstat (limited to 'src/liblzma/api')
-rw-r--r--src/liblzma/api/lzma/subblock.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/liblzma/api/lzma/subblock.h b/src/liblzma/api/lzma/subblock.h
index 0474b6af..1db35b13 100644
--- a/src/liblzma/api/lzma/subblock.h
+++ b/src/liblzma/api/lzma/subblock.h
@@ -95,9 +95,10 @@ typedef struct {
* input_offset % alignment == output_offset % alignment
*
* The Subblock filter assumes that the first output byte will be
- * written to a position in the output stream that is properly aligned.
- *
- * FIXME desc
+ * written to a position in the output stream that is properly
+ * aligned. This requirement is automatically met when the start
+ * offset of the Stream or Block is correctly told to Block or
+ * Stream encoder.
*/
uint32_t alignment;
# define LZMA_SUBBLOCK_ALIGNMENT_MIN 1
@@ -161,16 +162,17 @@ typedef struct {
*
* When subfilter_mode is LZMA_SUBFILTER_NONE, the application may
* put Subfilter options to subfilter_options structure, and then
- * set subfilter_mode to LZMA_SUBFILTER_SET. This implies setting
- * flush to true. No new input data will be read until the Subfilter
- * has been enabled. Once the Subfilter has been enabled, liblzma
- * will set subfilter_mode to LZMA_SUBFILTER_RUN.
+ * set subfilter_mode to LZMA_SUBFILTER_SET. No new input data will
+ * be read until the Subfilter has been enabled. Once the Subfilter
+ * has been enabled, liblzma will set subfilter_mode to
+ * LZMA_SUBFILTER_RUN.
*
* When subfilter_mode is LZMA_SUBFILTER_RUN, the application may
- * set subfilter_mode to LZMA_SUBFILTER_FINISH. No new input data
- * will be read until the Subfilter has been finished. Once the
- * Subfilter has been finished, liblzma will set subfilter_mode
- * to LZMA_SUBFILTER_NONE.
+ * set subfilter_mode to LZMA_SUBFILTER_FINISH. All the input
+ * currently available will be encoded before unsetting the
+ * Subfilter. Application must not change the amount of available
+ * input until the Subfilter has finished. Once the Subfilter has
+ * finished, liblzma will set subfilter_mode to LZMA_SUBFILTER_NONE.
*
* If the intent is to have Subfilter enabled to the very end of
* the data, it is not needed to separately disable Subfilter with
@@ -178,6 +180,11 @@ typedef struct {
* of lzma_code() will make the Subblock encoder to disable the
* Subfilter once all the data has been ran through the Subfilter.
*
+ * After the first call with LZMA_SYNC_FLUSH or LZMA_FINISH, the
+ * application must not change subfilter_mode until LZMA_STREAM_END.
+ * Setting LZMA_SUBFILTER_SET/LZMA_SUBFILTER_FINISH and
+ * LZMA_SYNC_FLUSH/LZMA_FINISH _at the same time_ is fine.
+ *
* \note This variable is ignored if allow_subfilters is false.
*/
lzma_subfilter_mode subfilter_mode;