base.h | base.h | |||
---|---|---|---|---|
skipping to change at line 239 | skipping to change at line 239 | |||
* | * | |||
* If you think that your code is correct, this error code | * If you think that your code is correct, this error code | |||
* can be a sign of a bug in liblzma. See the documentation | * can be a sign of a bug in liblzma. See the documentation | |||
* how to report bugs. | * how to report bugs. | |||
*/ | */ | |||
} lzma_ret; | } lzma_ret; | |||
/** | /** | |||
* \brief The `action' argument for lzma_code() | * \brief The `action' argument for lzma_code() | |||
* | * | |||
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, or LZMA_FINISH, | * After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRI | |||
* the same `action' must is used until lzma_code() returns LZMA_STREAM_END | ER, | |||
. | * or LZMA_FINISH, the same `action' must is used until lzma_code() returns | |||
* Also, the amount of input (that is, strm->avail_in) must not be modified | * LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) mus | |||
* by the application until lzma_code() returns LZMA_STREAM_END. Changing t | t | |||
he | * not be modified by the application until lzma_code() returns | |||
* `action' or modifying the amount of input will make lzma_code() return | * LZMA_STREAM_END. Changing the `action' or modifying the amount of input | |||
* LZMA_PROG_ERROR. | * will make lzma_code() return LZMA_PROG_ERROR. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
LZMA_RUN = 0, | LZMA_RUN = 0, | |||
/**< | /**< | |||
* \brief Continue coding | * \brief Continue coding | |||
* | * | |||
* Encoder: Encode as much input as possible. Some internal | * Encoder: Encode as much input as possible. Some internal | |||
* buffering will probably be done (depends on the filter | * buffering will probably be done (depends on the filter | |||
* chain in use), which causes latency: the input used won't | * chain in use), which causes latency: the input used won't | |||
* usually be decodeable from the output of the same | * usually be decodeable from the output of the same | |||
skipping to change at line 292 | skipping to change at line 292 | |||
* | * | |||
* Decoders don't support LZMA_SYNC_FLUSH. | * Decoders don't support LZMA_SYNC_FLUSH. | |||
*/ | */ | |||
LZMA_FULL_FLUSH = 2, | LZMA_FULL_FLUSH = 2, | |||
/**< | /**< | |||
* \brief Finish encoding of the current Block | * \brief Finish encoding of the current Block | |||
* | * | |||
* All the input data going to the current Block must have | * All the input data going to the current Block must have | |||
* been given to the encoder (the last bytes can still be | * been given to the encoder (the last bytes can still be | |||
* pending in* next_in). Call lzma_code() with LZMA_FULL_FLU SH | * pending in *next_in). Call lzma_code() with LZMA_FULL_FLU SH | |||
* until it returns LZMA_STREAM_END. Then continue normally | * until it returns LZMA_STREAM_END. Then continue normally | |||
* with LZMA_RUN or finish the Stream with LZMA_FINISH. | * with LZMA_RUN or finish the Stream with LZMA_FINISH. | |||
* | * | |||
* This action is currently supported only by Stream encoder | * This action is currently supported only by Stream encoder | |||
* and easy encoder (which uses Stream encoder). If there is | * and easy encoder (which uses Stream encoder). If there is | |||
* no unfinished Block, no empty Block is created. | * no unfinished Block, no empty Block is created. | |||
*/ | */ | |||
LZMA_FULL_BARRIER = 4, | ||||
/**< | ||||
* \brief Finish encoding of the current Block | ||||
* | ||||
* This is like LZMA_FULL_FLUSH except that this doesn't | ||||
* necessarily wait until all the input has been made | ||||
* available via the output buffer. That is, lzma_code() | ||||
* might return LZMA_STREAM_END as soon as all the input | ||||
* has been consumed (avail_in == 0). | ||||
* | ||||
* LZMA_FULL_BARRIER is useful with a threaded encoder if | ||||
* one wants to split the .xz Stream into Blocks at specific | ||||
* offsets but doesn't care if the output isn't flushed | ||||
* immediately. Using LZMA_FULL_BARRIER allows keeping | ||||
* the threads busy while LZMA_FULL_FLUSH would make | ||||
* lzma_code() wait until all the threads have finished | ||||
* until more data could be passed to the encoder. | ||||
* | ||||
* With a lzma_stream initialized with the single-threaded | ||||
* lzma_stream_encoder() or lzma_easy_encoder(), | ||||
* LZMA_FULL_BARRIER is an alias for LZMA_FULL_FLUSH. | ||||
*/ | ||||
LZMA_FINISH = 3 | LZMA_FINISH = 3 | |||
/**< | /**< | |||
* \brief Finish the coding operation | * \brief Finish the coding operation | |||
* | * | |||
* All the input data must have been given to the encoder | * All the input data must have been given to the encoder | |||
* (the last bytes can still be pending in next_in). | * (the last bytes can still be pending in next_in). | |||
* Call lzma_code() with LZMA_FINISH until it returns | * Call lzma_code() with LZMA_FINISH until it returns | |||
* LZMA_STREAM_END. Once LZMA_FINISH has been used, | * LZMA_STREAM_END. Once LZMA_FINISH has been used, | |||
* the amount of input must no longer be changed by | * the amount of input must no longer be changed by | |||
* the application. | * the application. | |||
skipping to change at line 452 | skipping to change at line 475 | |||
* - Once the coding has been finished, the existing lzma_stream can be | * - Once the coding has been finished, the existing lzma_stream can be | |||
* reused. It is OK to reuse lzma_stream with different initialization | * reused. It is OK to reuse lzma_stream with different initialization | |||
* function without calling lzma_end() first. Old allocations are | * function without calling lzma_end() first. Old allocations are | |||
* automatically freed. | * automatically freed. | |||
* | * | |||
* - Finally, use lzma_end() to free the allocated memory. lzma_end() neve r | * - Finally, use lzma_end() to free the allocated memory. lzma_end() neve r | |||
* frees the lzma_stream structure itself. | * frees the lzma_stream structure itself. | |||
* | * | |||
* Application may modify the values of total_in and total_out as it wants. | * Application may modify the values of total_in and total_out as it wants. | |||
* They are updated by liblzma to match the amount of data read and | * They are updated by liblzma to match the amount of data read and | |||
* written, but aren't used for anything else. | * written but aren't used for anything else except as a possible return | |||
* values from lzma_get_progress(). | ||||
*/ | */ | |||
typedef struct { | typedef struct { | |||
const uint8_t *next_in; /**< Pointer to the next input byte. */ | const uint8_t *next_in; /**< Pointer to the next input byte. */ | |||
size_t avail_in; /**< Number of available input bytes in next_in. */ | size_t avail_in; /**< Number of available input bytes in next_in. */ | |||
uint64_t total_in; /**< Total number of bytes read by liblzma. */ | uint64_t total_in; /**< Total number of bytes read by liblzma. */ | |||
uint8_t *next_out; /**< Pointer to the next output position. */ | uint8_t *next_out; /**< Pointer to the next output position. */ | |||
size_t avail_out; /**< Amount of free space in next_out. */ | size_t avail_out; /**< Amount of free space in next_out. */ | |||
uint64_t total_out; /**< Total number of bytes written by liblzma. * / | uint64_t total_out; /**< Total number of bytes written by liblzma. * / | |||
/** | /** | |||
* \brief Custom memory allocation functions | * \brief Custom memory allocation functions | |||
* | * | |||
* In most cases this is NULL which makes liblzma use | * In most cases this is NULL which makes liblzma use | |||
* the standard malloc() and free(). | * the standard malloc() and free(). | |||
* | ||||
* \note In 5.0.x this is not a const pointer. | ||||
*/ | */ | |||
lzma_allocator *allocator; | const lzma_allocator *allocator; | |||
/** Internal state is not visible to applications. */ | /** Internal state is not visible to applications. */ | |||
lzma_internal *internal; | lzma_internal *internal; | |||
/* | /* | |||
* Reserved space to allow possible future extensions without | * Reserved space to allow possible future extensions without | |||
* breaking the ABI. Excluding the initialization of this structure, | * breaking the ABI. Excluding the initialization of this structure, | |||
* you should not touch these, because the names of these variables | * you should not touch these, because the names of these variables | |||
* may change. | * may change. | |||
*/ | */ | |||
skipping to change at line 547 | skipping to change at line 573 | |||
* After lzma_end(strm), strm->internal is guaranteed to be NULL. No other | * After lzma_end(strm), strm->internal is guaranteed to be NULL. No other | |||
* members of the lzma_stream structure are touched. | * members of the lzma_stream structure are touched. | |||
* | * | |||
* \note zlib indicates an error if application end()s unfinished | * \note zlib indicates an error if application end()s unfinished | |||
* stream structure. liblzma doesn't do this, and assumes that | * stream structure. liblzma doesn't do this, and assumes that | |||
* application knows what it is doing. | * application knows what it is doing. | |||
*/ | */ | |||
extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow; | extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow; | |||
/** | /** | |||
* \brief Get progress information | ||||
* | ||||
* In single-threaded mode, applications can get progress information from | ||||
* strm->total_in and strm->total_out. In multi-threaded mode this is less | ||||
* useful because a significant amount of both input and output data gets | ||||
* buffered internally by liblzma. This makes total_in and total_out give | ||||
* misleading information and also makes the progress indicator updates | ||||
* non-smooth. | ||||
* | ||||
* This function gives realistic progress information also in multi-threade | ||||
d | ||||
* mode by taking into account the progress made by each thread. In | ||||
* single-threaded mode *progress_in and *progress_out are set to | ||||
* strm->total_in and strm->total_out, respectively. | ||||
*/ | ||||
extern LZMA_API(void) lzma_get_progress(lzma_stream *strm, | ||||
uint64_t *progress_in, uint64_t *progress_out) lzma_nothrow; | ||||
/** | ||||
* \brief Get the memory usage of decoder filter chain | * \brief Get the memory usage of decoder filter chain | |||
* | * | |||
* This function is currently supported only when *strm has been initialize d | * This function is currently supported only when *strm has been initialize d | |||
* with a function that takes a memlimit argument. With other functions, yo u | * with a function that takes a memlimit argument. With other functions, yo u | |||
* should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage () | * should use e.g. lzma_raw_encoder_memusage() or lzma_raw_decoder_memusage () | |||
* to estimate the memory requirements. | * to estimate the memory requirements. | |||
* | * | |||
* This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how b ig | * This function is useful e.g. after LZMA_MEMLIMIT_ERROR to find out how b ig | |||
* the memory usage limit should have been to decode the input. Note that | * the memory usage limit should have been to decode the input. Note that | |||
* this may give misleading information if decoding .xz Streams that have | * this may give misleading information if decoding .xz Streams that have | |||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 56 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |