23 #define IN_BUF_MAX 4096
24 #define OUT_BUF_MAX 4096
28 #define RET_ERROR_INIT 1
29 #define RET_ERROR_INPUT 2
30 #define RET_ERROR_OUTPUT 3
31 #define RET_ERROR_DECOMPRESSION 4
44 bool in_finished =
false;
45 bool out_finished =
false;
53 ret_xz = lzma_stream_decoder (&
strm, memory_limit,
flags);
55 fprintf (stderr,
"lzma_stream_decoder error: %d\n", (
int) ret_xz);
59 while ((! in_finished) && (! out_finished)) {
66 if (ferror (in_file)) {
89 fprintf (stderr,
"lzma_code error: %d\n", (
int) ret_xz);
95 fwrite (
out_buf, 1, out_len, out_file);
96 if (ferror (out_file)) {
108 fprintf (stderr,
"Input truncated or corrupt\n");
static io_buf in_buf
Input and output buffers.
#define LZMA_CONCATENATED
#define LZMA_TELL_UNSUPPORTED_CHECK
The public API of liblzma data compression library.
static struct sockaddr static addrlen static backlog const void static flags void flags
Passing data to and from liblzma.
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_OK
Operation completed successfully.
lzma_action
The ‘action’ argument for lzma_code()
@ LZMA_FINISH
Finish the coding operation.
@ LZMA_RUN
Continue coding.
#define LZMA_STREAM_INIT
Initialization for lzma_stream.
int xz_decompress(FILE *in_file, FILE *out_file)
#define RET_ERROR_DECOMPRESSION