Rizin
unix-like reverse engineering framework and cli tools
base.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 
29 typedef unsigned char lzma_bool;
30 
31 
44 typedef enum {
47 
48 
57 typedef enum {
58  LZMA_OK = 0,
63  LZMA_STREAM_END = 1,
75  LZMA_NO_CHECK = 2,
115  LZMA_GET_CHECK = 4,
128  LZMA_MEM_ERROR = 5,
150  LZMA_FORMAT_ERROR = 7,
160  LZMA_OPTIONS_ERROR = 8,
172  LZMA_DATA_ERROR = 9,
191  LZMA_BUF_ERROR = 10,
218  LZMA_PROG_ERROR = 11,
237 } lzma_ret;
238 
239 
250 typedef enum {
251  LZMA_RUN = 0,
265  LZMA_SYNC_FLUSH = 1,
290  LZMA_FULL_FLUSH = 2,
305  LZMA_FULL_BARRIER = 4,
328  LZMA_FINISH = 3
346 
347 
372 typedef struct {
407  void *(LZMA_API_CALL *alloc)(void *opaque, size_t nmemb, size_t size);
408 
421  void (LZMA_API_CALL *free)(void *opaque, void *ptr);
422 
432  void *opaque;
433 
435 
436 
442 typedef struct lzma_internal_s lzma_internal;
443 
444 
485 typedef struct {
486  const uint8_t *next_in;
487  size_t avail_in;
491  size_t avail_out;
503 
505  lzma_internal *internal;
506 
507  /*
508  * Reserved space to allow possible future extensions without
509  * breaking the ABI. Excluding the initialization of this structure,
510  * you should not touch these, because the names of these variables
511  * may change.
512  */
523 
524 } lzma_stream;
525 
526 
545 #define LZMA_STREAM_INIT \
546  { NULL, 0, 0, NULL, 0, 0, NULL, NULL, \
547  NULL, NULL, NULL, NULL, 0, 0, 0, 0, \
548  LZMA_RESERVED_ENUM, LZMA_RESERVED_ENUM }
549 
550 
563 extern LZMA_API(lzma_ret) lzma_code(lzma_stream *strm, lzma_action action)
565 
566 
580 extern LZMA_API(void) lzma_end(lzma_stream *strm) lzma_nothrow;
581 
582 
598 extern LZMA_API(void) lzma_get_progress(lzma_stream *strm,
600 
601 
624 extern LZMA_API(uint64_t) lzma_memusage(const lzma_stream *strm)
626 
627 
637 extern LZMA_API(uint64_t) lzma_memlimit_get(const lzma_stream *strm)
639 
640 
658 extern LZMA_API(lzma_ret) lzma_memlimit_set(
uint64_t memlimit
Definition: container.h:537
static lzma_stream strm
Definition: full_flush.c:20
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void uLong size
Definition: ioapi.h:138
#define const
Definition: ansidecl.h:240
#define LZMA_API_CALL
Definition: lzma.h:202
#define lzma_attr_pure
Definition: lzma.h:265
unsigned long uint64_t
Definition: sftypes.h:28
unsigned char uint8_t
Definition: sftypes.h:31
Custom functions for memory handling.
Definition: base.h:372
void * ptr
Definition: base.h:421
void * opaque
Pointer passed to .alloc() and .free()
Definition: base.h:432
void *LZMA_API_CALL * alloc(void *opaque, size_t nmemb, size_t size)
Pointer to a custom memory allocation function.
Passing data to and from liblzma.
Definition: base.h:485
uint64_t reserved_int1
Definition: base.h:517
void * reserved_ptr3
Definition: base.h:515
uint8_t * next_out
Definition: base.h:490
uint64_t total_in
Definition: base.h:488
size_t reserved_int3
Definition: base.h:519
const lzma_allocator * allocator
Custom memory allocation functions.
Definition: base.h:502
size_t avail_out
Definition: base.h:491
const uint8_t * next_in
Definition: base.h:486
uint64_t total_out
Definition: base.h:492
void * reserved_ptr1
Definition: base.h:513
lzma_reserved_enum reserved_enum2
Definition: base.h:522
lzma_reserved_enum reserved_enum1
Definition: base.h:521
void * reserved_ptr2
Definition: base.h:514
size_t avail_in
Definition: base.h:487
void * reserved_ptr4
Definition: base.h:516
size_t reserved_int4
Definition: base.h:520
uint64_t reserved_int2
Definition: base.h:518
lzma_reserved_enum
Type of reserved enumeration variable in structures.
Definition: base.h:44
@ LZMA_RESERVED_ENUM
Definition: base.h:45
lzma_action action lzma_nothrow lzma_attr_warn_unused_result
Definition: base.h:564
LZMA_API(lzma_ret) lzma_code(lzma_stream *strm
Encode or decode data.
uint64_t uint64_t *progress_out lzma_nothrow
Definition: base.h:599
lzma_ret
Return values used by several functions in liblzma.
Definition: base.h:57
@ LZMA_PROG_ERROR
Programming error.
Definition: base.h:218
@ LZMA_DATA_ERROR
Data is corrupt.
Definition: base.h:172
@ LZMA_MEM_ERROR
Cannot allocate memory.
Definition: base.h:128
@ LZMA_FORMAT_ERROR
Memory usage limit was reached.
Definition: base.h:150
@ LZMA_STREAM_END
End of stream was reached.
Definition: base.h:63
@ LZMA_UNSUPPORTED_CHECK
Cannot calculate the integrity check.
Definition: base.h:90
@ LZMA_BUF_ERROR
No progress is possible.
Definition: base.h:191
@ LZMA_MEMLIMIT_ERROR
Definition: base.h:140
@ LZMA_GET_CHECK
Integrity check type is now available.
Definition: base.h:115
@ LZMA_NO_CHECK
Input stream has no integrity check.
Definition: base.h:75
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
Definition: base.h:160
@ LZMA_OK
Operation completed successfully.
Definition: base.h:58
lzma_action
The ‘action’ argument for lzma_code()
Definition: base.h:250
@ LZMA_SYNC_FLUSH
Make all the input available at output.
Definition: base.h:265
@ LZMA_FINISH
Finish the coding operation.
Definition: base.h:328
@ LZMA_RUN
Continue coding.
Definition: base.h:251
@ LZMA_FULL_FLUSH
Finish encoding of the current Block.
Definition: base.h:290
@ LZMA_FULL_BARRIER
Finish encoding of the current Block.
Definition: base.h:305
unsigned char lzma_bool
Boolean.
Definition: base.h:29
uint64_t * progress_in
Definition: base.h:599