4.35 beta

This commit is contained in:
Igor Pavlov
2006-03-03 00:00:00 +00:00
committed by Kornel Lesiński
parent 0f60a4933b
commit 191cf6781a
16 changed files with 156 additions and 53 deletions

View File

@@ -6,6 +6,7 @@ CFLAGS = $(CFLAGS) -I ../../../ \
-DNO_REGISTRY \
-D_NO_CRYPTO \
-DFORMAT_7Z \
-DCOMPRESS_MT \
-DCOMPRESS_BCJ_X86 \
-DCOMPRESS_BCJ2 \
-DCOMPRESS_COPY \
@@ -78,6 +79,7 @@ UI_COMMON_OBJS = \
$O\ExtractingFilePath.obj \
$O\OpenArchive.obj \
$O\PropIDUtils.obj \
$O\SetProperties.obj \
$O\SortUtils.obj \
$O\TempFiles.obj \
$O\Update.obj \
@@ -97,6 +99,7 @@ AR_COMMON_OBJS = \
$O\ItemNameUtils.obj \
$O\MultiStream.obj \
$O\OutStreamWithCRC.obj \
$O\ParseProperties.obj \
7Z_OBJS = \

View File

@@ -459,7 +459,7 @@ int Main2(
HRESULT result = ListArchives(
v1, v2,
wildcardCensorHead,
true,
true, false,
passwordEnabled,
password);
if (result != S_OK)

View File

@@ -27,9 +27,9 @@ public:
bool CopyBlock(UInt32 distance, UInt32 len)
{
UInt32 pos = _pos - distance - 1;
if (pos >= _bufferSize)
if (distance >= _pos)
{
if (!_overDict)
if (!_overDict || distance >= _bufferSize)
return false;
pos += _bufferSize;
}

View File

@@ -152,7 +152,7 @@ int main2(int n, const char *args[])
g_IsNT = IsItWindowsNT();
#endif
fprintf(stderr, "\nLZMA 4.34 Copyright (c) 1999-2006 Igor Pavlov 2006-02-23\n");
fprintf(stderr, "\nLZMA 4.35 Copyright (c) 1999-2006 Igor Pavlov 2006-03-03\n");
if (n == 1)
{

View File

@@ -287,7 +287,10 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
}
else
return S_FALSE;
CopyBackBlockOp(distance, length);
m_RepDists[m_RepDistPtr++ & 3] = distance;
m_LastLength = length;
if (!m_OutWindowStream.CopyBlock(distance, length))
return S_FALSE;
pos += length;
}
}

View File

@@ -56,16 +56,6 @@ class CDecoder :
void InitStructures();
bool ReadTables();
bool ReadLastTables();
void CopyBackBlockOp(UInt32 aDistance, UInt32 aLength)
{
/*
if(m_Position <= aDistance)
throw CDecoderException(CDecoderException::kData);
*/
m_RepDists[m_RepDistPtr++ & 3] = aDistance;
m_LastLength = aLength;
m_OutWindowStream.CopyBlock(aDistance, aLength);
}
public:
CDecoder();

View File

@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 4
#define MY_VER_MINOR 34
#define MY_VERSION "4.34 beta"
#define MY_7ZIP_VERSION "7-Zip 4.34 beta"
#define MY_DATE "2006-02-27"
#define MY_VER_MINOR 35
#define MY_VERSION "4.35 beta"
#define MY_7ZIP_VERSION "7-Zip 4.35 beta"
#define MY_DATE "2006-03-03"
#define MY_COPYRIGHT "Copyright (c) 1999-2006 Igor Pavlov"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE

View File

