Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/C/Archive
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2007-04-17 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:50 +0300
commita145bfc7cf17f7bbcfae8f0064333c8ea75b455c (patch)
tree4ea458c9f35956fe080562989a702ea8c9af4b90 /C/Archive
parentd9666cf046a8453b33b3e2fbf4d82295a9f87df3 (diff)
4.45 beta
Diffstat (limited to 'C/Archive')
-rwxr-xr-xC/Archive/7z/7zAlloc.h20
-rwxr-xr-xC/Archive/7z/7zBuffer.h19
-rwxr-xr-xC/Archive/7z/7zDecode.h21
-rwxr-xr-xC/Archive/7z/7zExtract.c4
-rwxr-xr-xC/Archive/7z/7zExtract.h40
-rwxr-xr-xC/Archive/7z/7zHeader.h55
-rwxr-xr-xC/Archive/7z/7zIn.c27
-rwxr-xr-xC/Archive/7z/7zIn.h55
-rwxr-xr-xC/Archive/7z/7zItem.h90
-rwxr-xr-xC/Archive/7z/7zMain.c8
-rwxr-xr-xC/Archive/7z/7zMethodID.h18
-rwxr-xr-xC/Archive/7z/7z_C.dsp12
-rwxr-xr-xC/Archive/7z/makefile13
-rwxr-xr-xC/Archive/7z/makefile.gcc8
14 files changed, 358 insertions, 32 deletions
diff --git a/C/Archive/7z/7zAlloc.h b/C/Archive/7z/7zAlloc.h
new file mode 100755
index 00000000..4ca4170c
--- /dev/null
+++ b/C/Archive/7z/7zAlloc.h
@@ -0,0 +1,20 @@
+/* 7zAlloc.h */
+
+#ifndef __7Z_ALLOC_H
+#define __7Z_ALLOC_H
+
+#include <stddef.h>
+
+typedef struct _ISzAlloc
+{
+ void *(*Alloc)(size_t size);
+ void (*Free)(void *address); /* address can be 0 */
+} ISzAlloc;
+
+void *SzAlloc(size_t size);
+void SzFree(void *address);
+
+void *SzAllocTemp(size_t size);
+void SzFreeTemp(void *address);
+
+#endif
diff --git a/C/Archive/7z/7zBuffer.h b/C/Archive/7z/7zBuffer.h
new file mode 100755
index 00000000..05c6d748
--- /dev/null
+++ b/C/Archive/7z/7zBuffer.h
@@ -0,0 +1,19 @@
+/* 7zBuffer.h */
+
+#ifndef __7Z_BUFFER_H
+#define __7Z_BUFFER_H
+
+#include <stddef.h>
+#include "../../Types.h"
+
+typedef struct _CSzByteBuffer
+{
+ size_t Capacity;
+ Byte *Items;
+}CSzByteBuffer;
+
+void SzByteBufferInit(CSzByteBuffer *buffer);
+int SzByteBufferCreate(CSzByteBuffer *buffer, size_t newCapacity, void * (*allocFunc)(size_t size));
+void SzByteBufferFree(CSzByteBuffer *buffer, void (*freeFunc)(void *));
+
+#endif
diff --git a/C/Archive/7z/7zDecode.h b/C/Archive/7z/7zDecode.h
new file mode 100755
index 00000000..74bb180f
--- /dev/null
+++ b/C/Archive/7z/7zDecode.h
@@ -0,0 +1,21 @@
+/* 7zDecode.h */
+
+#ifndef __7Z_DECODE_H
+#define __7Z_DECODE_H
+
+#include "7zItem.h"
+#include "7zAlloc.h"
+#ifdef _LZMA_IN_CB
+#include "7zIn.h"
+#endif
+
+SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder,
+ #ifdef _LZMA_IN_CB
+ ISzInStream *stream,
+ #else
+ const Byte *inBuffer,
+ #endif
+ Byte *outBuffer, size_t outSize,
+ size_t *outSizeProcessed, ISzAlloc *allocMain);
+
+#endif
diff --git a/C/Archive/7z/7zExtract.c b/C/Archive/7z/7zExtract.c
index 748591a5..75733fd1 100755
--- a/C/Archive/7z/7zExtract.c
+++ b/C/Archive/7z/7zExtract.c
@@ -83,7 +83,7 @@ SZ_RESULT SzExtract(
{
if (folder->UnPackCRCDefined)
{
- if (!CrcVerifyDigest(folder->UnPackCRC, *outBuffer, (size_t)unPackSize))
+ if (CrcCalc(*outBuffer, (size_t)unPackSize) != folder->UnPackCRC)
res = SZE_FAIL;
}
}
@@ -109,7 +109,7 @@ SZ_RESULT SzExtract(
{
if (fileItem->IsFileCRCDefined)
{
- if (!CrcVerifyDigest(fileItem->FileCRC, *outBuffer + *offset, *outSizeProcessed))
+ if (CrcCalc(*outBuffer + *offset, *outSizeProcessed) != fileItem->FileCRC)
res = SZE_FAIL;
}
}
diff --git a/C/Archive/7z/7zExtract.h b/C/Archive/7z/7zExtract.h
new file mode 100755
index 00000000..e9a4fb4e
--- /dev/null
+++ b/C/Archive/7z/7zExtract.h
@@ -0,0 +1,40 @@
+/* 7zExtract.h */
+
+#ifndef __7Z_EXTRACT_H
+#define __7Z_EXTRACT_H
+
+#include "7zIn.h"
+
+/*
+ SzExtract extracts file from archive
+
+ *outBuffer must be 0 before first call for each new archive.
+
+ Extracting cache:
+ If you need to decompress more than one file, you can send
+ these values from previous call:
+ *blockIndex,
+ *outBuffer,
+ *outBufferSize
+ You can consider "*outBuffer" as cache of solid block. If your archive is solid,
+ it will increase decompression speed.
+
+ If you use external function, you can declare these 3 cache variables
+ (blockIndex, outBuffer, outBufferSize) as static in that external function.
+
+ Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
+*/
+
+SZ_RESULT SzExtract(
+ ISzInStream *inStream,
+ CArchiveDatabaseEx *db,
+ UInt32 fileIndex, /* index of file */
+ UInt32 *blockIndex, /* index of solid block */
+ Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
+ size_t *outBufferSize, /* buffer size for output buffer */
+ size_t *offset, /* offset of stream for required file in *outBuffer */
+ size_t *outSizeProcessed, /* size of file in *outBuffer */
+ ISzAlloc *allocMain,
+ ISzAlloc *allocTemp);
+
+#endif
diff --git a/C/Archive/7z/7zHeader.h b/C/Archive/7z/7zHeader.h
new file mode 100755
index 00000000..3e67cf57
--- /dev/null
+++ b/C/Archive/7z/7zHeader.h
@@ -0,0 +1,55 @@
+/* 7zHeader.h */
+
+#ifndef __7Z_HEADER_H
+#define __7Z_HEADER_H
+
+#include "../../Types.h"
+
+#define k7zSignatureSize 6
+extern Byte k7zSignature[k7zSignatureSize];
+
+#define k7zMajorVersion 0
+
+#define k7zStartHeaderSize 0x20
+
+enum EIdEnum
+{
+ k7zIdEnd,
+
+ k7zIdHeader,
+
+ k7zIdArchiveProperties,
+
+ k7zIdAdditionalStreamsInfo,
+ k7zIdMainStreamsInfo,
+ k7zIdFilesInfo,
+
+ k7zIdPackInfo,
+ k7zIdUnPackInfo,
+ k7zIdSubStreamsInfo,
+
+ k7zIdSize,
+ k7zIdCRC,
+
+ k7zIdFolder,
+
+ k7zIdCodersUnPackSize,
+ k7zIdNumUnPackStream,
+
+ k7zIdEmptyStream,
+ k7zIdEmptyFile,
+ k7zIdAnti,
+
+ k7zIdName,
+ k7zIdCreationTime,
+ k7zIdLastAccessTime,
+ k7zIdLastWriteTime,
+ k7zIdWinAttributes,
+ k7zIdComment,
+
+ k7zIdEncodedHeader,
+
+ k7zIdStartPos
+};
+
+#endif
diff --git a/C/Archive/7z/7zIn.c b/C/Archive/7z/7zIn.c
index 8f3d7cae..04e83a8e 100755
--- a/C/Archive/7z/7zIn.c
+++ b/C/Archive/7z/7zIn.c
@@ -208,7 +208,7 @@ SZ_RESULT SafeReadDirectByte(ISzInStream *inStream, Byte *data)
return SafeReadDirect(inStream, data, 1);
}
-SZ_RESULT SafeReadDirectUInt32(ISzInStream *inStream, UInt32 *value)
+SZ_RESULT SafeReadDirectUInt32(ISzInStream *inStream, UInt32 *value, UInt32 *crc)
{
int i;
*value = 0;
@@ -217,11 +217,12 @@ SZ_RESULT SafeReadDirectUInt32(ISzInStream *inStream, UInt32 *value)
Byte b;
RINOK(SafeReadDirectByte(inStream, &b));
*value |= ((UInt32)b << (8 * i));
+ *crc = CRC_UPDATE_BYTE(*crc, b);
}
return SZ_OK;
}
-SZ_RESULT SafeReadDirectUInt64(ISzInStream *inStream, UInt64 *value)
+SZ_RESULT SafeReadDirectUInt64(ISzInStream *inStream, UInt64 *value, UInt32 *crc)
{
int i;
*value = 0;
@@ -230,6 +231,7 @@ SZ_RESULT SafeReadDirectUInt64(ISzInStream *inStream, UInt64 *value)
Byte b;
RINOK(SafeReadDirectByte(inStream, &b));
*value |= ((UInt64)b << (8 * i));
+ *crc = CRC_UPDATE_BYTE(*crc, b);
}
return SZ_OK;
}
@@ -1133,7 +1135,7 @@ SZ_RESULT SzReadAndDecodePackedStreams2(
if (outRealSize != (UInt32)unPackSize)
return SZE_FAIL;
if (folder->UnPackCRCDefined)
- if (!CrcVerifyDigest(folder->UnPackCRC, outBuffer->Items, (size_t)unPackSize))
+ if (CrcCalc(outBuffer->Items, (size_t)unPackSize) != folder->UnPackCRC)
return SZE_FAIL;
return SZ_OK;
}
@@ -1182,7 +1184,7 @@ SZ_RESULT SzArchiveOpen2(
UInt64 nextHeaderOffset;
UInt64 nextHeaderSize;
UInt32 nextHeaderCRC;
- UInt32 crc;
+ UInt32 crc = 0;
CFileSize pos = 0;
CSzByteBuffer buffer;
CSzData sd;
@@ -1202,20 +1204,17 @@ SZ_RESULT SzArchiveOpen2(
return SZE_ARCHIVE_ERROR;
RINOK(SafeReadDirectByte(inStream, &version));
- RINOK(SafeReadDirectUInt32(inStream, &crcFromArchive));
+ RINOK(SafeReadDirectUInt32(inStream, &crcFromArchive, &crc));
- CrcInit(&crc);
- RINOK(SafeReadDirectUInt64(inStream, &nextHeaderOffset));
- CrcUpdateUInt64(&crc, nextHeaderOffset);
- RINOK(SafeReadDirectUInt64(inStream, &nextHeaderSize));
- CrcUpdateUInt64(&crc, nextHeaderSize);
- RINOK(SafeReadDirectUInt32(inStream, &nextHeaderCRC));
- CrcUpdateUInt32(&crc, nextHeaderCRC);
+ crc = CRC_INIT_VAL;
+ RINOK(SafeReadDirectUInt64(inStream, &nextHeaderOffset, &crc));
+ RINOK(SafeReadDirectUInt64(inStream, &nextHeaderSize, &crc));
+ RINOK(SafeReadDirectUInt32(inStream, &nextHeaderCRC, &crc));
pos = k7zStartHeaderSize;
db->ArchiveInfo.StartPositionAfterHeader = pos;
- if (CrcGetDigest(&crc) != crcFromArchive)
+ if (CRC_GET_DIGEST(crc) != crcFromArchive)
return SZE_ARCHIVE_ERROR;
if (nextHeaderSize == 0)
@@ -1230,7 +1229,7 @@ SZ_RESULT SzArchiveOpen2(
if (res == SZ_OK)
{
res = SZE_ARCHIVE_ERROR;
- if (CrcVerifyDigest(nextHeaderCRC, buffer.Items, (UInt32)nextHeaderSize))
+ if (CrcCalc(buffer.Items, (UInt32)nextHeaderSize) == nextHeaderCRC)
{
for (;;)
{
diff --git a/C/Archive/7z/7zIn.h b/C/Archive/7z/7zIn.h
new file mode 100755
index 00000000..6bfa2a70
--- /dev/null
+++ b/C/Archive/7z/7zIn.h
@@ -0,0 +1,55 @@
+/* 7zIn.h */
+
+#ifndef __7Z_IN_H
+#define __7Z_IN_H
+
+#include "7zHeader.h"
+#include "7zItem.h"
+#include "7zAlloc.h"
+
+typedef struct _CInArchiveInfo
+{
+ CFileSize StartPositionAfterHeader;
+ CFileSize DataStartPosition;
+}CInArchiveInfo;
+
+typedef struct _CArchiveDatabaseEx
+{
+ CArchiveDatabase Database;
+ CInArchiveInfo ArchiveInfo;
+ UInt32 *FolderStartPackStreamIndex;
+ CFileSize *PackStreamStartPositions;
+ UInt32 *FolderStartFileIndex;
+ UInt32 *FileIndexToFolderIndexMap;
+}CArchiveDatabaseEx;
+
+void SzArDbExInit(CArchiveDatabaseEx *db);
+void SzArDbExFree(CArchiveDatabaseEx *db, void (*freeFunc)(void *));
+CFileSize SzArDbGetFolderStreamPos(CArchiveDatabaseEx *db, UInt32 folderIndex, UInt32 indexInFolder);
+CFileSize SzArDbGetFolderFullPackSize(CArchiveDatabaseEx *db, UInt32 folderIndex);
+
+typedef struct _ISzInStream
+{
+ #ifdef _LZMA_IN_CB
+ SZ_RESULT (*Read)(
+ void *object, /* pointer to ISzInStream itself */
+ void **buffer, /* out: pointer to buffer with data */
+ size_t maxRequiredSize, /* max required size to read */
+ size_t *processedSize); /* real processed size.
+ processedSize can be less than maxRequiredSize.
+ If processedSize == 0, then there are no more
+ bytes in stream. */
+ #else
+ SZ_RESULT (*Read)(void *object, void *buffer, size_t size, size_t *processedSize);
+ #endif
+ SZ_RESULT (*Seek)(void *object, CFileSize pos);
+} ISzInStream;
+
+
+int SzArchiveOpen(
+ ISzInStream *inStream,
+ CArchiveDatabaseEx *db,
+ ISzAlloc *allocMain,
+ ISzAlloc *allocTemp);
+
+#endif
diff --git a/C/Archive/7z/7zItem.h b/C/Archive/7z/7zItem.h
new file mode 100755
index 00000000..876539a9
--- /dev/null
+++ b/C/Archive/7z/7zItem.h
@@ -0,0 +1,90 @@
+/* 7zItem.h */
+
+#ifndef __7Z_ITEM_H
+#define __7Z_ITEM_H
+
+#include "7zMethodID.h"
+#include "7zHeader.h"
+#include "7zBuffer.h"
+
+typedef struct _CCoderInfo
+{
+ UInt32 NumInStreams;
+ UInt32 NumOutStreams;
+ CMethodID MethodID;
+ CSzByteBuffer Properties;
+}CCoderInfo;
+
+void SzCoderInfoInit(CCoderInfo *coder);
+void SzCoderInfoFree(CCoderInfo *coder, void (*freeFunc)(void *p));
+
+typedef struct _CBindPair
+{
+ UInt32 InIndex;
+ UInt32 OutIndex;
+}CBindPair;
+
+typedef struct _CFolder
+{
+ UInt32 NumCoders;
+ CCoderInfo *Coders;
+ UInt32 NumBindPairs;
+ CBindPair *BindPairs;
+ UInt32 NumPackStreams;
+ UInt32 *PackStreams;
+ CFileSize *UnPackSizes;
+ int UnPackCRCDefined;
+ UInt32 UnPackCRC;
+
+ UInt32 NumUnPackStreams;
+}CFolder;
+
+void SzFolderInit(CFolder *folder);
+CFileSize SzFolderGetUnPackSize(CFolder *folder);
+int SzFolderFindBindPairForInStream(CFolder *folder, UInt32 inStreamIndex);
+UInt32 SzFolderGetNumOutStreams(CFolder *folder);
+CFileSize SzFolderGetUnPackSize(CFolder *folder);
+
+/* #define CArchiveFileTime UInt64 */
+
+typedef struct _CFileItem
+{
+ /*
+ CArchiveFileTime LastWriteTime;
+ CFileSize StartPos;
+ UInt32 Attributes;
+ */
+ CFileSize Size;
+ UInt32 FileCRC;
+ char *Name;
+
+ Byte IsFileCRCDefined;
+ Byte HasStream;
+ Byte IsDirectory;
+ Byte IsAnti;
+ /*
+ int AreAttributesDefined;
+ int IsLastWriteTimeDefined;
+ int IsStartPosDefined;
+ */
+}CFileItem;
+
+void SzFileInit(CFileItem *fileItem);
+
+typedef struct _CArchiveDatabase
+{
+ UInt32 NumPackStreams;
+ CFileSize *PackSizes;
+ Byte *PackCRCsDefined;
+ UInt32 *PackCRCs;
+ UInt32 NumFolders;
+ CFolder *Folders;
+ UInt32 NumFiles;
+ CFileItem *Files;
+}CArchiveDatabase;
+
+void SzArchiveDatabaseInit(CArchiveDatabase *db);
+void SzArchiveDatabaseFree(CArchiveDatabase *db, void (*freeFunc)(void *));
+
+
+#endif
diff --git a/C/Archive/7z/7zMain.c b/C/Archive/7z/7zMain.c
index 0a789639..efd3624d 100755
--- a/C/Archive/7z/7zMain.c
+++ b/C/Archive/7z/7zMain.c
@@ -159,7 +159,11 @@ SZ_RESULT SzFileSeekImp(void *object, CFileSize pos)
{
LARGE_INTEGER value;
value.LowPart = (DWORD)pos;
- value.HighPart = (LONG)(pos >> 32);
+ value.HighPart = (LONG)((UInt64)pos >> 32);
+ #ifdef _SZ_FILE_SIZE_32
+ // VC 6.0 has bug with >> 32 shifts.
+ value.HighPart = 0;
+ #endif
value.LowPart = SetFilePointer(s->File, value.LowPart, &value.HighPart, FILE_BEGIN);
if (value.LowPart == 0xFFFFFFFF)
if(GetLastError() != NO_ERROR)
@@ -187,7 +191,7 @@ int main(int numargs, char *args[])
ISzAlloc allocImp;
ISzAlloc allocTempImp;
- printf("\n7z ANSI-C Decoder 4.44 Copyright (c) 1999-2006 Igor Pavlov 2006-08-27\n");
+ printf("\n7z ANSI-C Decoder 4.45 Copyright (c) 1999-2007 Igor Pavlov 2007-03-15\n");
if (numargs == 1)
{
printf(
diff --git a/C/Archive/7z/7zMethodID.h b/C/Archive/7z/7zMethodID.h
new file mode 100755
index 00000000..8eb301da
--- /dev/null
+++ b/C/Archive/7z/7zMethodID.h
@@ -0,0 +1,18 @@
+/* 7zMethodID.h */
+
+#ifndef __7Z_METHOD_ID_H
+#define __7Z_METHOD_ID_H
+
+#include "../../Types.h"
+
+#define kMethodIDSize 15
+
+typedef struct _CMethodID
+{
+ Byte ID[kMethodIDSize];
+ Byte IDSize;
+} CMethodID;
+
+int AreMethodsEqual(CMethodID *a1, CMethodID *a2);
+
+#endif
diff --git a/C/Archive/7z/7z_C.dsp b/C/Archive/7z/7z_C.dsp
index 699384ef..e53d1d0a 100755
--- a/C/Archive/7z/7z_C.dsp
+++ b/C/Archive/7z/7z_C.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W4 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LZMA_PROB32" /D "_LZMA_IN_CB" /D "_SZ_FILE_SIZE_64" /YX /FD /c
+# ADD CPP /nologo /W4 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LZMA_PROB32" /D "_LZMA_IN_CB" /YX /FD /c
# ADD BASE RSC /l 0x419 /d "NDEBUG"
# ADD RSC /l 0x419 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W4 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LZMA_PROB32" /D "_LZMA_IN_CB" /D "_SZ_FILE_SIZE_64" /YX /FD /GZ /c
+# ADD CPP /nologo /W4 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_LZMA_PROB32" /D "_LZMA_IN_CB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x419 /d "_DEBUG"
# ADD RSC /l 0x419 /d "_DEBUG"
BSC32=bscmake.exe
@@ -109,6 +109,10 @@ SOURCE=..\..\7zCrc.c
SOURCE=..\..\7zCrc.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\Types.h
+# End Source File
# End Group
# Begin Source File
@@ -178,9 +182,5 @@ SOURCE=.\7zMethodID.c
SOURCE=.\7zMethodID.h
# End Source File
-# Begin Source File
-
-SOURCE=.\7zTypes.h
-# End Source File
# End Target
# End Project
diff --git a/C/Archive/7z/makefile b/C/Archive/7z/makefile
index 9ce2c346..d6181717 100755
--- a/C/Archive/7z/makefile
+++ b/C/Archive/7z/makefile
@@ -8,11 +8,11 @@ O=O
!ENDIF
!ENDIF
-CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -GS-
+CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -GS- -WX -Gy
CFLAGS_O1 = $(CFLAGS) -O1
CFLAGS_O2 = $(CFLAGS) -O2
-LFLAGS = $(LFLAGS) -nologo -OPT:NOWIN98
+LFLAGS = $(LFLAGS) -nologo -OPT:NOWIN98 -OPT:REF
PROGPATH = $O\$(PROG)
@@ -20,11 +20,13 @@ COMPL_O1 = $(CPP) $(CFLAGS_O1) $**
COMPL_O2 = $(CPP) $(CFLAGS_O2) $**
COMPL = $(CPP) $(CFLAGS_O1) $**
+C_OBJS = \
+ $O\7zCrc.obj \
+
7Z_OBJS = \
$O\7zAlloc.obj \
$O\7zBuffer.obj \
- $O\7zCrc.obj \
$O\7zDecode.obj \
$O\7zExtract.obj \
$O\7zHeader.obj \
@@ -36,6 +38,7 @@ COMPL = $(CPP) $(CFLAGS_O1) $**
OBJS = \
$(7Z_OBJS) \
$O\LzmaDecode.obj \
+ $(C_OBJS) \
all: $(PROGPATH)
@@ -51,5 +54,7 @@ $(PROGPATH): $O $(OBJS)
$(7Z_OBJS): $(*B).c
$(COMPL)
-$O\LzmaDecode.obj: ../../Compress/LZMA_C/$(*B).c
+$O\LzmaDecode.obj: ../../Compress/Lzma/$(*B).c
+ $(COMPL_O2)
+$(C_OBJS): ../../$(*B).c
$(COMPL_O2)
diff --git a/C/Archive/7z/makefile.gcc b/C/Archive/7z/makefile.gcc
index 21b7df47..8de50b72 100755
--- a/C/Archive/7z/makefile.gcc
+++ b/C/Archive/7z/makefile.gcc
@@ -17,8 +17,8 @@ $(PROG): $(OBJS)
7zBuffer.o: 7zBuffer.c
$(CXX) $(CFLAGS) 7zBuffer.c
-7zCrc.o: 7zCrc.c
- $(CXX) $(CFLAGS) 7zCrc.c
+7zCrc.o: ../../7zCrc.c
+ $(CXX) $(CFLAGS) ../../7zCrc.c
7zDecode.o: 7zDecode.c
$(CXX) $(CFLAGS) 7zDecode.c
@@ -41,8 +41,8 @@ $(PROG): $(OBJS)
7zMethodID.o: 7zMethodID.c
$(CXX) $(CFLAGS) 7zMethodID.c
-LzmaDecode.o: ../../Compress/LZMA_C/LzmaDecode.c
- $(CXX) $(CFLAGS) ../../Compress/LZMA_C/LzmaDecode.c
+LzmaDecode.o: ../../Compress/Lzma/LzmaDecode.c
+ $(CXX) $(CFLAGS) ../../Compress/Lzma/LzmaDecode.c
clean: