index_hash.c | index_hash.c | |||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
/// Position in variable-length integers when decoding them from | /// Position in variable-length integers when decoding them from | |||
/// the List of Records. | /// the List of Records. | |||
size_t pos; | size_t pos; | |||
/// CRC32 of the Index | /// CRC32 of the Index | |||
uint32_t crc32; | uint32_t crc32; | |||
}; | }; | |||
extern LZMA_API(lzma_index_hash *) | extern LZMA_API(lzma_index_hash *) | |||
lzma_index_hash_init(lzma_index_hash *index_hash, lzma_allocator *allocator | lzma_index_hash_init(lzma_index_hash *index_hash, | |||
) | const lzma_allocator *allocator) | |||
{ | { | |||
if (index_hash == NULL) { | if (index_hash == NULL) { | |||
index_hash = lzma_alloc(sizeof(lzma_index_hash), allocator); | index_hash = lzma_alloc(sizeof(lzma_index_hash), allocator); | |||
if (index_hash == NULL) | if (index_hash == NULL) | |||
return NULL; | return NULL; | |||
} | } | |||
index_hash->sequence = SEQ_BLOCK; | index_hash->sequence = SEQ_BLOCK; | |||
index_hash->blocks.blocks_size = 0; | index_hash->blocks.blocks_size = 0; | |||
index_hash->blocks.uncompressed_size = 0; | index_hash->blocks.uncompressed_size = 0; | |||
skipping to change at line 100 | skipping to change at line 101 | |||
index_hash->crc32 = 0; | index_hash->crc32 = 0; | |||
// These cannot fail because LZMA_CHECK_BEST is known to be supporte d. | // These cannot fail because LZMA_CHECK_BEST is known to be supporte d. | |||
(void)lzma_check_init(&index_hash->blocks.check, LZMA_CHECK_BEST); | (void)lzma_check_init(&index_hash->blocks.check, LZMA_CHECK_BEST); | |||
(void)lzma_check_init(&index_hash->records.check, LZMA_CHECK_BEST); | (void)lzma_check_init(&index_hash->records.check, LZMA_CHECK_BEST); | |||
return index_hash; | return index_hash; | |||
} | } | |||
extern LZMA_API(void) | extern LZMA_API(void) | |||
lzma_index_hash_end(lzma_index_hash *index_hash, lzma_allocator *allocator) | lzma_index_hash_end(lzma_index_hash *index_hash, | |||
const lzma_allocator *allocator) | ||||
{ | { | |||
lzma_free(index_hash, allocator); | lzma_free(index_hash, allocator); | |||
return; | return; | |||
} | } | |||
extern LZMA_API(lzma_vli) | extern LZMA_API(lzma_vli) | |||
lzma_index_hash_size(const lzma_index_hash *index_hash) | lzma_index_hash_size(const lzma_index_hash *index_hash) | |||
{ | { | |||
// Get the size of the Index from ->blocks instead of ->records for | // Get the size of the Index from ->blocks instead of ->records for | |||
// cases where application wants to know the Index Size before | // cases where application wants to know the Index Size before | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 4 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/ |