@@ -27,7 +27,7 @@ using namespace NCommandLineParser;
using namespace NWindows;
using namespace NFile;
static const int kNumSwitches = 26;
static const int kNumSwitches = 27;
namespace NKey {
enum Enum
@@ -57,7 +57,8 @@ enum Enum
kEmail,
kShowDialog,
kLargePages,
kCharSet
kCharSet,
kTechMode
};
}
@@ -121,7 +122,8 @@ static const CSwitchForm kSwitchForms[kNumSwitches] =
{ L"SEML", NSwitchType::kUnLimitedPostString, false, 0},
{ L"AD", NSwitchType::kSimple, false },
{ L"SLP", NSwitchType::kUnLimitedPostString, false, 0},
{ L"SCS", NSwitchType::kUnLimitedPostString, false, 0}
{ L"SCS", NSwitchType::kUnLimitedPostString, false, 0},
{ L"SLT", NSwitchType::kSimple, false }
};
static const int kNumCommandForms = 7;
@@ -236,7 +238,7 @@ static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
return true;
}
static inline GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
static void AddToCensorFromListFile(NWildcard::CCensor &wildcardCensor,
LPCWSTR fileName, bool include, NRecursedType::EEnum type, UINT codePage)
@@ -747,6 +749,8 @@ void CArchiveCommandLineParser::Parse2(CArchiveCommandLineOptions &options)
if (!ParseArchiveCommand(nonSwitchStrings[kCommandIndex], options.Command))
throw kUserErrorMessage;
options.TechMode = parser[NKey::kTechMode].ThereIs;
NRecursedType::EEnum recursedType;
if (parser[NKey::kRecursed].ThereIs)
recursedType = GetRecursedTypeFromIndex(parser[NKey::kRecursed].PostCharIndex);

View File

@@ -62,6 +62,7 @@ struct CArchiveCommandLineOptions
bool PasswordEnabled;
UString Password;
bool TechMode;
// Extract
bool AppendName;
UString OutputDir;

View File

