diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-13 12:10:43 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-13 12:10:43 +0300 |
commit | 13a74b78e37f16c9096ba5fe1859cc04eaa2f9f7 (patch) | |
tree | aa9c137d41bd5d39fa8835cc77cf325ff13a7e7c /src/liblzma/api | |
parent | Improved the Stream Flags handling API. (diff) | |
download | xz-13a74b78e37f16c9096ba5fe1859cc04eaa2f9f7.tar.xz |
Renamed constants:
- LZMA_VLI_VALUE_MAX -> LZMA_VLI_MAX
- LZMA_VLI_VALUE_UNKNOWN -> LZMA_VLI_UNKNOWN
- LZMA_HEADER_ERRRO -> LZMA_OPTIONS_ERROR
Diffstat (limited to 'src/liblzma/api')
-rw-r--r-- | src/liblzma/api/lzma/alignment.h | 2 | ||||
-rw-r--r-- | src/liblzma/api/lzma/base.h | 4 | ||||
-rw-r--r-- | src/liblzma/api/lzma/block.h | 28 | ||||
-rw-r--r-- | src/liblzma/api/lzma/container.h | 12 | ||||
-rw-r--r-- | src/liblzma/api/lzma/filter.h | 28 | ||||
-rw-r--r-- | src/liblzma/api/lzma/index.h | 2 | ||||
-rw-r--r-- | src/liblzma/api/lzma/lzma.h | 4 | ||||
-rw-r--r-- | src/liblzma/api/lzma/simple.h | 2 | ||||
-rw-r--r-- | src/liblzma/api/lzma/stream_flags.h | 20 | ||||
-rw-r--r-- | src/liblzma/api/lzma/vli.h | 16 |
10 files changed, 59 insertions, 59 deletions
diff --git a/src/liblzma/api/lzma/alignment.h b/src/liblzma/api/lzma/alignment.h index 008af690..84e59c8b 100644 --- a/src/liblzma/api/lzma/alignment.h +++ b/src/liblzma/api/lzma/alignment.h @@ -37,7 +37,7 @@ extern uint32_t lzma_alignment_input( * encoder which tries to align the Compressed Data field optimally. * * \param filters Pointer to lzma_filter array, whose last - * member must have .id = LZMA_VLI_VALUE_UNKNOWN. + * member must have .id = LZMA_VLI_UNKNOWN. * \param guess The value to return if the alignment of the output * is the same as the alignment of the input data. * If you want to always detect this special case, diff --git a/src/liblzma/api/lzma/base.h b/src/liblzma/api/lzma/base.h index ddbcb033..54ac3084 100644 --- a/src/liblzma/api/lzma/base.h +++ b/src/liblzma/api/lzma/base.h @@ -161,7 +161,7 @@ typedef enum { * format. */ - LZMA_HEADER_ERROR = 8, + LZMA_OPTIONS_ERROR = 8, /**< * \brief Invalid or unsupported options * @@ -282,7 +282,7 @@ typedef enum { * * Only some filters support LZMA_SYNC_FLUSH. Trying to use * LZMA_SYNC_FLUSH with filters that don't support it will - * make lzma_code() return LZMA_HEADER_ERROR. For example, + * make lzma_code() return LZMA_OPTIONS_ERROR. For example, * LZMA1 doesn't support LZMA_SYNC_FLUSH but LZMA2 does. * * Using LZMA_SYNC_FLUSH very often can dramatically reduce diff --git a/src/liblzma/api/lzma/block.h b/src/liblzma/api/lzma/block.h index 60ea97f4..eb3768e2 100644 --- a/src/liblzma/api/lzma/block.h +++ b/src/liblzma/api/lzma/block.h @@ -85,18 +85,18 @@ typedef struct { /** * \brief Uncompressed Size in bytes * - * Encoder: If this value is not LZMA_VLI_VALUE_UNKNOWN, it is stored + * Encoder: If this value is not LZMA_VLI_UNKNOWN, it is stored * to the Uncompressed Size field in the Block Header. The real * uncompressed size of the data being compressed must match - * the Uncompressed Size or LZMA_HEADER_ERROR is returned. + * the Uncompressed Size or LZMA_OPTIONS_ERROR is returned. * * If Uncompressed Size is unknown, End of Payload Marker must - * be used. If uncompressed_size == LZMA_VLI_VALUE_UNKNOWN and - * has_eopm == 0, LZMA_HEADER_ERROR will be returned. + * be used. If uncompressed_size == LZMA_VLI_UNKNOWN and + * has_eopm == 0, LZMA_OPTIONS_ERROR will be returned. * - * Decoder: If this value is not LZMA_VLI_VALUE_UNKNOWN, it is + * Decoder: If this value is not LZMA_VLI_UNKNOWN, it is * compared to the real Uncompressed Size. If they do not match, - * LZMA_HEADER_ERROR is returned. + * LZMA_OPTIONS_ERROR is returned. * * Read by: * - lzma_block_header_size() @@ -114,7 +114,7 @@ typedef struct { * \brief Array of filters * * There can be 1-4 filters. The end of the array is marked with - * .id = LZMA_VLI_VALUE_UNKNOWN. + * .id = LZMA_VLI_UNKNOWN. * * Read by: * - lzma_block_header_size() @@ -125,12 +125,12 @@ typedef struct { * Written by: * - lzma_block_header_decode(): Note that this does NOT free() * the old filter options structures. All unused filters[] will - * have .id == LZMA_VLI_VALUE_UNKNOWN and .options == NULL. If + * have .id == LZMA_VLI_UNKNOWN and .options == NULL. If * decoding fails, all filters[] are guaranteed to be - * LZMA_VLI_VALUE_UNKNOWN and NULL. + * LZMA_VLI_UNKNOWN and NULL. * * \note Because of the array is terminated with - * .id = LZMA_VLI_VALUE_UNKNOWN, the actual array must + * .id = LZMA_VLI_UNKNOWN, the actual array must * have LZMA_BLOCK_FILTERS_MAX + 1 members or the Block * Header decoder will overflow the buffer. */ @@ -157,7 +157,7 @@ typedef struct { * * \return - LZMA_OK: Size calculated successfully and stored to * options->header_size. - * - LZMA_HEADER_ERROR: Unsupported filters or filter options. + * - LZMA_OPTIONS_ERROR: Unsupported filters or filter options. * - LZMA_PROG_ERROR: Invalid options * * \note This doesn't check that all the options are valid i.e. this @@ -180,7 +180,7 @@ extern lzma_ret lzma_block_header_size(lzma_block *options) * * \return - LZMA_OK: Encoding was successful. options->header_size * bytes were written to output buffer. - * - LZMA_HEADER_ERROR: Invalid or unsupported options. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. * - LZMA_PROG_ERROR */ extern lzma_ret lzma_block_header_encode( @@ -202,7 +202,7 @@ extern lzma_ret lzma_block_header_encode( * * \return - LZMA_OK: Decoding was successful. options->header_size * bytes were written to output buffer. - * - LZMA_HEADER_ERROR: Invalid or unsupported options. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. * - LZMA_PROG_ERROR */ extern lzma_ret lzma_block_header_decode(lzma_block *options, @@ -254,7 +254,7 @@ extern lzma_vli lzma_block_total_size_get(const lzma_block *options) * * \return - LZMA_OK: All good, continue with lzma_code(). * - LZMA_MEM_ERROR - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_DATA_ERROR: Limits (total_limit and uncompressed_limit) * have been reached already. * - LZMA_UNSUPPORTED_CHECK: options->check specfies a Check diff --git a/src/liblzma/api/lzma/container.h b/src/liblzma/api/lzma/container.h index 9535ffa9..256bbc69 100644 --- a/src/liblzma/api/lzma/container.h +++ b/src/liblzma/api/lzma/container.h @@ -36,7 +36,7 @@ * \note If liblzma is built without encoder support, or with some * filters disabled, some of the compression levels may be * unsupported. In that case, the initialization functions - * will return LZMA_HEADER_ERROR. + * will return LZMA_OPTIONS_ERROR. */ typedef enum { LZMA_EASY_COPY = 0, @@ -115,7 +115,7 @@ extern uint64_t lzma_easy_memory_usage(lzma_easy_level level) * encode your data. * - LZMA_MEM_ERROR: Memory allocation failed. All memory * previously allocated for *strm is now freed. - * - LZMA_HEADER_ERROR: The given compression level is not + * - LZMA_OPTIONS_ERROR: The given compression level is not * supported by this build of liblzma. * * If initialization succeeds, use lzma_code() to do the actual encoding. @@ -132,7 +132,7 @@ extern lzma_ret lzma_easy_encoder(lzma_stream *strm, lzma_easy_level level) * * \param strm Pointer to properly prepared lzma_stream * \param filters Array of filters. This must be terminated with - * filters[n].id = LZMA_VLI_VALUE_UNKNOWN. There must + * filters[n].id = LZMA_VLI_UNKNOWN. There must * be 1-4 filters, but there are restrictions on how * multiple filters can be combined. FIXME Tell where * to find more information. @@ -141,7 +141,7 @@ extern lzma_ret lzma_easy_encoder(lzma_stream *strm, lzma_easy_level level) * * \return - LZMA_OK: Initialization was successful. * - LZMA_MEM_ERROR - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_PROG_ERROR */ extern lzma_ret lzma_stream_encoder(lzma_stream *strm, @@ -225,7 +225,7 @@ extern lzma_ret lzma_alone_encoder( * * \return - LZMA_OK: Initialization was successful. * - LZMA_MEM_ERROR: Cannot allocate memory. - * - LZMA_HEADER_ERROR: Unsupported flags + * - LZMA_OPTIONS_ERROR: Unsupported flags */ extern lzma_ret lzma_stream_decoder( lzma_stream *strm, uint64_t memlimit, uint32_t flags) @@ -245,7 +245,7 @@ extern lzma_ret lzma_stream_decoder( * * \return - LZMA_OK: Initialization was successful. * - LZMA_MEM_ERROR: Cannot allocate memory. - * - LZMA_HEADER_ERROR: Unsupported flags + * - LZMA_OPTIONS_ERROR: Unsupported flags */ extern lzma_ret lzma_auto_decoder( lzma_stream *strm, uint64_t memlimit, uint32_t flags) diff --git a/src/liblzma/api/lzma/filter.h b/src/liblzma/api/lzma/filter.h index f9c30d5e..53e5737e 100644 --- a/src/liblzma/api/lzma/filter.h +++ b/src/liblzma/api/lzma/filter.h @@ -33,7 +33,7 @@ typedef struct { * * Use constants whose name begin with `LZMA_FILTER_' to specify * different filters. In an array of lzma_option_filter structures, - * use LZMA_VLI_VALUE_UNKNOWN to indicate end of filters. + * use LZMA_VLI_UNKNOWN to indicate end of filters. */ lzma_vli id; @@ -41,7 +41,7 @@ typedef struct { * \brief Pointer to filter-specific options structure * * If the filter doesn't need options, set this to NULL. If id is - * set to LZMA_VLI_VALUE_UNKNOWN, options is ignored, and thus + * set to LZMA_VLI_UNKNOWN, options is ignored, and thus * doesn't need be initialized. * * Some filters support changing the options in the middle of @@ -80,7 +80,7 @@ extern lzma_bool lzma_filter_decoder_is_supported(lzma_vli id); * \brief Calculate rough memory requirements for raw encoder * * \param filters Array of filters terminated with - * .id == LZMA_VLI_VALUE_UNKNOWN. + * .id == LZMA_VLI_UNKNOWN. * * \return Rough number of bytes required for the given filter chain * when encoding. @@ -93,7 +93,7 @@ extern uint64_t lzma_memusage_encoder(const lzma_filter *filters) * \brief Calculate rough memory requirements for raw decoder * * \param filters Array of filters terminated with - * .id == LZMA_VLI_VALUE_UNKNOWN. + * .id == LZMA_VLI_UNKNOWN. * * \return Rough number of bytes required for the given filter chain * when decoding. @@ -110,7 +110,7 @@ extern uint64_t lzma_memusage_decoder(const lzma_filter *filters) * \param strm Pointer to properly prepared lzma_stream * \param options Array of lzma_filter structures. * The end of the array must be marked with - * .id = LZMA_VLI_VALUE_UNKNOWN. The minimum + * .id = LZMA_VLI_UNKNOWN. The minimum * number of filters is one and the maximum is four. * * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the @@ -118,7 +118,7 @@ extern uint64_t lzma_memusage_decoder(const lzma_filter *filters) * * \return - LZMA_OK * - LZMA_MEM_ERROR - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_PROG_ERROR */ extern lzma_ret lzma_raw_encoder( @@ -136,7 +136,7 @@ extern lzma_ret lzma_raw_encoder( * * \return - LZMA_OK * - LZMA_MEM_ERROR - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_PROG_ERROR */ extern lzma_ret lzma_raw_decoder( @@ -155,13 +155,13 @@ extern lzma_ret lzma_raw_decoder( * vary depending on the options) * * \return - LZMA_OK - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_PROG_ERROR * * \note This function validates the Filter ID, but does not * necessarily validate the options. Thus, it is possible * that this returns LZMA_OK while the following call to - * lzma_properties_encode() returns LZMA_HEADER_ERROR. + * lzma_properties_encode() returns LZMA_OPTIONS_ERROR. */ extern lzma_ret lzma_properties_size( uint32_t *size, const lzma_filter *filter); @@ -176,7 +176,7 @@ extern lzma_ret lzma_properties_size( * lzma_properties_size(). * * \return - LZMA_OK - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_PROG_ERROR * * \note Even this function won't validate more options than actually @@ -207,10 +207,10 @@ extern lzma_ret lzma_properties_encode( * \param props Input buffer containing the properties. * \param props_size Size of the properties. This must be the exact * size; giving too much or too little input will - * return LZMA_HEADER_ERROR. + * return LZMA_OPTIONS_ERROR. * * \return - LZMA_OK - * - LZMA_HEADER_ERROR + * - LZMA_OPTIONS_ERROR * - LZMA_MEM_ERROR */ extern lzma_ret lzma_properties_decode( @@ -231,7 +231,7 @@ extern lzma_ret lzma_properties_decode( * \return - LZMA_OK: *size set successfully. Note that this doesn't * guarantee that options->options is valid, thus * lzma_filter_flags_encode() may still fail. - * - LZMA_HEADER_ERROR: Unknown Filter ID or unsupported options. + * - LZMA_OPTIONS_ERROR: Unknown Filter ID or unsupported options. * - LZMA_PROG_ERROR: Invalid options * * \note If you need to calculate size of List of Filter Flags, @@ -255,7 +255,7 @@ extern lzma_ret lzma_filter_flags_size( * \param options Filter options to be encoded * * \return - LZMA_OK: Encoding was successful. - * - LZMA_HEADER_ERROR: Invalid or unsupported options. + * - LZMA_OPTIONS_ERROR: Invalid or unsupported options. * - LZMA_PROG_ERROR: Invalid options or not enough output * buffer space (you should have checked it with * lzma_filter_flags_size()). diff --git a/src/liblzma/api/lzma/index.h b/src/liblzma/api/lzma/index.h index 44be10b1..522969d4 100644 --- a/src/liblzma/api/lzma/index.h +++ b/src/liblzma/api/lzma/index.h @@ -82,7 +82,7 @@ extern void lzma_index_end(lzma_index *i, lzma_allocator *allocator); * \param index Pointer to a lzma_index structure * \param total_size Total Size of a Block * \param uncompressed_size Uncompressed Size of a Block, or - * LZMA_VLI_VALUE_UNKNOWN to indicate padding. + * LZMA_VLI_UNKNOWN to indicate padding. * * Appending a new Record does not affect the read position. * diff --git a/src/liblzma/api/lzma/lzma.h b/src/liblzma/api/lzma/lzma.h index 64d47393..8979b2d8 100644 --- a/src/liblzma/api/lzma/lzma.h +++ b/src/liblzma/api/lzma/lzma.h @@ -54,7 +54,7 @@ typedef enum { * \note It's possible that this match finder gets * removed in future. The definition will stay * in this header, but liblzma may return - * LZMA_HEADER_ERROR if it is specified (just + * LZMA_OPTIONS_ERROR if it is specified (just * like it would if the match finder had been * disabled at compile time). */ @@ -68,7 +68,7 @@ typedef enum { * \note It's possible that this match finder gets * removed in future. The definition will stay * in this header, but liblzma may return - * LZMA_HEADER_ERROR if it is specified (just + * LZMA_OPTIONS_ERROR if it is specified (just * like it would if the match finder had been * disabled at compile time). */ diff --git a/src/liblzma/api/lzma/simple.h b/src/liblzma/api/lzma/simple.h index 13417480..98f3f49a 100644 --- a/src/liblzma/api/lzma/simple.h +++ b/src/liblzma/api/lzma/simple.h @@ -67,7 +67,7 @@ * * \note At the moment, none of the simple filters support * LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified, - * LZMA_HEADER_ERROR will be returned. If there is need, + * LZMA_OPTIONS_ERROR will be returned. If there is need, * partial support for LZMA_SYNC_FLUSH can be added in future. * Partial means that flushing would be possible only at * offsets that are multiple of 2, 4, or 16 depending on diff --git a/src/liblzma/api/lzma/stream_flags.h b/src/liblzma/api/lzma/stream_flags.h index bb080ac7..44c68616 100644 --- a/src/liblzma/api/lzma/stream_flags.h +++ b/src/liblzma/api/lzma/stream_flags.h @@ -43,7 +43,7 @@ typedef struct { * indicate which fields in this structure are in use. For now, * version must always be zero. With non-zero version, the * lzma_stream_header_encode() and lzma_stream_footer_encode() - * will return LZMA_HEADER_ERROR. + * will return LZMA_OPTIONS_ERROR. * * lzma_stream_header_decode() and lzma_stream_footer_decode() * will always set this to the lowest value that supports all the @@ -64,7 +64,7 @@ typedef struct { * initialize backward_size when encoding Stream Header. * * lzma_stream_header_decode() always sets backward_size to - * LZMA_VLI_VALUE_UNKNOWN so that it is convenient to use + * LZMA_VLI_UNKNOWN so that it is convenient to use * lzma_stream_flags_compare() when both Stream Header and Stream * Footer have been decoded. */ @@ -118,7 +118,7 @@ typedef struct { * need to be initialized. * * \return - LZMA_OK: Encoding was successful. - * - LZMA_HEADER_ERROR: options->version is not supported by + * - LZMA_OPTIONS_ERROR: options->version is not supported by * this liblzma version. * - LZMA_PROG_ERROR: Invalid options. */ @@ -135,7 +135,7 @@ extern lzma_ret lzma_stream_header_encode( * \param options Stream Footer options to be encoded. * * \return - LZMA_OK: Encoding was successful. - * - LZMA_HEADER_ERROR: options->version is not supported by + * - LZMA_OPTIONS_ERROR: options->version is not supported by * this liblzma version. * - LZMA_PROG_ERROR: Invalid options. */ @@ -151,7 +151,7 @@ extern lzma_ret lzma_stream_footer_encode( * \param in Beginning of the input buffer of * LZMA_STREAM_HEADER_SIZE bytes. * - * options->index_size is always set to LZMA_VLI_VALUE_UNKNOWN. This is to + * options->index_size is always set to LZMA_VLI_UNKNOWN. This is to * help comparing Stream Flags from Stream Header and Stream Footer with * lzma_stream_flags_compare(). * @@ -160,7 +160,7 @@ extern lzma_ret lzma_stream_footer_encode( * buffer cannot be Stream Header. * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the header * is corrupt. - * - LZMA_HEADER_ERROR: Unsupported options are present + * - LZMA_OPTIONS_ERROR: Unsupported options are present * in the header. */ extern lzma_ret lzma_stream_header_decode( @@ -180,7 +180,7 @@ extern lzma_ret lzma_stream_header_decode( * buffer cannot be Stream Footer. * - LZMA_DATA_ERROR: CRC32 doesn't match, thus the footer * is corrupt. - * - LZMA_HEADER_ERROR: Unsupported options are present + * - LZMA_OPTIONS_ERROR: Unsupported options are present * in the footer. * * \note If Stream Header was already decoded successfully, but @@ -199,13 +199,13 @@ extern lzma_ret lzma_stream_footer_decode( * \brief Compare two lzma_stream_flags structures * * backward_size values are compared only if both are not - * LZMA_VLI_VALUE_UNKNOWN. + * LZMA_VLI_UNKNOWN. * * \return - LZMA_OK: Both are equal. If either had backward_size set - * to LZMA_VLI_VALUE_UNKNOWN, backward_size values were not + * to LZMA_VLI_UNKNOWN, backward_size values were not * compared or validated. * - LZMA_DATA_ERROR: The structures differ. - * - LZMA_HEADER_ERROR: version in either structure is greater + * - LZMA_OPTIONS_ERROR: version in either structure is greater * than the maximum supported version (currently zero). * - LZMA_PROG_ERROR: Invalid value, e.g. invalid check or * backward_size. diff --git a/src/liblzma/api/lzma/vli.h b/src/liblzma/api/lzma/vli.h index 294e5cdd..1b13f865 100644 --- a/src/liblzma/api/lzma/vli.h +++ b/src/liblzma/api/lzma/vli.h @@ -24,12 +24,12 @@ /** * \brief Maximum supported value of variable-length integer */ -#define LZMA_VLI_VALUE_MAX (UINT64_MAX / 2) +#define LZMA_VLI_MAX (UINT64_MAX / 2) /** * \brief VLI value to denote that the value is unknown */ -#define LZMA_VLI_VALUE_UNKNOWN UINT64_MAX +#define LZMA_VLI_UNKNOWN UINT64_MAX /** * \brief Maximum supported length of variable length integers @@ -47,12 +47,12 @@ * \brief Variable-length integer type * * This will always be unsigned integer. Valid VLI values are in the range - * [0, LZMA_VLI_VALUE_MAX]. Unknown value is indicated with - * LZMA_VLI_VALUE_UNKNOWN, which is the maximum value of the underlaying - * integer type (this feature is useful in several situations). + * [0, LZMA_VLI_MAX]. Unknown value is indicated with LZMA_VLI_UNKNOWN, + * which is the maximum value of the underlaying integer type (this feature + * is useful in several situations). * * In future, even if lzma_vli is typdefined to something else than uint64_t, - * it is guaranteed that 2 * LZMA_VLI_VALUE_MAX will not overflow lzma_vli. + * it is guaranteed that 2 * LZMA_VLI_MAX will not overflow lzma_vli. * This simplifies integer overflow detection. */ typedef uint64_t lzma_vli; @@ -68,7 +68,7 @@ typedef uint64_t lzma_vli; * indicates unknown value. */ #define lzma_vli_is_valid(vli) \ - ((vli) <= LZMA_VLI_VALUE_MAX || (vli) == LZMA_VLI_VALUE_UNKNOWN) + ((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN) /** @@ -83,7 +83,7 @@ typedef uint64_t lzma_vli; * non-minimum number of bytes are invalid, thus every integer has exactly * one encoded representation. The maximum number of bits in a VLI is 63, * thus the vli argument must be at maximum of UINT64_MAX / 2. You should - * use LZMA_VLI_VALUE_MAX for clarity. + * use LZMA_VLI_MAX for clarity. * * This function has two modes: single-call and multi-call. Single-call mode * encodes the whole integer at once; it is an error if the output buffer is |