32 # define TOOL_FORMAT "lzma"
34 # define TOOL_FORMAT "xz"
44 my_errorf(
const char *fmt, ...)
51 vfprintf(stderr, fmt, ap);
52 fprintf(stderr,
"\n");
64 "Usage: %s [OPTION]... [FILE]...\n"
65 "Decompress files in the ." TOOL_FORMAT " format to standard output.\n"
67 " -d, --decompress (ignored, only decompression is supported)\n"
68 " -k, --keep (ignored, files are never deleted)\n"
69 " -c, --stdout (ignored, output is always written to standard output)\n"
70 " -q, --quiet specify *twice* to suppress errors\n"
71 " -Q, --no-warn (ignored, the exit status 2 is never used)\n"
72 " -h, --help display this help and exit\n"
73 " -V, --version display the version number and exit\n"
75 "With no FILE, or when FILE is -, read standard input.\n"
88 "liblzma %s\n", lzma_version_string());
98 static const char short_opts[] =
"cdkM:hqQV";
99 static const struct option long_opts[] = {
159 :
"Internal error (bug)");
182 my_errorf(
"%s: Error reading input file: %s",
203 if (fwrite(
out_buf, 1, write_size, stdout)
208 my_errorf(
"Cannot write to standard output: "
209 "%s", strerror(errno));
245 msg =
"File format not recognized";
250 msg =
"Unsupported compression options";
254 msg =
"File is corrupt";
258 msg =
"Unexpected end of input";
262 msg =
"Internal error (bug)";
288 #ifdef TUKLIB_DOSLIKE
313 }
while (++
optind < argc);
#define PACKAGE_BUGREPORT
static io_buf in_buf
Input and output buffers.
#define LZMA_CONCATENATED
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static fork const void static count static fd const char const char static newpath char char argv
The public API of liblzma data compression library.
assert(limit<=UINT32_MAX/2)
static struct sockaddr static addrlen static backlog const void msg
Passing data to and from liblzma.
Common includes, definitions, system-specific things etc.
Close stdout and stderr, and exit.
Program name to be displayed in messages.
#define tuklib_progname_init
lzma_ret
Return values used by several functions in liblzma.
@ LZMA_DATA_ERROR
Data is corrupt.
@ LZMA_MEM_ERROR
Cannot allocate memory.
@ LZMA_FORMAT_ERROR
Memory usage limit was reached.
@ LZMA_STREAM_END
End of stream was reached.
@ LZMA_BUF_ERROR
No progress is possible.
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
@ 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.
#define LZMA_VERSION_STRING
Compile-time version as a string.
static void parse_options(int argc, char **argv)
Parses command line options.
static void uncompress(lzma_stream *strm, FILE *file, const char *filename)
int main(int argc, char **argv)
static void lzma_attribute((__format__(__printf__, 1, 2)))
static int display_errors