@@ -24,6 +24,42 @@
using namespace NWindows;
struct CPropIdToName
{
PROPID PropID;
const wchar_t *Name;
};
static CPropIdToName kPropIdToName[] =
{
{ kpidPath, L"Path" },
{ kpidName, L"Name" },
{ kpidIsFolder, L"Folder" },
{ kpidSize, L"Size" },
{ kpidPackedSize, L"Packed Size" },
{ kpidAttributes, L"Attributes" },
{ kpidCreationTime, L"Created" },
{ kpidLastAccessTime, L"Accessed" },
{ kpidLastWriteTime, L"Modified" },
{ kpidSolid, L"Solid" },
{ kpidCommented, L"Commented" },
{ kpidEncrypted, L"Encrypted" },
{ kpidSplitBefore, L"Split Before" },
{ kpidSplitAfter, L"Split After" },
{ kpidDictionarySize, L"Dictionary Size" },
{ kpidCRC, L"CRC" },
{ kpidType, L"Type" },
{ kpidIsAnti, L"Anti" },
{ kpidMethod, L"Method" },
{ kpidHostOS, L"Host OS" },
{ kpidFileSystem, L"File System" },
{ kpidUser, L"User" },
{ kpidGroup, L"Group" },
{ kpidBlock, L"Block" },
{ kpidComment, L"Comment" },
{ kpidPosition, L"Position" }
};
static const char kEmptyAttributeChar = '.';
static const char kDirectoryAttributeChar = 'D';
static const char kReadonlyAttributeChar = 'R';
@@ -116,19 +152,23 @@ class CFieldPrinter
{
CObjectVector<CFieldInfo> _fields;
public:
void Clear() { _fields.Clear(); }
void Init(const CFieldInfoInit *standardFieldTable, int numItems);
HRESULT Init(IInArchive *archive);
void PrintTitle();
void PrintTitleLines();
HRESULT PrintItemInfo(IInArchive *archive,
const UString &defaultItemName,
const NWindows::NFile::NFind::CFileInfoW &archiveFileInfo,
UInt32 index);
UInt32 index,
bool techMode);
HRESULT PrintSummaryInfo(UInt64 numFiles, const UInt64 *size,
const UInt64 *compressedSize);
};
void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems)
{
Clear();
for (int i = 0; i < numItems; i++)
{
CFieldInfo fieldInfo;
@@ -143,7 +183,39 @@ void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, int numItems)
}
}
HRESULT CFieldPrinter::Init(IInArchive *archive)
{
Clear();
UInt32 numProps;
RINOK(archive->GetNumberOfProperties(&numProps));
for (UInt32 i = 0; i < numProps; i++)
{
CMyComBSTR name;
PROPID propID;
VARTYPE vt;
RINOK(archive->GetPropertyInfo(i, &name, &propID, &vt));
CFieldInfo fieldInfo;
fieldInfo.PropID = propID;
if (name != NULL)
fieldInfo.Name = name;
else
{
fieldInfo.Name = L"Unknown";
for (int i = 0; i < sizeof(kPropIdToName) / sizeof(kPropIdToName[0]); i++)
{
const CPropIdToName &propIdToName = kPropIdToName[i];
if (propIdToName.PropID == propID)
{
fieldInfo.Name = propIdToName.Name;
break;
}
}
}
_fields.Add(fieldInfo);
}
return S_OK;
}
void CFieldPrinter::PrintTitle()
{
for (int i = 0; i < _fields.Size(); i++)
@@ -195,15 +267,29 @@ void PrintTime(const NCOM::CPropVariant &propVariant)
HRESULT CFieldPrinter::PrintItemInfo(IInArchive *archive,
const UString &defaultItemName,
const NWindows::NFile::NFind::CFileInfoW &archiveFileInfo,
UInt32 index)
UInt32 index,
bool techMode)
{
/*
if (techMode)
{
g_StdOut << "Index = ";
g_StdOut << (UInt64)index;
g_StdOut << endl;
}
*/
for (int i = 0; i < _fields.Size(); i++)
{
const CFieldInfo &fieldInfo = _fields[i];
PrintSpaces(fieldInfo.PrefixSpacesWidth);
if (!techMode)
PrintSpaces(fieldInfo.PrefixSpacesWidth);
NCOM::CPropVariant propVariant;
RINOK(archive->GetProperty(index, fieldInfo.PropID, &propVariant));
if (techMode)
{
g_StdOut << fieldInfo.Name << " = ";
}
int width = (fieldInfo.PropID == kpidPath) ? 0: fieldInfo.Width;
if (propVariant.vt == VT_EMPTY)
{
@@ -216,17 +302,18 @@ HRESULT CFieldPrinter::PrintItemInfo(IInArchive *archive,
propVariant = archiveFileInfo.LastWriteTime;
break;
default:
PrintSpaces(width);
if (techMode)
g_StdOut << endl;
else
PrintSpaces(width);
continue;
}
}
if (fieldInfo.PropID == kpidLastWriteTime)
{
PrintTime(propVariant);
continue;
}
if (fieldInfo.PropID == kpidAttributes)
else if (fieldInfo.PropID == kpidAttributes)
{
if (propVariant.vt != VT_UI4)
throw "incorrect item";
@@ -236,16 +323,24 @@ HRESULT CFieldPrinter::PrintItemInfo(IInArchive *archive,
char s[8];
GetAttributesString(attributes, isFolder, s);
g_StdOut << s;
continue;
}
if (propVariant.vt == VT_BSTR)
else if (propVariant.vt == VT_BSTR)
{
PrintString(fieldInfo.TextAdjustment, width, propVariant.bstrVal);
continue;
if (techMode)
g_StdOut << propVariant.bstrVal;
else
PrintString(fieldInfo.TextAdjustment, width, propVariant.bstrVal);
}
PrintString(fieldInfo.TextAdjustment, width,
ConvertPropertyToString(propVariant, fieldInfo.PropID));
else
{
UString s = ConvertPropertyToString(propVariant, fieldInfo.PropID);
if (techMode)
g_StdOut << s;
else
PrintString(fieldInfo.TextAdjustment, width, s);
}
if (techMode)
g_StdOut << endl;
}
return S_OK;
}
@@ -299,10 +394,11 @@ bool GetUInt64Value(IInArchive *archive, UInt32 index, PROPID propID, UInt64 &va
HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFull,
const NWildcard::CCensorNode &wildcardCensor,
bool enableHeaders, bool &passwordEnabled, UString &password)
bool enableHeaders, bool techMode, bool &passwordEnabled, UString &password)
{
CFieldPrinter fieldPrinter;
fieldPrinter.Init(kStandardFieldTable, sizeof(kStandardFieldTable) / sizeof(kStandardFieldTable[0]));
if (!techMode)
fieldPrinter.Init(kStandardFieldTable, sizeof(kStandardFieldTable) / sizeof(kStandardFieldTable[0]));
UInt64 numFiles2 = 0, totalPackSize2 = 0, totalUnPackSize2 = 0;
UInt64 *totalPackSizePointer2 = 0, *totalUnPackSizePointer2 = 0;
@@ -355,14 +451,18 @@ HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFul
if (enableHeaders)
g_StdOut << endl << kListing << archiveName << endl << endl;
if (enableHeaders)
if (enableHeaders && !techMode)
{
fieldPrinter.PrintTitle();
g_StdOut << endl;
fieldPrinter.PrintTitleLines();
g_StdOut << endl;
}
if (techMode)
{
RINOK(fieldPrinter.Init(archive));
}
UInt64 numFiles = 0, totalPackSize = 0, totalUnPackSize = 0;
UInt64 *totalPackSizePointer = 0, *totalUnPackSizePointer = 0;
UInt32 numItems;
@@ -380,7 +480,7 @@ HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFul
if (!wildcardCensor.CheckPath(filePath, !isFolder))
continue;
fieldPrinter.PrintItemInfo(archive, defaultItemName, archiveFileInfo, i);
fieldPrinter.PrintItemInfo(archive, defaultItemName, archiveFileInfo, i, techMode);
UInt64 packSize, unpackSize;
if (!GetUInt64Value(archive, i, kpidSize, unpackSize))
@@ -398,7 +498,7 @@ HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFul
totalPackSize += packSize;
totalUnPackSize += unpackSize;
}
if (enableHeaders)
if (enableHeaders && !techMode)
{
fieldPrinter.PrintTitleLines();
g_StdOut << endl;
@@ -417,7 +517,7 @@ HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFul
}
numFiles2 += numFiles;
}
if (enableHeaders && archivePaths.Size() > 1)
if (enableHeaders && !techMode && archivePaths.Size() > 1)
{
g_StdOut << endl;
fieldPrinter.PrintTitleLines();

View File

@@ -7,7 +7,7 @@
HRESULT ListArchives(UStringVector &archivePaths, UStringVector &archivePathsFull,
const NWildcard::CCensorNode &wildcardCensor,
bool enableHeaders, bool &passwordEnabled, UString &password);
bool enableHeaders, bool techMode, bool &passwordEnabled, UString &password);
#endif

