Rizin
unix-like reverse engineering framework and cli tools
block.h
Go to the documentation of this file.
1 
6 /*
7  * Author: Lasse Collin
8  *
9  * This file has been put into the public domain.
10  * You can do whatever you want with this file.
11  *
12  * See ../lzma.h for information about liblzma as a whole.
13  */
14 
15 #ifndef LZMA_H_INTERNAL
16 # error Never include this file directly. Use <lzma.h> instead.
17 #endif
18 
19 
30 typedef struct {
53 
73 # define LZMA_BLOCK_HEADER_SIZE_MIN 8
74 # define LZMA_BLOCK_HEADER_SIZE_MAX 1024
75 
94 
149 
173 
201 
218 
219  /*
220  * Reserved space to allow possible future extensions without
221  * breaking the ABI. You should not touch these, because the names
222  * of these variables may change. These are and will never be used
223  * with the currently supported options, so it is safe to leave these
224  * uninitialized.
225  */
241 
262 
270 
271 } lzma_block;
272 
273 
285 #define lzma_block_header_size_decode(b) (((uint32_t)(b) + 1) * 4)
286 
287 
309 extern LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block)
311 
312 
331 extern LZMA_API(lzma_ret) lzma_block_header_encode(
332  const lzma_block *block, uint8_t *out)
334 
335 
376 extern LZMA_API(lzma_ret) lzma_block_header_decode(lzma_block *block,
379 
380 
408 extern LZMA_API(lzma_ret) lzma_block_compressed_size(
411 
412 
424 extern LZMA_API(lzma_vli) lzma_block_unpadded_size(const lzma_block *block)
426 
427 
437 extern LZMA_API(lzma_vli) lzma_block_total_size(const lzma_block *block)
439 
440 
455 extern LZMA_API(lzma_ret) lzma_block_encoder(
456  lzma_stream *strm, lzma_block *block)
458 
459 
473 extern LZMA_API(lzma_ret) lzma_block_decoder(
474  lzma_stream *strm, lzma_block *block)
476 
477 
484 extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
485  lzma_nothrow;
486 
487 
525 extern LZMA_API(lzma_ret) lzma_block_buffer_encode(
528  uint8_t *out, size_t *out_pos, size_t out_size)
530 
531 
544 extern LZMA_API(lzma_ret) lzma_block_uncomp_encode(lzma_block *block,
545  const uint8_t *in, size_t in_size,
546  uint8_t *out, size_t *out_pos, size_t out_size)
548 
549 
577 extern LZMA_API(lzma_ret) lzma_block_buffer_decode(
579  const uint8_t *in, size_t *in_pos, size_t in_size,
580  uint8_t *out, size_t *out_pos, size_t out_size)
lzma_check
Type of the integrity check (Check ID)
Definition: check.h:27
#define LZMA_CHECK_SIZE_MAX
Maximum size of a Check field.
Definition: check.h:102
const lzma_allocator lzma_vli unpadded_size
Definition: index.h:345
const lzma_allocator const uint8_t size_t size_t uint8_t size_t size_t out_size lzma_nothrow
Definition: block.h:581
const lzma_allocator const uint8_t size_t uint8_t size_t * out_pos
Definition: block.h:528
const lzma_allocator const uint8_t size_t * in_pos
Definition: block.h:579
const lzma_allocator const uint8_t size_t in_size
Definition: block.h:527
const lzma_allocator * allocator
Definition: block.h:377
const lzma_allocator const uint8_t * in
Definition: block.h:527
uint8_t *out lzma_nothrow lzma_attr_warn_unused_result
Definition: block.h:333
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
LZMA_API(lzma_ret) lzma_block_header_size(lzma_block *block) lzma_nothrow lzma_attr_warn_unused_result
Calculate Block Header Size.
static lzma_stream strm
Definition: full_flush.c:20
#define const
Definition: ansidecl.h:240
#define lzma_attr_pure
Definition: lzma.h:265
unsigned int uint32_t
Definition: sftypes.h:29
unsigned char uint8_t
Definition: sftypes.h:31
Custom functions for memory handling.
Definition: base.h:372
Options for the Block and Block Header encoders and decoders.
Definition: block.h:30
lzma_vli reserved_int6
Definition: block.h:234
void * reserved_ptr2
Definition: block.h:227
lzma_vli uncompressed_size
Uncompressed Size in bytes.
Definition: block.h:172
lzma_vli reserved_int8
Definition: block.h:236
lzma_reserved_enum reserved_enum3
Definition: block.h:239
lzma_bool ignore_check
A flag to Block decoder to not verify the Check field.
Definition: block.h:261
lzma_bool reserved_bool7
Definition: block.h:268
uint32_t reserved_int2
Definition: block.h:230
lzma_filter * filters
Array of filters.
Definition: block.h:200
uint32_t header_size
Size of the Block Header field.
Definition: block.h:72
lzma_bool reserved_bool2
Definition: block.h:263
lzma_bool reserved_bool6
Definition: block.h:267
lzma_vli reserved_int5
Definition: block.h:233
lzma_check check
Type of integrity Check.
Definition: block.h:93
lzma_vli compressed_size
Size of the Compressed Data in bytes.
Definition: block.h:148
lzma_reserved_enum reserved_enum4
Definition: block.h:240
lzma_vli reserved_int3
Definition: block.h:231
lzma_vli reserved_int4
Definition: block.h:232
void * reserved_ptr3
Definition: block.h:228
lzma_reserved_enum reserved_enum1
Definition: block.h:237
lzma_reserved_enum reserved_enum2
Definition: block.h:238
lzma_bool reserved_bool4
Definition: block.h:265
uint32_t version
Block format version.
Definition: block.h:52
void * reserved_ptr1
Definition: block.h:226
lzma_vli reserved_int7
Definition: block.h:235
lzma_bool reserved_bool8
Definition: block.h:269
uint32_t reserved_int1
Definition: block.h:229
lzma_bool reserved_bool5
Definition: block.h:266
lzma_bool reserved_bool3
Definition: block.h:264
Filter options.
Definition: filter.h:43
Passing data to and from liblzma.
Definition: base.h:485
uint64_t uncompressed_size
Definition: list.c:106
uint64_t lzma_vli
Variable-length integer type.
Definition: vli.h:63
lzma_reserved_enum
Type of reserved enumeration variable in structures.
Definition: base.h:44
lzma_ret
Return values used by several functions in liblzma.
Definition: base.h:57
unsigned char lzma_bool
Boolean.
Definition: base.h:29