/** @file
LZMA Compress/Decompress tool (LzmaCompress)
Based on LZMA SDK 4.65:
LzmaUtil.c -- Test application for LZMA compression
2008-11-23 : Igor Pavlov : Public domain
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Sdk/C/7zFile.h"
#include "Sdk/C/7zVersion.h"
#include "CommonLib.h"
typedef enum {
#define UTILITY_MAJOR_VERSION 0
#define INTEL_COPYRIGHT \
"Copyright (c) 2009-2012, Intel Corporation. All rights reserved."
{
"\nUsage: LzmaCompress -e|-d [options] <inputFile>\n"
" -e: encode file\n"
" -d: decode file\n"
" -o FileName, --output FileName: specify the output filename\n"
" --f86: enable converter for x86 code\n"
" -v, --verbose: increase output messages\n"
" -q, --quiet: reduce output messages\n"
" --debug [0-9]: set debug level\n"
" --version: display the program version and exit\n"
" -h, --help: display this help text\n"
);
}
{
return 1;
}
{
return 1;
}
{
}
{
sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
}
{
if (inSize != 0) {
if (inBuffer == 0)
return SZ_ERROR_MEM;
} else {
return SZ_ERROR_INPUT_EOF;
}
res = SZ_ERROR_READ;
goto Done;
}
// we allocate 105% of original size + 64KB for output buffer
if (outBuffer == 0) {
res = SZ_ERROR_MEM;
goto Done;
}
{
int i;
for (i = 0; i < 8; i++)
}
if (mConType != NoConverter)
{
if (filteredStream == 0) {
res = SZ_ERROR_MEM;
goto Done;
}
if (mConType == X86Converter) {
{
}
}
}
{
goto Done;
}
Done:
return res;
}
{
int i;
if (inSize < LZMA_HEADER_SIZE)
return SZ_ERROR_INPUT_EOF;
if (inBuffer == 0)
return SZ_ERROR_MEM;
res = SZ_ERROR_READ;
goto Done;
}
for (i = 0; i < 8; i++)
if (outSize != 0) {
if (outBuffer == 0) {
res = SZ_ERROR_MEM;
goto Done;
}
} else {
goto Done;
}
goto Done;
if (mConType == X86Converter)
{
}
Done:
return res;
}
{
int res;
int encodeMode = 0;
int param;
if (numArgs == 1)
{
return 0;
}
modeWasSet = True;
#ifdef VBOX_LZMA_F86_COMPRESS
#endif
return PrintUserError(rs);
}
return PrintUserError(rs);
}
//
// For now we silently ignore this parameter to achieve command line
// parameter compatibility with other build tools.
//
param++;
} else if (
) {
return 0;
} else if (
) {
//
// For now we silently ignore this parameter to achieve command line
// parameter compatibility with other build tools.
//
} else if (
) {
mQuietMode = True;
return 0;
} else {
return PrintUserError(rs);
}
}
return PrintUserError(rs);
}
{
}
if (encodeMode)
{
if (!mQuietMode) {
printf("Encoding\n");
}
}
else
{
if (!mQuietMode) {
printf("Decoding\n");
}
}
{
if (res == SZ_ERROR_MEM)
else if (res == SZ_ERROR_DATA)
else if (res == SZ_ERROR_WRITE)
else if (res == SZ_ERROR_READ)
}
return 0;
}
{
}
return res;
}