View File

@@ -257,6 +257,7 @@ int Main2(
options.ArchivePathsFullSorted,
options.WildcardCensor.Pairs.Front().Head,
options.EnableHeaders,
options.TechMode,
options.PasswordEnabled,
options.Password);
if (result != S_OK)

View File

@@ -40,12 +40,12 @@ You must download 7-Zip program from www.7-zip.org.
You can create .7z archive with 7z.exe or 7za.exe:
7za.exe a archive.7z *.htm -r -mx -m0fb=255
7za.exe a archive.7z *.htm -r -mx -m0fb=255 -mf=off
If you have big number of files in archive, and you need fast extracting,
you can use partly-solid archives:
7za.exe a archive.7z *.htm -ms=512K -r -mx -m0fb=255 -m0d=512K
7za.exe a archive.7z *.htm -ms=512K -r -mx -m0fb=255 -m0d=512K -mf=off
In that example 7-Zip will use 512KB solid blocks. So it needs to decompress only
512KB for extracting one file from such archive.

View File

@@ -2,7 +2,7 @@
;Defines
!define VERSION_MAJOR 4
!define VERSION_MINOR 34
!define VERSION_MINOR 35
!define VERSION_POSTFIX_FULL " beta"
!ifdef WIN64
!ifdef IA64
@@ -14,7 +14,7 @@
!define VERSION_SYS_POSTFIX_FULL ""
!endif
!define NAME_FULL "7-Zip ${VERSION_MAJOR}.${VERSION_MINOR}${VERSION_POSTFIX_FULL}${VERSION_SYS_POSTFIX_FULL}"
!define VERSION_POSTFIX "b"
!define VERSION_POSTFIX ""
!ifdef WIN64
!ifdef IA64
!define VERSION_SYS_POSTFIX "-ia64"

View File

@@ -1,7 +1,7 @@
LZMA SDK 4.34
LZMA SDK 4.35
-------------
LZMA SDK 4.34 Copyright (C) 1999-2006 Igor Pavlov
LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
LZMA SDK provides the documentation, samples, header files, libraries,
and tools you need to develop applications that use LZMA compression.

View File

@@ -1,4 +1,4 @@
7-Zip 4.33 Sources
7-Zip 4.35 Sources
------------------
7-Zip is a file archiver for Windows 95/98/ME/NT/2000/2003/XP.
@@ -170,6 +170,7 @@ Windows Win32 wrappers
Bundle Modules that are bundles of other modules
------
Alone 7za.exe: Standalone version of 7z
Alone7z 7zr.exe: Standalone version of 7z that supports only 7z/LZMA/BCJ/BCJ2
SFXCon 7zCon.sfx: Console 7z SFX module
SFXWin 7z.sfx: Windows 7z SFX module
SFXSetup 7zS.sfx: Windows 7z SFX module for Installers