Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/lzma
File: block.h
/**
[0] Fix | Delete
* \file lzma/block.h
[1] Fix | Delete
* \brief .xz Block handling
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
/*
[5] Fix | Delete
* Author: Lasse Collin
[6] Fix | Delete
*
[7] Fix | Delete
* This file has been put into the public domain.
[8] Fix | Delete
* You can do whatever you want with this file.
[9] Fix | Delete
*
[10] Fix | Delete
* See ../lzma.h for information about liblzma as a whole.
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
#ifndef LZMA_H_INTERNAL
[14] Fix | Delete
# error Never include this file directly. Use <lzma.h> instead.
[15] Fix | Delete
#endif
[16] Fix | Delete
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* \brief Options for the Block and Block Header encoders and decoders
[20] Fix | Delete
*
[21] Fix | Delete
* Different Block handling functions use different parts of this structure.
[22] Fix | Delete
* Some read some members, other functions write, and some do both. Only the
[23] Fix | Delete
* members listed for reading need to be initialized when the specified
[24] Fix | Delete
* functions are called. The members marked for writing will be assigned
[25] Fix | Delete
* new values at some point either by calling the given function or by
[26] Fix | Delete
* later calls to lzma_code().
[27] Fix | Delete
*/
[28] Fix | Delete
typedef struct {
[29] Fix | Delete
/**
[30] Fix | Delete
* \brief Block format version
[31] Fix | Delete
*
[32] Fix | Delete
* To prevent API and ABI breakages when new features are needed,
[33] Fix | Delete
* a version number is used to indicate which fields in this
[34] Fix | Delete
* structure are in use:
[35] Fix | Delete
* - liblzma >= 5.0.0: version = 0 is supported.
[36] Fix | Delete
* - liblzma >= 5.1.4beta: Support for version = 1 was added,
[37] Fix | Delete
* which adds the ignore_check field.
[38] Fix | Delete
*
[39] Fix | Delete
* If version is greater than one, most Block related functions
[40] Fix | Delete
* will return LZMA_OPTIONS_ERROR (lzma_block_header_decode() works
[41] Fix | Delete
* with any version value).
[42] Fix | Delete
*
[43] Fix | Delete
* Read by:
[44] Fix | Delete
* - All functions that take pointer to lzma_block as argument,
[45] Fix | Delete
* including lzma_block_header_decode().
[46] Fix | Delete
*
[47] Fix | Delete
* Written by:
[48] Fix | Delete
* - lzma_block_header_decode()
[49] Fix | Delete
*/
[50] Fix | Delete
uint32_t version;
[51] Fix | Delete
[52] Fix | Delete
/**
[53] Fix | Delete
* \brief Size of the Block Header field
[54] Fix | Delete
*
[55] Fix | Delete
* This is always a multiple of four.
[56] Fix | Delete
*
[57] Fix | Delete
* Read by:
[58] Fix | Delete
* - lzma_block_header_encode()
[59] Fix | Delete
* - lzma_block_header_decode()
[60] Fix | Delete
* - lzma_block_compressed_size()
[61] Fix | Delete
* - lzma_block_unpadded_size()
[62] Fix | Delete
* - lzma_block_total_size()
[63] Fix | Delete
* - lzma_block_decoder()
[64] Fix | Delete
* - lzma_block_buffer_decode()
[65] Fix | Delete
*
[66] Fix | Delete
* Written by:
[67] Fix | Delete
* - lzma_block_header_size()
[68] Fix | Delete
* - lzma_block_buffer_encode()
[69] Fix | Delete
*/
[70] Fix | Delete
uint32_t header_size;
[71] Fix | Delete
# define LZMA_BLOCK_HEADER_SIZE_MIN 8
[72] Fix | Delete
# define LZMA_BLOCK_HEADER_SIZE_MAX 1024
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* \brief Type of integrity Check
[76] Fix | Delete
*
[77] Fix | Delete
* The Check ID is not stored into the Block Header, thus its value
[78] Fix | Delete
* must be provided also when decoding.
[79] Fix | Delete
*
[80] Fix | Delete
* Read by:
[81] Fix | Delete
* - lzma_block_header_encode()
[82] Fix | Delete
* - lzma_block_header_decode()
[83] Fix | Delete
* - lzma_block_compressed_size()
[84] Fix | Delete
* - lzma_block_unpadded_size()
[85] Fix | Delete
* - lzma_block_total_size()
[86] Fix | Delete
* - lzma_block_encoder()
[87] Fix | Delete
* - lzma_block_decoder()
[88] Fix | Delete
* - lzma_block_buffer_encode()
[89] Fix | Delete
* - lzma_block_buffer_decode()
[90] Fix | Delete
*/
[91] Fix | Delete
lzma_check check;
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* \brief Size of the Compressed Data in bytes
[95] Fix | Delete
*
[96] Fix | Delete
* Encoding: If this is not LZMA_VLI_UNKNOWN, Block Header encoder
[97] Fix | Delete
* will store this value to the Block Header. Block encoder doesn't
[98] Fix | Delete
* care about this value, but will set it once the encoding has been
[99] Fix | Delete
* finished.
[100] Fix | Delete
*
[101] Fix | Delete
* Decoding: If this is not LZMA_VLI_UNKNOWN, Block decoder will
[102] Fix | Delete
* verify that the size of the Compressed Data field matches
[103] Fix | Delete
* compressed_size.
[104] Fix | Delete
*
[105] Fix | Delete
* Usually you don't know this value when encoding in streamed mode,
[106] Fix | Delete
* and thus cannot write this field into the Block Header.
[107] Fix | Delete
*
[108] Fix | Delete
* In non-streamed mode you can reserve space for this field before
[109] Fix | Delete
* encoding the actual Block. After encoding the data, finish the
[110] Fix | Delete
* Block by encoding the Block Header. Steps in detail:
[111] Fix | Delete
*
[112] Fix | Delete
* - Set compressed_size to some big enough value. If you don't know
[113] Fix | Delete
* better, use LZMA_VLI_MAX, but remember that bigger values take
[114] Fix | Delete
* more space in Block Header.
[115] Fix | Delete
*
[116] Fix | Delete
* - Call lzma_block_header_size() to see how much space you need to
[117] Fix | Delete
* reserve for the Block Header.
[118] Fix | Delete
*
[119] Fix | Delete
* - Encode the Block using lzma_block_encoder() and lzma_code().
[120] Fix | Delete
* It sets compressed_size to the correct value.
[121] Fix | Delete
*
[122] Fix | Delete
* - Use lzma_block_header_encode() to encode the Block Header.
[123] Fix | Delete
* Because space was reserved in the first step, you don't need
[124] Fix | Delete
* to call lzma_block_header_size() anymore, because due to
[125] Fix | Delete
* reserving, header_size has to be big enough. If it is "too big",
[126] Fix | Delete
* lzma_block_header_encode() will add enough Header Padding to
[127] Fix | Delete
* make Block Header to match the size specified by header_size.
[128] Fix | Delete
*
[129] Fix | Delete
* Read by:
[130] Fix | Delete
* - lzma_block_header_size()
[131] Fix | Delete
* - lzma_block_header_encode()
[132] Fix | Delete
* - lzma_block_compressed_size()
[133] Fix | Delete
* - lzma_block_unpadded_size()
[134] Fix | Delete
* - lzma_block_total_size()
[135] Fix | Delete
* - lzma_block_decoder()
[136] Fix | Delete
* - lzma_block_buffer_decode()
[137] Fix | Delete
*
[138] Fix | Delete
* Written by:
[139] Fix | Delete
* - lzma_block_header_decode()
[140] Fix | Delete
* - lzma_block_compressed_size()
[141] Fix | Delete
* - lzma_block_encoder()
[142] Fix | Delete
* - lzma_block_decoder()
[143] Fix | Delete
* - lzma_block_buffer_encode()
[144] Fix | Delete
* - lzma_block_buffer_decode()
[145] Fix | Delete
*/
[146] Fix | Delete
lzma_vli compressed_size;
[147] Fix | Delete
[148] Fix | Delete
/**
[149] Fix | Delete
* \brief Uncompressed Size in bytes
[150] Fix | Delete
*
[151] Fix | Delete
* This is handled very similarly to compressed_size above.
[152] Fix | Delete
*
[153] Fix | Delete
* uncompressed_size is needed by fewer functions than
[154] Fix | Delete
* compressed_size. This is because uncompressed_size isn't
[155] Fix | Delete
* needed to validate that Block stays within proper limits.
[156] Fix | Delete
*
[157] Fix | Delete
* Read by:
[158] Fix | Delete
* - lzma_block_header_size()
[159] Fix | Delete
* - lzma_block_header_encode()
[160] Fix | Delete
* - lzma_block_decoder()
[161] Fix | Delete
* - lzma_block_buffer_decode()
[162] Fix | Delete
*
[163] Fix | Delete
* Written by:
[164] Fix | Delete
* - lzma_block_header_decode()
[165] Fix | Delete
* - lzma_block_encoder()
[166] Fix | Delete
* - lzma_block_decoder()
[167] Fix | Delete
* - lzma_block_buffer_encode()
[168] Fix | Delete
* - lzma_block_buffer_decode()
[169] Fix | Delete
*/
[170] Fix | Delete
lzma_vli uncompressed_size;
[171] Fix | Delete
[172] Fix | Delete
/**
[173] Fix | Delete
* \brief Array of filters
[174] Fix | Delete
*
[175] Fix | Delete
* There can be 1-4 filters. The end of the array is marked with
[176] Fix | Delete
* .id = LZMA_VLI_UNKNOWN.
[177] Fix | Delete
*
[178] Fix | Delete
* Read by:
[179] Fix | Delete
* - lzma_block_header_size()
[180] Fix | Delete
* - lzma_block_header_encode()
[181] Fix | Delete
* - lzma_block_encoder()
[182] Fix | Delete
* - lzma_block_decoder()
[183] Fix | Delete
* - lzma_block_buffer_encode()
[184] Fix | Delete
* - lzma_block_buffer_decode()
[185] Fix | Delete
*
[186] Fix | Delete
* Written by:
[187] Fix | Delete
* - lzma_block_header_decode(): Note that this does NOT free()
[188] Fix | Delete
* the old filter options structures. All unused filters[] will
[189] Fix | Delete
* have .id == LZMA_VLI_UNKNOWN and .options == NULL. If
[190] Fix | Delete
* decoding fails, all filters[] are guaranteed to be
[191] Fix | Delete
* LZMA_VLI_UNKNOWN and NULL.
[192] Fix | Delete
*
[193] Fix | Delete
* \note Because of the array is terminated with
[194] Fix | Delete
* .id = LZMA_VLI_UNKNOWN, the actual array must
[195] Fix | Delete
* have LZMA_FILTERS_MAX + 1 members or the Block
[196] Fix | Delete
* Header decoder will overflow the buffer.
[197] Fix | Delete
*/
[198] Fix | Delete
lzma_filter *filters;
[199] Fix | Delete
[200] Fix | Delete
/**
[201] Fix | Delete
* \brief Raw value stored in the Check field
[202] Fix | Delete
*
[203] Fix | Delete
* After successful coding, the first lzma_check_size(check) bytes
[204] Fix | Delete
* of this array contain the raw value stored in the Check field.
[205] Fix | Delete
*
[206] Fix | Delete
* Note that CRC32 and CRC64 are stored in little endian byte order.
[207] Fix | Delete
* Take it into account if you display the Check values to the user.
[208] Fix | Delete
*
[209] Fix | Delete
* Written by:
[210] Fix | Delete
* - lzma_block_encoder()
[211] Fix | Delete
* - lzma_block_decoder()
[212] Fix | Delete
* - lzma_block_buffer_encode()
[213] Fix | Delete
* - lzma_block_buffer_decode()
[214] Fix | Delete
*/
[215] Fix | Delete
uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
[216] Fix | Delete
[217] Fix | Delete
/*
[218] Fix | Delete
* Reserved space to allow possible future extensions without
[219] Fix | Delete
* breaking the ABI. You should not touch these, because the names
[220] Fix | Delete
* of these variables may change. These are and will never be used
[221] Fix | Delete
* with the currently supported options, so it is safe to leave these
[222] Fix | Delete
* uninitialized.
[223] Fix | Delete
*/
[224] Fix | Delete
void *reserved_ptr1;
[225] Fix | Delete
void *reserved_ptr2;
[226] Fix | Delete
void *reserved_ptr3;
[227] Fix | Delete
uint32_t reserved_int1;
[228] Fix | Delete
uint32_t reserved_int2;
[229] Fix | Delete
lzma_vli reserved_int3;
[230] Fix | Delete
lzma_vli reserved_int4;
[231] Fix | Delete
lzma_vli reserved_int5;
[232] Fix | Delete
lzma_vli reserved_int6;
[233] Fix | Delete
lzma_vli reserved_int7;
[234] Fix | Delete
lzma_vli reserved_int8;
[235] Fix | Delete
lzma_reserved_enum reserved_enum1;
[236] Fix | Delete
lzma_reserved_enum reserved_enum2;
[237] Fix | Delete
lzma_reserved_enum reserved_enum3;
[238] Fix | Delete
lzma_reserved_enum reserved_enum4;
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* \brief A flag to Block decoder to not verify the Check field
[242] Fix | Delete
*
[243] Fix | Delete
* This field is supported by liblzma >= 5.1.4beta if .version >= 1.
[244] Fix | Delete
*
[245] Fix | Delete
* If this is set to true, the integrity check won't be calculated
[246] Fix | Delete
* and verified. Unless you know what you are doing, you should
[247] Fix | Delete
* leave this to false. (A reason to set this to true is when the
[248] Fix | Delete
* file integrity is verified externally anyway and you want to
[249] Fix | Delete
* speed up the decompression, which matters mostly when using
[250] Fix | Delete
* SHA-256 as the integrity check.)
[251] Fix | Delete
*
[252] Fix | Delete
* If .version >= 1, read by:
[253] Fix | Delete
* - lzma_block_decoder()
[254] Fix | Delete
* - lzma_block_buffer_decode()
[255] Fix | Delete
*
[256] Fix | Delete
* Written by (.version is ignored):
[257] Fix | Delete
* - lzma_block_header_decode() always sets this to false
[258] Fix | Delete
*/
[259] Fix | Delete
lzma_bool ignore_check;
[260] Fix | Delete
[261] Fix | Delete
lzma_bool reserved_bool2;
[262] Fix | Delete
lzma_bool reserved_bool3;
[263] Fix | Delete
lzma_bool reserved_bool4;
[264] Fix | Delete
lzma_bool reserved_bool5;
[265] Fix | Delete
lzma_bool reserved_bool6;
[266] Fix | Delete
lzma_bool reserved_bool7;
[267] Fix | Delete
lzma_bool reserved_bool8;
[268] Fix | Delete
[269] Fix | Delete
} lzma_block;
[270] Fix | Delete
[271] Fix | Delete
[272] Fix | Delete
/**
[273] Fix | Delete
* \brief Decode the Block Header Size field
[274] Fix | Delete
*
[275] Fix | Delete
* To decode Block Header using lzma_block_header_decode(), the size of the
[276] Fix | Delete
* Block Header has to be known and stored into lzma_block.header_size.
[277] Fix | Delete
* The size can be calculated from the first byte of a Block using this macro.
[278] Fix | Delete
* Note that if the first byte is 0x00, it indicates beginning of Index; use
[279] Fix | Delete
* this macro only when the byte is not 0x00.
[280] Fix | Delete
*
[281] Fix | Delete
* There is no encoding macro, because Block Header encoder is enough for that.
[282] Fix | Delete
*/
[283] Fix | Delete
#define lzma_block_header_size_decode(b) (((uint32_t)(b) + 1) * 4)
[284] Fix | Delete
[285] Fix | Delete
[286] Fix | Delete
/**
[287] Fix | Delete
* \brief Calculate Block Header Size
[288] Fix | Delete
*
[289] Fix | Delete
* Calculate the minimum size needed for the Block Header field using the
[290] Fix | Delete
* settings specified in the lzma_block structure. Note that it is OK to
[291] Fix | Delete
* increase the calculated header_size value as long as it is a multiple of
[292] Fix | Delete
* four and doesn't exceed LZMA_BLOCK_HEADER_SIZE_MAX. Increasing header_size
[293] Fix | Delete
* just means that lzma_block_header_encode() will add Header Padding.
[294] Fix | Delete
*
[295] Fix | Delete
* \return - LZMA_OK: Size calculated successfully and stored to
[296] Fix | Delete
* block->header_size.
[297] Fix | Delete
* - LZMA_OPTIONS_ERROR: Unsupported version, filters or
[298] Fix | Delete
* filter options.
[299] Fix | Delete
* - LZMA_PROG_ERROR: Invalid values like compressed_size == 0.
[300] Fix | Delete
*
[301] Fix | Delete
* \note This doesn't check that all the options are valid i.e. this
[302] Fix | Delete
* may return LZMA_OK even if lzma_block_header_encode() or
[303] Fix | Delete
* lzma_block_encoder() would fail. If you want to validate the
[304] Fix | Delete
* filter chain, consider using lzma_memlimit_encoder() which as
[305] Fix | Delete
* a side-effect validates the filter chain.
[306] Fix | Delete
*/
[307] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block)
[308] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[309] Fix | Delete
[310] Fix | Delete
[311] Fix | Delete
/**
[312] Fix | Delete
* \brief Encode Block Header
[313] Fix | Delete
*
[314] Fix | Delete
* The caller must have calculated the size of the Block Header already with
[315] Fix | Delete
* lzma_block_header_size(). If a value larger than the one calculated by
[316] Fix | Delete
* lzma_block_header_size() is used, the Block Header will be padded to the
[317] Fix | Delete
* specified size.
[318] Fix | Delete
*
[319] Fix | Delete
* \param out Beginning of the output buffer. This must be
[320] Fix | Delete
* at least block->header_size bytes.
[321] Fix | Delete
* \param block Block options to be encoded.
[322] Fix | Delete
*
[323] Fix | Delete
* \return - LZMA_OK: Encoding was successful. block->header_size
[324] Fix | Delete
* bytes were written to output buffer.
[325] Fix | Delete
* - LZMA_OPTIONS_ERROR: Invalid or unsupported options.
[326] Fix | Delete
* - LZMA_PROG_ERROR: Invalid arguments, for example
[327] Fix | Delete
* block->header_size is invalid or block->filters is NULL.
[328] Fix | Delete
*/
[329] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_header_encode(
[330] Fix | Delete
const lzma_block *block, uint8_t *out)
[331] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[332] Fix | Delete
[333] Fix | Delete
[334] Fix | Delete
/**
[335] Fix | Delete
* \brief Decode Block Header
[336] Fix | Delete
*
[337] Fix | Delete
* block->version should (usually) be set to the highest value supported
[338] Fix | Delete
* by the application. If the application sets block->version to a value
[339] Fix | Delete
* higher than supported by the current liblzma version, this function will
[340] Fix | Delete
* downgrade block->version to the highest value supported by it. Thus one
[341] Fix | Delete
* should check the value of block->version after calling this function if
[342] Fix | Delete
* block->version was set to a non-zero value and the application doesn't
[343] Fix | Delete
* otherwise know that the liblzma version being used is new enough to
[344] Fix | Delete
* support the specified block->version.
[345] Fix | Delete
*
[346] Fix | Delete
* The size of the Block Header must have already been decoded with
[347] Fix | Delete
* lzma_block_header_size_decode() macro and stored to block->header_size.
[348] Fix | Delete
*
[349] Fix | Delete
* The integrity check type from Stream Header must have been stored
[350] Fix | Delete
* to block->check.
[351] Fix | Delete
*
[352] Fix | Delete
* block->filters must have been allocated, but they don't need to be
[353] Fix | Delete
* initialized (possible existing filter options are not freed).
[354] Fix | Delete
*
[355] Fix | Delete
* \param block Destination for Block options.
[356] Fix | Delete
* \param allocator lzma_allocator for custom allocator functions.
[357] Fix | Delete
* Set to NULL to use malloc() (and also free()
[358] Fix | Delete
* if an error occurs).
[359] Fix | Delete
* \param in Beginning of the input buffer. This must be
[360] Fix | Delete
* at least block->header_size bytes.
[361] Fix | Delete
*
[362] Fix | Delete
* \return - LZMA_OK: Decoding was successful. block->header_size
[363] Fix | Delete
* bytes were read from the input buffer.
[364] Fix | Delete
* - LZMA_OPTIONS_ERROR: The Block Header specifies some
[365] Fix | Delete
* unsupported options such as unsupported filters. This can
[366] Fix | Delete
* happen also if block->version was set to a too low value
[367] Fix | Delete
* compared to what would be required to properly represent
[368] Fix | Delete
* the information stored in the Block Header.
[369] Fix | Delete
* - LZMA_DATA_ERROR: Block Header is corrupt, for example,
[370] Fix | Delete
* the CRC32 doesn't match.
[371] Fix | Delete
* - LZMA_PROG_ERROR: Invalid arguments, for example
[372] Fix | Delete
* block->header_size is invalid or block->filters is NULL.
[373] Fix | Delete
*/
[374] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block,
[375] Fix | Delete
const lzma_allocator *allocator, const uint8_t *in)
[376] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[377] Fix | Delete
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
* \brief Validate and set Compressed Size according to Unpadded Size
[381] Fix | Delete
*
[382] Fix | Delete
* Block Header stores Compressed Size, but Index has Unpadded Size. If the
[383] Fix | Delete
* application has already parsed the Index and is now decoding Blocks,
[384] Fix | Delete
* it can calculate Compressed Size from Unpadded Size. This function does
[385] Fix | Delete
* exactly that with error checking:
[386] Fix | Delete
*
[387] Fix | Delete
* - Compressed Size calculated from Unpadded Size must be positive integer,
[388] Fix | Delete
* that is, Unpadded Size must be big enough that after Block Header and
[389] Fix | Delete
* Check fields there's still at least one byte for Compressed Size.
[390] Fix | Delete
*
[391] Fix | Delete
* - If Compressed Size was present in Block Header, the new value
[392] Fix | Delete
* calculated from Unpadded Size is compared against the value
[393] Fix | Delete
* from Block Header.
[394] Fix | Delete
*
[395] Fix | Delete
* \note This function must be called _after_ decoding the Block Header
[396] Fix | Delete
* field so that it can properly validate Compressed Size if it
[397] Fix | Delete
* was present in Block Header.
[398] Fix | Delete
*
[399] Fix | Delete
* \return - LZMA_OK: block->compressed_size was set successfully.
[400] Fix | Delete
* - LZMA_DATA_ERROR: unpadded_size is too small compared to
[401] Fix | Delete
* block->header_size and lzma_check_size(block->check).
[402] Fix | Delete
* - LZMA_PROG_ERROR: Some values are invalid. For example,
[403] Fix | Delete
* block->header_size must be a multiple of four and
[404] Fix | Delete
* between 8 and 1024 inclusive.
[405] Fix | Delete
*/
[406] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_compressed_size(
[407] Fix | Delete
lzma_block *block, lzma_vli unpadded_size)
[408] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[409] Fix | Delete
[410] Fix | Delete
[411] Fix | Delete
/**
[412] Fix | Delete
* \brief Calculate Unpadded Size
[413] Fix | Delete
*
[414] Fix | Delete
* The Index field stores Unpadded Size and Uncompressed Size. The latter
[415] Fix | Delete
* can be taken directly from the lzma_block structure after coding a Block,
[416] Fix | Delete
* but Unpadded Size needs to be calculated from Block Header Size,
[417] Fix | Delete
* Compressed Size, and size of the Check field. This is where this function
[418] Fix | Delete
* is needed.
[419] Fix | Delete
*
[420] Fix | Delete
* \return Unpadded Size on success, or zero on error.
[421] Fix | Delete
*/
[422] Fix | Delete
extern LZMA_API(lzma_vli) lzma_block_unpadded_size(const lzma_block *block)
[423] Fix | Delete
lzma_nothrow lzma_attr_pure;
[424] Fix | Delete
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* \brief Calculate the total encoded size of a Block
[428] Fix | Delete
*
[429] Fix | Delete
* This is equivalent to lzma_block_unpadded_size() except that the returned
[430] Fix | Delete
* value includes the size of the Block Padding field.
[431] Fix | Delete
*
[432] Fix | Delete
* \return On success, total encoded size of the Block. On error,
[433] Fix | Delete
* zero is returned.
[434] Fix | Delete
*/
[435] Fix | Delete
extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block)
[436] Fix | Delete
lzma_nothrow lzma_attr_pure;
[437] Fix | Delete
[438] Fix | Delete
[439] Fix | Delete
/**
[440] Fix | Delete
* \brief Initialize .xz Block encoder
[441] Fix | Delete
*
[442] Fix | Delete
* Valid actions for lzma_code() are LZMA_RUN, LZMA_SYNC_FLUSH (only if the
[443] Fix | Delete
* filter chain supports it), and LZMA_FINISH.
[444] Fix | Delete
*
[445] Fix | Delete
* \return - LZMA_OK: All good, continue with lzma_code().
[446] Fix | Delete
* - LZMA_MEM_ERROR
[447] Fix | Delete
* - LZMA_OPTIONS_ERROR
[448] Fix | Delete
* - LZMA_UNSUPPORTED_CHECK: block->check specifies a Check ID
[449] Fix | Delete
* that is not supported by this buid of liblzma. Initializing
[450] Fix | Delete
* the encoder failed.
[451] Fix | Delete
* - LZMA_PROG_ERROR
[452] Fix | Delete
*/
[453] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_encoder(
[454] Fix | Delete
lzma_stream *strm, lzma_block *block)
[455] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[456] Fix | Delete
[457] Fix | Delete
[458] Fix | Delete
/**
[459] Fix | Delete
* \brief Initialize .xz Block decoder
[460] Fix | Delete
*
[461] Fix | Delete
* Valid actions for lzma_code() are LZMA_RUN and LZMA_FINISH. Using
[462] Fix | Delete
* LZMA_FINISH is not required. It is supported only for convenience.
[463] Fix | Delete
*
[464] Fix | Delete
* \return - LZMA_OK: All good, continue with lzma_code().
[465] Fix | Delete
* - LZMA_UNSUPPORTED_CHECK: Initialization was successful, but
[466] Fix | Delete
* the given Check ID is not supported, thus Check will be
[467] Fix | Delete
* ignored.
[468] Fix | Delete
* - LZMA_PROG_ERROR
[469] Fix | Delete
* - LZMA_MEM_ERROR
[470] Fix | Delete
*/
[471] Fix | Delete
extern LZMA_API(lzma_ret) lzma_block_decoder(
[472] Fix | Delete
lzma_stream *strm, lzma_block *block)
[473] Fix | Delete
lzma_nothrow lzma_attr_warn_unused_result;
[474] Fix | Delete
[475] Fix | Delete
[476] Fix | Delete
/**
[477] Fix | Delete
* \brief Calculate maximum output size for single-call Block encoding
[478] Fix | Delete
*
[479] Fix | Delete
* This is equivalent to lzma_stream_buffer_bound() but for .xz Blocks.
[480] Fix | Delete
* See the documentation of lzma_stream_buffer_bound().
[481] Fix | Delete
*/
[482] Fix | Delete
extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
[483] Fix | Delete
lzma_nothrow;
[484] Fix | Delete
[485] Fix | Delete
[486] Fix | Delete
/**
[487] Fix | Delete
* \brief Single-call .xz Block encoder
[488] Fix | Delete
*
[489] Fix | Delete
* In contrast to the multi-call encoder initialized with
[490] Fix | Delete
* lzma_block_encoder(), this function encodes also the Block Header. This
[491] Fix | Delete
* is required to make it possible to write appropriate Block Header also
[492] Fix | Delete
* in case the data isn't compressible, and different filter chain has to be
[493] Fix | Delete
* used to encode the data in uncompressed form using uncompressed chunks
[494] Fix | Delete
* of the LZMA2 filter.
[495] Fix | Delete
*
[496] Fix | Delete
* When the data isn't compressible, header_size, compressed_size, and
[497] Fix | Delete
* uncompressed_size are set just like when the data was compressible, but
[498] Fix | Delete
* it is possible that header_size is too small to hold the filter chain
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function