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
diff options
context:
space:
mode:
-rwxr-xr-xC/7zVersion.h6
-rwxr-xr-xC/Archive/7z/7zIn.c60
-rwxr-xr-xCPP/7zip/Archive/7z/7zDecode.cpp19
-rwxr-xr-xCPP/7zip/Archive/7z/7zEncode.cpp6
-rwxr-xr-xCPP/7zip/Archive/7z/7zHandler.cpp53
-rwxr-xr-xCPP/7zip/Archive/7z/7zHandlerOut.cpp48
-rwxr-xr-xCPP/7zip/Archive/7z/7zIn.cpp171
-rwxr-xr-xCPP/7zip/Archive/7z/7zIn.h14
-rwxr-xr-xCPP/7zip/Archive/7z/7zItem.h6
-rwxr-xr-xCPP/7zip/Archive/7z/7zOut.cpp10
-rwxr-xr-xCPP/7zip/Archive/7z/7zUpdate.cpp53
-rwxr-xr-xCPP/7zip/Archive/ArjHandler.cpp10
-rwxr-xr-xCPP/7zip/Archive/BZip2/BZip2Handler.cpp6
-rwxr-xr-xCPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp2
-rwxr-xr-xCPP/7zip/Archive/Cab/CabHandler.cpp20
-rwxr-xr-xCPP/7zip/Archive/Chm/ChmHandler.cpp13
-rwxr-xr-xCPP/7zip/Archive/Common/HandlerOut.cpp76
-rwxr-xr-xCPP/7zip/Archive/Common/HandlerOut.h4
-rwxr-xr-xCPP/7zip/Archive/Common/OutStreamWithCRC.h4
-rwxr-xr-xCPP/7zip/Archive/Common/OutStreamWithSha1.h6
-rwxr-xr-xCPP/7zip/Archive/Cpio/CpioHandler.cpp18
-rwxr-xr-xCPP/7zip/Archive/DebHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/DmgHandler.cpp6
-rwxr-xr-xCPP/7zip/Archive/ElfHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/GZip/GZipHandlerOut.cpp13
-rwxr-xr-xCPP/7zip/Archive/GZip/GZipUpdate.cpp10
-rwxr-xr-xCPP/7zip/Archive/Iso/IsoHandler.cpp16
-rwxr-xr-xCPP/7zip/Archive/Lzh/LzhHandler.cpp11
-rwxr-xr-xCPP/7zip/Archive/MachoHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/MubHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/PeHandler.cpp8
-rwxr-xr-xCPP/7zip/Archive/Rar/RarHandler.cpp22
-rwxr-xr-xCPP/7zip/Archive/Rar/RarIn.h8
-rwxr-xr-xCPP/7zip/Archive/RpmHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/Split/SplitHandler.cpp16
-rwxr-xr-xCPP/7zip/Archive/Tar/TarHandler.cpp20
-rwxr-xr-xCPP/7zip/Archive/Tar/TarUpdate.cpp9
-rwxr-xr-xCPP/7zip/Archive/Udf/UdfHandler.cpp14
-rwxr-xr-xCPP/7zip/Archive/Wim/WimIn.cpp2
-rwxr-xr-xCPP/7zip/Archive/Wim/WimIn.h8
-rwxr-xr-xCPP/7zip/Archive/XarHandler.cpp6
-rwxr-xr-xCPP/7zip/Archive/ZHandler.cpp2
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipAddCommon.cpp17
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipAddCommon.h16
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipHandler.cpp146
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipHandlerOut.cpp19
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipUpdate.cpp21
-rwxr-xr-xCPP/7zip/Bundles/Alone/Alone.dsp495
-rwxr-xr-xCPP/7zip/Bundles/Alone/makefile152
-rwxr-xr-xCPP/7zip/Bundles/Alone7z/makefile35
-rwxr-xr-xCPP/7zip/Bundles/Format7z/makefile107
-rwxr-xr-xCPP/7zip/Bundles/Format7zExtract/makefile88
-rwxr-xr-xCPP/7zip/Bundles/Format7zExtractR/makefile36
-rwxr-xr-xCPP/7zip/Bundles/Format7zF/Format7z.dsp512
-rwxr-xr-xCPP/7zip/Bundles/Format7zF/makefile182
-rwxr-xr-xCPP/7zip/Bundles/Format7zR/makefile38
-rwxr-xr-xCPP/7zip/Bundles/SFXCon/SFXCon.dsp84
-rwxr-xr-xCPP/7zip/Bundles/SFXCon/makefile61
-rwxr-xr-xCPP/7zip/Bundles/SFXSetup/SFXSetup.dsp50
-rwxr-xr-xCPP/7zip/Bundles/SFXSetup/makefile34
-rwxr-xr-xCPP/7zip/Bundles/SFXWin/SFXWin.dsp108
-rwxr-xr-xCPP/7zip/Bundles/SFXWin/makefile65
-rwxr-xr-xCPP/7zip/Common/LSBFEncoder.cpp11
-rwxr-xr-xCPP/7zip/Common/MethodProps.cpp17
-rwxr-xr-xCPP/7zip/Common/MethodProps.h8
-rwxr-xr-xCPP/7zip/Compress/Arj/ArjDecoder2.h64
-rwxr-xr-xCPP/7zip/Compress/Arj/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/ArjDecoder1.cpp (renamed from CPP/7zip/Compress/Arj/ArjDecoder1.cpp)18
-rwxr-xr-xCPP/7zip/Compress/ArjDecoder1.h (renamed from CPP/7zip/Compress/Arj/ArjDecoder1.h)33
-rwxr-xr-xCPP/7zip/Compress/ArjDecoder2.cpp (renamed from CPP/7zip/Compress/Arj/ArjDecoder2.cpp)15
-rwxr-xr-xCPP/7zip/Compress/ArjDecoder2.h59
-rwxr-xr-xCPP/7zip/Compress/BZip2/BZip2CRC.cpp26
-rwxr-xr-xCPP/7zip/Compress/BZip2/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/BZip2Const.h (renamed from CPP/7zip/Compress/BZip2/BZip2Const.h)0
-rwxr-xr-xCPP/7zip/Compress/BZip2Crc.cpp26
-rwxr-xr-xCPP/7zip/Compress/BZip2Crc.h (renamed from CPP/7zip/Compress/BZip2/BZip2CRC.h)10
-rwxr-xr-xCPP/7zip/Compress/BZip2Decoder.cpp (renamed from CPP/7zip/Compress/BZip2/BZip2Decoder.cpp)44
-rwxr-xr-xCPP/7zip/Compress/BZip2Decoder.h (renamed from CPP/7zip/Compress/BZip2/BZip2Decoder.h)41
-rwxr-xr-xCPP/7zip/Compress/BZip2Encoder.cpp (renamed from CPP/7zip/Compress/BZip2/BZip2Encoder.cpp)56
-rwxr-xr-xCPP/7zip/Compress/BZip2Encoder.h (renamed from CPP/7zip/Compress/BZip2/BZip2Encoder.h)49
-rwxr-xr-xCPP/7zip/Compress/BZip2Register.cpp (renamed from CPP/7zip/Compress/BZip2/BZip2Register.cpp)5
-rwxr-xr-xCPP/7zip/Compress/Bcj2Coder.cpp (renamed from CPP/7zip/Compress/Branch/x86_2.cpp)7
-rwxr-xr-xCPP/7zip/Compress/Bcj2Coder.h (renamed from CPP/7zip/Compress/Branch/x86_2.h)14
-rwxr-xr-xCPP/7zip/Compress/Bcj2Register.cpp (renamed from CPP/7zip/Compress/Branch/BCJ2Register.cpp)7
-rwxr-xr-xCPP/7zip/Compress/BcjCoder.cpp (renamed from CPP/7zip/Compress/Branch/x86.cpp)5
-rwxr-xr-xCPP/7zip/Compress/BcjCoder.h (renamed from CPP/7zip/Compress/Branch/x86.h)11
-rwxr-xr-xCPP/7zip/Compress/BcjRegister.cpp (renamed from CPP/7zip/Compress/Branch/BCJRegister.cpp)7
-rwxr-xr-xCPP/7zip/Compress/BitlDecoder.cpp (renamed from CPP/7zip/Common/LSBFDecoder.cpp)13
-rwxr-xr-xCPP/7zip/Compress/BitlDecoder.h (renamed from CPP/7zip/Common/LSBFDecoder.h)12
-rwxr-xr-xCPP/7zip/Compress/BitlEncoder.h (renamed from CPP/7zip/Common/LSBFEncoder.h)17
-rwxr-xr-xCPP/7zip/Compress/BitmDecoder.h (renamed from CPP/7zip/Common/MSBFDecoder.h)13
-rwxr-xr-xCPP/7zip/Compress/BitmEncoder.h (renamed from CPP/7zip/Common/MSBFEncoder.h)15
-rwxr-xr-xCPP/7zip/Compress/Branch/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/BranchCoder.cpp (renamed from CPP/7zip/Compress/Branch/BranchCoder.cpp)1
-rwxr-xr-xCPP/7zip/Compress/BranchCoder.h (renamed from CPP/7zip/Compress/Branch/BranchCoder.h)9
-rwxr-xr-xCPP/7zip/Compress/BranchMisc.cpp (renamed from CPP/7zip/Compress/Branch/BranchMisc.cpp)5
-rwxr-xr-xCPP/7zip/Compress/BranchMisc.h (renamed from CPP/7zip/Compress/Branch/BranchMisc.h)4
-rwxr-xr-xCPP/7zip/Compress/BranchRegister.cpp (renamed from CPP/7zip/Compress/Branch/BranchRegister.cpp)2
-rwxr-xr-xCPP/7zip/Compress/ByteSwap.cpp (renamed from CPP/7zip/Compress/ByteSwap/ByteSwap.cpp)0
-rwxr-xr-xCPP/7zip/Compress/ByteSwap.h30
-rwxr-xr-xCPP/7zip/Compress/ByteSwap/ByteSwap.h37
-rwxr-xr-xCPP/7zip/Compress/ByteSwap/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/ByteSwapRegister.cpp (renamed from CPP/7zip/Compress/ByteSwap/ByteSwapRegister.cpp)3
-rwxr-xr-xCPP/7zip/Compress/Copy/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/CopyCoder.cpp (renamed from CPP/7zip/Compress/Copy/CopyCoder.cpp)6
-rwxr-xr-xCPP/7zip/Compress/CopyCoder.h (renamed from CPP/7zip/Compress/Copy/CopyCoder.h)15
-rwxr-xr-xCPP/7zip/Compress/CopyRegister.cpp (renamed from CPP/7zip/Compress/Copy/CopyRegister.cpp)5
-rwxr-xr-xCPP/7zip/Compress/Deflate/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/Deflate64Register.cpp (renamed from CPP/7zip/Compress/Deflate/Deflate64Register.cpp)3
-rwxr-xr-xCPP/7zip/Compress/DeflateConst.h (renamed from CPP/7zip/Compress/Deflate/DeflateConst.h)0
-rwxr-xr-xCPP/7zip/Compress/DeflateDecoder.cpp (renamed from CPP/7zip/Compress/Deflate/DeflateDecoder.cpp)13
-rwxr-xr-xCPP/7zip/Compress/DeflateDecoder.h (renamed from CPP/7zip/Compress/Deflate/DeflateDecoder.h)27
-rwxr-xr-xCPP/7zip/Compress/DeflateEncoder.cpp (renamed from CPP/7zip/Compress/Deflate/DeflateEncoder.cpp)65
-rwxr-xr-xCPP/7zip/Compress/DeflateEncoder.h (renamed from CPP/7zip/Compress/Deflate/DeflateEncoder.h)50
-rwxr-xr-xCPP/7zip/Compress/DeflateNsisRegister.cpp (renamed from CPP/7zip/Compress/Deflate/DeflateNsisRegister.cpp)3
-rwxr-xr-xCPP/7zip/Compress/DeflateRegister.cpp (renamed from CPP/7zip/Compress/Deflate/DeflateRegister.cpp)4
-rwxr-xr-xCPP/7zip/Compress/HuffmanDecoder.h (renamed from CPP/7zip/Compress/Huffman/HuffmanDecoder.h)6
-rwxr-xr-xCPP/7zip/Compress/Implode/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/ImplodeDecoder.cpp (renamed from CPP/7zip/Compress/Implode/ImplodeDecoder.cpp)12
-rwxr-xr-xCPP/7zip/Compress/ImplodeDecoder.h (renamed from CPP/7zip/Compress/Implode/ImplodeDecoder.h)27
-rwxr-xr-xCPP/7zip/Compress/ImplodeHuffmanDecoder.cpp (renamed from CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.cpp)0
-rwxr-xr-xCPP/7zip/Compress/ImplodeHuffmanDecoder.h (renamed from CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.h)7
-rwxr-xr-xCPP/7zip/Compress/LZ/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/LZMA/LZMA.dsp403
-rwxr-xr-xCPP/7zip/Compress/LZMA/LZMA.dsw29
-rwxr-xr-xCPP/7zip/Compress/LZMA/StdAfx.cpp3
-rwxr-xr-xCPP/7zip/Compress/LZMA/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/LZMA/makefile61
-rwxr-xr-xCPP/7zip/Compress/LZMA/resource.rc3
-rwxr-xr-xCPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp12
-rwxr-xr-xCPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp8
-rwxr-xr-xCPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp15
-rwxr-xr-xCPP/7zip/Compress/LZMA_Alone/makefile6
-rwxr-xr-xCPP/7zip/Compress/LZMA_Alone/makefile.gcc12
-rwxr-xr-xCPP/7zip/Compress/LzOutWindow.cpp (renamed from CPP/7zip/Compress/LZ/LZOutWindow.cpp)10
-rwxr-xr-xCPP/7zip/Compress/LzOutWindow.h (renamed from CPP/7zip/Compress/LZ/LZOutWindow.h)11
-rwxr-xr-xCPP/7zip/Compress/LzhDecoder.cpp (renamed from CPP/7zip/Compress/Lzh/LzhDecoder.cpp)2
-rwxr-xr-xCPP/7zip/Compress/LzhDecoder.h (renamed from CPP/7zip/Compress/Lzh/LzhDecoder.h)19
-rwxr-xr-xCPP/7zip/Compress/LzmaDecoder.cpp (renamed from CPP/7zip/Compress/LZMA/LZMADecoder.cpp)19
-rwxr-xr-xCPP/7zip/Compress/LzmaDecoder.h (renamed from CPP/7zip/Compress/LZMA/LZMADecoder.h)20
-rwxr-xr-xCPP/7zip/Compress/LzmaEncoder.cpp (renamed from CPP/7zip/Compress/LZMA/LZMAEncoder.cpp)40
-rwxr-xr-xCPP/7zip/Compress/LzmaEncoder.h (renamed from CPP/7zip/Compress/LZMA/LZMAEncoder.h)30
-rwxr-xr-xCPP/7zip/Compress/LzmaRegister.cpp (renamed from CPP/7zip/Compress/LZMA/LZMARegister.cpp)13
-rwxr-xr-xCPP/7zip/Compress/Lzx.h (renamed from CPP/7zip/Compress/Lzx/Lzx.h)0
-rwxr-xr-xCPP/7zip/Compress/Lzx/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/Lzx86Converter.cpp (renamed from CPP/7zip/Compress/Lzx/Lzx86Converter.cpp)2
-rwxr-xr-xCPP/7zip/Compress/Lzx86Converter.h (renamed from CPP/7zip/Compress/Lzx/Lzx86Converter.h)11
-rwxr-xr-xCPP/7zip/Compress/LzxDecoder.cpp (renamed from CPP/7zip/Compress/Lzx/LzxDecoder.cpp)22
-rwxr-xr-xCPP/7zip/Compress/LzxDecoder.h (renamed from CPP/7zip/Compress/Lzx/LzxDecoder.h)27
-rwxr-xr-xCPP/7zip/Compress/Mtf8.h (renamed from CPP/7zip/Compress/BWT/Mtf8.h)109
-rwxr-xr-xCPP/7zip/Compress/PPMD/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/PpmdContext.h (renamed from CPP/7zip/Compress/PPMD/PPMDContext.h)10
-rwxr-xr-xCPP/7zip/Compress/PpmdDecode.h (renamed from CPP/7zip/Compress/PPMD/PPMDDecode.h)6
-rwxr-xr-xCPP/7zip/Compress/PpmdDecoder.cpp (renamed from CPP/7zip/Compress/PPMD/PPMDDecoder.cpp)16
-rwxr-xr-xCPP/7zip/Compress/PpmdDecoder.h (renamed from CPP/7zip/Compress/PPMD/PPMDDecoder.h)29
-rwxr-xr-xCPP/7zip/Compress/PpmdEncode.h (renamed from CPP/7zip/Compress/PPMD/PPMDEncode.h)9
-rwxr-xr-xCPP/7zip/Compress/PpmdEncoder.cpp (renamed from CPP/7zip/Compress/PPMD/PPMDEncoder.cpp)38
-rwxr-xr-xCPP/7zip/Compress/PpmdEncoder.h (renamed from CPP/7zip/Compress/PPMD/PPMDEncoder.h)29
-rwxr-xr-xCPP/7zip/Compress/PpmdRegister.cpp (renamed from CPP/7zip/Compress/PPMD/PPMDRegister.cpp)13
-rwxr-xr-xCPP/7zip/Compress/PpmdSubAlloc.h (renamed from CPP/7zip/Compress/PPMD/PPMDSubAlloc.h)12
-rwxr-xr-xCPP/7zip/Compress/PpmdType.h (renamed from CPP/7zip/Compress/PPMD/PPMDType.h)5
-rwxr-xr-xCPP/7zip/Compress/Quantum/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/QuantumDecoder.cpp (renamed from CPP/7zip/Compress/Quantum/QuantumDecoder.cpp)16
-rwxr-xr-xCPP/7zip/Compress/QuantumDecoder.h (renamed from CPP/7zip/Compress/Quantum/QuantumDecoder.h)26
-rwxr-xr-xCPP/7zip/Compress/RangeCoder.h (renamed from CPP/7zip/Compress/RangeCoder/RangeCoder.h)10
-rwxr-xr-xCPP/7zip/Compress/RangeCoder/RangeCoderBit.cpp36
-rwxr-xr-xCPP/7zip/Compress/RangeCoder/RangeCoderBitTree.h161
-rwxr-xr-xCPP/7zip/Compress/RangeCoder/RangeCoderOpt.h31
-rwxr-xr-xCPP/7zip/Compress/RangeCoderBit.h (renamed from CPP/7zip/Compress/RangeCoder/RangeCoderBit.h)6
-rwxr-xr-xCPP/7zip/Compress/Rar/Rar29.dsp319
-rwxr-xr-xCPP/7zip/Compress/Rar/Rar29.dsw29
-rwxr-xr-xCPP/7zip/Compress/Rar/StdAfx.cpp3
-rwxr-xr-xCPP/7zip/Compress/Rar/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/Rar/makefile60
-rwxr-xr-xCPP/7zip/Compress/Rar/resource.rc3
-rwxr-xr-xCPP/7zip/Compress/Rar1Decoder.cpp (renamed from CPP/7zip/Compress/Rar/Rar1Decoder.cpp)12
-rwxr-xr-xCPP/7zip/Compress/Rar1Decoder.h (renamed from CPP/7zip/Compress/Rar/Rar1Decoder.h)35
-rwxr-xr-xCPP/7zip/Compress/Rar2Decoder.cpp (renamed from CPP/7zip/Compress/Rar/Rar2Decoder.cpp)12
-rwxr-xr-xCPP/7zip/Compress/Rar2Decoder.h (renamed from CPP/7zip/Compress/Rar/Rar2Decoder.h)31
-rwxr-xr-xCPP/7zip/Compress/Rar3Decoder.cpp (renamed from CPP/7zip/Compress/Rar/Rar3Decoder.cpp)8
-rwxr-xr-xCPP/7zip/Compress/Rar3Decoder.h (renamed from CPP/7zip/Compress/Rar/Rar3Decoder.h)28
-rwxr-xr-xCPP/7zip/Compress/Rar3Vm.cpp (renamed from CPP/7zip/Compress/Rar/Rar3Vm.cpp)8
-rwxr-xr-xCPP/7zip/Compress/Rar3Vm.h (renamed from CPP/7zip/Compress/Rar/Rar3Vm.h)10
-rwxr-xr-xCPP/7zip/Compress/RarCodecsRegister.cpp (renamed from CPP/7zip/Compress/Rar/RarCodecsRegister.cpp)2
-rwxr-xr-xCPP/7zip/Compress/Shrink/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/ShrinkDecoder.cpp (renamed from CPP/7zip/Compress/Shrink/ShrinkDecoder.cpp)26
-rwxr-xr-xCPP/7zip/Compress/ShrinkDecoder.h (renamed from CPP/7zip/Compress/Shrink/ShrinkDecoder.h)17
-rwxr-xr-xCPP/7zip/Compress/Z/StdAfx.h8
-rwxr-xr-xCPP/7zip/Compress/Z/ZDecoder.h43
-rwxr-xr-xCPP/7zip/Compress/ZDecoder.cpp (renamed from CPP/7zip/Compress/Z/ZDecoder.cpp)20
-rwxr-xr-xCPP/7zip/Compress/ZDecoder.h42
-rwxr-xr-xCPP/7zip/Compress/ZlibDecoder.cpp (renamed from CPP/7zip/Compress/Deflate/ZlibDecoder.cpp)10
-rwxr-xr-xCPP/7zip/Compress/ZlibDecoder.h (renamed from CPP/7zip/Compress/Deflate/ZlibDecoder.h)5
-rwxr-xr-xCPP/7zip/Crypto/7zAES/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/7zAes.cpp (renamed from CPP/7zip/Crypto/7zAES/7zAES.cpp)19
-rwxr-xr-xCPP/7zip/Crypto/7zAes.h (renamed from CPP/7zip/Crypto/7zAES/7zAES.h)9
-rwxr-xr-xCPP/7zip/Crypto/7zAesRegister.cpp (renamed from CPP/7zip/Crypto/7zAES/7zAESRegister.cpp)6
-rwxr-xr-xCPP/7zip/Crypto/AES/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/Hash/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/HmacSha1.cpp (renamed from CPP/7zip/Crypto/Hash/HmacSha1.cpp)0
-rwxr-xr-xCPP/7zip/Crypto/HmacSha1.h (renamed from CPP/7zip/Crypto/Hash/HmacSha1.h)4
-rwxr-xr-xCPP/7zip/Crypto/MyAes.cpp (renamed from CPP/7zip/Crypto/AES/MyAES.cpp)4
-rwxr-xr-xCPP/7zip/Crypto/MyAes.h (renamed from CPP/7zip/Crypto/AES/MyAES.h)18
-rwxr-xr-xCPP/7zip/Crypto/Pbkdf2HmacSha1.cpp (renamed from CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp)0
-rwxr-xr-xCPP/7zip/Crypto/Pbkdf2HmacSha1.h (renamed from CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h)6
-rwxr-xr-xCPP/7zip/Crypto/RandGen.cpp (renamed from CPP/7zip/Crypto/Hash/RandGen.cpp)2
-rwxr-xr-xCPP/7zip/Crypto/RandGen.h (renamed from CPP/7zip/Crypto/Hash/RandGen.h)4
-rwxr-xr-xCPP/7zip/Crypto/Rar20/Rar20Cipher.cpp35
-rwxr-xr-xCPP/7zip/Crypto/Rar20/Rar20Cipher.h35
-rwxr-xr-xCPP/7zip/Crypto/Rar20/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/Rar20Crypto.cpp (renamed from CPP/7zip/Crypto/Rar20/Rar20Crypto.cpp)83
-rwxr-xr-xCPP/7zip/Crypto/Rar20Crypto.h (renamed from CPP/7zip/Crypto/Rar20/Rar20Crypto.h)25
-rwxr-xr-xCPP/7zip/Crypto/RarAES/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/RarAes.cpp (renamed from CPP/7zip/Crypto/RarAES/RarAES.cpp)9
-rwxr-xr-xCPP/7zip/Crypto/RarAes.h (renamed from CPP/7zip/Crypto/RarAES/RarAES.h)21
-rwxr-xr-xCPP/7zip/Crypto/Sha1.cpp (renamed from CPP/7zip/Crypto/Hash/Sha1.cpp)16
-rwxr-xr-xCPP/7zip/Crypto/Sha1.h (renamed from CPP/7zip/Crypto/Hash/Sha1.h)18
-rwxr-xr-xCPP/7zip/Crypto/StdAfx.h (renamed from CPP/7zip/Compress/RangeCoder/StdAfx.h)2
-rwxr-xr-xCPP/7zip/Crypto/WzAES/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/WzAes.cpp (renamed from CPP/7zip/Crypto/WzAES/WzAES.cpp)17
-rwxr-xr-xCPP/7zip/Crypto/WzAes.h (renamed from CPP/7zip/Crypto/WzAES/WzAES.h)20
-rwxr-xr-xCPP/7zip/Crypto/Zip/StdAfx.h8
-rwxr-xr-xCPP/7zip/Crypto/Zip/ZipCrypto.cpp63
-rwxr-xr-xCPP/7zip/Crypto/Zip/ZipCrypto.h26
-rwxr-xr-xCPP/7zip/Crypto/ZipCrypto.cpp (renamed from CPP/7zip/Crypto/Zip/ZipCipher.cpp)63
-rwxr-xr-xCPP/7zip/Crypto/ZipCrypto.h (renamed from CPP/7zip/Crypto/Zip/ZipCipher.h)34
-rwxr-xr-xCPP/7zip/Crypto/ZipStrong.cpp180
-rwxr-xr-xCPP/7zip/Crypto/ZipStrong.h53
-rwxr-xr-xCPP/7zip/Crypto/makefile7
-rwxr-xr-xCPP/7zip/MyVersion.h8
-rwxr-xr-xCPP/7zip/UI/Agent/AgentOut.cpp25
-rwxr-xr-xCPP/7zip/UI/Agent/UpdateCallbackAgent.cpp7
-rwxr-xr-xCPP/7zip/UI/Common/Update.cpp22
-rwxr-xr-xCPP/7zip/UI/Common/UpdateCallback.h2
-rwxr-xr-xCPP/7zip/UI/Common/UpdateProduce.cpp8
-rwxr-xr-xCPP/7zip/UI/Common/UpdateProduce.h8
-rwxr-xr-xCPP/7zip/UI/Console/Console.dsp4
-rwxr-xr-xCPP/7zip/UI/Console/UpdateCallbackConsole.cpp19
-rwxr-xr-xCPP/7zip/UI/Console/makefile2
-rwxr-xr-xCPP/7zip/UI/Far/Far.dsp4
-rwxr-xr-xCPP/7zip/UI/Far/makefile2
-rwxr-xr-xCPP/7zip/UI/FileManager/App.cpp7
-rwxr-xr-xCPP/7zip/UI/FileManager/FM.dsp4
-rwxr-xr-xCPP/7zip/UI/FileManager/Panel.cpp4
-rwxr-xr-xCPP/7zip/UI/FileManager/Panel.h4
-rwxr-xr-xCPP/7zip/UI/FileManager/PanelFolderChange.cpp3
-rwxr-xr-xCPP/7zip/UI/FileManager/PanelItemOpen.cpp2
-rwxr-xr-xCPP/7zip/UI/FileManager/PanelItems.cpp3
-rwxr-xr-xCPP/7zip/UI/FileManager/RegistryUtils.cpp11
-rwxr-xr-xCPP/7zip/UI/FileManager/RegistryUtils.h3
-rwxr-xr-xCPP/7zip/UI/FileManager/UpdateCallback100.cpp3
-rwxr-xr-xCPP/7zip/UI/FileManager/makefile2
-rwxr-xr-xCPP/7zip/UI/GUI/GUI.dsp4
-rwxr-xr-xCPP/7zip/UI/GUI/UpdateCallbackGUI.cpp19
-rwxr-xr-xCPP/7zip/UI/GUI/makefile2
-rwxr-xr-xCPP/Common/MyVector.cpp2
-rwxr-xr-xDOC/7zip.nsi2
-rwxr-xr-xDOC/7zip.wxs2
-rwxr-xr-xDOC/lzma.txt4
259 files changed, 2568 insertions, 4631 deletions
diff --git a/C/7zVersion.h b/C/7zVersion.h
index 6d840902..9009300a 100755
--- a/C/7zVersion.h
+++ b/C/7zVersion.h
@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 4
-#define MY_VER_MINOR 62
+#define MY_VER_MINOR 63
#define MY_VER_BUILD 0
-#define MY_VERSION "4.62"
-#define MY_DATE "2008-12-02"
+#define MY_VERSION "4.63"
+#define MY_DATE "2008-12-31"
#define MY_COPYRIGHT ": Igor Pavlov : Public domain"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE
diff --git a/C/Archive/7z/7zIn.c b/C/Archive/7z/7zIn.c
index fa10ecff..f6143f83 100755
--- a/C/Archive/7z/7zIn.c
+++ b/C/Archive/7z/7zIn.c
@@ -1,5 +1,5 @@
/* 7zIn.c -- 7z Input functions
-2008-11-23 : Igor Pavlov : Public domain */
+2008-12-31 : Igor Pavlov : Public domain */
#include "../../7zCrc.h"
#include "../../CpuArch.h"
@@ -9,6 +9,9 @@
#define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; }
+#define NUM_FOLDER_CODERS_MAX 32
+#define NUM_CODER_STREAMS_MAX 32
+
void SzArEx_Init(CSzArEx *p)
{
SzAr_Init(&p->db);
@@ -409,15 +412,14 @@ static SRes SzReadSwitch(CSzData *sd)
static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
{
- UInt32 numCoders;
- UInt32 numBindPairs;
- UInt32 numPackedStreams;
- UInt32 i;
- UInt32 numInStreams = 0;
- UInt32 numOutStreams = 0;
+ UInt32 numCoders, numBindPairs, numPackStreams, i;
+ UInt32 numInStreams = 0, numOutStreams = 0;
+
RINOK(SzReadNumber32(sd, &numCoders));
+ if (numCoders > NUM_FOLDER_CODERS_MAX)
+ return SZ_ERROR_UNSUPPORTED;
folder->NumCoders = numCoders;
-
+
MY_ALLOC(CSzCoderInfo, folder->Coders, (size_t)numCoders, alloc);
for (i = 0; i < numCoders; i++)
@@ -443,6 +445,9 @@ static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
{
RINOK(SzReadNumber32(sd, &coder->NumInStreams));
RINOK(SzReadNumber32(sd, &coder->NumOutStreams));
+ if (coder->NumInStreams > NUM_CODER_STREAMS_MAX ||
+ coder->NumOutStreams > NUM_CODER_STREAMS_MAX)
+ return SZ_ERROR_UNSUPPORTED;
}
else
{
@@ -475,41 +480,40 @@ static SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)
RINOK(SzSkeepDataSize(sd, propertiesSize));
}
}
- numInStreams += (UInt32)coder->NumInStreams;
- numOutStreams += (UInt32)coder->NumOutStreams;
+ numInStreams += coder->NumInStreams;
+ numOutStreams += coder->NumOutStreams;
}
- numBindPairs = numOutStreams - 1;
- folder->NumBindPairs = numBindPairs;
-
+ if (numOutStreams == 0)
+ return SZ_ERROR_UNSUPPORTED;
+ folder->NumBindPairs = numBindPairs = numOutStreams - 1;
MY_ALLOC(CBindPair, folder->BindPairs, (size_t)numBindPairs, alloc);
for (i = 0; i < numBindPairs; i++)
{
- CBindPair *bindPair = folder->BindPairs + i;
- RINOK(SzReadNumber32(sd, &bindPair->InIndex));
- RINOK(SzReadNumber32(sd, &bindPair->OutIndex));
+ CBindPair *bp = folder->BindPairs + i;
+ RINOK(SzReadNumber32(sd, &bp->InIndex));
+ RINOK(SzReadNumber32(sd, &bp->OutIndex));
}
- numPackedStreams = numInStreams - (UInt32)numBindPairs;
+ if (numInStreams < numBindPairs)
+ return SZ_ERROR_UNSUPPORTED;
- folder->NumPackStreams = numPackedStreams;
- MY_ALLOC(UInt32, folder->PackStreams, (size_t)numPackedStreams, alloc);
+ folder->NumPackStreams = numPackStreams = numInStreams - numBindPairs;
+ MY_ALLOC(UInt32, folder->PackStreams, (size_t)numPackStreams, alloc);
- if (numPackedStreams == 1)
+ if (numPackStreams == 1)
{
- UInt32 j;
- UInt32 pi = 0;
- for (j = 0; j < numInStreams; j++)
- if (SzFolder_FindBindPairForInStream(folder, j) < 0)
- {
- folder->PackStreams[pi++] = j;
+ for (i = 0; i < numInStreams ; i++)
+ if (SzFolder_FindBindPairForInStream(folder, i) < 0)
break;
- }
+ if (i == numInStreams)
+ return SZ_ERROR_UNSUPPORTED;
+ folder->PackStreams[0] = i;
}
else
- for (i = 0; i < numPackedStreams; i++)
+ for (i = 0; i < numPackStreams; i++)
{
RINOK(SzReadNumber32(sd, folder->PackStreams + i));
}
diff --git a/CPP/7zip/Archive/7z/7zDecode.cpp b/CPP/7zip/Archive/7z/7zDecode.cpp
index e630538d..2d25ff2e 100755
--- a/CPP/7zip/Archive/7z/7zDecode.cpp
+++ b/CPP/7zip/Archive/7z/7zDecode.cpp
@@ -2,15 +2,12 @@
#include "StdAfx.h"
-#include "7zDecode.h"
-
-#include "../../IPassword.h"
+#include "../../Common/LimitedStreams.h"
#include "../../Common/LockedStream.h"
-#include "../../Common/StreamObjects.h"
#include "../../Common/ProgressUtils.h"
-#include "../../Common/LimitedStreams.h"
-#include "../../Common/CreateCoder.h"
-#include "../../Common/FilterCoder.h"
+#include "../../Common/StreamObjects.h"
+
+#include "7zDecode.h"
namespace NArchive {
namespace N7z {
@@ -105,6 +102,8 @@ HRESULT CDecoder::Decode(
#endif
)
{
+ if (!folderInfo.CheckStructure())
+ return E_NOTIMPL;
#ifndef _NO_CRYPTO
passwordIsDefined = false;
#endif
@@ -229,13 +228,13 @@ HRESULT CDecoder::Decode(
decoder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecoderProperties);
if (setDecoderProperties)
{
- const CByteBuffer &properties = coderInfo.Properties;
- size_t size = properties.GetCapacity();
+ const CByteBuffer &props = coderInfo.Props;
+ size_t size = props.GetCapacity();
if (size > 0xFFFFFFFF)
return E_NOTIMPL;
if (size > 0)
{
- RINOK(setDecoderProperties->SetDecoderProperties2((const Byte *)properties, (UInt32)size));
+ RINOK(setDecoderProperties->SetDecoderProperties2((const Byte *)props, (UInt32)size));
}
}
}
diff --git a/CPP/7zip/Archive/7z/7zEncode.cpp b/CPP/7zip/Archive/7z/7zEncode.cpp
index b5a43f56..01803842 100755
--- a/CPP/7zip/Archive/7z/7zEncode.cpp
+++ b/CPP/7zip/Archive/7z/7zEncode.cpp
@@ -233,8 +233,8 @@ HRESULT CEncoder::Encode(
outStreamSpec->Init();
writeCoderProperties->WriteCoderProperties(outStream);
size_t size = outStreamSpec->GetSize();
- encodingInfo.Properties.SetCapacity(size);
- memmove(encodingInfo.Properties, outStreamSpec->GetBuffer(), size);
+ encodingInfo.Props.SetCapacity(size);
+ memmove(encodingInfo.Props, outStreamSpec->GetBuffer(), size);
}
}
@@ -278,7 +278,7 @@ HRESULT CEncoder::Encode(
folderItem.UnpackSizes.Add(streamSize);
}
for (i = numMethods - 1; i >= 0; i--)
- folderItem.Coders[numMethods - 1 - i].Properties = _codersInfo[i].Properties;
+ folderItem.Coders[numMethods - 1 - i].Props = _codersInfo[i].Props;
return S_OK;
}
diff --git a/CPP/7zip/Archive/7z/7zHandler.cpp b/CPP/7zip/Archive/7z/7zHandler.cpp
index 76b3c72d..44131fae 100755
--- a/CPP/7zip/Archive/7z/7zHandler.cpp
+++ b/CPP/7zip/Archive/7z/7zHandler.cpp
@@ -2,25 +2,29 @@
#include "StdAfx.h"
-#include "7zHandler.h"
-#include "7zProperties.h"
+extern "C"
+{
+ #include "../../../../C/CpuArch.h"
+}
-#include "../../../Common/IntToString.h"
#include "../../../Common/ComTry.h"
-#include "../../../Windows/Defs.h"
+#include "../../../Common/IntToString.h"
+
+#ifdef COMPRESS_MT
+#include "../../../Windows/System.h"
+#endif
#include "../Common/ItemNameUtils.h"
+#include "7zHandler.h"
+#include "7zProperties.h"
+
#ifdef __7Z_SET_PROPERTIES
#ifdef EXTRACT_ONLY
#include "../Common/ParseProperties.h"
#endif
#endif
-#ifdef COMPRESS_MT
-#include "../../../Windows/System.h"
-#endif
-
using namespace NWindows;
extern UString ConvertMethodIdToString(UInt64 id);
@@ -191,13 +195,6 @@ static inline UString GetHex2(Byte value)
static const UInt64 k_AES = 0x06F10701;
-#ifndef _SFX
-static inline UInt32 GetUInt32FromMemLE(const Byte *p)
-{
- return p[0] | (((UInt32)p[1]) << 8) | (((UInt32)p[2]) << 16) | (((UInt32)p[3]) << 24);
-}
-#endif
-
bool CHandler::IsEncrypted(UInt32 index2) const
{
CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
@@ -291,33 +288,31 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
methodsString += methodName;
if (coderInfo.MethodID == k_LZMA)
{
- if (coderInfo.Properties.GetCapacity() >= 5)
+ if (coderInfo.Props.GetCapacity() >= 5)
{
methodsString += L":";
- UInt32 dicSize = GetUInt32FromMemLE(
- ((const Byte *)coderInfo.Properties + 1));
+ UInt32 dicSize = GetUi32((const Byte *)coderInfo.Props + 1);
methodsString += GetStringForSizeValue(dicSize);
}
}
else if (coderInfo.MethodID == k_PPMD)
{
- if (coderInfo.Properties.GetCapacity() >= 5)
+ if (coderInfo.Props.GetCapacity() >= 5)
{
- Byte order = *(const Byte *)coderInfo.Properties;
+ Byte order = *(const Byte *)coderInfo.Props;
methodsString += L":o";
methodsString += ConvertUInt32ToString(order);
methodsString += L":mem";
- UInt32 dicSize = GetUInt32FromMemLE(
- ((const Byte *)coderInfo.Properties + 1));
+ UInt32 dicSize = GetUi32((const Byte *)coderInfo.Props + 1);
methodsString += GetStringForSizeValue(dicSize);
}
}
else if (coderInfo.MethodID == k_AES)
{
- if (coderInfo.Properties.GetCapacity() >= 1)
+ if (coderInfo.Props.GetCapacity() >= 1)
{
methodsString += L":";
- const Byte *data = (const Byte *)coderInfo.Properties;
+ const Byte *data = (const Byte *)coderInfo.Props;
Byte firstByte = *data++;
UInt32 numCyclesPower = firstByte & 0x3F;
methodsString += ConvertUInt32ToString(numCyclesPower);
@@ -328,7 +323,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
return S_OK;
UInt32 saltSize = (firstByte >> 7) & 1;
UInt32 ivSize = (firstByte >> 6) & 1;
- if (coderInfo.Properties.GetCapacity() >= 2)
+ if (coderInfo.Props.GetCapacity() >= 2)
{
Byte secondByte = *data++;
saltSize += (secondByte >> 4);
@@ -340,18 +335,18 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
}
else
{
- if (coderInfo.Properties.GetCapacity() > 0)
+ if (coderInfo.Props.GetCapacity() > 0)
{
methodsString += L":[";
- for (size_t bi = 0; bi < coderInfo.Properties.GetCapacity(); bi++)
+ for (size_t bi = 0; bi < coderInfo.Props.GetCapacity(); bi++)
{
- if (bi > 5 && bi + 1 < coderInfo.Properties.GetCapacity())
+ if (bi > 5 && bi + 1 < coderInfo.Props.GetCapacity())
{
methodsString += L"..";
break;
}
else
- methodsString += GetHex2(coderInfo.Properties[bi]);
+ methodsString += GetHex2(coderInfo.Props[bi]);
}
methodsString += L"]";
}
diff --git a/CPP/7zip/Archive/7z/7zHandlerOut.cpp b/CPP/7zip/Archive/7z/7zHandlerOut.cpp
index ac9ef987..3e2591d5 100755
--- a/CPP/7zip/Archive/7z/7zHandlerOut.cpp
+++ b/CPP/7zip/Archive/7z/7zHandlerOut.cpp
@@ -2,20 +2,20 @@
#include "StdAfx.h"
-#include "7zHandler.h"
-#include "7zOut.h"
-#include "7zUpdate.h"
-
#include "../../../Windows/PropVariant.h"
#include "../../../Common/ComTry.h"
#include "../../../Common/StringToInt.h"
-#include "../../IPassword.h"
+
#include "../../ICoder.h"
#include "../Common/ItemNameUtils.h"
#include "../Common/ParseProperties.h"
+#include "7zHandler.h"
+#include "7zOut.h"
+#include "7zUpdate.h"
+
using namespace NWindows;
namespace NArchive {
@@ -85,28 +85,28 @@ HRESULT CHandler::SetCompressionMethod(
COneMethodInfo oneMethodInfo;
oneMethodInfo.MethodName = kLZMAMethodName;
{
- CProp property;
- property.Id = NCoderPropID::kMatchFinder;
- property.Value = kLzmaMatchFinderForHeaders;
- oneMethodInfo.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kMatchFinder;
+ prop.Value = kLzmaMatchFinderForHeaders;
+ oneMethodInfo.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kAlgorithm;
- property.Value = kAlgorithmForHeaders;
- oneMethodInfo.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kAlgorithm;
+ prop.Value = kAlgorithmForHeaders;
+ oneMethodInfo.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kNumFastBytes;
- property.Value = UInt32(kNumFastBytesForHeaders);
- oneMethodInfo.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kNumFastBytes;
+ prop.Value = (UInt32)kNumFastBytesForHeaders;
+ oneMethodInfo.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kDictionarySize;
- property.Value = UInt32(kDictionaryForHeaders);
- oneMethodInfo.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kDictionarySize;
+ prop.Value = (UInt32)kDictionaryForHeaders;
+ oneMethodInfo.Props.Add(prop);
}
headerMethodInfoVector.Add(oneMethodInfo);
HRESULT res = SetCompressionMethod(headerMethod, headerMethodInfoVector
@@ -155,14 +155,14 @@ HRESULT CHandler::SetCompressionMethod(
EXTERNAL_CODECS_VARS
oneMethodInfo.MethodName, methodFull.Id, methodFull.NumInStreams, methodFull.NumOutStreams))
return E_INVALIDARG;
- methodFull.Properties = oneMethodInfo.Properties;
+ methodFull.Props = oneMethodInfo.Props;
methodMode.Methods.Add(methodFull);
if (!_numSolidBytesDefined)
{
- for (int j = 0; j < methodFull.Properties.Size(); j++)
+ for (int j = 0; j < methodFull.Props.Size(); j++)
{
- const CProp &prop = methodFull.Properties[j];
+ const CProp &prop = methodFull.Props[j];
if ((prop.Id == NCoderPropID::kDictionarySize ||
prop.Id == NCoderPropID::kUsedMemorySize) && prop.Value.vt == VT_UI4)
{
diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp
index 6cf3fdf6..ab78eeae 100755
--- a/CPP/7zip/Archive/7z/7zIn.cpp
+++ b/CPP/7zip/Archive/7z/7zIn.cpp
@@ -2,16 +2,18 @@
#include "StdAfx.h"
-#include "7zIn.h"
-#include "7zDecode.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/StreamUtils.h"
extern "C"
{
#include "../../../../C/7zCrc.h"
#include "../../../../C/CpuArch.h"
}
+#include "../../Common/StreamObjects.h"
+#include "../../Common/StreamUtils.h"
+
+#include "7zDecode.h"
+#include "7zIn.h"
+
#define Get16(p) GetUi16(p)
#define Get32(p) GetUi32(p)
#define Get64(p) GetUi64(p)
@@ -24,6 +26,86 @@ extern "C"
namespace NArchive {
namespace N7z {
+static void BoolVector_Fill_False(CBoolVector &v, int size)
+{
+ v.Clear();
+ v.Reserve(size);
+ for (int i = 0; i < size; i++)
+ v.Add(false);
+}
+
+static bool BoolVector_GetAndSet(CBoolVector &v, UInt32 index)
+{
+ if (index >= (UInt32)v.Size())
+ return true;
+ bool res = v[index];
+ v[index] = true;
+ return res;
+}
+
+bool CFolder::CheckStructure() const
+{
+ const int kNumCodersMax = sizeof(UInt32) * 8; // don't change it
+ const int kMaskSize = sizeof(UInt32) * 8; // it must be >= kNumCodersMax
+ const int kNumBindsMax = 32;
+
+ if (Coders.Size() > kNumCodersMax || BindPairs.Size() > kNumBindsMax)
+ return false;
+
+ {
+ CBoolVector v;
+ BoolVector_Fill_False(v, BindPairs.Size() + PackStreams.Size());
+
+ int i;
+ for (i = 0; i < BindPairs.Size(); i++)
+ if (BoolVector_GetAndSet(v, BindPairs[i].InIndex))
+ return false;
+ for (i = 0; i < PackStreams.Size(); i++)
+ if (BoolVector_GetAndSet(v, PackStreams[i]))
+ return false;
+
+ BoolVector_Fill_False(v, UnpackSizes.Size());
+ for (i = 0; i < BindPairs.Size(); i++)
+ if (BoolVector_GetAndSet(v, BindPairs[i].OutIndex))
+ return false;
+ }
+
+ UInt32 mask[kMaskSize];
+ int i;
+ for (i = 0; i < kMaskSize; i++)
+ mask[i] = 0;
+
+ {
+ CIntVector inStreamToCoder, outStreamToCoder;
+ for (i = 0; i < Coders.Size(); i++)
+ {
+ CNum j;
+ const CCoderInfo &coder = Coders[i];
+ for (j = 0; j < coder.NumInStreams; j++)
+ inStreamToCoder.Add(i);
+ for (j = 0; j < coder.NumOutStreams; j++)
+ outStreamToCoder.Add(i);
+ }
+
+ for (i = 0; i < BindPairs.Size(); i++)
+ {
+ const CBindPair &bp = BindPairs[i];
+ mask[inStreamToCoder[bp.InIndex]] |= (1 << outStreamToCoder[bp.OutIndex]);
+ }
+ }
+
+ for (i = 0; i < kMaskSize; i++)
+ for (int j = 0; j < kMaskSize; j++)
+ if (((1 << j) & mask[i]) != 0)
+ mask[i] |= mask[j];
+
+ for (i = 0; i < kMaskSize; i++)
+ if (((1 << i) & mask[i]) != 0)
+ return false;
+
+ return true;
+}
+
class CInArchiveException {};
static void ThrowException() { throw CInArchiveException(); }
@@ -323,9 +405,9 @@ void CInArchive::GetNextFolderItem(CFolder &folder)
}
if ((mainByte & 0x20) != 0)
{
- CNum propertiesSize = ReadNum();
- coder.Properties.SetCapacity((size_t)propertiesSize);
- ReadBytes((Byte *)coder.Properties, (size_t)propertiesSize);
+ CNum propsSize = ReadNum();
+ coder.Props.SetCapacity((size_t)propsSize);
+ ReadBytes((Byte *)coder.Props, (size_t)propsSize);
}
if ((mainByte & 0x80) != 0)
ThrowUnsupported();
@@ -334,31 +416,34 @@ void CInArchive::GetNextFolderItem(CFolder &folder)
numOutStreams += coder.NumOutStreams;
}
- CNum numBindPairs;
- numBindPairs = numOutStreams - 1;
+ CNum numBindPairs = numOutStreams - 1;
folder.BindPairs.Clear();
folder.BindPairs.Reserve(numBindPairs);
for (i = 0; i < numBindPairs; i++)
{
- CBindPair bindPair;
- bindPair.InIndex = ReadNum();
- bindPair.OutIndex = ReadNum();
- folder.BindPairs.Add(bindPair);
+ CBindPair bp;
+ bp.InIndex = ReadNum();
+ bp.OutIndex = ReadNum();
+ folder.BindPairs.Add(bp);
}
- CNum numPackedStreams = numInStreams - numBindPairs;
- folder.PackStreams.Reserve(numPackedStreams);
- if (numPackedStreams == 1)
+ if (numInStreams < numBindPairs)
+ ThrowUnsupported();
+ CNum numPackStreams = numInStreams - numBindPairs;
+ folder.PackStreams.Reserve(numPackStreams);
+ if (numPackStreams == 1)
{
- for (CNum j = 0; j < numInStreams; j++)
- if (folder.FindBindPairForInStream(j) < 0)
+ for (i = 0; i < numInStreams; i++)
+ if (folder.FindBindPairForInStream(i) < 0)
{
- folder.PackStreams.Add(j);
+ folder.PackStreams.Add(i);
break;
}
+ if (folder.PackStreams.Size() != 1)
+ ThrowUnsupported();
}
else
- for (i = 0; i < numPackedStreams; i++)
+ for (i = 0; i < numPackStreams; i++)
folder.PackStreams.Add(ReadNum());
}
@@ -376,7 +461,7 @@ void CInArchive::WaitAttribute(UInt64 attribute)
}
void CInArchive::ReadHashDigests(int numItems,
- CRecordVector<bool> &digestsDefined,
+ CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests)
{
ReadBoolVector2(numItems, digestsDefined);
@@ -394,7 +479,7 @@ void CInArchive::ReadHashDigests(int numItems,
void CInArchive::ReadPackInfo(
UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
+ CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs)
{
dataOffset = ReadNumber();
@@ -421,15 +506,11 @@ void CInArchive::ReadPackInfo(
}
if (packCRCsDefined.IsEmpty())
{
- packCRCsDefined.Reserve(numPackStreams);
- packCRCsDefined.Clear();
+ BoolVector_Fill_False(packCRCsDefined, numPackStreams);
packCRCs.Reserve(numPackStreams);
packCRCs.Clear();
for (CNum i = 0; i < numPackStreams; i++)
- {
- packCRCsDefined.Add(false);
packCRCs.Add(0);
- }
}
}
@@ -471,7 +552,7 @@ void CInArchive::ReadUnpackInfo(
return;
if (type == NID::kCRC)
{
- CRecordVector<bool> crcsDefined;
+ CBoolVector crcsDefined;
CRecordVector<UInt32> crcs;
ReadHashDigests(numFolders, crcsDefined, crcs);
for (i = 0; i < numFolders; i++)
@@ -490,7 +571,7 @@ void CInArchive::ReadSubStreamsInfo(
const CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes,
- CRecordVector<bool> &digestsDefined,
+ CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests)
{
numUnpackStreamsInFolders.Clear();
@@ -551,7 +632,7 @@ void CInArchive::ReadSubStreamsInfo(
{
if (type == NID::kCRC)
{
- CRecordVector<bool> digestsDefined2;
+ CBoolVector digestsDefined2;
CRecordVector<UInt32> digests2;
ReadHashDigests(numDigests, digestsDefined2, digests2);
int digestIndex = 0;
@@ -576,13 +657,10 @@ void CInArchive::ReadSubStreamsInfo(
{
if (digestsDefined.IsEmpty())
{
- digestsDefined.Clear();
+ BoolVector_Fill_False(digestsDefined, numDigestsTotal);
digests.Clear();
for (int i = 0; i < numDigestsTotal; i++)
- {
- digestsDefined.Add(false);
digests.Add(0);
- }
}
return;
}
@@ -596,12 +674,12 @@ void CInArchive::ReadStreamsInfo(
const CObjectVector<CByteBuffer> *dataVector,
UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
+ CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs,
CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes,
- CRecordVector<bool> &digestsDefined,
+ CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests)
{
for (;;)
@@ -695,13 +773,13 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
)
{
CRecordVector<UInt64> packSizes;
- CRecordVector<bool> packCRCsDefined;
+ CBoolVector packCRCsDefined;
CRecordVector<UInt32> packCRCs;
CObjectVector<CFolder> folders;
CRecordVector<CNum> numUnpackStreamsInFolders;
CRecordVector<UInt64> unpackSizes;
- CRecordVector<bool> digestsDefined;
+ CBoolVector digestsDefined;
CRecordVector<UInt32> digests;
ReadStreamsInfo(NULL,
@@ -802,7 +880,7 @@ HRESULT CInArchive::ReadHeader(
}
CRecordVector<UInt64> unpackSizes;
- CRecordVector<bool> digestsDefined;
+ CBoolVector digestsDefined;
CRecordVector<UInt32> digests;
if (type == NID::kMainStreamsInfo)
@@ -852,9 +930,7 @@ HRESULT CInArchive::ReadHeader(
db.ArchiveInfo.FileInfoPopIDs.Add(NID::kCRC);
CBoolVector emptyStreamVector;
- emptyStreamVector.Reserve((int)numFiles);
- for (i = 0; i < numFiles; i++)
- emptyStreamVector.Add(false);
+ BoolVector_Fill_False(emptyStreamVector, (int)numFiles);
CBoolVector emptyFileVector;
CBoolVector antiFileVector;
CNum numEmptyStreams = 0;
@@ -901,13 +977,10 @@ HRESULT CInArchive::ReadHeader(
for (i = 0; i < (CNum)emptyStreamVector.Size(); i++)
if (emptyStreamVector[i])
numEmptyStreams++;
- emptyFileVector.Reserve(numEmptyStreams);
- antiFileVector.Reserve(numEmptyStreams);
- for (i = 0; i < numEmptyStreams; i++)
- {
- emptyFileVector.Add(false);
- antiFileVector.Add(false);
- }
+
+ BoolVector_Fill_False(emptyFileVector, numEmptyStreams);
+ BoolVector_Fill_False(antiFileVector, numEmptyStreams);
+
break;
}
case NID::kEmptyFile: ReadBoolVector(numEmptyStreams, emptyFileVector); break;
diff --git a/CPP/7zip/Archive/7z/7zIn.h b/CPP/7zip/Archive/7z/7zIn.h
index 86d0e339..09c51105 100755
--- a/CPP/7zip/Archive/7z/7zIn.h
+++ b/CPP/7zip/Archive/7z/7zIn.h
@@ -4,8 +4,10 @@
#define __7Z_IN_H
#include "../../../Common/MyCom.h"
-#include "../../IStream.h"
+
#include "../../IPassword.h"
+#include "../../IStream.h"
+
#include "../../Common/CreateCoder.h"
#include "../../Common/InBuffer.h"
@@ -167,12 +169,12 @@ private:
void ReadArchiveProperties(CInArchiveInfo &archiveInfo);
void GetNextFolderItem(CFolder &itemInfo);
void ReadHashDigests(int numItems,
- CRecordVector<bool> &digestsDefined, CRecordVector<UInt32> &digests);
+ CBoolVector &digestsDefined, CRecordVector<UInt32> &digests);
void ReadPackInfo(
UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
+ CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs);
void ReadUnpackInfo(
@@ -183,19 +185,19 @@ private:
const CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes,
- CRecordVector<bool> &digestsDefined,
+ CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests);
void ReadStreamsInfo(
const CObjectVector<CByteBuffer> *dataVector,
UInt64 &dataOffset,
CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
+ CBoolVector &packCRCsDefined,
CRecordVector<UInt32> &packCRCs,
CObjectVector<CFolder> &folders,
CRecordVector<CNum> &numUnpackStreamsInFolders,
CRecordVector<UInt64> &unpackSizes,
- CRecordVector<bool> &digestsDefined,
+ CBoolVector &digestsDefined,
CRecordVector<UInt32> &digests);
diff --git a/CPP/7zip/Archive/7z/7zItem.h b/CPP/7zip/Archive/7z/7zItem.h
index 763a159f..1c3068bb 100755
--- a/CPP/7zip/Archive/7z/7zItem.h
+++ b/CPP/7zip/Archive/7z/7zItem.h
@@ -5,7 +5,9 @@
#include "../../../Common/Buffer.h"
#include "../../../Common/MyString.h"
+
#include "../../Common/MethodId.h"
+
#include "7zHeader.h"
namespace NArchive {
@@ -18,7 +20,7 @@ const CNum kNumNoIndex = 0xFFFFFFFF;
struct CCoderInfo
{
CMethodId MethodID;
- CByteBuffer Properties;
+ CByteBuffer Props;
CNum NumInStreams;
CNum NumOutStreams;
bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); }
@@ -80,6 +82,8 @@ struct CFolder
return i;
return -1;
}
+
+ bool CheckStructure() const;
};
struct CUInt64DefVector
diff --git a/CPP/7zip/Archive/7z/7zOut.cpp b/CPP/7zip/Archive/7z/7zOut.cpp
index dae242a6..7ac3c18c 100755
--- a/CPP/7zip/Archive/7z/7zOut.cpp
+++ b/CPP/7zip/Archive/7z/7zOut.cpp
@@ -278,7 +278,7 @@ void COutArchive::WriteFolder(const CFolder &folder)
{
const CCoderInfo &coder = folder.Coders[i];
{
- size_t propertiesSize = coder.Properties.GetCapacity();
+ size_t propsSize = coder.Props.GetCapacity();
UInt64 id = coder.MethodID;
int idSize;
@@ -292,7 +292,7 @@ void COutArchive::WriteFolder(const CFolder &folder)
b = (Byte)(idSize & 0xF);
bool isComplex = !coder.IsSimpleCoder();
b |= (isComplex ? 0x10 : 0);
- b |= ((propertiesSize != 0) ? 0x20 : 0 );
+ b |= ((propsSize != 0) ? 0x20 : 0 );
WriteByte(b);
WriteBytes(longID, idSize);
if (isComplex)
@@ -300,10 +300,10 @@ void COutArchive::WriteFolder(const CFolder &folder)
WriteNumber(coder.NumInStreams);
WriteNumber(coder.NumOutStreams);
}
- if (propertiesSize == 0)
+ if (propsSize == 0)
continue;
- WriteNumber(propertiesSize);
- WriteBytes(coder.Properties, propertiesSize);
+ WriteNumber(propsSize);
+ WriteBytes(coder.Props, propsSize);
}
}
for (i = 0; i < folder.BindPairs.Size(); i++)
diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp
index d3039d49..0285b189 100755
--- a/CPP/7zip/Archive/7z/7zUpdate.cpp
+++ b/CPP/7zip/Archive/7z/7zUpdate.cpp
@@ -1,18 +1,19 @@
-// UpdateMain.cpp
+// 7zUpdate.cpp
#include "StdAfx.h"
-#include "7zUpdate.h"
-#include "7zFolderInStream.h"
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "../Common/ItemNameUtils.h"
+
#include "7zEncode.h"
+#include "7zFolderInStream.h"
#include "7zHandler.h"
#include "7zOut.h"
-
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Common/ProgressUtils.h"
-#include "../../Common/LimitedStreams.h"
-#include "../../Common/LimitedStreams.h"
-#include "../Common/ItemNameUtils.h"
+#include "7zUpdate.h"
namespace NArchive {
namespace N7z {
@@ -78,7 +79,7 @@ static int CompareCoders(const CCoderInfo &c1, const CCoderInfo &c2)
RINOZ(MyCompare(c1.NumInStreams, c2.NumInStreams));
RINOZ(MyCompare(c1.NumOutStreams, c2.NumOutStreams));
RINOZ(MyCompare(c1.MethodID, c2.MethodID));
- return CompareBuffers(c1.Properties, c2.Properties);
+ return CompareBuffers(c1.Props, c2.Props);
}
static int CompareBindPairs(const CBindPair &b1, const CBindPair &b2)
@@ -336,28 +337,28 @@ static bool MakeExeMethod(const CCompressionMethodMode &method,
if (!GetMethodFull(k_LZMA, 1, methodFull))
return false;
{
- CProp property;
- property.Id = NCoderPropID::kAlgorithm;
- property.Value = kAlgorithmForBCJ2_LZMA;
- methodFull.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kAlgorithm;
+ prop.Value = kAlgorithmForBCJ2_LZMA;
+ methodFull.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kMatchFinder;
- property.Value = kMatchFinderForBCJ2_LZMA;
- methodFull.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kMatchFinder;
+ prop.Value = kMatchFinderForBCJ2_LZMA;
+ methodFull.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kDictionarySize;
- property.Value = kDictionaryForBCJ2_LZMA;
- methodFull.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kDictionarySize;
+ prop.Value = kDictionaryForBCJ2_LZMA;
+ methodFull.Props.Add(prop);
}
{
- CProp property;
- property.Id = NCoderPropID::kNumFastBytes;
- property.Value = kNumFastBytesForBCJ2_LZMA;
- methodFull.Properties.Add(property);
+ CProp prop;
+ prop.Id = NCoderPropID::kNumFastBytes;
+ prop.Value = kNumFastBytesForBCJ2_LZMA;
+ methodFull.Props.Add(prop);
}
exeMethod.Methods.Add(methodFull);
diff --git a/CPP/7zip/Archive/ArjHandler.cpp b/CPP/7zip/Archive/ArjHandler.cpp
index 9b12ed31..c40cbbcd 100755
--- a/CPP/7zip/Archive/ArjHandler.cpp
+++ b/CPP/7zip/Archive/ArjHandler.cpp
@@ -16,11 +16,9 @@
#include "../Common/StreamObjects.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Arj/ArjDecoder1.h"
-#include "../Compress/Arj/ArjDecoder2.h"
-#include "../Compress/Copy/CopyCoder.h"
-
-#include "IArchive.h"
+#include "../Compress/ArjDecoder1.h"
+#include "../Compress/ArjDecoder2.h"
+#include "../Compress/CopyCoder.h"
#include "Common/ItemNameUtils.h"
#include "Common/OutStreamWithCRC.h"
@@ -427,7 +425,7 @@ HRESULT CInArchive::GetNextItem(bool &filled, CItem &item)
/*
UInt32 extraData;
if ((header.Flags & NFileHeader::NFlags::kExtFile) != 0)
- extraData = GetUInt32FromMemLE(_block + pos);
+ extraData = GetUi32(_block + pos);
*/
RINOK(SkeepExtendedHeaders());
diff --git a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp
index 30b75444..05716b62 100755
--- a/CPP/7zip/Archive/BZip2/BZip2Handler.cpp
+++ b/CPP/7zip/Archive/BZip2/BZip2Handler.cpp
@@ -3,13 +3,13 @@
#include "StdAfx.h"
#include "Common/ComTry.h"
-#include "Common/Defs.h"
+
#include "Windows/PropVariant.h"
-#include "Windows/Defs.h"
+#include "../../Common/CreateCoder.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/StreamUtils.h"
-#include "../../Common/CreateCoder.h"
+
#include "../Common/DummyOutStream.h"
#include "BZip2Handler.h"
diff --git a/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp b/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp
index fd93f179..71311c32 100755
--- a/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp
+++ b/CPP/7zip/Archive/BZip2/BZip2HandlerOut.cpp
@@ -9,7 +9,7 @@
#include "Windows/PropVariant.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
#include "../Common/ParseProperties.h"
diff --git a/CPP/7zip/Archive/Cab/CabHandler.cpp b/CPP/7zip/Archive/Cab/CabHandler.cpp
index f4a11afb..ad015aaf 100755
--- a/CPP/7zip/Archive/Cab/CabHandler.cpp
+++ b/CPP/7zip/Archive/Cab/CabHandler.cpp
@@ -2,27 +2,27 @@
#include "StdAfx.h"
-#include "Common/StringConvert.h"
-#include "Common/Defs.h"
-#include "Common/UTFConvert.h"
#include "Common/ComTry.h"
+#include "Common/Defs.h"
#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
+#include "Common/UTFConvert.h"
#include "Windows/PropVariant.h"
#include "Windows/Time.h"
-#include "CabHandler.h"
-#include "CabBlockInStream.h"
-
#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Compress/Deflate/DeflateDecoder.h"
-#include "../../Compress/Lzx/LzxDecoder.h"
-#include "../../Compress/Quantum/QuantumDecoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../../Compress/DeflateDecoder.h"
+#include "../../Compress/LzxDecoder.h"
+#include "../../Compress/QuantumDecoder.h"
#include "../Common/ItemNameUtils.h"
+#include "CabBlockInStream.h"
+#include "CabHandler.h"
+
using namespace NWindows;
namespace NArchive {
diff --git a/CPP/7zip/Archive/Chm/ChmHandler.cpp b/CPP/7zip/Archive/Chm/ChmHandler.cpp
index 9da64bce..03bff821 100755
--- a/CPP/7zip/Archive/Chm/ChmHandler.cpp
+++ b/CPP/7zip/Archive/Chm/ChmHandler.cpp
@@ -1,27 +1,26 @@
-// Chm/Handler.cpp
+// ChmHandler.cpp
#include "StdAfx.h"
-#include "Common/StringConvert.h"
+#include "Common/ComTry.h"
#include "Common/Defs.h"
+#include "Common/StringConvert.h"
#include "Common/UTFConvert.h"
-#include "Common/ComTry.h"
#include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../Common/LimitedStreams.h"
-#include "../../Common/StreamUtils.h"
#include "../../Common/ProgressUtils.h"
+#include "../../Common/StreamUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Compress/Lzx/LzxDecoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../../Compress/LzxDecoder.h"
#include "../Common/ItemNameUtils.h"
#include "ChmHandler.h"
-
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/Common/HandlerOut.cpp b/CPP/7zip/Archive/Common/HandlerOut.cpp
index 63899fe4..3e817beb 100755
--- a/CPP/7zip/Archive/Common/HandlerOut.cpp
+++ b/CPP/7zip/Archive/Common/HandlerOut.cpp
@@ -1,17 +1,21 @@
-// HandlerOutCommon.cpp
+// HandlerOut.cpp
#include "StdAfx.h"
-#include "HandlerOut.h"
-#include "../../../Windows/PropVariant.h"
#include "../../../Common/StringToInt.h"
-#include "../../ICoder.h"
-#include "../Common/ParseProperties.h"
+
+#include "../../../Windows/PropVariant.h"
#ifdef COMPRESS_MT
#include "../../../Windows/System.h"
#endif
+#include "../../ICoder.h"
+
+#include "../Common/ParseProperties.h"
+
+#include "HandlerOut.h"
+
using namespace NWindows;
namespace NArchive {
@@ -161,13 +165,13 @@ static int FindPropIdFromStringName(const UString &name)
static void SetOneMethodProp(COneMethodInfo &oneMethodInfo, PROPID propID,
const NWindows::NCOM::CPropVariant &value)
{
- for (int j = 0; j < oneMethodInfo.Properties.Size(); j++)
- if (oneMethodInfo.Properties[j].Id == propID)
+ for (int j = 0; j < oneMethodInfo.Props.Size(); j++)
+ if (oneMethodInfo.Props[j].Id == propID)
return;
- CProp property;
- property.Id = propID;
- property.Value = value;
- oneMethodInfo.Properties.Add(property);
+ CProp prop;
+ prop.Id = propID;
+ prop.Value = value;
+ oneMethodInfo.Props.Add(prop);
}
void COutHandler::SetCompressionMethod2(COneMethodInfo &oneMethodInfo
@@ -311,19 +315,16 @@ static void SplitParam(const UString &param, UString &name, UString &value)
HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value)
{
- CProp property;
- if (
- name.CompareNoCase(L"D") == 0 ||
- name.CompareNoCase(L"MEM") == 0)
+ CProp prop;
+ if (name.CompareNoCase(L"D") == 0 ||
+ name.CompareNoCase(L"MEM") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(value, dicSize));
- if (name.CompareNoCase(L"D") == 0)
- property.Id = NCoderPropID::kDictionarySize;
- else
- property.Id = NCoderPropID::kUsedMemorySize;
- property.Value = dicSize;
- oneMethodInfo.Properties.Add(property);
+ prop.Id = (name.CompareNoCase(L"D") == 0) ?
+ NCoderPropID::kDictionarySize :
+ NCoderPropID::kUsedMemorySize;
+ prop.Value = dicSize;
}
else
{
@@ -332,7 +333,7 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name
return E_INVALIDARG;
const CNameToPropID &nameToPropID = g_NameToPropID[index];
- property.Id = nameToPropID.PropID;
+ prop.Id = nameToPropID.PropID;
NCOM::CPropVariant propValue;
@@ -354,11 +355,10 @@ HRESULT COutHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name
propValue = value;
}
- if (!ConvertProperty(propValue, nameToPropID.VarType, property.Value))
+ if (!ConvertProperty(propValue, nameToPropID.VarType, prop.Value))
return E_INVALIDARG;
-
- oneMethodInfo.Properties.Add(property);
}
+ oneMethodInfo.Props.Add(prop);
return S_OK;
}
@@ -576,14 +576,13 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
}
else
{
- CProp property;
+ CProp prop;
if (realName.Left(1).CompareNoCase(L"D") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(1), value, dicSize));
- property.Id = NCoderPropID::kDictionarySize;
- property.Value = dicSize;
- oneMethodInfo.Properties.Add(property);
+ prop.Id = NCoderPropID::kDictionarySize;
+ prop.Value = dicSize;
if (number <= mainDicMethodIndex)
mainDicSize = dicSize;
}
@@ -591,17 +590,15 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
{
UInt32 blockSize;
RINOK(ParsePropDictionaryValue(realName.Mid(1), value, blockSize));
- property.Id = NCoderPropID::kBlockSize;
- property.Value = blockSize;
- oneMethodInfo.Properties.Add(property);
+ prop.Id = NCoderPropID::kBlockSize;
+ prop.Value = blockSize;
}
else if (realName.Left(3).CompareNoCase(L"MEM") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(3), value, dicSize));
- property.Id = NCoderPropID::kUsedMemorySize;
- property.Value = dicSize;
- oneMethodInfo.Properties.Add(property);
+ prop.Id = NCoderPropID::kUsedMemorySize;
+ prop.Value = dicSize;
if (number <= mainDicMethodIndex)
mainDicSize = dicSize;
}
@@ -610,15 +607,12 @@ HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &val
int index = FindPropIdFromStringName(realName);
if (index < 0)
return E_INVALIDARG;
-
const CNameToPropID &nameToPropID = g_NameToPropID[index];
- property.Id = nameToPropID.PropID;
-
- if (!ConvertProperty(value, nameToPropID.VarType, property.Value))
+ prop.Id = nameToPropID.PropID;
+ if (!ConvertProperty(value, nameToPropID.VarType, prop.Value))
return E_INVALIDARG;
-
- oneMethodInfo.Properties.Add(property);
}
+ oneMethodInfo.Props.Add(prop);
}
return S_OK;
}
diff --git a/CPP/7zip/Archive/Common/HandlerOut.h b/CPP/7zip/Archive/Common/HandlerOut.h
index b6095a6b..89c81c1f 100755
--- a/CPP/7zip/Archive/Common/HandlerOut.h
+++ b/CPP/7zip/Archive/Common/HandlerOut.h
@@ -3,14 +3,14 @@
#ifndef __HANDLER_OUT_H
#define __HANDLER_OUT_H
-#include "../../Common/MethodProps.h"
#include "../../../Common/MyString.h"
+#include "../../Common/MethodProps.h"
namespace NArchive {
struct COneMethodInfo
{
- CObjectVector<CProp> Properties;
+ CObjectVector<CProp> Props;
UString MethodName;
};
diff --git a/CPP/7zip/Archive/Common/OutStreamWithCRC.h b/CPP/7zip/Archive/Common/OutStreamWithCRC.h
index 32870235..a034ee9b 100755
--- a/CPP/7zip/Archive/Common/OutStreamWithCRC.h
+++ b/CPP/7zip/Archive/Common/OutStreamWithCRC.h
@@ -1,7 +1,7 @@
// OutStreamWithCRC.h
-#ifndef __OUTSTREAMWITHCRC_H
-#define __OUTSTREAMWITHCRC_H
+#ifndef __OUT_STREAM_WITH_CRC_H
+#define __OUT_STREAM_WITH_CRC_H
#include "../../../Common/MyCom.h"
#include "../../IStream.h"
diff --git a/CPP/7zip/Archive/Common/OutStreamWithSha1.h b/CPP/7zip/Archive/Common/OutStreamWithSha1.h
index 6df23080..4eab42a7 100755
--- a/CPP/7zip/Archive/Common/OutStreamWithSha1.h
+++ b/CPP/7zip/Archive/Common/OutStreamWithSha1.h
@@ -1,14 +1,14 @@
// OutStreamWithSha1.h
-#ifndef __OUTSTREAMWITHSHA1_H
-#define __OUTSTREAMWITHSHA1_H
+#ifndef __OUT_STREAM_WITH_SHA1_H
+#define __OUT_STREAM_WITH_SHA1_H
#include "../../../Common/MyCom.h"
#include "../../IStream.h"
-#include "../../Crypto/Hash/Sha1.h"
+#include "../../Crypto/Sha1.h"
class COutStreamWithSha1:
diff --git a/CPP/7zip/Archive/Cpio/CpioHandler.cpp b/CPP/7zip/Archive/Cpio/CpioHandler.cpp
index e034c87b..d49c854f 100755
--- a/CPP/7zip/Archive/Cpio/CpioHandler.cpp
+++ b/CPP/7zip/Archive/Cpio/CpioHandler.cpp
@@ -1,25 +1,25 @@
-// Archive/cpio/Handler.cpp
+// CpioHandler.cpp
#include "StdAfx.h"
-#include "CpioHandler.h"
-#include "CpioIn.h"
-
+#include "Common/ComTry.h"
#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
-#include "Common/ComTry.h"
+#include "Common/StringConvert.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
+#include "../../Common/LimitedStreams.h"
#include "../../Common/ProgressUtils.h"
-#include "../../Common//LimitedStreams.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h"
+#include "CpioHandler.h"
+#include "CpioIn.h"
+
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/DebHandler.cpp b/CPP/7zip/Archive/DebHandler.cpp
index 9bac2b7d..cf0c383f 100755
--- a/CPP/7zip/Archive/DebHandler.cpp
+++ b/CPP/7zip/Archive/DebHandler.cpp
@@ -16,7 +16,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
#include "Common/ItemNameUtils.h"
diff --git a/CPP/7zip/Archive/DmgHandler.cpp b/CPP/7zip/Archive/DmgHandler.cpp
index 7d5201c0..dd1e95ec 100755
--- a/CPP/7zip/Archive/DmgHandler.cpp
+++ b/CPP/7zip/Archive/DmgHandler.cpp
@@ -17,9 +17,9 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/BZip2/BZip2Decoder.h"
-#include "../Compress/Copy/CopyCoder.h"
-#include "../Compress/Deflate/ZlibDecoder.h"
+#include "../Compress/BZip2Decoder.h"
+#include "../Compress/CopyCoder.h"
+#include "../Compress/ZlibDecoder.h"
// #define DMG_SHOW_RAW
diff --git a/CPP/7zip/Archive/ElfHandler.cpp b/CPP/7zip/Archive/ElfHandler.cpp
index 8d498177..cac7c3ad 100755
--- a/CPP/7zip/Archive/ElfHandler.cpp
+++ b/CPP/7zip/Archive/ElfHandler.cpp
@@ -15,7 +15,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h"
diff --git a/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp b/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp
index 1fb1547d..bcbfc7e2 100755
--- a/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp
+++ b/CPP/7zip/Archive/GZip/GZipHandlerOut.cpp
@@ -1,19 +1,20 @@
-// Archive/GZip/OutHandler.cpp
+// GZipHandlerOut.cpp
#include "StdAfx.h"
-#include "GZipHandler.h"
-#include "GZipUpdate.h"
-
#include "Common/StringConvert.h"
#include "Common/StringToInt.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
+
+#include "../../Compress/CopyCoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
#include "../Common/ParseProperties.h"
+#include "GZipHandler.h"
+#include "GZipUpdate.h"
+
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/GZip/GZipUpdate.cpp b/CPP/7zip/Archive/GZip/GZipUpdate.cpp
index 8f8a2c4f..f3a4d331 100755
--- a/CPP/7zip/Archive/GZip/GZipUpdate.cpp
+++ b/CPP/7zip/Archive/GZip/GZipUpdate.cpp
@@ -2,8 +2,6 @@
#include "StdAfx.h"
-#include "GZipUpdate.h"
-
#include "Common/Defs.h"
#include "Common/StringConvert.h"
@@ -11,12 +9,16 @@
#include "Windows/PropVariant.h"
#include "../../ICoder.h"
-#include "../../Common/ProgressUtils.h"
+
#include "../../Common/CreateCoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Compress/CopyCoder.h"
#include "../Common/InStreamWithCRC.h"
+#include "GZipUpdate.h"
+
namespace NArchive {
namespace NGZip {
diff --git a/CPP/7zip/Archive/Iso/IsoHandler.cpp b/CPP/7zip/Archive/Iso/IsoHandler.cpp
index db1b9c06..f0c926c4 100755
--- a/CPP/7zip/Archive/Iso/IsoHandler.cpp
+++ b/CPP/7zip/Archive/Iso/IsoHandler.cpp
@@ -1,25 +1,25 @@
-// Iso/Handler.cpp
+// IsoHandler.cpp
#include "StdAfx.h"
-#include "IsoHandler.h"
-
+#include "Common/ComTry.h"
#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/IntToString.h"
#include "Common/NewHandler.h"
-#include "Common/ComTry.h"
+#include "Common/StringConvert.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
-#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
#include "../Common/ItemNameUtils.h"
+#include "IsoHandler.h"
+
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/Lzh/LzhHandler.cpp b/CPP/7zip/Archive/Lzh/LzhHandler.cpp
index ee43a3b0..66153f7a 100755
--- a/CPP/7zip/Archive/Lzh/LzhHandler.cpp
+++ b/CPP/7zip/Archive/Lzh/LzhHandler.cpp
@@ -2,23 +2,23 @@
#include "StdAfx.h"
+#include "Common/ComTry.h"
#include "Common/Defs.h"
#include "Common/StringConvert.h"
-#include "Common/ComTry.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
#include "LzhHandler.h"
#include "LzhOutStreamWithCRC.h"
#include "../../ICoder.h"
-#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Compress/Lzh/LzhDecoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../../Compress/LzhDecoder.h"
#include "../Common/ItemNameUtils.h"
@@ -384,5 +384,4 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
COM_TRY_END
}
-
}}
diff --git a/CPP/7zip/Archive/MachoHandler.cpp b/CPP/7zip/Archive/MachoHandler.cpp
index bbae3150..f3ccadf5 100755
--- a/CPP/7zip/Archive/MachoHandler.cpp
+++ b/CPP/7zip/Archive/MachoHandler.cpp
@@ -14,7 +14,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h"
diff --git a/CPP/7zip/Archive/MubHandler.cpp b/CPP/7zip/Archive/MubHandler.cpp
index edf00f93..25c3815e 100755
--- a/CPP/7zip/Archive/MubHandler.cpp
+++ b/CPP/7zip/Archive/MubHandler.cpp
@@ -13,7 +13,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
#define Get32(p) GetBe32(p)
diff --git a/CPP/7zip/Archive/PeHandler.cpp b/CPP/7zip/Archive/PeHandler.cpp
index 7031db97..70af37c7 100755
--- a/CPP/7zip/Archive/PeHandler.cpp
+++ b/CPP/7zip/Archive/PeHandler.cpp
@@ -16,7 +16,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
#include "Common/DummyOutStream.h"
@@ -605,7 +605,11 @@ HRESULT CHandler::LoadDebugSections(IInStream *stream, bool &thereIsSection)
}
}
if (i == _sections.Size())
- return S_FALSE;
+ {
+ return S_OK;
+ // Exe for ARM requires S_OK
+ // return S_FALSE;
+ }
CByteBuffer buffer;
buffer.SetCapacity(debugLink.Size);
diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp
index e81c7967..2431e449 100755
--- a/CPP/7zip/Archive/Rar/RarHandler.cpp
+++ b/CPP/7zip/Archive/Rar/RarHandler.cpp
@@ -2,25 +2,29 @@
#include "StdAfx.h"
-#include "RarHandler.h"
-
-#include "Common/StringConvert.h"
#include "Common/ComTry.h"
#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
#include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../IPassword.h"
-#include "../../Common/ProgressUtils.h"
+
#include "../../Common/CreateCoder.h"
-#include "../../Common/MethodId.h"
#include "../../Common/FilterCoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Crypto/Rar20/Rar20Cipher.h"
-#include "../../Crypto/RarAES/RarAES.h"
-#include "../Common/OutStreamWithCRC.h"
+#include "../../Common/MethodId.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "../../Crypto/Rar20Crypto.h"
+#include "../../Crypto/RarAes.h"
+
#include "../Common/ItemNameUtils.h"
+#include "../Common/OutStreamWithCRC.h"
+
+#include "RarHandler.h"
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/Rar/RarIn.h b/CPP/7zip/Archive/Rar/RarIn.h
index 7be3f53c..ff97a109 100755
--- a/CPP/7zip/Archive/Rar/RarIn.h
+++ b/CPP/7zip/Archive/Rar/RarIn.h
@@ -5,10 +5,14 @@
#include "Common/DynamicBuffer.h"
#include "Common/MyCom.h"
-#include "../../IStream.h"
+
#include "../../ICoder.h"
+#include "../../IStream.h"
+
#include "../../Common/StreamObjects.h"
-#include "../../Crypto/RarAES/RarAES.h"
+
+#include "../../Crypto/RarAes.h"
+
#include "RarHeader.h"
#include "RarItem.h"
diff --git a/CPP/7zip/Archive/RpmHandler.cpp b/CPP/7zip/Archive/RpmHandler.cpp
index f39ee3c5..c6951799 100755
--- a/CPP/7zip/Archive/RpmHandler.cpp
+++ b/CPP/7zip/Archive/RpmHandler.cpp
@@ -13,7 +13,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Copy/CopyCoder.h"
+#include "../Compress/CopyCoder.h"
using namespace NWindows;
diff --git a/CPP/7zip/Archive/Split/SplitHandler.cpp b/CPP/7zip/Archive/Split/SplitHandler.cpp
index 380e6ce3..61b7f4a7 100755
--- a/CPP/7zip/Archive/Split/SplitHandler.cpp
+++ b/CPP/7zip/Archive/Split/SplitHandler.cpp
@@ -1,22 +1,24 @@
-// Tar/Handler.cpp
+// SplitHandler.cpp
#include "StdAfx.h"
-#include "SplitHandler.h"
-
+#include "Common/ComTry.h"
#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
-#include "Common/ComTry.h"
+#include "Common/StringConvert.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
+
+#include "../../Compress/CopyCoder.h"
+
#include "../Common/ItemNameUtils.h"
#include "../Common/MultiStream.h"
+#include "SplitHandler.h"
+
using namespace NWindows;
using namespace NTime;
diff --git a/CPP/7zip/Archive/Tar/TarHandler.cpp b/CPP/7zip/Archive/Tar/TarHandler.cpp
index f70f7e4e..f8000c85 100755
--- a/CPP/7zip/Archive/Tar/TarHandler.cpp
+++ b/CPP/7zip/Archive/Tar/TarHandler.cpp
@@ -1,26 +1,26 @@
-// Tar/Handler.cpp
+// TarHandler.cpp
#include "StdAfx.h"
-#include "TarHandler.h"
-#include "TarIn.h"
-
+#include "Common/ComTry.h"
#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/NewHandler.h"
-#include "Common/ComTry.h"
+#include "Common/StringConvert.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
-#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
-#include "../Common/DummyOutStream.h"
+#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../Common/DummyOutStream.h"
#include "../Common/ItemNameUtils.h"
+#include "TarHandler.h"
+#include "TarIn.h"
+
using namespace NWindows;
namespace NArchive {
diff --git a/CPP/7zip/Archive/Tar/TarUpdate.cpp b/CPP/7zip/Archive/Tar/TarUpdate.cpp
index 62c6bff6..1c048915 100755
--- a/CPP/7zip/Archive/Tar/TarUpdate.cpp
+++ b/CPP/7zip/Archive/Tar/TarUpdate.cpp
@@ -2,13 +2,10 @@
#include "StdAfx.h"
-#include "Common/Defs.h"
-#include "Common/StringConvert.h"
-#include "Windows/Defs.h"
-
-#include "../../Common/ProgressUtils.h"
#include "../../Common/LimitedStreams.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Compress/CopyCoder.h"
#include "TarOut.h"
#include "TarUpdate.h"
diff --git a/CPP/7zip/Archive/Udf/UdfHandler.cpp b/CPP/7zip/Archive/Udf/UdfHandler.cpp
index e503e843..12329147 100755
--- a/CPP/7zip/Archive/Udf/UdfHandler.cpp
+++ b/CPP/7zip/Archive/Udf/UdfHandler.cpp
@@ -1,19 +1,21 @@
-// Udf/Handler.cpp
+// UdfHandler.cpp
#include "StdAfx.h"
-#include "UdfHandler.h"
-
-#include "Common/NewHandler.h"
#include "Common/ComTry.h"
+#include "Common/NewHandler.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
#include "../../Common/ProgressUtils.h"
-#include "../../Compress/Copy/CopyCoder.h"
+
+#include "../../Compress/CopyCoder.h"
+
#include "../Common/DummyOutStream.h"
+#include "UdfHandler.h"
+
namespace NArchive {
namespace NUdf {
diff --git a/CPP/7zip/Archive/Wim/WimIn.cpp b/CPP/7zip/Archive/Wim/WimIn.cpp
index 5c741f8f..121e33ab 100755
--- a/CPP/7zip/Archive/Wim/WimIn.cpp
+++ b/CPP/7zip/Archive/Wim/WimIn.cpp
@@ -123,7 +123,7 @@ HRESULT CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outS
{
try { return CodeReal(inStream, outStream, outSize); }
catch(const CInBufferException &e) { return e.ErrorCode; } \
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Archive/Wim/WimIn.h b/CPP/7zip/Archive/Wim/WimIn.h
index 79e7bd01..e51a301a 100755
--- a/CPP/7zip/Archive/Wim/WimIn.h
+++ b/CPP/7zip/Archive/Wim/WimIn.h
@@ -3,11 +3,11 @@
#ifndef __ARCHIVE_WIM_IN_H
#define __ARCHIVE_WIM_IN_H
-#include "Common/MyString.h"
#include "Common/Buffer.h"
+#include "Common/MyString.h"
-#include "../../Compress/Lzx/LzxDecoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../../Compress/LzxDecoder.h"
namespace NArchive {
namespace NWim {
@@ -66,7 +66,7 @@ const UInt32 kMainTableSize = 256 + kNumPosLenSlots;
class CDecoder
{
CBitStream m_InBitStream;
- CLZOutWindow m_OutWindowStream;
+ CLzOutWindow m_OutWindowStream;
NCompress::NHuffman::CDecoder<kNumHuffmanBits, kMainTableSize> m_MainDecoder;
HRESULT CodeSpec(UInt32 size);
diff --git a/CPP/7zip/Archive/XarHandler.cpp b/CPP/7zip/Archive/XarHandler.cpp
index 1069d15d..2dddad9f 100755
--- a/CPP/7zip/Archive/XarHandler.cpp
+++ b/CPP/7zip/Archive/XarHandler.cpp
@@ -18,9 +18,9 @@
#include "../Common/StreamObjects.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/BZip2/BZip2Decoder.h"
-#include "../Compress/Copy/CopyCoder.h"
-#include "../Compress/Deflate/ZlibDecoder.h"
+#include "../Compress/BZip2Decoder.h"
+#include "../Compress/CopyCoder.h"
+#include "../Compress/ZlibDecoder.h"
#include "Common/OutStreamWithSha1.h"
diff --git a/CPP/7zip/Archive/ZHandler.cpp b/CPP/7zip/Archive/ZHandler.cpp
index bc006eda..21432b22 100755
--- a/CPP/7zip/Archive/ZHandler.cpp
+++ b/CPP/7zip/Archive/ZHandler.cpp
@@ -10,7 +10,7 @@
#include "../Common/RegisterArc.h"
#include "../Common/StreamUtils.h"
-#include "../Compress/Z/ZDecoder.h"
+#include "../Compress/ZDecoder.h"
#include "Common/DummyOutStream.h"
diff --git a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
index 9010a5e4..212a8b4b 100755
--- a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
+++ b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
@@ -1,4 +1,4 @@
-// AddCommon.cpp
+// ZipAddCommon.cpp
#include "StdAfx.h"
@@ -8,14 +8,17 @@ extern "C"
}
#include "Windows/PropVariant.h"
-#include "Windows/Defs.h"
-#include "../../MyVersion.h"
+
#include "../../ICoder.h"
#include "../../IPassword.h"
+#include "../../MyVersion.h"
+
#include "../../Common/CreateCoder.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"
-#include "../../Compress/LZMA/LZMAEncoder.h"
+
+#include "../../Compress/LzmaEncoder.h"
+
#include "../Common/InStreamWithCRC.h"
#include "ZipAddCommon.h"
@@ -34,7 +37,7 @@ class CLzmaEncoder:
public ICompressCoder,
public CMyUnknownImp
{
- NCompress::NLZMA::CEncoder *EncoderSpec;
+ NCompress::NLzma::CEncoder *EncoderSpec;
CMyComPtr<ICompressCoder> Encoder;
Byte Header[kLzmaHeaderSize];
public:
@@ -49,7 +52,7 @@ HRESULT CLzmaEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIAN
{
if (!Encoder)
{
- EncoderSpec = new NCompress::NLZMA::CEncoder;
+ EncoderSpec = new NCompress::NLzma::CEncoder;
Encoder = EncoderSpec;
}
CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp;
@@ -153,7 +156,7 @@ HRESULT CAddCommon::Compress(
}
if (_options.IsAesMode)
{
- _cryptoStreamSpec->Filter = _aesFilter = _filterAesSpec = new NCrypto::NWzAES::CEncoder;
+ _cryptoStreamSpec->Filter = _aesFilter = _filterAesSpec = new NCrypto::NWzAes::CEncoder;
_filterAesSpec->SetKeyMode(_options.AesKeyMode);
RINOK(_filterAesSpec->CryptoSetPassword(
(const Byte *)(const char *)_options.Password, _options.Password.Length()));
diff --git a/CPP/7zip/Archive/Zip/ZipAddCommon.h b/CPP/7zip/Archive/Zip/ZipAddCommon.h
index 6c766037..8f5b568d 100755
--- a/CPP/7zip/Archive/Zip/ZipAddCommon.h
+++ b/CPP/7zip/Archive/Zip/ZipAddCommon.h
@@ -1,16 +1,18 @@
-// Zip/AddCommon.h
+// ZipAddCommon.h
-#ifndef __ZIP_ADDCOMMON_H
-#define __ZIP_ADDCOMMON_H
+#ifndef __ZIP_ADD_COMMON_H
+#define __ZIP_ADD_COMMON_H
#include "../../ICoder.h"
#include "../../IProgress.h"
-#include "../../Compress/Copy/CopyCoder.h"
#include "../../Common/CreateCoder.h"
#include "../../Common/FilterCoder.h"
-#include "../../Crypto/Zip/ZipCipher.h"
-#include "../../Crypto/WzAES/WzAES.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "../../Crypto/ZipCrypto.h"
+#include "../../Crypto/WzAes.h"
#include "ZipCompressionMode.h"
@@ -38,7 +40,7 @@ class CAddCommon
CMyComPtr<ISequentialOutStream> _cryptoStream;
NCrypto::NZip::CEncoder *_filterSpec;
- NCrypto::NWzAES::CEncoder *_filterAesSpec;
+ NCrypto::NWzAes::CEncoder *_filterAesSpec;
CMyComPtr<ICompressFilter> _zipCryptoFilter;
CMyComPtr<ICompressFilter> _aesFilter;
diff --git a/CPP/7zip/Archive/Zip/ZipHandler.cpp b/CPP/7zip/Archive/Zip/ZipHandler.cpp
index 40d131f0..3054ae02 100755
--- a/CPP/7zip/Archive/Zip/ZipHandler.cpp
+++ b/CPP/7zip/Archive/Zip/ZipHandler.cpp
@@ -2,40 +2,35 @@
#include "StdAfx.h"
-#include "ZipHandler.h"
-
-#include "Common/Defs.h"
-#include "Common/StringConvert.h"
#include "Common/ComTry.h"
+#include "Common/Defs.h"
#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
-#include "Windows/Time.h"
#include "Windows/PropVariant.h"
+#include "Windows/Time.h"
#include "../../IPassword.h"
+#include "../../Common/CreateCoder.h"
+#include "../../Common/FilterCoder.h"
#include "../../Common/ProgressUtils.h"
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"
-#include "../../Common/CreateCoder.h"
-#include "../../Common/FilterCoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
-#include "../../Compress/LZMA/LZMADecoder.h"
+#include "../../Compress/CopyCoder.h"
+#include "../../Compress/LzmaDecoder.h"
+#include "../../Compress/ImplodeDecoder.h"
+#include "../../Compress/ShrinkDecoder.h"
+
+#include "../../Crypto/WzAes.h"
+#include "../../Crypto/ZipCrypto.h"
+#include "../../Crypto/ZipStrong.h"
#include "../Common/ItemNameUtils.h"
#include "../Common/OutStreamWithCRC.h"
-#include "../../Compress/Shrink/ShrinkDecoder.h"
-#include "../../Compress/Implode/ImplodeDecoder.h"
-
-
-#include "../../Crypto/Zip/ZipCipher.h"
-#include "../../Crypto/WzAES/WzAES.h"
-
-#ifdef ZIP_STRONG_SUPORT
-#include "../../Crypto/ZipStrong/ZipStrong.h"
-#endif
+#include "ZipHandler.h"
using namespace NWindows;
@@ -381,7 +376,7 @@ class CLzmaDecoder:
public ICompressCoder,
public CMyUnknownImp
{
- NCompress::NLZMA::CDecoder *DecoderSpec;
+ NCompress::NLzma::CDecoder *DecoderSpec;
CMyComPtr<ICompressCoder> Decoder;
public:
CLzmaDecoder();
@@ -393,7 +388,7 @@ public:
CLzmaDecoder::CLzmaDecoder()
{
- DecoderSpec = new NCompress::NLZMA::CDecoder;
+ DecoderSpec = new NCompress::NLzma::CDecoder;
Decoder = DecoderSpec;
}
@@ -417,20 +412,24 @@ struct CMethodItem
class CZipDecoder
{
NCrypto::NZip::CDecoder *_zipCryptoDecoderSpec;
- NCrypto::NWzAES::CDecoder *_aesDecoderSpec;
+ NCrypto::NZipStrong::CDecoder *_pkAesDecoderSpec;
+ NCrypto::NWzAes::CDecoder *_wzAesDecoderSpec;
+
CMyComPtr<ICompressFilter> _zipCryptoDecoder;
- CMyComPtr<ICompressFilter> _aesDecoder;
- #ifdef ZIP_STRONG_SUPORT
- NCrypto::NZipStrong::CDecoder *_zsDecoderSpec;
- CMyComPtr<ICompressFilter> _zsDecoder;
- #endif
+ CMyComPtr<ICompressFilter> _pkAesDecoder;
+ CMyComPtr<ICompressFilter> _wzAesDecoder;
+
CFilterCoder *filterStreamSpec;
CMyComPtr<ISequentialInStream> filterStream;
CMyComPtr<ICryptoGetTextPassword> getTextPassword;
CObjectVector<CMethodItem> methodItems;
public:
- CZipDecoder(): _zipCryptoDecoderSpec(0), _aesDecoderSpec(0), filterStreamSpec(0) {}
+ CZipDecoder():
+ _zipCryptoDecoderSpec(0),
+ _pkAesDecoderSpec(0),
+ _wzAesDecoderSpec(0),
+ filterStreamSpec(0) {}
HRESULT Decode(
DECL_EXTERNAL_CODECS_LOC_VARS
@@ -453,23 +452,19 @@ HRESULT CZipDecoder::Decode(
CInStreamReleaser inStreamReleaser;
bool needCRC = true;
- bool aesMode = false;
- #ifdef ZIP_STRONG_SUPORT
+ bool wzAesMode = false;
bool pkAesMode = false;
- #endif
UInt16 methodId = item.CompressionMethod;
if (item.IsEncrypted())
{
if (item.IsStrongEncrypted())
{
- #ifdef ZIP_STRONG_SUPORT
CStrongCryptoField f;
if (item.CentralExtra.GetStrongCryptoField(f))
{
pkAesMode = true;
}
if (!pkAesMode)
- #endif
{
res = NArchive::NExtract::NOperationResult::kUnSupportedMethod;
return S_OK;
@@ -480,7 +475,7 @@ HRESULT CZipDecoder::Decode(
CWzAesExtraField aesField;
if (item.CentralExtra.GetWzAesField(aesField))
{
- aesMode = true;
+ wzAesMode = true;
needCRC = aesField.NeedCrc();
}
}
@@ -496,11 +491,11 @@ HRESULT CZipDecoder::Decode(
CMyComPtr<ISequentialInStream> inStream;
{
UInt64 packSize = item.PackSize;
- if (aesMode)
+ if (wzAesMode)
{
- if (packSize < NCrypto::NWzAES::kMacSize)
+ if (packSize < NCrypto::NWzAes::kMacSize)
return S_OK;
- packSize -= NCrypto::NWzAES::kMacSize;
+ packSize -= NCrypto::NWzAes::kMacSize;
}
UInt64 dataPos = item.GetDataPosition();
inStream.Attach(archive.CreateLimitedStream(dataPos, packSize));
@@ -510,32 +505,30 @@ HRESULT CZipDecoder::Decode(
CMyComPtr<ICompressFilter> cryptoFilter;
if (item.IsEncrypted())
{
- if (aesMode)
+ if (wzAesMode)
{
CWzAesExtraField aesField;
if (!item.CentralExtra.GetWzAesField(aesField))
return S_OK;
methodId = aesField.Method;
- if (!_aesDecoder)
+ if (!_wzAesDecoder)
{
- _aesDecoderSpec = new NCrypto::NWzAES::CDecoder;
- _aesDecoder = _aesDecoderSpec;
+ _wzAesDecoderSpec = new NCrypto::NWzAes::CDecoder;
+ _wzAesDecoder = _wzAesDecoderSpec;
}
- cryptoFilter = _aesDecoder;
+ cryptoFilter = _wzAesDecoder;
Byte properties = aesField.Strength;
- RINOK(_aesDecoderSpec->SetDecoderProperties2(&properties, 1));
+ RINOK(_wzAesDecoderSpec->SetDecoderProperties2(&properties, 1));
}
- #ifdef ZIP_STRONG_SUPORT
else if (pkAesMode)
{
- if (!_zsDecoder)
+ if (!_pkAesDecoder)
{
- _zsDecoderSpec = new NCrypto::NZipStrong::CDecoder;
- _zsDecoder = _zsDecoderSpec;
+ _pkAesDecoderSpec = new NCrypto::NZipStrong::CDecoder;
+ _pkAesDecoder = _pkAesDecoderSpec;
}
- cryptoFilter = _zsDecoder;
+ cryptoFilter = _pkAesDecoder;
}
- #endif
else
{
if (!_zipCryptoDecoder)
@@ -556,11 +549,7 @@ HRESULT CZipDecoder::Decode(
CMyComBSTR password;
RINOK(getTextPassword->CryptoGetTextPassword(&password));
AString charPassword;
- if (aesMode
- #ifdef ZIP_STRONG_SUPORT
- || pkAesMode
- #endif
- )
+ if (wzAesMode || pkAesMode)
{
charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_ACP);
/*
@@ -583,9 +572,9 @@ HRESULT CZipDecoder::Decode(
// we use OEM. WinZip/Windows probably use ANSI for some files
charPassword = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP);
}
- HRESULT res = cryptoSetPassword->CryptoSetPassword(
+ HRESULT result = cryptoSetPassword->CryptoSetPassword(
(const Byte *)(const char *)charPassword, charPassword.Length());
- if (res != S_OK)
+ if (result != S_OK)
return S_OK;
}
else
@@ -660,7 +649,7 @@ HRESULT CZipDecoder::Decode(
#endif
{
- HRESULT result;
+ HRESULT result = S_OK;
CMyComPtr<ISequentialInStream> inStreamNew;
if (item.IsEncrypted())
{
@@ -670,33 +659,42 @@ HRESULT CZipDecoder::Decode(
filterStream = filterStreamSpec;
}
filterStreamSpec->Filter = cryptoFilter;
- if (aesMode)
+ if (wzAesMode)
{
- RINOK(_aesDecoderSpec->ReadHeader(inStream));
+ result = _wzAesDecoderSpec->ReadHeader(inStream);
+ if (result == S_OK)
+ {
+ if (!_wzAesDecoderSpec->CheckPasswordVerifyCode())
+ result = S_FALSE;
+ }
}
- #ifdef ZIP_STRONG_SUPORT
else if (pkAesMode)
{
- RINOK(_zsDecoderSpec->ReadHeader(inStream));
+ result =_pkAesDecoderSpec->ReadHeader(inStream, item.FileCRC, item.UnPackSize);
+ if (result == S_OK)
+ {
+ bool passwOK;
+ result = _pkAesDecoderSpec->CheckPassword(passwOK);
+ if (result == S_OK && !passwOK)
+ result = S_FALSE;
+ }
}
- #endif
else
{
- RINOK(_zipCryptoDecoderSpec->ReadHeader(inStream));
+ result = _zipCryptoDecoderSpec->ReadHeader(inStream);
}
- RINOK(filterStreamSpec->SetInStream(inStream));
- inStreamReleaser.FilterCoder = filterStreamSpec;
- inStreamNew = filterStream;
-
- if (aesMode)
+
+ if (result == S_OK)
{
- if (!_aesDecoderSpec->CheckPasswordVerifyCode())
- return S_OK;
+ RINOK(filterStreamSpec->SetInStream(inStream));
+ inStreamReleaser.FilterCoder = filterStreamSpec;
+ inStreamNew = filterStream;
}
}
else
inStreamNew = inStream;
- result = coder->Code(inStreamNew, outStream, NULL, &item.UnPackSize, compressProgress);
+ if (result == S_OK)
+ result = coder->Code(inStreamNew, outStream, NULL, &item.UnPackSize, compressProgress);
if (result == S_FALSE)
return S_OK;
if (result == E_NOTIMPL)
@@ -711,10 +709,10 @@ HRESULT CZipDecoder::Decode(
bool authOk = true;
if (needCRC)
crcOK = (outStreamSpec->GetCRC() == item.FileCRC);
- if (aesMode)
+ if (wzAesMode)
{
- inStream.Attach(archive.CreateLimitedStream(authenticationPos, NCrypto::NWzAES::kMacSize));
- if (_aesDecoderSpec->CheckMac(inStream, authOk) != S_OK)
+ inStream.Attach(archive.CreateLimitedStream(authenticationPos, NCrypto::NWzAes::kMacSize));
+ if (_wzAesDecoderSpec->CheckMac(inStream, authOk) != S_OK)
authOk = false;
}
diff --git a/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp b/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
index ea46e131..fe2c16e7 100755
--- a/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
+++ b/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp
@@ -1,22 +1,25 @@
-// Zip/HandlerOut.cpp
+// ZipHandlerOut.cpp
#include "StdAfx.h"
-#include "ZipHandler.h"
-#include "ZipUpdate.h"
-
-#include "Common/StringConvert.h"
#include "Common/ComTry.h"
+#include "Common/StringConvert.h"
#include "Common/StringToInt.h"
#include "Windows/PropVariant.h"
#include "Windows/Time.h"
#include "../../IPassword.h"
+
+#include "../../Common/OutBuffer.h"
+
+#include "../../Crypto/WzAes.h"
+
#include "../Common/ItemNameUtils.h"
#include "../Common/ParseProperties.h"
-#include "../../Crypto/WzAES/WzAES.h"
-#include "../../Common/OutBuffer.h"
+
+#include "ZipHandler.h"
+#include "ZipUpdate.h"
using namespace NWindows;
using namespace NCOM;
@@ -253,7 +256,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
return E_INVALIDARG;
if (m_IsAesMode)
{
- if (options.Password.Length() > NCrypto::NWzAES::kPasswordSizeMax)
+ if (options.Password.Length() > NCrypto::NWzAes::kPasswordSizeMax)
return E_INVALIDARG;
}
options.Password = UnicodeStringToMultiByte((const wchar_t *)password, CP_OEMCP);
diff --git a/CPP/7zip/Archive/Zip/ZipUpdate.cpp b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
index b10f801e..5c7e64db 100755
--- a/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+++ b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
@@ -2,27 +2,26 @@
#include "StdAfx.h"
-#include <stdio.h>
-
-#include "ZipUpdate.h"
-#include "ZipAddCommon.h"
-#include "ZipOut.h"
-
-#include "Common/Defs.h"
#include "Common/AutoPtr.h"
+#include "Common/Defs.h"
#include "Common/StringConvert.h"
+
#include "Windows/Defs.h"
#include "Windows/Thread.h"
+#include "../../Common/CreateCoder.h"
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/OutMemStream.h"
#include "../../Common/ProgressUtils.h"
#ifdef COMPRESS_MT
#include "../../Common/ProgressMt.h"
#endif
-#include "../../Common/LimitedStreams.h"
-#include "../../Common/OutMemStream.h"
-#include "../../Common/CreateCoder.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
+
+#include "ZipAddCommon.h"
+#include "ZipOut.h"
+#include "ZipUpdate.h"
using namespace NWindows;
using namespace NSynchronization;
diff --git a/CPP/7zip/Bundles/Alone/Alone.dsp b/CPP/7zip/Bundles/Alone/Alone.dsp
index 22930d9e..fc4e97f0 100755
--- a/CPP/7zip/Bundles/Alone/Alone.dsp
+++ b/CPP/7zip/Bundles/Alone/Alone.dsp
@@ -589,22 +589,6 @@ SOURCE=..\..\Common\LockedStream.h
# End Source File
# Begin Source File
-SOURCE=..\..\Common\LSBFDecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFEncoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFEncoder.h
-# End Source File
-# Begin Source File
-
SOURCE=..\..\Common\MemBlocks.cpp
# End Source File
# Begin Source File
@@ -625,14 +609,6 @@ SOURCE=..\..\Common\MethodProps.h
# End Source File
# Begin Source File
-SOURCE=..\..\Common\MSBFDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\MSBFEncoder.h
-# End Source File
-# Begin Source File
-
SOURCE=..\..\Common\OffsetStream.cpp
# End Source File
# Begin Source File
@@ -707,106 +683,20 @@ SOURCE=..\..\Common\VirtThread.h
# Begin Group "Compress"
# PROP Default_Filter ""
-# Begin Group "Branch"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BCJRegister.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchMisc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchMisc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchRegister.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\Coder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86.cpp
-
-!IF "$(CFG)" == "Alone - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86_2.cpp
-
-!IF "$(CFG)" == "Alone - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86_2.h
-# End Source File
-# End Group
# Begin Group "BZip2"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2CRC.cpp
+SOURCE=..\..\Compress\BZip2Crc.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2CRC.h
+SOURCE=..\..\Compress\BZip2Crc.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Decoder.cpp
+SOURCE=..\..\Compress\BZip2Decoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -827,11 +717,11 @@ SOURCE=..\..\Compress\BZip2\BZip2Decoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Decoder.h
+SOURCE=..\..\Compress\BZip2Decoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Encoder.cpp
+SOURCE=..\..\Compress\BZip2Encoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -852,11 +742,11 @@ SOURCE=..\..\Compress\BZip2\BZip2Encoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Encoder.h
+SOURCE=..\..\Compress\BZip2Encoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Register.cpp
+SOURCE=..\..\Compress\BZip2Register.cpp
# End Source File
# End Group
# Begin Group "Copy"
@@ -864,15 +754,15 @@ SOURCE=..\..\Compress\BZip2\BZip2Register.cpp
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyRegister.cpp
+SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# End Group
# Begin Group "Deflate"
@@ -880,15 +770,15 @@ SOURCE=..\..\Compress\Copy\CopyRegister.cpp
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Deflate\Deflate64Register.cpp
+SOURCE=..\..\Compress\Deflate64Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateConst.h
+SOURCE=..\..\Compress\DeflateConst.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateDecoder.cpp
+SOURCE=..\..\Compress\DeflateDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -909,11 +799,11 @@ SOURCE=..\..\Compress\Deflate\DeflateDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateDecoder.h
+SOURCE=..\..\Compress\DeflateDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateEncoder.cpp
+SOURCE=..\..\Compress\DeflateEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -934,15 +824,15 @@ SOURCE=..\..\Compress\Deflate\DeflateEncoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateEncoder.h
+SOURCE=..\..\Compress\DeflateEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateExtConst.h
+SOURCE=..\..\Compress\DeflateExtConst.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateRegister.cpp
+SOURCE=..\..\Compress\DeflateRegister.cpp
# End Source File
# End Group
# Begin Group "Huffman"
@@ -950,7 +840,7 @@ SOURCE=..\..\Compress\Deflate\DeflateRegister.cpp
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Huffman\HuffmanDecoder.h
+SOURCE=..\..\Compress\HuffmanDecoder.h
# End Source File
# End Group
# Begin Group "Implode"
@@ -958,82 +848,19 @@ SOURCE=..\..\Compress\Huffman\HuffmanDecoder.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Implode\ImplodeDecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Implode\ImplodeDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.h
-# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Group "MT"
-
-# PROP Default_Filter ""
-# End Group
-# Begin Group "HC"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\HashChain\HC.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\HashChain\HC2.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\HashChain\HC3.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\HashChain\HC4.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\HashChain\HC4b.h
+SOURCE=..\..\Compress\ImplodeDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\HashChain\HCMain.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\IMatchFinder.h
+SOURCE=..\..\Compress\ImplodeDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
-
-!IF "$(CFG)" == "Alone - Win32 Release"
-
-# ADD CPP /O1
-
-!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-
-# ADD CPP /O1
-
-!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
-
-!ENDIF
-
+SOURCE=..\..\Compress\ImplodeHuffmanDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
+SOURCE=..\..\Compress\ImplodeHuffmanDecoder.h
# End Source File
# End Group
# Begin Group "LZMA"
@@ -1041,11 +868,11 @@ SOURCE=..\..\Compress\LZ\LZOutWindow.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMA.h
+SOURCE=..\..\Compress\Lzma.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
+SOURCE=..\..\Compress\LzmaDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -1066,11 +893,11 @@ SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMADecoder.h
+SOURCE=..\..\Compress\LzmaDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMAEncoder.cpp
+SOURCE=..\..\Compress\LzmaEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -1091,11 +918,11 @@ SOURCE=..\..\Compress\LZMA\LZMAEncoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMAEncoder.h
+SOURCE=..\..\Compress\LzmaEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
+SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# End Group
# Begin Group "PPMd"
@@ -1103,15 +930,15 @@ SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDContext.h
+SOURCE=..\..\Compress\PpmdContext.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecode.h
+SOURCE=..\..\Compress\PpmdDecode.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
+SOURCE=..\..\Compress\PpmdDecoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -1132,15 +959,15 @@ SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.h
+SOURCE=..\..\Compress\PpmdDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncode.h
+SOURCE=..\..\Compress\PpmdEncode.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncoder.cpp
+SOURCE=..\..\Compress\PpmdEncoder.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -1161,19 +988,19 @@ SOURCE=..\..\Compress\PPMD\PPMDEncoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncoder.h
+SOURCE=..\..\Compress\PpmdEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp
+SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDSubAlloc.h
+SOURCE=..\..\Compress\PpmdSubAlloc.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDType.h
+SOURCE=..\..\Compress\PpmdType.h
# End Source File
# End Group
# Begin Group "RangeCoder"
@@ -1181,38 +1008,19 @@ SOURCE=..\..\Compress\PPMD\PPMDType.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoder.h
+SOURCE=..\..\Compress\RangeCoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.cpp
-
-!IF "$(CFG)" == "Alone - Win32 Release"
-
-# ADD CPP /O1
-
-!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-
-# ADD CPP /O1
-
-!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
-
-!ENDIF
-
+SOURCE=..\..\Compress\RangeCoderBit.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.h
+SOURCE=..\..\Compress\RangeCoderBitTree.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBitTree.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\RangeCoder\RangeCoderOpt.h
+SOURCE=..\..\Compress\RangeCoderOpt.h
# End Source File
# End Group
# Begin Group "Shrink"
@@ -1220,11 +1028,11 @@ SOURCE=..\..\Compress\RangeCoder\RangeCoderOpt.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Shrink\ShrinkDecoder.cpp
+SOURCE=..\..\Compress\ShrinkDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Shrink\ShrinkDecoder.h
+SOURCE=..\..\Compress\ShrinkDecoder.h
# End Source File
# End Group
# Begin Group "Z"
@@ -1232,11 +1040,11 @@ SOURCE=..\..\Compress\Shrink\ShrinkDecoder.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Z\ZDecoder.cpp
+SOURCE=..\..\Compress\ZDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Z\ZDecoder.h
+SOURCE=..\..\Compress\ZDecoder.h
# End Source File
# End Group
# Begin Group "BWT"
@@ -1244,7 +1052,7 @@ SOURCE=..\..\Compress\Z\ZDecoder.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\BWT\Mtf8.h
+SOURCE=..\..\Compress\Mtf8.h
# End Source File
# End Group
# Begin Group "LZX"
@@ -1252,23 +1060,23 @@ SOURCE=..\..\Compress\BWT\Mtf8.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx.h
+SOURCE=..\..\Compress\Lzx.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx86Converter.cpp
+SOURCE=..\..\Compress\Lzx86Converter.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx86Converter.h
+SOURCE=..\..\Compress\Lzx86Converter.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\LzxDecoder.cpp
+SOURCE=..\..\Compress\LzxDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\LzxDecoder.h
+SOURCE=..\..\Compress\LzxDecoder.h
# End Source File
# End Group
# Begin Group "Quantum"
@@ -1276,11 +1084,11 @@ SOURCE=..\..\Compress\Lzx\LzxDecoder.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Quantum\QuantumDecoder.cpp
+SOURCE=..\..\Compress\QuantumDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Quantum\QuantumDecoder.h
+SOURCE=..\..\Compress\QuantumDecoder.h
# End Source File
# End Group
# Begin Group "LZMA_Alone"
@@ -1303,6 +1111,90 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.cpp
SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h
# End Source File
# End Group
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BitlDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BitlDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BitlEncoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BitmDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BitmEncoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\ByteSwap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\ByteSwap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\ByteSwapRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzOutWindow.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzOutWindow.h
+# End Source File
# End Group
# Begin Group "Archive"
@@ -1991,22 +1883,21 @@ SOURCE=..\..\UI\Common\WorkDir.h
# Begin Group "Crypto"
# PROP Default_Filter ""
-# Begin Group "Zip Crypto"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCipher.cpp
+SOURCE=..\..\Crypto\7zAes.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
-# ADD CPP /O1
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-# ADD CPP /O1
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
@@ -2015,22 +1906,25 @@ SOURCE=..\..\Crypto\Zip\ZipCipher.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCipher.h
+SOURCE=..\..\Crypto\7zAes.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCrypto.cpp
+SOURCE=..\..\Crypto\7zAesRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
-# ADD CPP /O1
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-# ADD CPP /O1
-
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
@@ -2038,15 +1932,11 @@ SOURCE=..\..\Crypto\Zip\ZipCrypto.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCrypto.h
+SOURCE=..\..\Crypto\HmacSha1.h
# End Source File
-# End Group
-# Begin Group "AES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.cpp
+SOURCE=..\..\Crypto\MyAes.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -2067,15 +1957,11 @@ SOURCE=..\..\Crypto\AES\MyAES.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.h
+SOURCE=..\..\Crypto\MyAes.h
# End Source File
-# End Group
-# Begin Group "7z AES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.cpp
+SOURCE=..\..\Crypto\Pbkdf2HmacSha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -2086,9 +1972,6 @@ SOURCE=..\..\Crypto\7zAES\7zAES.cpp
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
@@ -2096,53 +1979,19 @@ SOURCE=..\..\Crypto\7zAES\7zAES.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp
-# End Source File
-# End Group
-# Begin Group "WzAES"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Crypto\WzAES\WzAES.cpp
+SOURCE=..\..\Crypto\Pbkdf2HmacSha1.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\WzAES\WzAES.h
-# End Source File
-# End Group
-# Begin Group "Hash"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Crypto\Hash\HmacSha1.cpp
-
-!IF "$(CFG)" == "Alone - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
-
-!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
-
-!ENDIF
-
+SOURCE=..\..\Crypto\RandGen.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\HmacSha1.h
+SOURCE=..\..\Crypto\RandGen.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.cpp
+SOURCE=..\..\Crypto\Sha1.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
@@ -2160,29 +2009,30 @@ SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.h
+SOURCE=..\..\Crypto\Sha1.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\RandGen.cpp
+SOURCE=..\..\Crypto\WzAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\RandGen.h
+SOURCE=..\..\Crypto\WzAes.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Sha1.cpp
+SOURCE=..\..\Crypto\ZipCrypto.cpp
!IF "$(CFG)" == "Alone - Win32 Release"
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
+# ADD CPP /O1
!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+# ADD CPP /O1
+
!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
!ENDIF
@@ -2190,9 +2040,16 @@ SOURCE=..\..\Crypto\Hash\Sha1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Sha1.h
+SOURCE=..\..\Crypto\ZipCrypto.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\ZipStrong.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\ZipStrong.h
# End Source File
-# End Group
# End Group
# Begin Group "7-zip"
diff --git a/CPP/7zip/Bundles/Alone/makefile b/CPP/7zip/Bundles/Alone/makefile
index 234153b3..2b948601 100755
--- a/CPP/7zip/Bundles/Alone/makefile
+++ b/CPP/7zip/Bundles/Alone/makefile
@@ -58,8 +58,6 @@ WIN_OBJS = \
$O\InOutTempBuffer.obj \
$O\LimitedStreams.obj \
$O\LockedStream.obj \
- $O\LSBFDecoder.obj \
- $O\LSBFEncoder.obj \
$O\MemBlocks.obj \
$O\MethodId.obj \
$O\MethodProps.obj \
@@ -182,88 +180,57 @@ ZIP_OBJS = \
$O\ZipRegister.obj \
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BitlDecoder.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-BZIP2_OBJS = \
$O\BZip2CRC.obj \
- $O\BZip2Register.obj \
-
-BZIP2_OPT_OBJS = \
$O\BZip2Decoder.obj \
$O\BZip2Encoder.obj \
-
-COPY_OBJS = \
+ $O\BZip2Register.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-DEFLATE_OPT_OBJS = \
+ $O\Deflate64Register.obj \
$O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \
$O\DeflateRegister.obj \
- $O\Deflate64Register.obj \
-
-LZ_OBJS = \
- $O\LzOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
-
-LZMA_BENCH_OBJS = \
- $O\LzmaBench.obj \
- $O\LzmaBenchCon.obj \
-
-LZX_OBJS = \
- $O\LzxDecoder.obj \
- $O\Lzx86Converter.obj \
-
-IMPLODE_OBJS = \
$O\ImplodeDecoder.obj \
$O\ImplodeHuffmanDecoder.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDEncoder.obj \
- $O\PPMDRegister.obj \
-
-SHRINK_OBJS = \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+ $O\LzOutWindow.obj \
+ $O\Lzx86Converter.obj \
+ $O\LzxDecoder.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdEncoder.obj \
+ $O\PpmdRegister.obj \
+ $O\QuantumDecoder.obj \
$O\ShrinkDecoder.obj \
-
-COMPRESS_Z_OBJS = \
$O\ZDecoder.obj \
+LZMA_BENCH_OBJS = \
+ $O\LzmaBench.obj \
+ $O\LzmaBenchCon.obj \
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
-
-CRYPTO_HASH_OBJS = \
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
$O\HmacSha1.obj \
+ $O\MyAes.obj \
$O\Pbkdf2HmacSha1.obj \
$O\RandGen.obj \
$O\Sha1.obj \
-
-CRYPTO_WZAES_OBJS = \
- $O\WzAES.obj \
-
-CRYPTO_ZIP_OBJS = \
- $O\ZipCipher.obj \
+ $O\WzAes.obj \
$O\ZipCrypto.obj \
+ $O\ZipStrong.obj \
C_OBJS = \
$O\Alloc.obj \
@@ -301,28 +268,10 @@ OBJS = \
$(SPLIT_OBJS) \
$(TAR_OBJS) \
$(ZIP_OBJS) \
- $(BZIP2_OBJS) \
- $(BZIP2_OPT_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(COPY_OBJS) \
- $(DEFLATE_OPT_OBJS) \
- $(IMPLODE_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
+ $(COMPRESS_OBJS) \
$(LZMA_BENCH_OBJS) \
- $(LZX_OBJS) \
- $(PPMD_OPT_OBJS) \
- $(SHRINK_OBJS) \
- $(COMPRESS_Z_OBJS) \
+ $(CRYPTO_OBJS) \
$(C_OBJS) \
- $O\RangeCoderBit.obj \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
- $(CRYPTO_HASH_OBJS) \
- $(CRYPTO_ZIP_OBJS) \
- $(CRYPTO_WZAES_OBJS) \
- $O\QuantumDecoder.obj \
$(CRC_OBJS) \
$O\resource.res
@@ -362,50 +311,13 @@ $(TAR_OBJS): ../../Archive/Tar/$(*B).cpp
$(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
$(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL)
-$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
- $(COMPL_O2)
-$(IMPLODE_OBJS): ../../Compress/Implode/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL_O2)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL_O2)
-$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
- $(COMPL)
-
-$(LZX_OBJS): ../../Compress/Lzx/$(*B).cpp
- $(COMPL_O2)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL_O2)
-$(SHRINK_OBJS): ../../Compress/Shrink/$(*B).cpp
- $(COMPL)
-$(COMPRESS_Z_OBJS): ../../Compress/Z/$(*B).cpp
- $(COMPL)
-$O\RangeCoderBit.obj: ../../Compress/RangeCoder/$(*B).cpp
- $(COMPL)
-$O\QuantumDecoder.obj: ../../Compress/Quantum/$(*B).cpp
+$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL)
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
- $(COMPL_O2)
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
- $(COMPL_O2)
-$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
- $(COMPL_O2)
-$(CRYPTO_ZIP_OBJS): ../../Crypto/Zip/$(*B).cpp
- $(COMPL)
-$(CRYPTO_WZAES_OBJS): ../../Crypto/WzAES/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c
diff --git a/CPP/7zip/Bundles/Alone7z/makefile b/CPP/7zip/Bundles/Alone7z/makefile
index 404c813d..d255af78 100755
--- a/CPP/7zip/Bundles/Alone7z/makefile
+++ b/CPP/7zip/Bundles/Alone7z/makefile
@@ -132,27 +132,21 @@ SPLIT_OBJS = \
$O\SplitHandlerOut.obj \
$O\SplitRegister.obj \
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-COPY_OBJS = \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
LZMA_BENCH_OBJS = \
$O\LzmaBench.obj \
@@ -181,10 +175,7 @@ OBJS = \
$(7Z_OBJS) \
$(LZM_OBJS) \
$(SPLIT_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(COPY_OBJS) \
- $(LZMA_OPT_OBJS) \
+ $(COMPRESS_OBJS) \
$(LZMA_BENCH_OBJS) \
$(C_OBJS) \
$(CRC_OBJS) \
@@ -213,13 +204,7 @@ $(LZM_OBJS): ../../Archive/Lzma/$(*B).cpp
$(COMPL)
$(SPLIT_OBJS): ../../Archive/Split/$(*B).cpp
$(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL_O2)
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL)
diff --git a/CPP/7zip/Bundles/Format7z/makefile b/CPP/7zip/Bundles/Format7z/makefile
index b839ebac..65be7a0c 100755
--- a/CPP/7zip/Bundles/Format7z/makefile
+++ b/CPP/7zip/Bundles/Format7z/makefile
@@ -33,7 +33,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \
$O\LimitedStreams.obj \
$O\LockedStream.obj \
- $O\LSBFDecoder.obj \
$O\MethodId.obj \
$O\MethodProps.obj \
$O\OutBuffer.obj \
@@ -78,57 +77,37 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \
$O\CodecExports.obj \
-
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BitlDecoder.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-BZIP2_OBJS = \
- $O\BZip2CRC.obj \
- $O\BZip2Register.obj \
-
-BZIP2_OPT_OBJS = \
+ $O\BZip2Crc.obj \
$O\BZip2Decoder.obj \
-
-COPY_OBJS = \
+ $O\BZip2Encoder.obj \
+ $O\BZip2Register.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \
+ $O\DeflateEncoder.obj \
$O\DeflateRegister.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDEncoder.obj \
- $O\PPMDRegister.obj \
-
-
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
-
-CRYPTO_HASH_OBJS = \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+ $O\LzOutWindow.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdEncoder.obj \
+ $O\PpmdRegister.obj \
+
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
$O\RandGen.obj \
$O\Sha1.obj \
@@ -137,11 +116,14 @@ C_OBJS = \
$O\Bra.obj \
$O\Bra86.obj \
$O\BraIA64.obj \
+ $O\BwtSort.obj \
+ $O\HuffEnc.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
$O\LzmaDec.obj \
$O\LzmaEnc.obj \
+ $O\Sort.obj \
$O\Threads.obj \
- $O\LzFind.obj \
- $O\LzFindMt.obj \
$O\Aes.obj \
$O\Sha256.obj \
@@ -157,19 +139,8 @@ OBJS = \
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
$(COMPRESS_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(BZIP2_OBJS) \
- $(BZIP2_OPT_OBJS) \
- $(COPY_OBJS) \
- $(DEFLATE_OPT_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(PPMD_OPT_OBJS) \
+ $(CRYPTO_OBJS) \
$(C_OBJS) \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
- $(CRYPTO_HASH_OBJS) \
$(CRC_OBJS) \
$O\resource.res
@@ -191,31 +162,9 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL)
-$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
- $(COMPL_O2)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL_O2)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2)
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
- $(COMPL_O2)
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
- $(COMPL_O2)
-$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c
diff --git a/CPP/7zip/Bundles/Format7zExtract/makefile b/CPP/7zip/Bundles/Format7zExtract/makefile
index 55cad33e..c8ef3df8 100755
--- a/CPP/7zip/Bundles/Format7zExtract/makefile
+++ b/CPP/7zip/Bundles/Format7zExtract/makefile
@@ -31,7 +31,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \
$O\LimitedStreams.obj \
$O\LockedStream.obj \
- $O\LSBFDecoder.obj \
$O\MethodId.obj \
$O\OutBuffer.obj \
$O\ProgressUtils.obj \
@@ -66,53 +65,33 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \
$O\CodecExports.obj \
-
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BitlDecoder.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-BZIP2_OBJS = \
- $O\BZip2CRC.obj \
- $O\BZip2Register.obj \
-
-BZIP2_OPT_OBJS = \
+ $O\BZip2Crc.obj \
$O\BZip2Decoder.obj \
-
-COPY_OBJS = \
+ $O\BZip2Register.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-DEFLATE_OPT_OBJS = \
$O\DeflateDecoder.obj \
$O\DeflateRegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+ $O\LzOutWindow.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdRegister.obj \
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMARegister.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDRegister.obj \
-
-
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
C_OBJS = \
$O\Alloc.obj \
@@ -136,17 +115,7 @@ OBJS = \
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
$(COMPRESS_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(BZIP2_OBJS) \
- $(BZIP2_OPT_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(COPY_OBJS) \
- $(DEFLATE_OPT_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(PPMD_OPT_OBJS) \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
+ $(CRYPTO_OBJS) \
$(C_OBJS) \
$(CRC_OBJS) \
$O\resource.res
@@ -169,30 +138,11 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL)
-$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
- $(COMPL_O2)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL_O2)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
$(COMPL_O2)
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
- $(COMPL_O2)
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
+
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
diff --git a/CPP/7zip/Bundles/Format7zExtractR/makefile b/CPP/7zip/Bundles/Format7zExtractR/makefile
index 55069721..f544083b 100755
--- a/CPP/7zip/Bundles/Format7zExtractR/makefile
+++ b/CPP/7zip/Bundles/Format7zExtractR/makefile
@@ -68,27 +68,19 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \
$O\CodecExports.obj \
-
-SWAP_OPT_OBJS = \
- $O\ByteSwap.obj \
- $O\ByteSwapRegister.obj \
-
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-COPY_OBJS = \
+ $O\ByteSwap.obj \
+ $O\ByteSwapRegister.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMARegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
C_OBJS = \
$O\7zCrc.obj \
@@ -109,10 +101,6 @@ OBJS = \
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
$(COMPRESS_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(COPY_OBJS) \
- $(LZMA_OPT_OBJS) \
$(C_OBJS) \
$O\resource.res
@@ -134,14 +122,6 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c
diff --git a/CPP/7zip/Bundles/Format7zF/Format7z.dsp b/CPP/7zip/Bundles/Format7zF/Format7z.dsp
index 16d89635..c80e4f64 100755
--- a/CPP/7zip/Bundles/Format7zF/Format7z.dsp
+++ b/CPP/7zip/Bundles/Format7zF/Format7z.dsp
@@ -324,558 +324,417 @@ SOURCE=..\..\..\Common\Wildcard.h
# Begin Group "Compress"
# PROP Default_Filter ""
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
-# End Source File
-# End Group
# Begin Group "PPMD"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDContext.h
+SOURCE=..\..\Compress\PpmdContext.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecode.h
+SOURCE=..\..\Compress\PpmdDecode.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.h
+SOURCE=..\..\Compress\PpmdDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncode.h
+SOURCE=..\..\Compress\PpmdEncode.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\PpmdEncoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDEncoder.h
+SOURCE=..\..\Compress\PpmdEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp
+SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDSubAlloc.h
+SOURCE=..\..\Compress\PpmdSubAlloc.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDType.h
+SOURCE=..\..\Compress\PpmdType.h
# End Source File
# End Group
-# Begin Group "Branch"
+# Begin Group "Bit Coder"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
+SOURCE=..\..\Compress\BitlDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJRegister.cpp
+SOURCE=..\..\Compress\BitlDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
+SOURCE=..\..\Compress\BitlEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.h
+SOURCE=..\..\Compress\BitmDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchMisc.cpp
+SOURCE=..\..\Compress\BitmEncoder.h
# End Source File
+# End Group
+# Begin Group "Rar Compress"
+
+# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchMisc.h
+SOURCE=..\..\Compress\Rar1Decoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchRegister.cpp
+SOURCE=..\..\Compress\Rar1Decoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\Rar2Decoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86.h
+SOURCE=..\..\Compress\Rar2Decoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86_2.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
+SOURCE=..\..\Compress\Rar3Decoder.cpp
+# End Source File
+# Begin Source File
-# SUBTRACT CPP /YX /Yc /Yu
+SOURCE=..\..\Compress\Rar3Decoder.h
+# End Source File
+# Begin Source File
-!ENDIF
+SOURCE=..\..\Compress\Rar3Vm.cpp
+# End Source File
+# Begin Source File
+SOURCE=..\..\Compress\Rar3Vm.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86_2.h
+SOURCE=..\..\Compress\RarCodecsRegister.cpp
# End Source File
# End Group
-# Begin Group "LZMA"
+# Begin Group "BZip2 Compress"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMA.h
+SOURCE=..\..\Compress\BZip2Const.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\BZip2Crc.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMADecoder.h
+SOURCE=..\..\Compress\BZip2Crc.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMAEncoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\BZip2Decoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMAEncoder.h
+SOURCE=..\..\Compress\BZip2Decoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
+SOURCE=..\..\Compress\BZip2Encoder.cpp
# End Source File
-# End Group
-# Begin Group "Copy"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\BZip2Encoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\BZip2Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyRegister.cpp
+SOURCE=..\..\Compress\Mtf8.h
# End Source File
# End Group
-# Begin Group "RangeCoder"
+# Begin Group "Zip Compress"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoder.h
+SOURCE=..\..\Compress\Deflate64Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.cpp
+SOURCE=..\..\Compress\DeflateConst.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBit.h
+SOURCE=..\..\Compress\DeflateDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderBitTree.h
+SOURCE=..\..\Compress\DeflateDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\RangeCoder\RangeCoderOpt.h
+SOURCE=..\..\Compress\DeflateEncoder.cpp
# End Source File
-# End Group
-# Begin Group "Deflate"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Deflate\Deflate64Register.cpp
+SOURCE=..\..\Compress\DeflateEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateConst.h
+SOURCE=..\..\Compress\DeflateNsisRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateDecoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-!ENDIF
-
+SOURCE=..\..\Compress\DeflateRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateDecoder.h
+SOURCE=..\..\Compress\ImplodeDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateEncoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-!ENDIF
+SOURCE=..\..\Compress\ImplodeDecoder.h
+# End Source File
+# Begin Source File
+SOURCE=..\..\Compress\ImplodeHuffmanDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateEncoder.h
+SOURCE=..\..\Compress\ImplodeHuffmanDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateNsisRegister.cpp
+SOURCE=..\..\Compress\ShrinkDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\DeflateRegister.cpp
+SOURCE=..\..\Compress\ShrinkDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\ZlibDecoder.cpp
+SOURCE=..\..\Compress\ZlibDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Deflate\ZlibDecoder.h
+SOURCE=..\..\Compress\ZlibDecoder.h
# End Source File
# End Group
-# Begin Group "BZip2"
+# Begin Group "7z Compress"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Const.h
+SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2CRC.cpp
+SOURCE=..\..\Compress\Bcj2Coder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2CRC.h
+SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Decoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-!ENDIF
-
+SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Decoder.h
+SOURCE=..\..\Compress\BcjCoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Encoder.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
+SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Encoder.h
+SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BZip2\BZip2Register.cpp
+SOURCE=..\..\Compress\BranchCoder.h
# End Source File
-# End Group
-# Begin Group "Rar Codecs"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar1Decoder.cpp
+SOURCE=..\..\Compress\BranchMisc.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar1Decoder.h
+SOURCE=..\..\Compress\BranchMisc.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar2Decoder.cpp
+SOURCE=..\..\Compress\BranchRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar2Decoder.h
+SOURCE=..\..\Compress\ByteSwap.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar3Decoder.cpp
+SOURCE=..\..\Compress\ByteSwap.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar3Decoder.h
+SOURCE=..\..\Compress\ByteSwapRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar3Vm.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\Rar3Vm.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Rar\RarCodecsRegister.cpp
+SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
-# End Group
-# Begin Group "BWT"
+# Begin Source File
-# PROP Default_Filter ""
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
# Begin Source File
-SOURCE=..\..\Compress\BWT\Mtf8.h
+SOURCE=..\..\Compress\LzmaDecoder.h
# End Source File
-# End Group
-# Begin Group "Implode"
+# Begin Source File
-# PROP Default_Filter ""
+SOURCE=..\..\Compress\LzmaEncoder.cpp
+# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Implode\ImplodeDecoder.cpp
+SOURCE=..\..\Compress\LzmaEncoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Implode\ImplodeDecoder.h
+SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.cpp
+SOURCE=..\..\Compress\RangeCoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Implode\ImplodeHuffmanDecoder.h
+SOURCE=..\..\Compress\RangeCoderBit.h
# End Source File
# End Group
-# Begin Group "Lzx"
+# Begin Group "Cab Compress"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx.h
+SOURCE=..\..\Compress\Lzx.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx86Converter.cpp
+SOURCE=..\..\Compress\Lzx86Converter.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\Lzx86Converter.h
+SOURCE=..\..\Compress\Lzx86Converter.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\LzxDecoder.cpp
+SOURCE=..\..\Compress\LzxDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzx\LzxDecoder.h
+SOURCE=..\..\Compress\LzxDecoder.h
# End Source File
-# End Group
-# Begin Group "Z Codec"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Z\ZDecoder.cpp
+SOURCE=..\..\Compress\QuantumDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Z\ZDecoder.h
+SOURCE=..\..\Compress\QuantumDecoder.h
# End Source File
# End Group
-# Begin Group "Arj Codecs"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Arj\ArjDecoder1.cpp
+SOURCE=..\..\Compress\ArjDecoder1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Arj\ArjDecoder1.h
+SOURCE=..\..\Compress\ArjDecoder1.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Arj\ArjDecoder2.cpp
+SOURCE=..\..\Compress\ArjDecoder2.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Arj\ArjDecoder2.h
+SOURCE=..\..\Compress\ArjDecoder2.h
# End Source File
-# End Group
-# Begin Group "ByteSwap"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\ByteSwap\ByteSwap.cpp
+SOURCE=..\..\Compress\HuffmanDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\ByteSwap\ByteSwap.h
+SOURCE=..\..\Compress\LzhDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\ByteSwap\ByteSwapRegister.cpp
+SOURCE=..\..\Compress\LzhDecoder.h
# End Source File
-# End Group
-# Begin Group "Shrink"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Shrink\ShrinkDecoder.cpp
+SOURCE=..\..\Compress\LzOutWindow.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Shrink\ShrinkDecoder.h
+SOURCE=..\..\Compress\LzOutWindow.h
# End Source File
-# End Group
-# Begin Group "Quantum"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Quantum\QuantumDecoder.cpp
+SOURCE=..\..\Compress\ZDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Quantum\QuantumDecoder.h
+SOURCE=..\..\Compress\ZDecoder.h
# End Source File
# End Group
-# Begin Group "Lzh Codecs"
+# Begin Group "Crypto"
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Lzh\LzhDecoder.cpp
+SOURCE=..\..\Crypto\7zAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Lzh\LzhDecoder.h
+SOURCE=..\..\Crypto\7zAes.h
# End Source File
-# End Group
-# End Group
-# Begin Group "Crypto"
-
-# PROP Default_Filter ""
-# Begin Group "AES"
+# Begin Source File
-# PROP Default_Filter ""
+SOURCE=..\..\Crypto\7zAesRegister.cpp
+# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.cpp
+SOURCE=..\..\Crypto\HmacSha1.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -884,22 +743,24 @@ SOURCE=..\..\Crypto\AES\MyAES.cpp
!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-# SUBTRACT CPP /YX /Yc /Yu
-
!ENDIF
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.h
+SOURCE=..\..\Crypto\HmacSha1.h
# End Source File
-# End Group
-# Begin Group "7zAES"
+# Begin Source File
-# PROP Default_Filter ""
+SOURCE=..\..\Crypto\MyAes.cpp
+# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.cpp
+SOURCE=..\..\Crypto\MyAes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\Pbkdf2HmacSha1.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -908,26 +769,16 @@ SOURCE=..\..\Crypto\7zAES\7zAES.cpp
!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-# SUBTRACT CPP /YX /Yc /Yu
-
!ENDIF
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp
+SOURCE=..\..\Crypto\Pbkdf2HmacSha1.h
# End Source File
-# End Group
-# Begin Group "Hash"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\Hash\HmacSha1.cpp
+SOURCE=..\..\Crypto\RandGen.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -941,11 +792,11 @@ SOURCE=..\..\Crypto\Hash\HmacSha1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\HmacSha1.h
+SOURCE=..\..\Crypto\RandGen.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.cpp
+SOURCE=..\..\Crypto\Rar20Crypto.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -959,29 +810,19 @@ SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Pbkdf2HmacSha1.h
+SOURCE=..\..\Crypto\Rar20Crypto.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\RandGen.cpp
-
-!IF "$(CFG)" == "7z - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "7z - Win32 Debug"
-
-!ENDIF
-
+SOURCE=..\..\Crypto\RarAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\RandGen.h
+SOURCE=..\..\Crypto\RarAes.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Sha1.cpp
+SOURCE=..\..\Crypto\Sha1.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -995,47 +836,19 @@ SOURCE=..\..\Crypto\Hash\Sha1.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Hash\Sha1.h
+SOURCE=..\..\Crypto\Sha1.h
# End Source File
-# End Group
-# Begin Group "RarAES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\RarAES\RarAES.cpp
+SOURCE=..\..\Crypto\WzAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\RarAES\RarAES.h
+SOURCE=..\..\Crypto\WzAes.h
# End Source File
-# End Group
-# Begin Group "RarCrypto"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Crypto\Rar20\Rar20Cipher.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\Rar20\Rar20Cipher.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\Rar20\Rar20Crypto.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\Rar20\Rar20Crypto.h
-# End Source File
-# End Group
-# Begin Group "WzAES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\WzAES\WzAES.cpp
+SOURCE=..\..\Crypto\ZipCrypto.cpp
!IF "$(CFG)" == "7z - Win32 Release"
@@ -1049,34 +862,27 @@ SOURCE=..\..\Crypto\WzAES\WzAES.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\WzAES\WzAES.h
+SOURCE=..\..\Crypto\ZipCrypto.h
# End Source File
-# End Group
-# Begin Group "ZipCrypto"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCipher.cpp
-# End Source File
-# Begin Source File
+SOURCE=..\..\Crypto\ZipStrong.cpp
-SOURCE=..\..\Crypto\Zip\ZipCipher.h
-# End Source File
-# Begin Source File
+!IF "$(CFG)" == "7z - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "7z - Win32 Debug"
+
+!ENDIF
-SOURCE=..\..\Crypto\Zip\ZipCrypto.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\Zip\ZipCrypto.h
+SOURCE=..\..\Crypto\ZipStrong.h
# End Source File
# End Group
-# Begin Group "ZipStrong"
-
-# PROP Default_Filter ""
-# End Group
-# End Group
# Begin Group "7zip Common"
# PROP Default_Filter ""
@@ -1130,22 +936,6 @@ SOURCE=..\..\Common\LockedStream.h
# End Source File
# Begin Source File
-SOURCE=..\..\Common\LSBFDecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFEncoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LSBFEncoder.h
-# End Source File
-# Begin Source File
-
SOURCE=..\..\Common\MemBlocks.cpp
# End Source File
# Begin Source File
diff --git a/CPP/7zip/Bundles/Format7zF/makefile b/CPP/7zip/Bundles/Format7zF/makefile
index fb2a1f91..18a2d731 100755
--- a/CPP/7zip/Bundles/Format7zF/makefile
+++ b/CPP/7zip/Bundles/Format7zF/makefile
@@ -38,8 +38,6 @@ WIN_OBJS = \
$O\FilterCoder.obj \
$O\LimitedStreams.obj \
$O\LockedStream.obj \
- $O\LSBFDecoder.obj \
- $O\LSBFEncoder.obj \
$O\MethodId.obj \
$O\MethodProps.obj \
$O\MemBlocks.obj \
@@ -213,107 +211,64 @@ ZIP_OBJS = \
COMPRESS_OBJS = \
$O\CodecExports.obj \
-
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+ $O\ArjDecoder1.obj \
+ $O\ArjDecoder2.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BitlDecoder.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-BZIP2_OBJS = \
- $O\BZip2CRC.obj \
- $O\BZip2Register.obj \
-
-BZIP2_OPT_OBJS = \
+ $O\BZip2Crc.obj \
$O\BZip2Decoder.obj \
$O\BZip2Encoder.obj \
-
-COPY_OBJS = \
+ $O\BZip2Register.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-DEFLATE_OPT_OBJS = \
+ $O\Deflate64Register.obj \
$O\DeflateDecoder.obj \
$O\DeflateEncoder.obj \
- $O\DeflateRegister.obj \
- $O\Deflate64Register.obj \
$O\DeflateNsisRegister.obj \
- $O\ZlibDecoder.obj \
-
-IMPLODE_OBJS = \
+ $O\DeflateRegister.obj \
$O\ImplodeDecoder.obj \
$O\ImplodeHuffmanDecoder.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
-
-LZX_OBJS = \
- $O\LzxDecoder.obj \
+ $O\LzhDecoder.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+ $O\LzOutWindow.obj \
$O\Lzx86Converter.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDEncoder.obj \
- $O\PPMDRegister.obj \
-
-RAR29_OPT_OBJS = \
+ $O\LzxDecoder.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdEncoder.obj \
+ $O\PpmdRegister.obj \
+ $O\QuantumDecoder.obj \
$O\Rar1Decoder.obj \
$O\Rar2Decoder.obj \
$O\Rar3Decoder.obj \
$O\Rar3Vm.obj \
$O\RarCodecsRegister.obj \
-
-SHRINK_OBJS = \
$O\ShrinkDecoder.obj \
-
-COMPRESS_ARJ_OBJS = \
- $O\ArjDecoder1.obj \
- $O\ArjDecoder2.obj \
-
-COMPRESS_LZH_OBJS = \
- $O\LzhDecoder.obj \
-
-COMPRESS_Z_OBJS = \
+ $O\ZlibDecoder.obj \
$O\ZDecoder.obj \
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
-
-CRYPTO_HASH_OBJS = \
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
$O\HmacSha1.obj \
+ $O\MyAes.obj \
$O\Pbkdf2HmacSha1.obj \
$O\RandGen.obj \
+ $O\Rar20Crypto.obj \
+ $O\RarAes.obj \
$O\Sha1.obj \
-
-CRYPTO_WZAES_OBJS = \
- $O\WzAES.obj \
-
-CRYPTO_ZIP_OBJS = \
- $O\ZipCipher.obj \
+ $O\WzAes.obj \
$O\ZipCrypto.obj \
-
-CRYPTO_RAR20_OBJS = \
- $O\Rar20Cipher.obj \
- $O\Rar20Crypto.obj \
-
-CRYPTO_RARAES_OBJS = \
- $O\RarAES.obj \
+ $O\ZipStrong.obj \
C_OBJS = \
@@ -360,33 +315,9 @@ OBJS = \
$(UDF_OBJS) \
$(WIM_OBJS) \
$(ZIP_OBJS) \
- $(BZIP2_OBJS) \
- $(BZIP2_OPT_OBJS) \
$(COMPRESS_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(COPY_OBJS) \
- $(DEFLATE_OPT_OBJS) \
- $(IMPLODE_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(LZX_OBJS) \
- $(PPMD_OPT_OBJS) \
- $(RAR29_OPT_OBJS) \
- $(SHRINK_OBJS) \
- $(COMPRESS_ARJ_OBJS) \
- $(COMPRESS_LZH_OBJS) \
- $(COMPRESS_Z_OBJS) \
- $O\QuantumDecoder.obj \
+ $(CRYPTO_OBJS) \
$(C_OBJS) \
- $O\RangeCoderBit.obj \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
- $(CRYPTO_ZIP_OBJS) \
- $(CRYPTO_WZAES_OBJS) \
- $(CRYPTO_HASH_OBJS) \
- $(CRYPTO_RAR20_OBJS) \
- $(CRYPTO_RARAES_OBJS) \
$(CRC_OBJS) \
$O\resource.res
@@ -442,59 +373,10 @@ $(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
$(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(BZIP2_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL)
-$(BZIP2_OPT_OBJS): ../../Compress/BZip2/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(DEFLATE_OPT_OBJS): ../../Compress/Deflate/$(*B).cpp
- $(COMPL_O2)
-$(IMPLODE_OBJS): ../../Compress/Implode/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
-$(LZX_OBJS): ../../Compress/Lzx/$(*B).cpp
- $(COMPL_O2)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
- $(COMPL_O2)
-$(RAR29_OPT_OBJS): ../../Compress/Rar/$(*B).cpp
- $(COMPL_O2)
-$(SHRINK_OBJS): ../../Compress/Shrink/$(*B).cpp
- $(COMPL)
-$(COMPRESS_ARJ_OBJS): ../../Compress/Arj/$(*B).cpp
- $(COMPL)
-$(COMPRESS_LZH_OBJS): ../../Compress/Lzh/$(*B).cpp
- $(COMPL)
-$(COMPRESS_Z_OBJS): ../../Compress/Z/$(*B).cpp
- $(COMPL)
-$O\QuantumDecoder.obj: ../../Compress/Quantum/$(*B).cpp
- $(COMPL)
-$O\RangeCoderBit.obj: ../../Compress/RangeCoder/$(*B).cpp
- $(COMPL)
-
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
- $(COMPL_O2)
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
- $(COMPL_O2)
-$(CRYPTO_ZIP_OBJS): ../../Crypto/Zip/$(*B).cpp
- $(COMPL)
-$(CRYPTO_WZAES_OBJS): ../../Crypto/WzAES/$(*B).cpp
- $(COMPL_O2)
-$(CRYPTO_HASH_OBJS): ../../Crypto/Hash/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL_O2)
-$(CRYPTO_RAR20_OBJS): ../../Crypto/Rar20/$(*B).cpp
- $(COMPL)
-$(CRYPTO_RARAES_OBJS): ../../Crypto/RarAES/$(*B).cpp
- $(COMPL)
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
diff --git a/CPP/7zip/Bundles/Format7zR/makefile b/CPP/7zip/Bundles/Format7zR/makefile
index 7fd28ad5..b103f2a6 100755
--- a/CPP/7zip/Bundles/Format7zR/makefile
+++ b/CPP/7zip/Bundles/Format7zR/makefile
@@ -75,28 +75,20 @@ AR_COMMON_OBJS = \
COMPRESS_OBJS = \
$O\CodecExports.obj \
-
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\BranchCoder.obj \
$O\BranchMisc.obj \
$O\BranchRegister.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-SWAP_OPT_OBJS = \
$O\ByteSwap.obj \
$O\ByteSwapRegister.obj \
-
-COPY_OBJS = \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
C_OBJS = \
$O\7zCrc.obj \
@@ -119,15 +111,7 @@ OBJS = \
$(AR_OBJS) \
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
- $(BZIP2_OBJS) \
- $(BZIP2_OPT_OBJS) \
$(COMPRESS_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(SWAP_OPT_OBJS) \
- $(COPY_OBJS) \
- $(DEFLATE_OPT_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(PPMD_OPT_OBJS) \
$(C_OBJS) \
$O\resource.res
@@ -149,14 +133,6 @@ $(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL_O2)
-$(SWAP_OPT_OBJS): ../../Compress/ByteSwap/$(*B).cpp
- $(COMPL_O2)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
$(COMPL_O2)
$(C_OBJS): ../../../../C/$(*B).c
diff --git a/CPP/7zip/Bundles/SFXCon/SFXCon.dsp b/CPP/7zip/Bundles/SFXCon/SFXCon.dsp
index 7d1f73a2..8dc222a5 100755
--- a/CPP/7zip/Bundles/SFXCon/SFXCon.dsp
+++ b/CPP/7zip/Bundles/SFXCon/SFXCon.dsp
@@ -255,127 +255,75 @@ SOURCE=..\..\Archive\7z\7zRegister.cpp
# Begin Group "Compress"
# PROP Default_Filter ""
-# Begin Group "LZMA"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
-# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
+SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
-# End Group
-# Begin Group "Branch"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
+SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJRegister.cpp
+SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
+SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.h
+SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86_2.cpp
+SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
-# End Group
-# Begin Group "PPMD"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
+SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp
+SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
+SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
+SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File
# End Group
-# Begin Group "Copy"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyRegister.cpp
-# End Source File
-# End Group
-# End Group
# Begin Group "Crypto"
# PROP Default_Filter ""
-# Begin Group "7zAES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.cpp
+SOURCE=..\..\Crypto\7zAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.h
+SOURCE=..\..\Crypto\7zAes.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp
+SOURCE=..\..\Crypto\7zAesRegister.cpp
# End Source File
-# End Group
-# Begin Group "AES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.cpp
+SOURCE=..\..\Crypto\MyAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\AES\MyAES.h
+SOURCE=..\..\Crypto\MyAes.h
# End Source File
# End Group
-# Begin Group "Hash"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Crypto\Hash\RotateDefs.h
-# End Source File
-# End Group
-# End Group
# Begin Group "Windows"
# PROP Default_Filter ""
diff --git a/CPP/7zip/Bundles/SFXCon/makefile b/CPP/7zip/Bundles/SFXCon/makefile
index 4bfe7f3d..a18aa7ac 100755
--- a/CPP/7zip/Bundles/SFXCon/makefile
+++ b/CPP/7zip/Bundles/SFXCon/makefile
@@ -81,34 +81,23 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \
$O\7zRegister.obj \
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+COMPRESS_OBJS = \
$O\BranchCoder.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-COPY_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdRegister.obj \
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMARegister.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDRegister.obj \
-
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
C_OBJS = \
$O\Alloc.obj \
@@ -130,13 +119,8 @@ OBJS = \
$(UI_COMMON_OBJS) \
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(COPY_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(PPMD_OPT_OBJS) \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
+ $(COMPRESS_OBJS) \
+ $(CRYPTO_OBJS) \
$(C_OBJS) \
$(CRC_OBJS) \
$O\resource.res
@@ -162,20 +146,9 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
- $(COMPL)
-
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL)
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
diff --git a/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp b/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
index 6a493519..1f5d99cb 100755
--- a/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
+++ b/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
@@ -243,75 +243,43 @@ SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
# Begin Group "Compress"
# PROP Default_Filter ""
-# Begin Group "LZMA"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
-# End Source File
-# End Group
-# Begin Group "Branch"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BCJRegister.cpp
-# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
+SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.h
+SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86.cpp
+SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86_2.cpp
+SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
-# End Group
-# Begin Group "Copy"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyRegister.cpp
+SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
+SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
+SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# End Group
-# End Group
# Begin Group "Common"
# PROP Default_Filter ""
diff --git a/CPP/7zip/Bundles/SFXSetup/makefile b/CPP/7zip/Bundles/SFXSetup/makefile
index 0d4255d1..44ffc9c6 100755
--- a/CPP/7zip/Bundles/SFXSetup/makefile
+++ b/CPP/7zip/Bundles/SFXSetup/makefile
@@ -79,23 +79,16 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \
$O\7zRegister.obj \
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+COMPRESS_OBJS = \
$O\BranchCoder.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-COPY_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMARegister.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
C_OBJS = \
$O\Alloc.obj \
@@ -116,10 +109,7 @@ OBJS = \
$(FM_OBJS)\
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(COPY_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
+ $(COMPRESS_OBJS) \
$O\MyMessages.obj \
$(C_OBJS) \
$(CRC_OBJS) \
@@ -148,13 +138,7 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
diff --git a/CPP/7zip/Bundles/SFXWin/SFXWin.dsp b/CPP/7zip/Bundles/SFXWin/SFXWin.dsp
index a6c7a6fd..fdb33a85 100755
--- a/CPP/7zip/Bundles/SFXWin/SFXWin.dsp
+++ b/CPP/7zip/Bundles/SFXWin/SFXWin.dsp
@@ -231,151 +231,75 @@ SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
# Begin Group "Compress"
# PROP Default_Filter ""
-# Begin Group "LZMA"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
+SOURCE=..\..\Compress\Bcj2Coder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZMA\LZMARegister.cpp
+SOURCE=..\..\Compress\Bcj2Register.cpp
# End Source File
-# End Group
-# Begin Group "Branch"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJ2Register.cpp
+SOURCE=..\..\Compress\BcjCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BCJRegister.cpp
+SOURCE=..\..\Compress\BcjRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
+SOURCE=..\..\Compress\BranchCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\BranchCoder.h
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86.cpp
+SOURCE=..\..\Compress\CopyRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Branch\x86_2.cpp
+SOURCE=..\..\Compress\LzmaDecoder.cpp
# End Source File
-# End Group
-# Begin Group "PPMD"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDContext.h
+SOURCE=..\..\Compress\LzmaRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\PPMD\PPMDDecode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\PPMD\PPMDDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\PPMD\PPMDRegister.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\PPMD\PPMDSubAlloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\PPMD\PPMDType.h
-# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
+SOURCE=..\..\Compress\PpmdDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
+SOURCE=..\..\Compress\PpmdRegister.cpp
# End Source File
# End Group
-# Begin Group "Copy"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyRegister.cpp
-# End Source File
-# End Group
-# End Group
# Begin Group "Crypto"
# PROP Default_Filter ""
-# Begin Group "AES"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Crypto\AES\MyAES.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Crypto\AES\MyAES.h
-# End Source File
-# End Group
-# Begin Group "7zAES"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.cpp
+SOURCE=..\..\Crypto\7zAes.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAES.h
+SOURCE=..\..\Crypto\7zAes.h
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\7zAESRegister.cpp
+SOURCE=..\..\Crypto\7zAesRegister.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Crypto\7zAES\MySHA256.h
+SOURCE=..\..\Crypto\MyAes.cpp
# End Source File
-# End Group
-# Begin Group "Hash"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Crypto\Hash\RotateDefs.h
+SOURCE=..\..\Crypto\MyAes.h
# End Source File
# End Group
-# End Group
# Begin Group "Dialogs"
# PROP Default_Filter ""
diff --git a/CPP/7zip/Bundles/SFXWin/makefile b/CPP/7zip/Bundles/SFXWin/makefile
index 80c7528e..8302b7d0 100755
--- a/CPP/7zip/Bundles/SFXWin/makefile
+++ b/CPP/7zip/Bundles/SFXWin/makefile
@@ -89,35 +89,24 @@ AR_COMMON_OBJS = \
$O\7zIn.obj \
$O\7zRegister.obj \
-BRANCH_OPT_OBJS = \
- $O\x86.obj \
- $O\x86_2.obj \
+COMPRESS_OBJS = \
$O\BranchCoder.obj \
- $O\BCJRegister.obj \
- $O\BCJ2Register.obj \
-
-COPY_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
$O\CopyCoder.obj \
$O\CopyRegister.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMARegister.obj \
-
-PPMD_OPT_OBJS = \
- $O\PPMDDecoder.obj \
- $O\PPMDRegister.obj \
-
-7ZAES_OPT_OBJS = \
- $O\7zAES.obj \
- $O\7zAESRegister.obj \
-
-AES_OPT_OBJS = \
- $O\MyAES.obj \
-
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdRegister.obj \
+
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
+
C_OBJS = \
$O\Alloc.obj \
$O\Bra86.obj \
@@ -140,13 +129,8 @@ OBJS = \
$(FM_OBJS)\
$(AR_COMMON_OBJS) \
$(7Z_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(COPY_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(PPMD_OPT_OBJS) \
- $(7ZAES_OPT_OBJS) \
- $(AES_OPT_OBJS) \
+ $(COMPRESS_OBJS) \
+ $(CRYPTO_OBJS) \
$O\MyMessages.obj \
$(C_OBJS) \
$(CRC_OBJS) \
@@ -177,20 +161,9 @@ $(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
$(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL)
-$(COPY_OBJS): ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL)
-$(PPMD_OPT_OBJS): ../../Compress/PPMD/$(*B).cpp
- $(COMPL)
-
-$(7ZAES_OPT_OBJS): ../../Crypto/7zAES/$(*B).cpp
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
$(COMPL)
-$(AES_OPT_OBJS): ../../Crypto/AES/$(*B).cpp
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
$(COMPL)
$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
diff --git a/CPP/7zip/Common/LSBFEncoder.cpp b/CPP/7zip/Common/LSBFEncoder.cpp
deleted file mode 100755
index 7809a8f6..00000000
--- a/CPP/7zip/Common/LSBFEncoder.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// LSBFEncoder.cpp
-
-#include "StdAfx.h"
-
-#include "LSBFEncoder.h"
-#include "Common/Defs.h"
-
-namespace NStream {
-namespace NLSBF {
-
-}}
diff --git a/CPP/7zip/Common/MethodProps.cpp b/CPP/7zip/Common/MethodProps.cpp
index 52f5511f..86adc6b8 100755
--- a/CPP/7zip/Common/MethodProps.cpp
+++ b/CPP/7zip/Common/MethodProps.cpp
@@ -2,9 +2,12 @@
#include "StdAfx.h"
-#include "MethodProps.h"
#include "../../Common/MyCom.h"
+#include "../ICoder.h"
+
+#include "MethodProps.h"
+
static UInt64 k_LZMA = 0x030101;
// static UInt64 k_LZMA2 = 0x030102;
@@ -35,24 +38,24 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
}
{
- int numProperties = method.Properties.Size();
+ int numProps = method.Props.Size();
CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
if (setCoderProperties == NULL)
{
- if (numProperties != 0)
+ if (numProps != 0)
return E_INVALIDARG;
}
else
{
CRecordVector<PROPID> propIDs;
- NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProperties];
+ NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProps];
HRESULT res = S_OK;
try
{
- for (int i = 0; i < numProperties; i++)
+ for (int i = 0; i < numProps; i++)
{
- const CProp &prop = method.Properties[i];
+ const CProp &prop = method.Props[i];
propIDs.Add(prop.Id);
NWindows::NCOM::CPropVariant &value = values[i];
value = prop.Value;
@@ -65,7 +68,7 @@ HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce
}
CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
- res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProperties);
+ res = setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProps);
}
catch(...)
{
diff --git a/CPP/7zip/Common/MethodProps.h b/CPP/7zip/Common/MethodProps.h
index 7978c551..c0761c51 100755
--- a/CPP/7zip/Common/MethodProps.h
+++ b/CPP/7zip/Common/MethodProps.h
@@ -3,11 +3,11 @@
#ifndef __7Z_METHOD_PROPS_H
#define __7Z_METHOD_PROPS_H
-#include "MethodId.h"
+#include "../../Common/MyVector.h"
#include "../../Windows/PropVariant.h"
-#include "../../Common/MyVector.h"
-#include "../ICoder.h"
+
+#include "MethodId.h"
struct CProp
{
@@ -18,7 +18,7 @@ struct CProp
struct CMethod
{
CMethodId Id;
- CObjectVector<CProp> Properties;
+ CObjectVector<CProp> Props;
};
struct CMethodsMode
diff --git a/CPP/7zip/Compress/Arj/ArjDecoder2.h b/CPP/7zip/Compress/Arj/ArjDecoder2.h
deleted file mode 100755
index 9d17ee91..00000000
--- a/CPP/7zip/Compress/Arj/ArjDecoder2.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Arj/Decoder2.h
-
-#ifndef __COMPRESS_ARJ_DECODER2_H
-#define __COMPRESS_ARJ_DECODER2_H
-
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
-#include "../LZ/LZOutWindow.h"
-
-/*
-// {23170F69-40C1-278B-0404-020000000000}
-DEFINE_GUID(CLSID_CCompressArj2Decoder,
-0x23170F69, 0x40C1, 0x278B, 0x04, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00);
-*/
-
-namespace NCompress {
-namespace NArj {
-namespace NDecoder2 {
-
-class CCoder :
- public ICompressCoder,
- public CMyUnknownImp
-{
- CLZOutWindow m_OutWindowStream;
- NStream::NMSBF::CDecoder<CInBuffer> m_InBitStream;
-
- void ReleaseStreams()
- {
- m_OutWindowStream.ReleaseStream();
- m_InBitStream.ReleaseStream();
- }
-
- class CCoderReleaser
- {
- CCoder *m_Coder;
- public:
- bool NeedFlush;
- CCoderReleaser(CCoder *coder): m_Coder(coder), NeedFlush(true) {}
- ~CCoderReleaser()
- {
- if (NeedFlush)
- m_Coder->m_OutWindowStream.Flush();
- m_Coder->ReleaseStreams();
- }
- };
- friend class CCoderReleaser;
-
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-public:
- MY_UNKNOWN_IMP
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
-};
-
-}}}
-
-#endif
diff --git a/CPP/7zip/Compress/Arj/StdAfx.h b/CPP/7zip/Compress/Arj/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Arj/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Arj/ArjDecoder1.cpp b/CPP/7zip/Compress/ArjDecoder1.cpp
index 964b2aea..3e66feeb 100755
--- a/CPP/7zip/Compress/Arj/ArjDecoder1.cpp
+++ b/CPP/7zip/Compress/ArjDecoder1.cpp
@@ -1,18 +1,16 @@
-// Arj/Decoder.cpp
+// ArjDecoder1.cpp
#include "StdAfx.h"
#include "ArjDecoder1.h"
-#include "Windows/Defs.h"
-
namespace NCompress{
namespace NArj {
namespace NDecoder1 {
static const UInt32 kHistorySize = 26624;
-static const UInt32 kMatchMaxLen = 256;
static const UInt32 kMatchMinLen = 3;
+static const UInt32 kMatchMaxLen = 256;
// static const UInt32 kNC = 255 + kMatchMaxLen + 2 - kMatchMinLen;
@@ -237,9 +235,8 @@ UInt32 CCoder::decode_p()
}
-HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (outSize == NULL)
return E_INVALIDARG;
@@ -306,13 +303,12 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush();
}
-STDMETHODIMP CCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress);}
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Arj/ArjDecoder1.h b/CPP/7zip/Compress/ArjDecoder1.h
index cecc9573..17939daf 100755
--- a/CPP/7zip/Compress/Arj/ArjDecoder1.h
+++ b/CPP/7zip/Compress/ArjDecoder1.h
@@ -1,19 +1,16 @@
-// Arj/Decoder1.h
+// ArjDecoder1.h
#ifndef __COMPRESS_ARJ_DECODER1_H
#define __COMPRESS_ARJ_DECODER1_H
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
-#include "../LZ/LZOutWindow.h"
+#include "../../Common/MyCom.h"
-/*
-// {23170F69-40C1-278B-0404-010000000000}
-DEFINE_GUID(CLSID_CCompressArjDecoder,
-0x23170F69, 0x40C1, 0x278B, 0x04, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00);
-*/
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NArj {
@@ -47,8 +44,8 @@ class CCoder :
public ICompressCoder,
public CMyUnknownImp
{
- CLZOutWindow m_OutWindowStream;
- NStream::NMSBF::CDecoder<CInBuffer> m_InBitStream;
+ CLzOutWindow m_OutWindowStream;
+ NBitm::CDecoder<CInBuffer> m_InBitStream;
UInt32 left[2 * NC - 1];
UInt32 right[2 * NC - 1];
@@ -86,15 +83,13 @@ class CCoder :
UInt32 decode_c();
UInt32 decode_p();
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
public:
MY_UNKNOWN_IMP
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
};
diff --git a/CPP/7zip/Compress/Arj/ArjDecoder2.cpp b/CPP/7zip/Compress/ArjDecoder2.cpp
index 5d7bf2ee..365993bc 100755
--- a/CPP/7zip/Compress/Arj/ArjDecoder2.cpp
+++ b/CPP/7zip/Compress/ArjDecoder2.cpp
@@ -1,4 +1,4 @@
-// Arj/Decoder2.cpp
+// ArjDecoder2.cpp
#include "StdAfx.h"
@@ -9,12 +9,10 @@ namespace NArj {
namespace NDecoder2 {
static const UInt32 kHistorySize = 26624;
-// static const UInt32 kMatchMaxLen = 256;
static const UInt32 kMatchMinLen = 3;
-HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize,
- ICompressProgressInfo * /* progress */)
+HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo * /* progress */)
{
if (outSize == NULL)
return E_INVALIDARG;
@@ -80,13 +78,12 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush();
}
-STDMETHODIMP CCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress);}
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/ArjDecoder2.h b/CPP/7zip/Compress/ArjDecoder2.h
new file mode 100755
index 00000000..cf00975d
--- /dev/null
+++ b/CPP/7zip/Compress/ArjDecoder2.h
@@ -0,0 +1,59 @@
+// ArjDecoder2.h
+
+#ifndef __COMPRESS_ARJ_DECODER2_H
+#define __COMPRESS_ARJ_DECODER2_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "LzOutWindow.h"
+
+namespace NCompress {
+namespace NArj {
+namespace NDecoder2 {
+
+class CCoder :
+ public ICompressCoder,
+ public CMyUnknownImp
+{
+ CLzOutWindow m_OutWindowStream;
+ NBitm::CDecoder<CInBuffer> m_InBitStream;
+
+ void ReleaseStreams()
+ {
+ m_OutWindowStream.ReleaseStream();
+ m_InBitStream.ReleaseStream();
+ }
+
+ class CCoderReleaser
+ {
+ CCoder *m_Coder;
+ public:
+ bool NeedFlush;
+ CCoderReleaser(CCoder *coder): m_Coder(coder), NeedFlush(true) {}
+ ~CCoderReleaser()
+ {
+ if (NeedFlush)
+ m_Coder->m_OutWindowStream.Flush();
+ m_Coder->ReleaseStreams();
+ }
+ };
+ friend class CCoderReleaser;
+
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+public:
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+
+};
+
+}}}
+
+#endif
diff --git a/CPP/7zip/Compress/BZip2/BZip2CRC.cpp b/CPP/7zip/Compress/BZip2/BZip2CRC.cpp
deleted file mode 100755
index ba9ddb7e..00000000
--- a/CPP/7zip/Compress/BZip2/BZip2CRC.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// BZip2CRC.cpp
-
-#include "StdAfx.h"
-
-#include "BZip2CRC.h"
-
-UInt32 CBZip2CRC::Table[256];
-
-static const UInt32 kBZip2CRCPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
-
-void CBZip2CRC::InitTable()
-{
- for (UInt32 i = 0; i < 256; i++)
- {
- UInt32 r = (i << 24);
- for (int j = 8; j > 0; j--)
- r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CRCPoly) : (r << 1);
- Table[i] = r;
- }
-}
-
-class CBZip2CRCTableInit
-{
-public:
- CBZip2CRCTableInit() { CBZip2CRC::InitTable(); }
-} g_BZip2CRCTableInit;
diff --git a/CPP/7zip/Compress/BZip2/StdAfx.h b/CPP/7zip/Compress/BZip2/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/BZip2/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/BZip2/BZip2Const.h b/CPP/7zip/Compress/BZip2Const.h
index 62427aa6..62427aa6 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Const.h
+++ b/CPP/7zip/Compress/BZip2Const.h
diff --git a/CPP/7zip/Compress/BZip2Crc.cpp b/CPP/7zip/Compress/BZip2Crc.cpp
new file mode 100755
index 00000000..4e4741f4
--- /dev/null
+++ b/CPP/7zip/Compress/BZip2Crc.cpp
@@ -0,0 +1,26 @@
+// BZip2Crc.cpp
+
+#include "StdAfx.h"
+
+#include "BZip2Crc.h"
+
+UInt32 CBZip2Crc::Table[256];
+
+static const UInt32 kBZip2CrcPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
+
+void CBZip2Crc::InitTable()
+{
+ for (UInt32 i = 0; i < 256; i++)
+ {
+ UInt32 r = (i << 24);
+ for (int j = 8; j > 0; j--)
+ r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CrcPoly) : (r << 1);
+ Table[i] = r;
+ }
+}
+
+class CBZip2CrcTableInit
+{
+public:
+ CBZip2CrcTableInit() { CBZip2Crc::InitTable(); }
+} g_BZip2CrcTableInit;
diff --git a/CPP/7zip/Compress/BZip2/BZip2CRC.h b/CPP/7zip/Compress/BZip2Crc.h
index 981fe837..876945b5 100755
--- a/CPP/7zip/Compress/BZip2/BZip2CRC.h
+++ b/CPP/7zip/Compress/BZip2Crc.h
@@ -1,28 +1,28 @@
-// BZip2CRC.h
+// BZip2Crc.h
#ifndef __BZIP2_CRC_H
#define __BZIP2_CRC_H
#include "Common/Types.h"
-class CBZip2CRC
+class CBZip2Crc
{
UInt32 _value;
static UInt32 Table[256];
public:
static void InitTable();
- CBZip2CRC(): _value(0xFFFFFFFF) {};
+ CBZip2Crc(): _value(0xFFFFFFFF) {};
void Init() { _value = 0xFFFFFFFF; }
void UpdateByte(Byte b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
void UpdateByte(unsigned int b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
};
-class CBZip2CombinedCRC
+class CBZip2CombinedCrc
{
UInt32 _value;
public:
- CBZip2CombinedCRC(): _value(0){};
+ CBZip2CombinedCrc(): _value(0){};
void Init() { _value = 0; }
void Update(UInt32 v) { _value = ((_value << 1) | (_value >> 31)) ^ v; }
UInt32 GetDigest() const { return _value ; }
diff --git a/CPP/7zip/Compress/BZip2/BZip2Decoder.cpp b/CPP/7zip/Compress/BZip2Decoder.cpp
index 6ec40ffa..c44debf0 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Decoder.cpp
+++ b/CPP/7zip/Compress/BZip2Decoder.cpp
@@ -2,20 +2,22 @@
#include "StdAfx.h"
-#include "BZip2Decoder.h"
-
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
-#include "../../../Common/Defs.h"
-#include "../BWT/Mtf8.h"
-#include "BZip2CRC.h"
+#include "../../Common/Defs.h"
+
+#include "BZip2Crc.h"
+#include "BZip2Decoder.h"
+#include "Mtf8.h"
namespace NCompress {
namespace NBZip2 {
+#define NO_INLINE MY_FAST_CALL
+
const UInt32 kNumThreadsMax = 4;
static const UInt32 kBufferSize = (1 << 17);
@@ -92,7 +94,7 @@ UInt32 CDecoder::ReadBits(int numBits) { return m_InStream.ReadBits(numBits); }
Byte CDecoder::ReadByte() {return (Byte)ReadBits(8); }
bool CDecoder::ReadBit() { return ReadBits(1) != 0; }
-UInt32 CDecoder::ReadCRC()
+UInt32 CDecoder::ReadCrc()
{
UInt32 crc = 0;
for (int i = 0; i < 4; i++)
@@ -103,17 +105,17 @@ UInt32 CDecoder::ReadCRC()
return crc;
}
-UInt32 NO_INLINE ReadBits(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream, int num)
+UInt32 NO_INLINE ReadBits(NBitm::CDecoder<CInBuffer> *m_InStream, int num)
{
return m_InStream->ReadBits(num);
}
-UInt32 NO_INLINE ReadBit(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream)
+UInt32 NO_INLINE ReadBit(NBitm::CDecoder<CInBuffer> *m_InStream)
{
return m_InStream->ReadBits(1);
}
-static HRESULT NO_INLINE ReadBlock(NStream::NMSBF::CDecoder<CInBuffer> *m_InStream,
+static HRESULT NO_INLINE ReadBlock(NBitm::CDecoder<CInBuffer> *m_InStream,
UInt32 *CharCounters, UInt32 blockSizeMax, Byte *m_Selectors, CHuffmanDecoder *m_HuffmanDecoders,
UInt32 *blockSizeRes, UInt32 *origPtrRes, bool *randRes)
{
@@ -280,7 +282,7 @@ void NO_INLINE DecodeBlock1(UInt32 *charCounters, UInt32 blockSize)
static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream)
{
- CBZip2CRC crc;
+ CBZip2Crc crc;
// it's for speed optimization: prefetch & prevByte_init;
UInt32 tPos = tt[tt[OrigPtr] >> 8];
@@ -371,7 +373,7 @@ static UInt32 NO_INLINE DecodeBlock2(const UInt32 *tt, UInt32 blockSize, UInt32
static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UInt32 OrigPtr, COutBuffer &m_OutStream)
{
- CBZip2CRC crc;
+ CBZip2Crc crc;
UInt32 randIndex = 1;
UInt32 randToGo = kRandNums[0] - 2;
@@ -492,7 +494,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
Byte s[6];
for (int i = 0; i < 6; i++)
s[i] = ReadByte();
- crc = ReadCRC();
+ crc = ReadCrc();
if (s[0] == kFinSig0)
{
if (s[1] != kFinSig1 ||
@@ -503,7 +505,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
return S_FALSE;
wasFinished = true;
- return (crc == CombinedCRC.GetDigest()) ? S_OK : S_FALSE;
+ return (crc == CombinedCrc.GetDigest()) ? S_OK : S_FALSE;
}
if (s[0] != kBlockSig0 ||
s[1] != kBlockSig1 ||
@@ -512,7 +514,7 @@ HRESULT CDecoder::ReadSignatures(bool &wasFinished, UInt32 &crc)
s[4] != kBlockSig4 ||
s[5] != kBlockSig5)
return S_FALSE;
- CombinedCRC.Update(crc);
+ CombinedCrc.Update(crc);
return S_OK;
}
@@ -552,7 +554,7 @@ HRESULT CDecoder::DecodeFile(bool &isBZ, ICompressProgressInfo *progress)
isBZ = true;
UInt32 dicSize = (UInt32)(s[3] - kArSig3) * kBlockSizeStep;
- CombinedCRC.Init();
+ CombinedCrc.Init();
#ifdef COMPRESS_BZIP2_MT
if (MtMode)
{
@@ -608,9 +610,8 @@ HRESULT CDecoder::DecodeFile(bool &isBZ, ICompressProgressInfo *progress)
return S_OK;
}
-HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
if (!m_InStream.Create(kBufferSize))
return E_OUTOFMEMORY;
@@ -630,9 +631,8 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
return isBZ ? S_OK: S_FALSE;
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
diff --git a/CPP/7zip/Compress/BZip2/BZip2Decoder.h b/CPP/7zip/Compress/BZip2Decoder.h
index f6058841..195b6b38 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Decoder.h
+++ b/CPP/7zip/Compress/BZip2Decoder.h
@@ -1,23 +1,24 @@
-// Compress/BZip2/Decoder.h
+// Compress/BZip2Decoder.h
#ifndef __COMPRESS_BZIP2_DECODER_H
#define __COMPRESS_BZIP2_DECODER_H
-#include "../../ICoder.h"
-#include "../../../Common/MyCom.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
-#include "../Huffman/HuffmanDecoder.h"
-#include "BZip2Const.h"
-#include "BZip2CRC.h"
+#include "../../Common/MyCom.h"
#ifdef COMPRESS_BZIP2_MT
-#include "../../../Windows/Thread.h"
-#include "../../../Windows/Synchronization.h"
+#include "../../Windows/Synchronization.h"
+#include "../../Windows/Thread.h"
#endif
-#define NO_INLINE MY_FAST_CALL
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+#include "../Common/OutBuffer.h"
+
+#include "BitmDecoder.h"
+#include "BZip2Const.h"
+#include "BZip2Crc.h"
+#include "HuffmanDecoder.h"
namespace NCompress {
namespace NBZip2 {
@@ -67,7 +68,7 @@ class CDecoder :
public:
COutBuffer m_OutStream;
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
- NStream::NMSBF::CDecoder<CInBuffer> m_InStream;
+ NBitm::CDecoder<CInBuffer> m_InStream;
Byte m_Selectors[kNumSelectorsMax];
CHuffmanDecoder m_HuffmanDecoders[kNumTablesMax];
private:
@@ -77,12 +78,11 @@ private:
UInt32 ReadBits(int numBits);
Byte ReadByte();
bool ReadBit();
- UInt32 ReadCRC();
+ UInt32 ReadCrc();
HRESULT PrepareBlock(CState &state);
HRESULT DecodeFile(bool &isBZ, ICompressProgressInfo *progress);
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
class CDecoderFlusher
{
CDecoder *_decoder;
@@ -98,7 +98,7 @@ private:
};
public:
- CBZip2CombinedCRC CombinedCRC;
+ CBZip2CombinedCrc CombinedCrc;
#ifdef COMPRESS_BZIP2_MT
ICompressProgressInfo *Progress;
@@ -144,9 +144,8 @@ public:
#endif
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
diff --git a/CPP/7zip/Compress/BZip2/BZip2Encoder.cpp b/CPP/7zip/Compress/BZip2Encoder.cpp
index 5ac9e50b..ef284a33 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Encoder.cpp
+++ b/CPP/7zip/Compress/BZip2Encoder.cpp
@@ -4,15 +4,14 @@
extern "C"
{
-#include "../../../../C/Alloc.h"
-#include "../../../../C/BwtSort.h"
-#include "../../../../C/HuffEnc.h"
+#include "../../../C/Alloc.h"
+#include "../../../C/BwtSort.h"
+#include "../../../C/HuffEnc.h"
}
+#include "BZip2Crc.h"
#include "BZip2Encoder.h"
-
-#include "../BWT/Mtf8.h"
-#include "BZip2CRC.h"
+#include "Mtf8.h"
namespace NCompress {
namespace NBZip2 {
@@ -239,7 +238,7 @@ void CThreadInfo::WriteBits2(UInt32 value, UInt32 numBits)
{ m_OutStreamCurrent->WriteBits(value, numBits); }
void CThreadInfo::WriteByte2(Byte b) { WriteBits2(b , 8); }
void CThreadInfo::WriteBit2(bool v) { WriteBits2((v ? 1 : 0), 1); }
-void CThreadInfo::WriteCRC2(UInt32 v)
+void CThreadInfo::WriteCrc2(UInt32 v)
{
for (int i = 0; i < 4; i++)
WriteByte2(((Byte)(v >> (24 - i * 8))));
@@ -249,7 +248,7 @@ void CEncoder::WriteBits(UInt32 value, UInt32 numBits)
{ m_OutStream.WriteBits(value, numBits); }
void CEncoder::WriteByte(Byte b) { WriteBits(b , 8); }
void CEncoder::WriteBit(bool v) { WriteBits((v ? 1 : 0), 1); }
-void CEncoder::WriteCRC(UInt32 v)
+void CEncoder::WriteCrc(UInt32 v)
{
for (int i = 0; i < 4; i++)
WriteByte(((Byte)(v >> (24 - i * 8))));
@@ -284,7 +283,7 @@ void CThreadInfo::EncodeBlock(const Byte *block, UInt32 blockSize)
if (inUse[i])
{
inUse16[i >> 4] = true;
- mtf.Buffer[numInUse++] = (Byte)i;
+ mtf.Buf[numInUse++] = (Byte)i;
}
for (i = 0; i < 16; i++)
WriteBit2(inUse16[i]);
@@ -583,7 +582,7 @@ UInt32 CThreadInfo::EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize)
WriteByte2(kBlockSig4);
WriteByte2(kBlockSig5);
- CBZip2CRC crc;
+ CBZip2Crc crc;
int numReps = 0;
Byte prevByte = block[0];
UInt32 i = 0;
@@ -608,7 +607,7 @@ UInt32 CThreadInfo::EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize)
}
while (++i < blockSize);
UInt32 crcRes = crc.GetDigest();
- WriteCRC2(crcRes);
+ WriteCrc2(crcRes);
EncodeBlock(block, blockSize);
return crcRes;
}
@@ -689,7 +688,7 @@ HRESULT CThreadInfo::EncodeBlock3(UInt32 blockSize)
Encoder->ThreadsInfo[m_BlockIndex].CanWriteEvent.Lock();
#endif
for (UInt32 i = 0; i < m_NumCrcs; i++)
- Encoder->CombinedCRC.Update(m_CRCs[i]);
+ Encoder->CombinedCrc.Update(m_CRCs[i]);
Encoder->WriteBytes(m_TempArray, outStreamTemp.GetPos(), outStreamTemp.GetCurByte());
HRESULT res = S_OK;
#ifdef COMPRESS_BZIP2_MT
@@ -720,9 +719,8 @@ void CEncoder::WriteBytes(const Byte *data, UInt32 sizeInBits, Byte lastByte)
}
-HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+HRESULT CEncoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
#ifdef COMPRESS_BZIP2_MT
Progress = progress;
@@ -764,7 +762,7 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
CFlusher flusher(this);
- CombinedCRC.Init();
+ CombinedCrc.Init();
#ifdef COMPRESS_BZIP2_MT
NextBlockIndex = 0;
StreamWasFinished = false;
@@ -824,13 +822,12 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
WriteByte(kFinSig4);
WriteByte(kFinSig5);
- WriteCRC(CombinedCRC.GetDigest());
+ WriteCrc(CombinedCrc.GetDigest());
return S_OK;
}
-STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
@@ -838,19 +835,18 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
catch(...) { return S_FALSE; }
}
-HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
+HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
{
- for(UInt32 i = 0; i < numProperties; i++)
+ for(UInt32 i = 0; i < numProps; i++)
{
- const PROPVARIANT &property = properties[i];
+ const PROPVARIANT &prop = props[i];
switch(propIDs[i])
{
case NCoderPropID::kNumPasses:
{
- if (property.vt != VT_UI4)
+ if (prop.vt != VT_UI4)
return E_INVALIDARG;
- UInt32 numPasses = property.ulVal;
+ UInt32 numPasses = prop.ulVal;
if (numPasses == 0)
numPasses = 1;
if (numPasses > kNumPassesMax)
@@ -861,9 +857,9 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs,
}
case NCoderPropID::kDictionarySize:
{
- if (property.vt != VT_UI4)
+ if (prop.vt != VT_UI4)
return E_INVALIDARG;
- UInt32 dictionary = property.ulVal / kBlockSizeStep;
+ UInt32 dictionary = prop.ulVal / kBlockSizeStep;
if (dictionary < kBlockSizeMultMin)
dictionary = kBlockSizeMultMin;
else if (dictionary > kBlockSizeMultMax)
@@ -874,9 +870,9 @@ HRESULT CEncoder::SetCoderProperties(const PROPID *propIDs,
case NCoderPropID::kNumThreads:
{
#ifdef COMPRESS_BZIP2_MT
- if (property.vt != VT_UI4)
+ if (prop.vt != VT_UI4)
return E_INVALIDARG;
- NumThreads = property.ulVal;
+ NumThreads = prop.ulVal;
if (NumThreads < 1)
NumThreads = 1;
#endif
diff --git a/CPP/7zip/Compress/BZip2/BZip2Encoder.h b/CPP/7zip/Compress/BZip2Encoder.h
index a7adc587..1dda0aa8 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Encoder.h
+++ b/CPP/7zip/Compress/BZip2Encoder.h
@@ -1,21 +1,25 @@
-// Compress/BZip2/Encoder.h
+// Compress/BZip2Encoder.h
#ifndef __COMPRESS_BZIP2_ENCODER_H
#define __COMPRESS_BZIP2_ENCODER_H
-#include "../../ICoder.h"
-#include "../../../Common/MyCom.h"
-#include "../../Common/MSBFEncoder.h"
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
-#include "BZip2Const.h"
-#include "BZip2CRC.h"
+#include "../../Common/Defs.h"
+#include "../../Common/MyCom.h"
#ifdef COMPRESS_BZIP2_MT
-#include "../../../Windows/Thread.h"
-#include "../../../Windows/Synchronization.h"
+#include "../../Windows/Synchronization.h"
+#include "../../Windows/Thread.h"
#endif
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+#include "../Common/OutBuffer.h"
+
+#include "BitmEncoder.h"
+#include "BZip2Const.h"
+#include "BZip2Crc.h"
+
namespace NCompress {
namespace NBZip2 {
@@ -38,13 +42,13 @@ public:
void Flush()
{
- if(m_BitPos < 8)
+ if (m_BitPos < 8)
WriteBits(0, m_BitPos);
}
void WriteBits(UInt32 value, int numBits)
{
- while(numBits > 0)
+ while (numBits > 0)
{
int numNewBits = MyMin(numBits, m_BitPos);
numBits -= numNewBits;
@@ -108,7 +112,7 @@ private:
void WriteBits2(UInt32 value, UInt32 numBits);
void WriteByte2(Byte b);
void WriteBit2(bool v);
- void WriteCRC2(UInt32 v);
+ void WriteCrc2(UInt32 v);
void EncodeBlock(const Byte *block, UInt32 blockSize);
UInt32 EncodeBlockWithHeaders(const Byte *block, UInt32 blockSize);
@@ -158,9 +162,9 @@ class CEncoder :
public:
CInBuffer m_InStream;
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
- NStream::NMSBF::CEncoder<COutBuffer> m_OutStream;
+ CBitmEncoder<COutBuffer> m_OutStream;
UInt32 NumPasses;
- CBZip2CombinedCRC CombinedCRC;
+ CBZip2CombinedCrc CombinedCrc;
#ifdef COMPRESS_BZIP2_MT
CThreadInfo *ThreadsInfo;
@@ -186,7 +190,7 @@ public:
void WriteBits(UInt32 value, UInt32 numBits);
void WriteByte(Byte b);
void WriteBit(bool v);
- void WriteCRC(UInt32 v);
+ void WriteCrc(UInt32 v);
#ifdef COMPRESS_BZIP2_MT
HRESULT Create();
@@ -227,15 +231,12 @@ public:
MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
#endif
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
#ifdef COMPRESS_BZIP2_MT
STDMETHOD(SetNumberOfThreads)(UInt32 numThreads);
diff --git a/CPP/7zip/Compress/BZip2/BZip2Register.cpp b/CPP/7zip/Compress/BZip2Register.cpp
index 1f9cf18d..ef14204b 100755
--- a/CPP/7zip/Compress/BZip2/BZip2Register.cpp
+++ b/CPP/7zip/Compress/BZip2Register.cpp
@@ -1,10 +1,11 @@
-// Bzip2Register.cpp
+// BZip2Register.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "BZip2Decoder.h"
+
static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NBZip2::CDecoder); }
#if !defined(EXTRACT_ONLY) && !defined(BZIP2_EXTRACT_ONLY)
#include "BZip2Encoder.h"
diff --git a/CPP/7zip/Compress/Branch/x86_2.cpp b/CPP/7zip/Compress/Bcj2Coder.cpp
index 87203195..e1356abb 100755
--- a/CPP/7zip/Compress/Branch/x86_2.cpp
+++ b/CPP/7zip/Compress/Bcj2Coder.cpp
@@ -1,13 +1,14 @@
-// x86_2.cpp
+// Bcj2Coder.cpp
#include "StdAfx.h"
-#include "x86_2.h"
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
+#include "Bcj2Coder.h"
+
namespace NCompress {
namespace NBcj2 {
diff --git a/CPP/7zip/Compress/Branch/x86_2.h b/CPP/7zip/Compress/Bcj2Coder.h
index 8c5d754b..b8b1e7a9 100755
--- a/CPP/7zip/Compress/Branch/x86_2.h
+++ b/CPP/7zip/Compress/Bcj2Coder.h
@@ -1,11 +1,13 @@
-// x86_2.h
+// Bcj2Coder.h
-#ifndef __BRANCH_X86_2_H
-#define __BRANCH_X86_2_H
+#ifndef __COMPRESS_BCJ2_CODER_H
+#define __COMPRESS_BCJ2_CODER_H
-#include "../../../Common/MyCom.h"
-#include "../RangeCoder/RangeCoderBit.h"
-#include "../../ICoder.h"
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "RangeCoderBit.h"
namespace NCompress {
namespace NBcj2 {
diff --git a/CPP/7zip/Compress/Branch/BCJ2Register.cpp b/CPP/7zip/Compress/Bcj2Register.cpp
index 88ebbac6..8eb1e736 100755
--- a/CPP/7zip/Compress/Branch/BCJ2Register.cpp
+++ b/CPP/7zip/Compress/Bcj2Register.cpp
@@ -1,10 +1,11 @@
-// BranchRegister.cpp
+// Bcj2Register.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
+
+#include "Bcj2Coder.h"
-#include "x86_2.h"
static void *CreateCodec() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CDecoder()); }
#ifndef EXTRACT_ONLY
static void *CreateCodecOut() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CEncoder()); }
diff --git a/CPP/7zip/Compress/Branch/x86.cpp b/CPP/7zip/Compress/BcjCoder.cpp
index 79d49657..0e34ef48 100755
--- a/CPP/7zip/Compress/Branch/x86.cpp
+++ b/CPP/7zip/Compress/BcjCoder.cpp
@@ -1,7 +1,8 @@
-// x86.cpp
+// BcjCoder.cpp
#include "StdAfx.h"
-#include "x86.h"
+
+#include "BcjCoder.h"
UInt32 CBCJ_x86_Encoder::SubFilter(Byte *data, UInt32 size)
{
diff --git a/CPP/7zip/Compress/Branch/x86.h b/CPP/7zip/Compress/BcjCoder.h
index 960791c4..612bb547 100755
--- a/CPP/7zip/Compress/Branch/x86.h
+++ b/CPP/7zip/Compress/BcjCoder.h
@@ -1,14 +1,15 @@
-// x86.h
+// BcjCoder.h
-#ifndef __X86_H
-#define __X86_H
+#ifndef __COMPRESS_BCJ_CODER_H
+#define __COMPRESS_BCJ_CODER_H
-#include "BranchCoder.h"
extern "C"
{
-#include "../../../../C/Bra.h"
+#include "../../../C/Bra.h"
}
+#include "BranchCoder.h"
+
struct CBranch86
{
UInt32 _prevMask;
diff --git a/CPP/7zip/Compress/Branch/BCJRegister.cpp b/CPP/7zip/Compress/BcjRegister.cpp
index a62d964d..648ad8e0 100755
--- a/CPP/7zip/Compress/Branch/BCJRegister.cpp
+++ b/CPP/7zip/Compress/BcjRegister.cpp
@@ -1,10 +1,11 @@
-// BranchRegister.cpp
+// BcjRegister.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
+
+#include "BcjCoder.h"
-#include "x86.h"
static void *CreateCodec() { return (void *)(ICompressFilter *)(new CBCJ_x86_Decoder()); }
#ifndef EXTRACT_ONLY
static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new CBCJ_x86_Encoder()); }
diff --git a/CPP/7zip/Common/LSBFDecoder.cpp b/CPP/7zip/Compress/BitlDecoder.cpp
index 76dd090f..78665be8 100755
--- a/CPP/7zip/Common/LSBFDecoder.cpp
+++ b/CPP/7zip/Compress/BitlDecoder.cpp
@@ -1,17 +1,15 @@
-// Stream/LSBFDecoder.cpp
+// BitlDecoder.cpp
#include "StdAfx.h"
-#include "LSBFDecoder.h"
+#include "BitlDecoder.h"
-namespace NStream {
-namespace NLSBF {
+namespace NBitl {
Byte kInvertTable[256];
-class CInverterTableInitializer
+struct CInverterTableInitializer
{
-public:
CInverterTableInitializer()
{
for (int i = 0; i < 256; i++)
@@ -23,5 +21,4 @@ public:
}
} g_InverterTableInitializer;
-
-}}
+}
diff --git a/CPP/7zip/Common/LSBFDecoder.h b/CPP/7zip/Compress/BitlDecoder.h
index 730636aa..0ccd7154 100755
--- a/CPP/7zip/Common/LSBFDecoder.h
+++ b/CPP/7zip/Compress/BitlDecoder.h
@@ -1,12 +1,11 @@
-// LSBFDecoder.h
+// BitlDecoder.h -- the Least Significant Bit of byte is First
-#ifndef __STREAM_LSBFDECODER_H
-#define __STREAM_LSBFDECODER_H
+#ifndef __BITL_DECODER_H
+#define __BITL_DECODER_H
#include "../IStream.h"
-namespace NStream {
-namespace NLSBF {
+namespace NBitl {
const int kNumBigValueBits = 8 * 4;
@@ -16,7 +15,6 @@ const int kNumValueBits = 8 * kNumValueBytes;
const UInt32 kMask = (1 << kNumValueBits) - 1;
extern Byte kInvertTable[256];
-// the Least Significant Bit of byte is First
template<class TInByte>
class CBaseDecoder
@@ -122,6 +120,6 @@ public:
}
};
-}}
+}
#endif
diff --git a/CPP/7zip/Common/LSBFEncoder.h b/CPP/7zip/Compress/BitlEncoder.h
index c6455475..02f5a9c6 100755
--- a/CPP/7zip/Common/LSBFEncoder.h
+++ b/CPP/7zip/Compress/BitlEncoder.h
@@ -1,15 +1,11 @@
-// Stream/LSBFEncoder.h
+// BitlEncoder.h -- the Least Significant Bit of byte is First
-#ifndef __STREAM_LSBFENCODER_H
-#define __STREAM_LSBFENCODER_H
+#ifndef __BITL_ENCODER_H
+#define __BITL_ENCODER_H
-#include "../IStream.h"
-#include "OutBuffer.h"
+#include "../Common/OutBuffer.h"
-namespace NStream {
-namespace NLSBF {
-
-class CEncoder
+class CBitlEncoder
{
COutBuffer m_Stream;
int m_BitPos;
@@ -61,7 +57,4 @@ public:
void WriteByte(Byte b) { m_Stream.WriteByte(b);}
};
-
-}}
-
#endif
diff --git a/CPP/7zip/Common/MSBFDecoder.h b/CPP/7zip/Compress/BitmDecoder.h
index 1894ca40..fbe4c949 100755
--- a/CPP/7zip/Common/MSBFDecoder.h
+++ b/CPP/7zip/Compress/BitmDecoder.h
@@ -1,14 +1,11 @@
-// MSBFDecoder.h
-// the Most Significant Bit of byte is First
+// BitmDecoder.h -- the Most Significant Bit of byte is First
-#ifndef __STREAM_MSBFDECODER_H
-#define __STREAM_MSBFDECODER_H
+#ifndef __BITM_DECODER_H
+#define __BITM_DECODER_H
-#include "../../Common/Types.h"
#include "../IStream.h"
-namespace NStream {
-namespace NMSBF {
+namespace NBitm {
const int kNumBigValueBits = 8 * 4;
const int kNumValueBytes = 3;
@@ -64,6 +61,6 @@ public:
}
};
-}}
+}
#endif
diff --git a/CPP/7zip/Common/MSBFEncoder.h b/CPP/7zip/Compress/BitmEncoder.h
index da92799b..25976ef6 100755
--- a/CPP/7zip/Common/MSBFEncoder.h
+++ b/CPP/7zip/Compress/BitmEncoder.h
@@ -1,17 +1,12 @@
-// Stream/MSBFEncoder.h
+// BitmEncoder.h -- the Most Significant Bit of byte is First
-#ifndef __STREAM_MSBFENCODER_H
-#define __STREAM_MSBFENCODER_H
+#ifndef __BITM_ENCODER_H
+#define __BITM_ENCODER_H
-#include "Common/Defs.h"
#include "../IStream.h"
-#include "OutBuffer.h"
-
-namespace NStream {
-namespace NMSBF {
template<class TOutByte>
-class CEncoder
+class CBitmEncoder
{
TOutByte m_Stream;
int m_BitPos;
@@ -54,6 +49,4 @@ public:
return m_Stream.GetProcessedSize() + (8 - m_BitPos + 7) / 8; }
};
-}}
-
#endif
diff --git a/CPP/7zip/Compress/Branch/StdAfx.h b/CPP/7zip/Compress/Branch/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Branch/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Branch/BranchCoder.cpp b/CPP/7zip/Compress/BranchCoder.cpp
index 8d25f0d5..43170952 100755
--- a/CPP/7zip/Compress/Branch/BranchCoder.cpp
+++ b/CPP/7zip/Compress/BranchCoder.cpp
@@ -1,6 +1,7 @@
// BranchCoder.cpp
#include "StdAfx.h"
+
#include "BranchCoder.h"
STDMETHODIMP CBranchConverter::Init()
diff --git a/CPP/7zip/Compress/Branch/BranchCoder.h b/CPP/7zip/Compress/BranchCoder.h
index 8ea84761..0e3a5c4e 100755
--- a/CPP/7zip/Compress/Branch/BranchCoder.h
+++ b/CPP/7zip/Compress/BranchCoder.h
@@ -1,12 +1,11 @@
// BranchCoder.h
-#ifndef __BRANCH_CODER_H
-#define __BRANCH_CODER_H
+#ifndef __COMPRESS_BRANCH_CODER_H
+#define __COMPRESS_BRANCH_CODER_H
-#include "Common/MyCom.h"
-#include "Common/Types.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
+#include "../ICoder.h"
class CBranchConverter:
public ICompressFilter,
diff --git a/CPP/7zip/Compress/Branch/BranchMisc.cpp b/CPP/7zip/Compress/BranchMisc.cpp
index 956bafaf..5a19c44a 100755
--- a/CPP/7zip/Compress/Branch/BranchMisc.cpp
+++ b/CPP/7zip/Compress/BranchMisc.cpp
@@ -1,13 +1,14 @@
// BranchMisc.cpp
#include "StdAfx.h"
-#include "BranchMisc.h"
extern "C"
{
-#include "../../../../C/Bra.h"
+#include "../../../C/Bra.h"
}
+#include "BranchMisc.h"
+
UInt32 CBC_ARM_Encoder::SubFilter(Byte *data, UInt32 size)
{ return (UInt32)::ARM_Convert(data, size, _bufferPos, 1); }
diff --git a/CPP/7zip/Compress/Branch/BranchMisc.h b/CPP/7zip/Compress/BranchMisc.h
index 219eec1c..81198b21 100755
--- a/CPP/7zip/Compress/Branch/BranchMisc.h
+++ b/CPP/7zip/Compress/BranchMisc.h
@@ -1,7 +1,7 @@
// BranchMisc.h
-#ifndef __BRANCHMISC_H
-#define __BRANCHMISC_H
+#ifndef __COMPRESS_BRANCH_MISC_H
+#define __COMPRESS_BRANCH_MISC_H
#include "BranchCoder.h"
diff --git a/CPP/7zip/Compress/Branch/BranchRegister.cpp b/CPP/7zip/Compress/BranchRegister.cpp
index 69fbe5d3..380828c6 100755
--- a/CPP/7zip/Compress/Branch/BranchRegister.cpp
+++ b/CPP/7zip/Compress/BranchRegister.cpp
@@ -2,7 +2,7 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "BranchMisc.h"
diff --git a/CPP/7zip/Compress/ByteSwap/ByteSwap.cpp b/CPP/7zip/Compress/ByteSwap.cpp
index 3f252f2c..3f252f2c 100755
--- a/CPP/7zip/Compress/ByteSwap/ByteSwap.cpp
+++ b/CPP/7zip/Compress/ByteSwap.cpp
diff --git a/CPP/7zip/Compress/ByteSwap.h b/CPP/7zip/Compress/ByteSwap.h
new file mode 100755
index 00000000..f13bec80
--- /dev/null
+++ b/CPP/7zip/Compress/ByteSwap.h
@@ -0,0 +1,30 @@
+// ByteSwap.h
+
+#ifndef __COMPRESS_BYTE_SWAP_H
+#define __COMPRESS_BYTE_SWAP_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+class CByteSwap2:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP
+ STDMETHOD(Init)();
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
+};
+
+class CByteSwap4:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP
+ STDMETHOD(Init)();
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
+};
+
+#endif
diff --git a/CPP/7zip/Compress/ByteSwap/ByteSwap.h b/CPP/7zip/Compress/ByteSwap/ByteSwap.h
deleted file mode 100755
index 4d223d4c..00000000
--- a/CPP/7zip/Compress/ByteSwap/ByteSwap.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// ByteSwap.h
-
-#ifndef __BYTESWAP_H
-#define __BYTESWAP_H
-
-#include "../../ICoder.h"
-#include "Common/MyCom.h"
-
-// {23170F69-40C1-278B-0203-020000000000}
-DEFINE_GUID(CLSID_CCompressConvertByteSwap2,
-0x23170F69, 0x40C1, 0x278B, 0x02, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00);
-
-// {23170F69-40C1-278B-0203-040000000000}
-DEFINE_GUID(CLSID_CCompressConvertByteSwap4,
-0x23170F69, 0x40C1, 0x278B, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00);
-
-class CByteSwap2:
- public ICompressFilter,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
- STDMETHOD(Init)();
- STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
-};
-
-class CByteSwap4:
- public ICompressFilter,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
- STDMETHOD(Init)();
- STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
-};
-
-#endif
diff --git a/CPP/7zip/Compress/ByteSwap/StdAfx.h b/CPP/7zip/Compress/ByteSwap/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/ByteSwap/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/ByteSwap/ByteSwapRegister.cpp b/CPP/7zip/Compress/ByteSwapRegister.cpp
index b1cf8fa6..e3405ca0 100755
--- a/CPP/7zip/Compress/ByteSwap/ByteSwapRegister.cpp
+++ b/CPP/7zip/Compress/ByteSwapRegister.cpp
@@ -2,9 +2,10 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "ByteSwap.h"
+
static void *CreateCodec2() { return (void *)(ICompressFilter *)(new CByteSwap2); }
static void *CreateCodec4() { return (void *)(ICompressFilter *)(new CByteSwap4); }
diff --git a/CPP/7zip/Compress/Copy/StdAfx.h b/CPP/7zip/Compress/Copy/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Copy/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Copy/CopyCoder.cpp b/CPP/7zip/Compress/CopyCoder.cpp
index be4fee36..899ffa3a 100755
--- a/CPP/7zip/Compress/Copy/CopyCoder.cpp
+++ b/CPP/7zip/Compress/CopyCoder.cpp
@@ -4,11 +4,12 @@
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
+#include "../Common/StreamUtils.h"
+
#include "CopyCoder.h"
-#include "../../Common/StreamUtils.h"
namespace NCompress {
@@ -59,4 +60,3 @@ STDMETHODIMP CCopyCoder::GetInStreamProcessedSize(UInt64 *value)
}
}
-
diff --git a/CPP/7zip/Compress/Copy/CopyCoder.h b/CPP/7zip/Compress/CopyCoder.h
index 7de13992..c5736781 100755
--- a/CPP/7zip/Compress/Copy/CopyCoder.h
+++ b/CPP/7zip/Compress/CopyCoder.h
@@ -1,10 +1,11 @@
// Compress/CopyCoder.h
-#ifndef __COMPRESS_COPYCODER_H
-#define __COMPRESS_COPYCODER_H
+#ifndef __COMPRESS_COPY_CODER_H
+#define __COMPRESS_COPY_CODER_H
-#include "../../ICoder.h"
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
namespace NCompress {
@@ -21,10 +22,8 @@ public:
MY_UNKNOWN_IMP1(ICompressGetInStreamProcessedSize)
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
};
diff --git a/CPP/7zip/Compress/Copy/CopyRegister.cpp b/CPP/7zip/Compress/CopyRegister.cpp
index 1e688b7c..efb9b9e9 100755
--- a/CPP/7zip/Compress/Copy/CopyRegister.cpp
+++ b/CPP/7zip/Compress/CopyRegister.cpp
@@ -1,10 +1,11 @@
-// LZMARegister.cpp
+// CopyRegister.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "CopyCoder.h"
+
static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::CCopyCoder); }
static CCodecInfo g_CodecInfo =
diff --git a/CPP/7zip/Compress/Deflate/StdAfx.h b/CPP/7zip/Compress/Deflate/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Deflate/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Deflate/Deflate64Register.cpp b/CPP/7zip/Compress/Deflate64Register.cpp
index 554e0153..509e675a 100755
--- a/CPP/7zip/Compress/Deflate/Deflate64Register.cpp
+++ b/CPP/7zip/Compress/Deflate64Register.cpp
@@ -2,9 +2,10 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "DeflateDecoder.h"
+
static void *CreateCodecDeflate64() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder64); }
#if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
#include "DeflateEncoder.h"
diff --git a/CPP/7zip/Compress/Deflate/DeflateConst.h b/CPP/7zip/Compress/DeflateConst.h
index 00e5ab8b..00e5ab8b 100755
--- a/CPP/7zip/Compress/Deflate/DeflateConst.h
+++ b/CPP/7zip/Compress/DeflateConst.h
diff --git a/CPP/7zip/Compress/Deflate/DeflateDecoder.cpp b/CPP/7zip/Compress/DeflateDecoder.cpp
index b5382912..dae60c07 100755
--- a/CPP/7zip/Compress/Deflate/DeflateDecoder.cpp
+++ b/CPP/7zip/Compress/DeflateDecoder.cpp
@@ -231,10 +231,8 @@ HRESULT CCoder::CodeSpec(UInt32 curSize)
return S_OK;
}
-HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *, const UInt64 *outSize, ICompressProgressInfo *progress)
{
SetInStream(inStream);
m_OutWindowStream.SetStream(outStream);
@@ -286,14 +284,13 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
#define DEFLATE_TRY_BEGIN try {
#define DEFLATE_TRY_END } \
catch(const CInBufferException &e) { return e.ErrorCode; } \
- catch(const CLZOutWindowException &e) { return e.ErrorCode; } \
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; } \
catch(...) { return S_FALSE; }
#endif
-HRESULT CCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
DEFLATE_TRY_BEGIN
return CodeReal(inStream, outStream, inSize, outSize, progress);
diff --git a/CPP/7zip/Compress/Deflate/DeflateDecoder.h b/CPP/7zip/Compress/DeflateDecoder.h
index add02ba6..796d90a4 100755
--- a/CPP/7zip/Compress/Deflate/DeflateDecoder.h
+++ b/CPP/7zip/Compress/DeflateDecoder.h
@@ -3,15 +3,16 @@
#ifndef __DEFLATE_DECODER_H
#define __DEFLATE_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/LSBFDecoder.h"
-#include "../../Common/InBuffer.h"
-#include "../LZ/LZOutWindow.h"
-#include "../Huffman/HuffmanDecoder.h"
+#include "../ICoder.h"
+#include "../Common/InBuffer.h"
+
+#include "BitlDecoder.h"
#include "DeflateConst.h"
+#include "HuffmanDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NDeflate {
@@ -27,8 +28,8 @@ class CCoder:
#endif
public CMyUnknownImp
{
- CLZOutWindow m_OutWindowStream;
- NStream::NLSBF::CDecoder<CInBuffer> m_InBitStream;
+ CLzOutWindow m_OutWindowStream;
+ NBitl::CDecoder<CInBuffer> m_InBitStream;
NCompress::NHuffman::CDecoder<kNumHuffmanBits, kFixedMainTableSize> m_MainDecoder;
NCompress::NHuffman::CDecoder<kNumHuffmanBits, kFixedDistTableSize> m_DistDecoder;
NCompress::NHuffman::CDecoder<kNumHuffmanBits, kLevelTableSize> m_LevelDecoder;
@@ -82,9 +83,8 @@ public:
CCoder(bool deflate64Mode, bool deflateNSIS = false);
void SetKeepHistory(bool keepHistory) { _keepHistory = keepHistory; }
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
#ifndef NO_READ_FROM_CODER
MY_UNKNOWN_IMP4(
@@ -98,9 +98,8 @@ public:
ICompressGetInStreamProcessedSize)
#endif
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetInStream)(ISequentialInStream *inStream);
STDMETHOD(ReleaseInStream)();
diff --git a/CPP/7zip/Compress/Deflate/DeflateEncoder.cpp b/CPP/7zip/Compress/DeflateEncoder.cpp
index 14c7cb00..b5c70969 100755
--- a/CPP/7zip/Compress/Deflate/DeflateEncoder.cpp
+++ b/CPP/7zip/Compress/DeflateEncoder.cpp
@@ -2,18 +2,16 @@
#include "StdAfx.h"
-#include <stdio.h>
-
-#include "DeflateEncoder.h"
-
-#include "Windows/Defs.h"
-#include "Common/ComTry.h"
extern "C"
{
-#include "../../../../C/Alloc.h"
-#include "../../../../C/HuffEnc.h"
+#include "../../../C/Alloc.h"
+#include "../../../C/HuffEnc.h"
}
+#include "Common/ComTry.h"
+
+#include "DeflateEncoder.h"
+
#if _MSC_VER >= 1300
#define NO_INLINE __declspec(noinline)
#else
@@ -163,13 +161,11 @@ HRESULT CCoder::Create()
COM_TRY_END
}
-// ICompressSetEncoderProperties2
-HRESULT CCoder::BaseSetEncoderProperties2(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
+HRESULT CCoder::BaseSetEncoderProperties2(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
{
- for(UInt32 i = 0; i < numProperties; i++)
+ for (UInt32 i = 0; i < numProps; i++)
{
- const PROPVARIANT &prop = properties[i];
+ const PROPVARIANT &prop = props[i];
switch(propIDs[i])
{
case NCoderPropID::kNumPasses:
@@ -220,14 +216,10 @@ HRESULT CCoder::BaseSetEncoderProperties2(const PROPID *propIDs,
void CCoder::Free()
{
- ::MidFree(m_OnePosMatchesMemory);
- m_OnePosMatchesMemory = 0;
- ::MyFree(m_DistanceMemory);
- m_DistanceMemory = 0;
- ::MyFree(m_Values);
- m_Values = 0;
- ::MyFree(m_Tables);
- m_Tables = 0;
+ ::MidFree(m_OnePosMatchesMemory); m_OnePosMatchesMemory = 0;
+ ::MyFree(m_DistanceMemory); m_DistanceMemory = 0;
+ ::MyFree(m_Values); m_Values = 0;
+ ::MyFree(m_Tables); m_Tables = 0;
}
CCoder::~CCoder()
@@ -922,9 +914,8 @@ SRes Read(void *object, void *data, size_t *size)
return (SRes)res;
}
-HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */ , const UInt64 * /* outSize */ ,
- ICompressProgressInfo *progress)
+HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */ , const UInt64 * /* outSize */ , ICompressProgressInfo *progress)
{
m_CheckStatic = (m_NumPasses != 1 || m_NumDivPasses != 1);
m_IsMultiPass = (m_CheckStatic || (m_NumPasses != 1 || m_NumDivPasses != 1));
@@ -971,32 +962,26 @@ HRESULT CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutStream.Flush();
}
-HRESULT CCoder::BaseCode(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CCoder::BaseCode(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const COutBufferException &e) { return e.ErrorCode; }
catch(...) { return E_FAIL; }
}
-STDMETHODIMP CCOMCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CCOMCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{ return BaseCode(inStream, outStream, inSize, outSize, progress); }
-STDMETHODIMP CCOMCoder::SetCoderProperties(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
- { return BaseSetEncoderProperties2(propIDs, properties, numProperties); }
+STDMETHODIMP CCOMCoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
+ { return BaseSetEncoderProperties2(propIDs, props, numProps); }
-STDMETHODIMP CCOMCoder64::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CCOMCoder64::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{ return BaseCode(inStream, outStream, inSize, outSize, progress); }
-STDMETHODIMP CCOMCoder64::SetCoderProperties(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
- { return BaseSetEncoderProperties2(propIDs, properties, numProperties); }
+STDMETHODIMP CCOMCoder64::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
+ { return BaseSetEncoderProperties2(propIDs, props, numProps); }
}}}
-
diff --git a/CPP/7zip/Compress/Deflate/DeflateEncoder.h b/CPP/7zip/Compress/DeflateEncoder.h
index e16b074d..2790bcc7 100755
--- a/CPP/7zip/Compress/Deflate/DeflateEncoder.h
+++ b/CPP/7zip/Compress/DeflateEncoder.h
@@ -3,18 +3,18 @@
#ifndef __DEFLATE_ENCODER_H
#define __DEFLATE_ENCODER_H
+extern "C"
+{
+ #include "../../../C/LzFind.h"
+}
+
#include "Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/LSBFEncoder.h"
+#include "../ICoder.h"
+#include "BitlEncoder.h"
#include "DeflateConst.h"
-extern "C"
-{
- #include "../../../../C/LzFind.h"
-}
-
namespace NCompress {
namespace NDeflate {
namespace NEncoder {
@@ -58,7 +58,7 @@ typedef struct _CSeqInStream
class CCoder
{
CMatchFinder _lzInWindow;
- NStream::NLSBF::CEncoder m_OutStream;
+ CBitlEncoder m_OutStream;
CSeqInStream _seqInStream;
@@ -171,20 +171,15 @@ public:
CCoder(bool deflate64Mode = false);
~CCoder();
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- HRESULT BaseCode(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT BaseCode(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- // ICompressSetCoderProperties
- HRESULT BaseSetEncoderProperties2(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
+ HRESULT BaseSetEncoderProperties2(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
};
-///////////////////////////////////////////////////////////////
class CCOMCoder :
public ICompressCoder,
@@ -195,12 +190,9 @@ class CCOMCoder :
public:
MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
CCOMCoder(): CCoder(false) {};
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
- // ICompressSetCoderProperties
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
};
class CCOMCoder64 :
@@ -212,15 +204,11 @@ class CCOMCoder64 :
public:
MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
CCOMCoder64(): CCoder(true) {};
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
- // ICompressSetCoderProperties
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
};
-
}}}
#endif
diff --git a/CPP/7zip/Compress/Deflate/DeflateNsisRegister.cpp b/CPP/7zip/Compress/DeflateNsisRegister.cpp
index db181021..ffad96c2 100755
--- a/CPP/7zip/Compress/Deflate/DeflateNsisRegister.cpp
+++ b/CPP/7zip/Compress/DeflateNsisRegister.cpp
@@ -2,9 +2,10 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "DeflateDecoder.h"
+
static void *CreateCodecDeflateNsis() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CNsisCOMCoder); }
static CCodecInfo g_CodecInfo =
diff --git a/CPP/7zip/Compress/Deflate/DeflateRegister.cpp b/CPP/7zip/Compress/DeflateRegister.cpp
index ab3789fd..45f55219 100755
--- a/CPP/7zip/Compress/Deflate/DeflateRegister.cpp
+++ b/CPP/7zip/Compress/DeflateRegister.cpp
@@ -2,10 +2,12 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "DeflateDecoder.h"
+
static void *CreateCodecDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder); }
+
#if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
#include "DeflateEncoder.h"
static void *CreateCodecOutDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NEncoder::CCOMCoder); }
diff --git a/CPP/7zip/Compress/Huffman/HuffmanDecoder.h b/CPP/7zip/Compress/HuffmanDecoder.h
index 76b35c3a..82a1e6f2 100755
--- a/CPP/7zip/Compress/Huffman/HuffmanDecoder.h
+++ b/CPP/7zip/Compress/HuffmanDecoder.h
@@ -1,9 +1,9 @@
// Compress/HuffmanDecoder.h
-#ifndef __COMPRESS_HUFFMANDECODER_H
-#define __COMPRESS_HUFFMANDECODER_H
+#ifndef __COMPRESS_HUFFMAN_DECODER_H
+#define __COMPRESS_HUFFMAN_DECODER_H
-#include "../../../Common/Types.h"
+#include "../../Common/Types.h"
namespace NCompress {
namespace NHuffman {
diff --git a/CPP/7zip/Compress/Implode/StdAfx.h b/CPP/7zip/Compress/Implode/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Implode/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Implode/ImplodeDecoder.cpp b/CPP/7zip/Compress/ImplodeDecoder.cpp
index a641f53e..f84a013c 100755
--- a/CPP/7zip/Compress/Implode/ImplodeDecoder.cpp
+++ b/CPP/7zip/Compress/ImplodeDecoder.cpp
@@ -121,9 +121,8 @@ public:
~CCoderReleaser() { m_Coder->ReleaseStreams(); }
};
-STDMETHODIMP CCoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CCoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (!m_InBitStream.Create(1 << 20))
return E_OUTOFMEMORY;
@@ -193,12 +192,11 @@ STDMETHODIMP CCoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush();
}
-STDMETHODIMP CCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Implode/ImplodeDecoder.h b/CPP/7zip/Compress/ImplodeDecoder.h
index 9616edf9..7ea1553e 100755
--- a/CPP/7zip/Compress/Implode/ImplodeDecoder.h
+++ b/CPP/7zip/Compress/ImplodeDecoder.h
@@ -1,26 +1,26 @@
// ImplodeDecoder.h
-#ifndef __IMPLODE_DECODER_H
-#define __IMPLODE_DECODER_H
+#ifndef __COMPRESS_IMPLODE_DECODER_H
+#define __COMPRESS_IMPLODE_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../LZ/LZOutWindow.h"
+#include "../ICoder.h"
#include "ImplodeHuffmanDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NImplode {
namespace NDecoder {
-class CCoder :
+class CCoder:
public ICompressCoder,
public ICompressSetDecoderProperties2,
public CMyUnknownImp
{
- CLZOutWindow m_OutWindowStream;
- NStream::NLSBF::CDecoder<CInBuffer> m_InBitStream;
+ CLzOutWindow m_OutWindowStream;
+ NBitl::CDecoder<CInBuffer> m_InBitStream;
NImplode::NHuffman::CDecoder m_LiteralDecoder;
NImplode::NHuffman::CDecoder m_LengthDecoder;
@@ -41,17 +41,14 @@ public:
MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2)
void ReleaseStreams();
- HRESULT (Flush)() { return m_OutWindowStream.Flush(); }
+ HRESULT Flush() { return m_OutWindowStream.Flush(); }
- STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- // ICompressSetDecoderProperties
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
};
diff --git a/CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.cpp b/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp
index 64345e08..64345e08 100755
--- a/CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.cpp
+++ b/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp
diff --git a/CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.h b/CPP/7zip/Compress/ImplodeHuffmanDecoder.h
index 541ca59d..6120a35a 100755
--- a/CPP/7zip/Compress/Implode/ImplodeHuffmanDecoder.h
+++ b/CPP/7zip/Compress/ImplodeHuffmanDecoder.h
@@ -3,8 +3,9 @@
#ifndef __IMPLODE_HUFFMAN_DECODER_H
#define __IMPLODE_HUFFMAN_DECODER_H
-#include "../../Common/LSBFDecoder.h"
-#include "../../Common/InBuffer.h"
+#include "../Common/InBuffer.h"
+
+#include "BitlDecoder.h"
namespace NCompress {
namespace NImplode {
@@ -12,7 +13,7 @@ namespace NHuffman {
const int kNumBitsInLongestCode = 16;
-typedef NStream::NLSBF::CDecoder<CInBuffer> CInBit;
+typedef NBitl::CDecoder<CInBuffer> CInBit;
class CDecoder
{
diff --git a/CPP/7zip/Compress/LZ/StdAfx.h b/CPP/7zip/Compress/LZ/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/LZ/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/LZMA/LZMA.dsp b/CPP/7zip/Compress/LZMA/LZMA.dsp
deleted file mode 100755
index d7e130fd..00000000
--- a/CPP/7zip/Compress/LZMA/LZMA.dsp
+++ /dev/null
@@ -1,403 +0,0 @@
-# Microsoft Developer Studio Project File - Name="LZMA" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=LZMA - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "LZMA.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "LZMA.mak" CFG="LZMA - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "LZMA - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "LZMA - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 1
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMA_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "../../../" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMA_EXPORTS" /D "COMPRESS_MF_MT" /D "_7ZIP_LARGE_PAGES" /Yu"StdAfx.h" /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "NDEBUG"
-# ADD RSC /l 0x419 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-zip\Codecs\LZMA.dll" /opt:NOWIN98
-# SUBTRACT LINK32 /pdb:none /debug
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 1
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMA_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "../../../" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMA_EXPORTS" /D "COMPRESS_MF_MT" /D "_7ZIP_LARGE_PAGES" /Yu"StdAfx.h" /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "_DEBUG"
-# ADD RSC /l 0x419 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-zip\Codecs\LZMA.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "LZMA - Win32 Release"
-# Name "LZMA - Win32 Debug"
-# Begin Group "Spec"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Codec.def
-# End Source File
-# Begin Source File
-
-SOURCE=..\CodecExports.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\DllExports.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\resource.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"StdAfx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# End Group
-# Begin Group "7-zip Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.h
-# End Source File
-# End Group
-# Begin Group "RangeCoder"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\RangeCoder\RangeCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\RangeCoder\RangeCoderBit.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\RangeCoder\RangeCoderBit.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\RangeCoder\RangeCoderBitTree.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\RangeCoder\RangeCoderOpt.h
-# End Source File
-# End Group
-# Begin Group "Interface"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\ICoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\IStream.h
-# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\LZ\LZOutWindow.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\LZ\LZOutWindow.h
-# End Source File
-# End Group
-# Begin Group "Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\Common\ComTry.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Defs.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Exception.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\MyCom.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\MyUnknown.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\MyWindows.h
-# End Source File
-# End Group
-# Begin Group "C"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\..\C\7zCrc.c
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\7zCrc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Alloc.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Alloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\IStream.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzFind.c
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzFind.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzFindMt.c
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzFindMt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzHash.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzmaDec.c
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzmaDec.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzmaEnc.c
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\LzmaEnc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Threads.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Threads.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Types.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\LZMA.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\LZMADecoder.cpp
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\LZMADecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\LZMAEncoder.cpp
-
-!IF "$(CFG)" == "LZMA - Win32 Release"
-
-# ADD CPP /O2 /FAs
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LZMA - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\LZMAEncoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\LZMARegister.cpp
-# End Source File
-# End Target
-# End Project
diff --git a/CPP/7zip/Compress/LZMA/LZMA.dsw b/CPP/7zip/Compress/LZMA/LZMA.dsw
deleted file mode 100755
index f750e453..00000000
--- a/CPP/7zip/Compress/LZMA/LZMA.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "LZMA"=".\LZMA.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/CPP/7zip/Compress/LZMA/StdAfx.cpp b/CPP/7zip/Compress/LZMA/StdAfx.cpp
deleted file mode 100755
index d0feea85..00000000
--- a/CPP/7zip/Compress/LZMA/StdAfx.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// StdAfx.cpp
-
-#include "StdAfx.h"
diff --git a/CPP/7zip/Compress/LZMA/StdAfx.h b/CPP/7zip/Compress/LZMA/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/LZMA/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/LZMA/makefile b/CPP/7zip/Compress/LZMA/makefile
deleted file mode 100755
index e3b795e6..00000000
--- a/CPP/7zip/Compress/LZMA/makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-PROG = LZMA.dll
-DEF_FILE = ../Codec.def
-CFLAGS = $(CFLAGS) -I ../../../ \
- -DCOMPRESS_MF_MT \
- -D_7ZIP_LARGE_PAGES \
-
-LIBS = $(LIBS) oleaut32.lib
-
-COMPRESS_OBJS = \
- $O\CodecExports.obj \
- $O\DllExports.obj \
-
-COMMON_OBJS = \
- $O\CRC.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
- $O\LZMARegister.obj \
-
-7ZIP_COMMON_OBJS = \
- $O\InBuffer.obj \
- $O\OutBuffer.obj \
- $O\StreamUtils.obj \
-
-C_OBJS = \
- $O\Alloc.obj \
- $O\LzFind.obj \
- $O\LzFindMt.obj \
- $O\LzmaDec.obj \
- $O\LzmaEnc.obj \
- $O\Threads.obj \
-
-!include "../../Crc2.mak"
-
-OBJS = \
- $O\StdAfx.obj \
- $(COMPRESS_OBJS) \
- $(COMMON_OBJS) \
- $(LZMA_OPT_OBJS) \
- $(7ZIP_COMMON_OBJS) \
- $(C_OBJS) \
- $(CRC_OBJS) \
- $O\RangeCoderBit.obj \
- $O\resource.res
-
-!include "../../../Build.mak"
-
-$(COMPRESS_OBJS): ../$(*B).cpp
- $(COMPL)
-$(COMMON_OBJS): ../../../Common/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): $(*B).cpp
- $(COMPL_O2)
-$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
- $(COMPL)
-$O\RangeCoderBit.obj: ../RangeCoder/$(*B).cpp
- $(COMPL)
-$(C_OBJS): ../../../../C/$(*B).c
- $(COMPL_O2)
-!include "../../Crc.mak"
diff --git a/CPP/7zip/Compress/LZMA/resource.rc b/CPP/7zip/Compress/LZMA/resource.rc
deleted file mode 100755
index 1b2b6abb..00000000
--- a/CPP/7zip/Compress/LZMA/resource.rc
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../MyVersionInfo.rc"
-
-MY_VERSION_INFO_DLL("LZMA Codec", "LZMA")
diff --git a/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp b/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp
index abfbb237..76fa7b84 100755
--- a/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp
+++ b/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp
@@ -160,23 +160,19 @@ SOURCE=.\StdAfx.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\LZMA\LZMA.h
+SOURCE=..\LzmaDecoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\LZMA\LZMADecoder.cpp
+SOURCE=..\LzmaDecoder.h
# End Source File
# Begin Source File
-SOURCE=..\LZMA\LZMADecoder.h
+SOURCE=..\LzmaEncoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\LZMA\LZMAEncoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\LZMA\LZMAEncoder.h
+SOURCE=..\LzmaEncoder.h
# End Source File
# End Group
# End Group
diff --git a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
index d6ead3f4..4044c86d 100755
--- a/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
+++ b/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
@@ -22,8 +22,8 @@
#include "../../Common/FileStreams.h"
#include "../../Common/StreamUtils.h"
-#include "../LZMA/LZMADecoder.h"
-#include "../LZMA/LZMAEncoder.h"
+#include "../LzmaDecoder.h"
+#include "../LzmaEncoder.h"
#include "LzmaBenchCon.h"
@@ -380,7 +380,7 @@ int main2(int n, const char *args[])
UInt64 fileSize;
if (encodeMode)
{
- NCompress::NLZMA::CEncoder *encoderSpec = new NCompress::NLZMA::CEncoder;
+ NCompress::NLzma::CEncoder *encoderSpec = new NCompress::NLzma::CEncoder;
CMyComPtr<ICompressCoder> encoder = encoderSpec;
if (!dictDefined)
@@ -482,7 +482,7 @@ int main2(int n, const char *args[])
}
else
{
- NCompress::NLZMA::CDecoder *decoderSpec = new NCompress::NLZMA::CDecoder;
+ NCompress::NLzma::CDecoder *decoderSpec = new NCompress::NLzma::CDecoder;
CMyComPtr<ICompressCoder> decoder = decoderSpec;
decoderSpec->FinishStream = true;
const UInt32 kPropertiesSize = 5;
diff --git a/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp b/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp
index 5d350d45..2ad9a577 100755
--- a/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp
+++ b/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp
@@ -30,22 +30,23 @@
extern "C"
{
-#include "../../../../C/Alloc.h"
#include "../../../../C/7zCrc.h"
+#include "../../../../C/Alloc.h"
}
+
#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
#ifdef BENCH_MT
-#include "../../../Windows/Thread.h"
#include "../../../Windows/Synchronization.h"
+#include "../../../Windows/Thread.h"
#endif
#ifdef EXTERNAL_LZMA
#include "../../../Windows/PropVariant.h"
+#include "../../ICoder.h"
#else
-#include "../LZMA/LZMADecoder.h"
-#include "../LZMA/LZMAEncoder.h"
+#include "../LzmaDecoder.h"
+#include "../LzmaEncoder.h"
#endif
static const UInt32 kUncompressMinBlockSize = 1 << 26;
@@ -697,14 +698,14 @@ HRESULT LzmaBench(
#ifdef EXTERNAL_LZMA
RINOK(codecs->CreateCoder(name, true, encoder.encoder));
#else
- encoder.encoder = new NCompress::NLZMA::CEncoder;
+ encoder.encoder = new NCompress::NLzma::CEncoder;
#endif
for (UInt32 j = 0; j < numSubDecoderThreads; j++)
{
#ifdef EXTERNAL_LZMA
RINOK(codecs->CreateCoder(name, false, encoder.decoders[j]));
#else
- encoder.decoders[j] = new NCompress::NLZMA::CDecoder;
+ encoder.decoders[j] = new NCompress::NLzma::CDecoder;
#endif
}
}
diff --git a/CPP/7zip/Compress/LZMA_Alone/makefile b/CPP/7zip/Compress/LZMA_Alone/makefile
index 69196871..1c4baa0b 100755
--- a/CPP/7zip/Compress/LZMA_Alone/makefile
+++ b/CPP/7zip/Compress/LZMA_Alone/makefile
@@ -10,8 +10,8 @@ LZMA_OBJS = \
$O\LzmaBenchCon.obj \
LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
- $O\LZMAEncoder.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
COMMON_OBJS = \
$O\CommandLineParser.obj \
@@ -61,7 +61,7 @@ OBJS = \
$(LZMA_OBJS): $(*B).cpp
$(COMPL)
-$(LZMA_OPT_OBJS): ../LZMA/$(*B).cpp
+$(LZMA_OPT_OBJS): ../$(*B).cpp
$(COMPL_O2)
$(COMMON_OBJS): ../../../Common/$(*B).cpp
$(COMPL)
diff --git a/CPP/7zip/Compress/LZMA_Alone/makefile.gcc b/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
index 32ec28a3..8d534372 100755
--- a/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
+++ b/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
@@ -22,8 +22,8 @@ OBJS = \
LzmaAlone.o \
LzmaBench.o \
LzmaBenchCon.o \
- LZMADecoder.o \
- LZMAEncoder.o \
+ LzmaDecoder.o \
+ LzmaEncoder.o \
InBuffer.o \
OutBuffer.o \
FileStreams.o \
@@ -60,11 +60,11 @@ LzmaBench.o: LzmaBench.cpp
LzmaBenchCon.o: LzmaBenchCon.cpp
$(CXX) $(CFLAGS) LzmaBenchCon.cpp
-LZMADecoder.o: ../LZMA/LZMADecoder.cpp
- $(CXX) $(CFLAGS) ../LZMA/LZMADecoder.cpp
+LzmaDecoder.o: ../LzmaDecoder.cpp
+ $(CXX) $(CFLAGS) ../LzmaDecoder.cpp
-LZMAEncoder.o: ../LZMA/LZMAEncoder.cpp
- $(CXX) $(CFLAGS) ../LZMA/LZMAEncoder.cpp
+LzmaEncoder.o: ../LzmaEncoder.cpp
+ $(CXX) $(CFLAGS) ../LzmaEncoder.cpp
InBuffer.o: ../../Common/InBuffer.cpp
$(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
diff --git a/CPP/7zip/Compress/LZ/LZOutWindow.cpp b/CPP/7zip/Compress/LzOutWindow.cpp
index 9de2d06f..df46295b 100755
--- a/CPP/7zip/Compress/LZ/LZOutWindow.cpp
+++ b/CPP/7zip/Compress/LzOutWindow.cpp
@@ -1,16 +1,14 @@
-// LZOutWindow.cpp
+// LzOutWindow.cpp
#include "StdAfx.h"
-#include "LZOutWindow.h"
+#include "LzOutWindow.h"
-void CLZOutWindow::Init(bool solid)
+void CLzOutWindow::Init(bool solid)
{
- if(!solid)
+ if (!solid)
COutBuffer::Init();
#ifdef _NO_EXCEPTIONS
ErrorCode = S_OK;
#endif
}
-
-
diff --git a/CPP/7zip/Compress/LZ/LZOutWindow.h b/CPP/7zip/Compress/LzOutWindow.h
index 747d49d1..d8d13c22 100755
--- a/CPP/7zip/Compress/LZ/LZOutWindow.h
+++ b/CPP/7zip/Compress/LzOutWindow.h
@@ -1,16 +1,17 @@
-// LZOutWindow.h
+// LzOutWindow.h
#ifndef __LZ_OUT_WINDOW_H
#define __LZ_OUT_WINDOW_H
-#include "../../IStream.h"
-#include "../../Common/OutBuffer.h"
+#include "../IStream.h"
+
+#include "../Common/OutBuffer.h"
#ifndef _NO_EXCEPTIONS
-typedef COutBufferException CLZOutWindowException;
+typedef COutBufferException CLzOutWindowException;
#endif
-class CLZOutWindow: public COutBuffer
+class CLzOutWindow: public COutBuffer
{
public:
void Init(bool solid = false);
diff --git a/CPP/7zip/Compress/Lzh/LzhDecoder.cpp b/CPP/7zip/Compress/LzhDecoder.cpp
index ef1b718a..6f9b5065 100755
--- a/CPP/7zip/Compress/Lzh/LzhDecoder.cpp
+++ b/CPP/7zip/Compress/LzhDecoder.cpp
@@ -213,7 +213,7 @@ STDMETHODIMP CCoder::Code(ISequentialInStream *inStream,
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress);}
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Lzh/LzhDecoder.h b/CPP/7zip/Compress/LzhDecoder.h
index c2f240e0..ed631e20 100755
--- a/CPP/7zip/Compress/Lzh/LzhDecoder.h
+++ b/CPP/7zip/Compress/LzhDecoder.h
@@ -3,12 +3,15 @@
#ifndef __COMPRESS_LZH_DECODER_H
#define __COMPRESS_LZH_DECODER_H
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
-#include "../Huffman/HuffmanDecoder.h"
-#include "../LZ/LZOutWindow.h"
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "HuffmanDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NLzh {
@@ -44,8 +47,8 @@ class CCoder :
public ICompressCoder,
public CMyUnknownImp
{
- CLZOutWindow m_OutWindowStream;
- NStream::NMSBF::CDecoder<CInBuffer> m_InBitStream;
+ CLzOutWindow m_OutWindowStream;
+ NBitm::CDecoder<CInBuffer> m_InBitStream;
int m_NumDictBits;
diff --git a/CPP/7zip/Compress/LZMA/LZMADecoder.cpp b/CPP/7zip/Compress/LzmaDecoder.cpp
index ae5da5de..5bfffe90 100755
--- a/CPP/7zip/Compress/LZMA/LZMADecoder.cpp
+++ b/CPP/7zip/Compress/LzmaDecoder.cpp
@@ -1,16 +1,16 @@
-// LZMADecoder.cpp
+// LzmaDecoder.cpp
#include "StdAfx.h"
-#include "LZMADecoder.h"
-#include "../../../Common/Defs.h"
-#include "../../Common/StreamUtils.h"
-
extern "C"
{
- #include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
+#include "../Common/StreamUtils.h"
+
+#include "LzmaDecoder.h"
+
static HRESULT SResToHRESULT(SRes res)
{
switch(res)
@@ -26,7 +26,7 @@ static HRESULT SResToHRESULT(SRes res)
}
namespace NCompress {
-namespace NLZMA {
+namespace NLzma {
static const UInt32 kInBufSize = 1 << 20;
@@ -76,9 +76,8 @@ STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
return S_OK;
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */,
- const UInt64 *outSize, ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (_inBuf == 0)
return S_FALSE;
diff --git a/CPP/7zip/Compress/LZMA/LZMADecoder.h b/CPP/7zip/Compress/LzmaDecoder.h
index 40dc3f36..e132d5cb 100755
--- a/CPP/7zip/Compress/LZMA/LZMADecoder.h
+++ b/CPP/7zip/Compress/LzmaDecoder.h
@@ -1,18 +1,18 @@
-// LZMADecoder.h
+// LzmaDecoder.h
#ifndef __LZMA_DECODER_H
#define __LZMA_DECODER_H
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-
extern "C"
{
- #include "../../../../C/LzmaDec.h"
+#include "../../../C/LzmaDec.h"
}
+#include "../../Common/MyCom.h"
+#include "../ICoder.h"
+
namespace NCompress {
-namespace NLZMA {
+namespace NLzma {
class CDecoder:
public ICompressCoder,
@@ -49,14 +49,10 @@ public:
ICompressGetInStreamProcessedSize)
#endif
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *_inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
-
STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
-
STDMETHOD(SetInStream)(ISequentialInStream *inStream);
STDMETHOD(ReleaseInStream)();
STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
diff --git a/CPP/7zip/Compress/LZMA/LZMAEncoder.cpp b/CPP/7zip/Compress/LzmaEncoder.cpp
index 43e1b772..986e1edb 100755
--- a/CPP/7zip/Compress/LZMA/LZMAEncoder.cpp
+++ b/CPP/7zip/Compress/LzmaEncoder.cpp
@@ -1,30 +1,16 @@
-// LZMA/Encoder.cpp
+// LzmaEncoder.cpp
#include "StdAfx.h"
-#include <stdio.h>
-
-#ifdef _WIN32
-#define USE_ALLOCA
-#endif
-
-#ifdef USE_ALLOCA
-#ifdef _WIN32
-#include <malloc.h>
-#else
-#include <stdlib.h>
-#endif
-#endif
-
-#include "LZMAEncoder.h"
-
-#include "../../Common/StreamUtils.h"
-
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
+#include "../Common/StreamUtils.h"
+
+#include "LzmaEncoder.h"
+
static HRESULT SResToHRESULT(SRes res)
{
switch(res)
@@ -38,7 +24,7 @@ static HRESULT SResToHRESULT(SRes res)
}
namespace NCompress {
-namespace NLZMA {
+namespace NLzma {
static const UInt32 kStreamStepSize = (UInt32)1 << 31;
@@ -123,14 +109,14 @@ static int ParseMatchFinder(const wchar_t *s, int *btMode, int *numHashBytes)
}
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
+ const PROPVARIANT *coderProps, UInt32 numProps)
{
CLzmaEncProps props;
LzmaEncProps_Init(&props);
- for (UInt32 i = 0; i < numProperties; i++)
+ for (UInt32 i = 0; i < numProps; i++)
{
- const PROPVARIANT &prop = properties[i];
+ const PROPVARIANT &prop = coderProps[i];
switch (propIDs[i])
{
case NCoderPropID::kNumFastBytes:
@@ -203,10 +189,8 @@ SRes CompressProgress(void *pp, UInt64 inSize, UInt64 outSize)
return (SRes)p->Res;
}
-STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */,
- const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
CCompressProgressImp progressImp;
progressImp.p.Progress = CompressProgress;
diff --git a/CPP/7zip/Compress/LZMA/LZMAEncoder.h b/CPP/7zip/Compress/LzmaEncoder.h
index 05583e74..4205d2b1 100755
--- a/CPP/7zip/Compress/LZMA/LZMAEncoder.h
+++ b/CPP/7zip/Compress/LzmaEncoder.h
@@ -1,18 +1,19 @@
-// LZMA/Encoder.h
+// LzmaEncoder.h
#ifndef __LZMA_ENCODER_H
#define __LZMA_ENCODER_H
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-
extern "C"
{
- #include "../../../../C/LzmaEnc.h"
+#include "../../../C/LzmaEnc.h"
}
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
namespace NCompress {
-namespace NLZMA {
+namespace NLzma {
struct CSeqInStream
{
@@ -35,7 +36,7 @@ class CEncoder :
public CMyUnknownImp
{
CLzmaEncHandle _encoder;
-
+
CSeqInStream _seqInStream;
CSeqOutStream _seqOutStream;
@@ -48,19 +49,10 @@ public:
ICompressWriteCoderProperties
)
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- // ICompressSetCoderProperties2
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
-
- // ICompressWriteCoderProperties
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
-
STDMETHOD(SetOutStream)(ISequentialOutStream *outStream);
STDMETHOD(ReleaseOutStream)();
diff --git a/CPP/7zip/Compress/LZMA/LZMARegister.cpp b/CPP/7zip/Compress/LzmaRegister.cpp
index bc8f7262..96ed0bae 100755
--- a/CPP/7zip/Compress/LZMA/LZMARegister.cpp
+++ b/CPP/7zip/Compress/LzmaRegister.cpp
@@ -1,14 +1,15 @@
-// LZMARegister.cpp
+// LzmaRegister.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
-#include "LZMADecoder.h"
-static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NLZMA::CDecoder); }
+#include "LzmaDecoder.h"
+
+static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NLzma::CDecoder); }
#ifndef EXTRACT_ONLY
-#include "LZMAEncoder.h"
-static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NLZMA::CEncoder); }
+#include "LzmaEncoder.h"
+static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NLzma::CEncoder); }
#else
#define CreateCodecOut 0
#endif
diff --git a/CPP/7zip/Compress/Lzx/Lzx.h b/CPP/7zip/Compress/Lzx.h
index 249cbe51..249cbe51 100755
--- a/CPP/7zip/Compress/Lzx/Lzx.h
+++ b/CPP/7zip/Compress/Lzx.h
diff --git a/CPP/7zip/Compress/Lzx/StdAfx.h b/CPP/7zip/Compress/Lzx/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Lzx/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Lzx/Lzx86Converter.cpp b/CPP/7zip/Compress/Lzx86Converter.cpp
index 0492b36c..9e53f18a 100755
--- a/CPP/7zip/Compress/Lzx/Lzx86Converter.cpp
+++ b/CPP/7zip/Compress/Lzx86Converter.cpp
@@ -2,7 +2,7 @@
#include "StdAfx.h"
-#include "Common/Defs.h"
+#include "../../Common/Defs.h"
#include "Lzx86Converter.h"
diff --git a/CPP/7zip/Compress/Lzx/Lzx86Converter.h b/CPP/7zip/Compress/Lzx86Converter.h
index c8757ad5..9f110c29 100755
--- a/CPP/7zip/Compress/Lzx/Lzx86Converter.h
+++ b/CPP/7zip/Compress/Lzx86Converter.h
@@ -1,10 +1,11 @@
-// Lzx/x86Converter.h
+// Lzx86Converter.h
-#ifndef __LZX_X86CONVERTER_H
-#define __LZX_X86CONVERTER_H
+#ifndef __LZX_86_CONVERTER_H
+#define __LZX_86_CONVERTER_H
-#include "Common/MyCom.h"
-#include "../../IStream.h"
+#include "../../Common/MyCom.h"
+
+#include "../IStream.h"
namespace NCompress {
namespace NLzx {
diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp b/CPP/7zip/Compress/LzxDecoder.cpp
index ceeb25d3..373c902c 100755
--- a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp
+++ b/CPP/7zip/Compress/LzxDecoder.cpp
@@ -2,14 +2,9 @@
#include "StdAfx.h"
-#include "LzxDecoder.h"
+#include "../../Common/Defs.h"
-#include "Common/Defs.h"
-extern "C"
-{
-#include "../../../../C/Alloc.h"
-}
-#include "Windows/Defs.h"
+#include "LzxDecoder.h"
namespace NCompress {
namespace NLzx {
@@ -306,10 +301,8 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize)
return S_OK;
}
-HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (outSize == NULL)
return E_INVALIDARG;
@@ -343,12 +336,11 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
return Flush();
}
-HRESULT CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.h b/CPP/7zip/Compress/LzxDecoder.h
index a9b41570..d7979231 100755
--- a/CPP/7zip/Compress/Lzx/LzxDecoder.h
+++ b/CPP/7zip/Compress/LzxDecoder.h
@@ -1,14 +1,14 @@
// LzxDecoder.h
-#ifndef __LZXDECODER_H
-#define __LZXDECODER_H
+#ifndef __LZX_DECODER_H
+#define __LZX_DECODER_H
-#include "../../ICoder.h"
+#include "../ICoder.h"
-#include "../../Compress/Huffman/HuffmanDecoder.h"
-#include "../../Compress/LZ/LZOutWindow.h"
-#include "../../Common/InBuffer.h"
+#include "../Common/InBuffer.h"
+#include "HuffmanDecoder.h"
+#include "LzOutWindow.h"
#include "Lzx.h"
#include "Lzx86Converter.h"
@@ -101,7 +101,7 @@ class CDecoder :
public CMyUnknownImp
{
NBitStream::CDecoder m_InBitStream;
- CLZOutWindow m_OutWindowStream;
+ CLzOutWindow m_OutWindowStream;
UInt32 m_RepDistances[kNumRepDistances];
UInt32 m_NumPosLenSlots;
@@ -135,10 +135,8 @@ class CDecoder :
HRESULT CodeSpec(UInt32 size);
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
public:
CDecoder(bool wimMode = false);
@@ -147,11 +145,8 @@ public:
void ReleaseStreams();
STDMETHOD(Flush)();
- // ICompressCoder interface
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetInStream)(ISequentialInStream *inStream);
STDMETHOD(ReleaseInStream)();
diff --git a/CPP/7zip/Compress/BWT/Mtf8.h b/CPP/7zip/Compress/Mtf8.h
index 470fd044..7a6b7fe6 100755
--- a/CPP/7zip/Compress/BWT/Mtf8.h
+++ b/CPP/7zip/Compress/Mtf8.h
@@ -1,63 +1,63 @@
// Mtf8.h
-#ifndef __MTF8_H
-#define __MTF8_H
+#ifndef __COMPRESS_MTF8_H
+#define __COMPRESS_MTF8_H
-#include "Common/Types.h"
+#include "../../Common/Types.h"
namespace NCompress {
-class CMtf8Encoder
+struct CMtf8Encoder
{
-public:
- Byte Buffer[256];
+ Byte Buf[256];
+
int FindAndMove(Byte v)
{
int pos;
- for (pos = 0; Buffer[pos] != v; pos++);
+ for (pos = 0; Buf[pos] != v; pos++);
int resPos = pos;
for (; pos >= 8; pos -= 8)
{
- Buffer[pos] = Buffer[pos - 1];
- Buffer[pos - 1] = Buffer[pos - 2];
- Buffer[pos - 2] = Buffer[pos - 3];
- Buffer[pos - 3] = Buffer[pos - 4];
- Buffer[pos - 4] = Buffer[pos - 5];
- Buffer[pos - 5] = Buffer[pos - 6];
- Buffer[pos - 6] = Buffer[pos - 7];
- Buffer[pos - 7] = Buffer[pos - 8];
+ Buf[pos] = Buf[pos - 1];
+ Buf[pos - 1] = Buf[pos - 2];
+ Buf[pos - 2] = Buf[pos - 3];
+ Buf[pos - 3] = Buf[pos - 4];
+ Buf[pos - 4] = Buf[pos - 5];
+ Buf[pos - 5] = Buf[pos - 6];
+ Buf[pos - 6] = Buf[pos - 7];
+ Buf[pos - 7] = Buf[pos - 8];
}
for (; pos > 0; pos--)
- Buffer[pos] = Buffer[pos - 1];
- Buffer[0] = v;
+ Buf[pos] = Buf[pos - 1];
+ Buf[0] = v;
return resPos;
}
};
/*
-class CMtf8Decoder
+struct CMtf8Decoder
{
-public:
- Byte Buffer[256];
+ Byte Buf[256];
+
void Init(int) {};
- Byte GetHead() const { return Buffer[0]; }
+ Byte GetHead() const { return Buf[0]; }
Byte GetAndMove(int pos)
{
- Byte res = Buffer[pos];
+ Byte res = Buf[pos];
for (; pos >= 8; pos -= 8)
{
- Buffer[pos] = Buffer[pos - 1];
- Buffer[pos - 1] = Buffer[pos - 2];
- Buffer[pos - 2] = Buffer[pos - 3];
- Buffer[pos - 3] = Buffer[pos - 4];
- Buffer[pos - 4] = Buffer[pos - 5];
- Buffer[pos - 5] = Buffer[pos - 6];
- Buffer[pos - 6] = Buffer[pos - 7];
- Buffer[pos - 7] = Buffer[pos - 8];
+ Buf[pos] = Buf[pos - 1];
+ Buf[pos - 1] = Buf[pos - 2];
+ Buf[pos - 2] = Buf[pos - 3];
+ Buf[pos - 3] = Buf[pos - 4];
+ Buf[pos - 4] = Buf[pos - 5];
+ Buf[pos - 5] = Buf[pos - 6];
+ Buf[pos - 6] = Buf[pos - 7];
+ Buf[pos - 7] = Buf[pos - 8];
}
for (; pos > 0; pos--)
- Buffer[pos] = Buffer[pos - 1];
- Buffer[0] = res;
+ Buf[pos] = Buf[pos - 1];
+ Buf[0] = res;
return res;
}
};
@@ -78,41 +78,41 @@ typedef UInt32 CMtfVar;
#define MTF_MASK ((1 << MTF_MOVS) - 1)
-class CMtf8Decoder
+struct CMtf8Decoder
{
-public:
- CMtfVar Buffer[256 >> MTF_MOVS];
- void StartInit() { memset(Buffer, 0, sizeof(Buffer)); }
- void Add(unsigned int pos, Byte val) { Buffer[pos >> MTF_MOVS] |= ((CMtfVar)val << ((pos & MTF_MASK) << 3)); }
- Byte GetHead() const { return (Byte)Buffer[0]; }
+ CMtfVar Buf[256 >> MTF_MOVS];
+
+ void StartInit() { memset(Buf, 0, sizeof(Buf)); }
+ void Add(unsigned int pos, Byte val) { Buf[pos >> MTF_MOVS] |= ((CMtfVar)val << ((pos & MTF_MASK) << 3)); }
+ Byte GetHead() const { return (Byte)Buf[0]; }
Byte GetAndMove(unsigned int pos)
{
UInt32 lim = ((UInt32)pos >> MTF_MOVS);
pos = (pos & MTF_MASK) << 3;
- CMtfVar prev = (Buffer[lim] >> pos) & 0xFF;
+ CMtfVar prev = (Buf[lim] >> pos) & 0xFF;
UInt32 i = 0;
if ((lim & 1) != 0)
{
- CMtfVar next = Buffer[0];
- Buffer[0] = (next << 8) | prev;
+ CMtfVar next = Buf[0];
+ Buf[0] = (next << 8) | prev;
prev = (next >> (MTF_MASK << 3));
i = 1;
lim -= 1;
}
for (; i < lim; i += 2)
{
- CMtfVar next = Buffer[i];
- Buffer[i] = (next << 8) | prev;
+ CMtfVar next = Buf[i];
+ Buf[i] = (next << 8) | prev;
prev = (next >> (MTF_MASK << 3));
- next = Buffer[i + 1];
- Buffer[i + 1] = (next << 8) | prev;
+ next = Buf[i + 1];
+ Buf[i + 1] = (next << 8) | prev;
prev = (next >> (MTF_MASK << 3));
}
- CMtfVar next = Buffer[i];
+ CMtfVar next = Buf[i];
CMtfVar mask = (((CMtfVar)0x100 << pos) - 1);
- Buffer[i] = (next & ~mask) | (((next << 8) | prev) & mask);
- return (Byte)Buffer[0];
+ Buf[i] = (next & ~mask) | (((next << 8) | prev) & mask);
+ return (Byte)Buf[0];
}
};
@@ -125,13 +125,13 @@ class CMtf8Decoder
Byte Counts[16];
int Size;
public:
- Byte Buffer[256];
+ Byte Buf[256];
Byte GetHead() const
{
if (SmallSize > 0)
return SmallBuffer[kSmallSize - SmallSize];
- return Buffer[0];
+ return Buf[0];
}
void Init(int size)
@@ -165,12 +165,12 @@ public:
g--;
int offset = (g << 4);
for (int t = Counts[g] - 1; t >= 0; t--, i--)
- Buffer[i] = Buffer[offset + t];
+ Buf[i] = Buf[offset + t];
}
while(g != 0);
for (i = kSmallSize - 1; i >= 0; i--)
- Buffer[i] = SmallBuffer[i];
+ Buf[i] = SmallBuffer[i];
Init(Size);
}
pos -= SmallSize;
@@ -178,9 +178,9 @@ public:
for (g = 0; pos >= Counts[g]; g++)
pos -= Counts[g];
int offset = (g << 4);
- Byte res = Buffer[offset + pos];
+ Byte res = Buf[offset + pos];
for (pos; pos < 16 - 1; pos++)
- Buffer[offset + pos] = Buffer[offset + pos + 1];
+ Buf[offset + pos] = Buf[offset + pos + 1];
SmallSize++;
SmallBuffer[kSmallSize - SmallSize] = res;
@@ -192,4 +192,5 @@ public:
*/
}
+
#endif
diff --git a/CPP/7zip/Compress/PPMD/StdAfx.h b/CPP/7zip/Compress/PPMD/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/PPMD/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/PPMD/PPMDContext.h b/CPP/7zip/Compress/PpmdContext.h
index 577d3b76..f4fa78e4 100755
--- a/CPP/7zip/Compress/PPMD/PPMDContext.h
+++ b/CPP/7zip/Compress/PpmdContext.h
@@ -1,16 +1,16 @@
-// Compress/PPMD/Context.h
+// PpmdContext.h
// This code is based on Dmitry Shkarin's PPMdH code
#ifndef __COMPRESS_PPMD_CONTEXT_H
#define __COMPRESS_PPMD_CONTEXT_H
-#include "../../../Common/Types.h"
+#include "../../Common/Types.h"
-#include "../RangeCoder/RangeCoder.h"
-#include "PPMDSubAlloc.h"
+#include "PpmdSubAlloc.h"
+#include "RangeCoder.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
const int INT_BITS=7, PERIOD_BITS=7, TOT_BITS=INT_BITS+PERIOD_BITS,
INTERVAL=1 << INT_BITS, BIN_SCALE=1 << TOT_BITS, MAX_FREQ=124;
diff --git a/CPP/7zip/Compress/PPMD/PPMDDecode.h b/CPP/7zip/Compress/PpmdDecode.h
index 1df2c9cd..860c65b4 100755
--- a/CPP/7zip/Compress/PPMD/PPMDDecode.h
+++ b/CPP/7zip/Compress/PpmdDecode.h
@@ -1,13 +1,13 @@
-// PPMDDecode.h
+// PpmdDecode.h
// This code is based on Dmitry Shkarin's PPMdH code
#ifndef __COMPRESS_PPMD_DECODE_H
#define __COMPRESS_PPMD_DECODE_H
-#include "PPMDContext.h"
+#include "PpmdContext.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
class CRangeDecoderVirt
{
diff --git a/CPP/7zip/Compress/PPMD/PPMDDecoder.cpp b/CPP/7zip/Compress/PpmdDecoder.cpp
index cbb7e786..dea36d9a 100755
--- a/CPP/7zip/Compress/PPMD/PPMDDecoder.cpp
+++ b/CPP/7zip/Compress/PpmdDecoder.cpp
@@ -1,14 +1,14 @@
-// PPMDDecoder.cpp
+// PpmdDecoder.cpp
#include "StdAfx.h"
#include "Common/Defs.h"
#include "Windows/Defs.h"
-#include "PPMDDecoder.h"
+#include "PpmdDecoder.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
const int kLenIdFinished = -1;
const int kLenIdNeedInit = -2;
@@ -84,9 +84,8 @@ HRESULT CDecoder::CodeSpec(UInt32 size, Byte *memStream)
return S_OK;
}
-STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (!_outStream.Create(1 << 20))
return E_OUTOFMEMORY;
@@ -132,9 +131,8 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
#endif
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
PPMD_TRY_BEGIN
return CodeReal(inStream, outStream, inSize, outSize, progress);
diff --git a/CPP/7zip/Compress/PPMD/PPMDDecoder.h b/CPP/7zip/Compress/PpmdDecoder.h
index 7c7201bf..0d8817d4 100755
--- a/CPP/7zip/Compress/PPMD/PPMDDecoder.h
+++ b/CPP/7zip/Compress/PpmdDecoder.h
@@ -1,18 +1,19 @@
-// Compress/PPM/PPMDDecoder.h
+// PpmdDecoder.h
#ifndef __COMPRESS_PPMD_DECODER_H
#define __COMPRESS_PPMD_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/OutBuffer.h"
-#include "../RangeCoder/RangeCoder.h"
+#include "../ICoder.h"
-#include "PPMDDecode.h"
+#include "../Common/OutBuffer.h"
+
+#include "PpmdDecode.h"
+#include "RangeCoder.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
class CDecoder :
public ICompressCoder,
@@ -39,6 +40,7 @@ class CDecoder :
UInt64 _processedSize;
HRESULT CodeSpec(UInt32 num, Byte *memStream);
+
public:
#ifndef NO_READ_FROM_CODER
@@ -60,15 +62,11 @@ public:
HRESULT Flush() { return _outStream.Flush(); }
- STDMETHOD(CodeReal)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
@@ -81,7 +79,6 @@ public:
#endif
CDecoder(): _outSizeDefined(false) {}
-
};
}}
diff --git a/CPP/7zip/Compress/PPMD/PPMDEncode.h b/CPP/7zip/Compress/PpmdEncode.h
index 1e9d907c..0db92361 100755
--- a/CPP/7zip/Compress/PPMD/PPMDEncode.h
+++ b/CPP/7zip/Compress/PpmdEncode.h
@@ -1,17 +1,16 @@
-// PPMDEncode.h
+// PpmdEncode.h
// This code is based on Dmitry Shkarin's PPMdH code
#ifndef __COMPRESS_PPMD_ENCODE_H
#define __COMPRESS_PPMD_ENCODE_H
-#include "PPMDContext.h"
+#include "PpmdContext.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
struct CEncodeInfo: public CInfo
{
-
void EncodeBinSymbol(int symbol, NRangeCoder::CEncoder *rangeEncoder)
{
PPM_CONTEXT::STATE& rs = MinContext->oneState();
@@ -135,8 +134,8 @@ SYMBOL_FOUND:
}
NextContext();
}
-
};
+
}}
#endif
diff --git a/CPP/7zip/Compress/PPMD/PPMDEncoder.cpp b/CPP/7zip/Compress/PpmdEncoder.cpp
index c4cd1df2..1e98c091 100755
--- a/CPP/7zip/Compress/PPMD/PPMDEncoder.cpp
+++ b/CPP/7zip/Compress/PpmdEncoder.cpp
@@ -1,20 +1,16 @@
-// Compress/Associative/Encoder.h
+// PpmdEncoder.cpp
#include "StdAfx.h"
-#include "Windows/Defs.h"
-
// #include <fstream.h>
// #include <iomanip.h>
-#include "Common/Defs.h"
-
-#include "../../Common/StreamUtils.h"
+#include "../Common/StreamUtils.h"
-#include "PPMDEncoder.h"
+#include "PpmdEncoder.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
const UInt32 kMinMemSize = (1 << 11);
const UInt32 kMinOrder = 2;
@@ -45,12 +41,11 @@ public:
CCounter g_Counter;
*/
-STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties)
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
{
- for (UInt32 i = 0; i < numProperties; i++)
+ for (UInt32 i = 0; i < numProps; i++)
{
- const PROPVARIANT &prop = properties[i];
+ const PROPVARIANT &prop = props[i];
switch(propIDs[i])
{
case NCoderPropID::kUsedMemorySize:
@@ -77,11 +72,11 @@ STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
{
const UInt32 kPropSize = 5;
- Byte properties[kPropSize];
- properties[0] = _order;
+ Byte props[kPropSize];
+ props[0] = _order;
for (int i = 0; i < 4; i++)
- properties[1 + i] = Byte(_usedMemorySize >> (8 * i));
- return WriteStream(outStream, properties, kPropSize);
+ props[1 + i] = Byte(_usedMemorySize >> (8 * i));
+ return WriteStream(outStream, props, kPropSize);
}
const UInt32 kUsedMemorySizeDefault = (1 << 24);
@@ -94,10 +89,8 @@ CEncoder::CEncoder():
}
-HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 * /* inSize */, const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+HRESULT CEncoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
if (!_inStream.Create(1 << 20))
return E_OUTOFMEMORY;
@@ -142,9 +135,8 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
}
}
-STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const COutBufferException &e) { return e.ErrorCode; }
diff --git a/CPP/7zip/Compress/PPMD/PPMDEncoder.h b/CPP/7zip/Compress/PpmdEncoder.h
index 0c027ff0..72b10651 100755
--- a/CPP/7zip/Compress/PPMD/PPMDEncoder.h
+++ b/CPP/7zip/Compress/PpmdEncoder.h
@@ -1,18 +1,19 @@
-// Compress/PPMD/Encoder.h
+// PpmdEncoder.h
#ifndef __COMPRESS_PPMD_ENCODER_H
#define __COMPRESS_PPMD_ENCODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/InBuffer.h"
-#include "../RangeCoder/RangeCoder.h"
+#include "../ICoder.h"
-#include "PPMDEncode.h"
+#include "../Common/InBuffer.h"
+
+#include "PpmdEncode.h"
+#include "RangeCoder.h"
namespace NCompress {
-namespace NPPMD {
+namespace NPpmd {
class CEncoder :
public ICompressCoder,
@@ -41,9 +42,8 @@ public:
_rangeEncoder.ReleaseStream();
}
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
class CEncoderFlusher
{
@@ -63,17 +63,14 @@ public:
ICompressSetCoderProperties,
ICompressWriteCoderProperties)
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
CEncoder();
-
};
}}
diff --git a/CPP/7zip/Compress/PPMD/PPMDRegister.cpp b/CPP/7zip/Compress/PpmdRegister.cpp
index 2f6dd7cd..cac1fb85 100755
--- a/CPP/7zip/Compress/PPMD/PPMDRegister.cpp
+++ b/CPP/7zip/Compress/PpmdRegister.cpp
@@ -1,14 +1,15 @@
-// PPMDRegister.cpp
+// PpmdRegister.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
-#include "PPMDDecoder.h"
-static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NPPMD::CDecoder); }
+#include "PpmdDecoder.h"
+
+static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NPpmd::CDecoder); }
#ifndef EXTRACT_ONLY
-#include "PPMDEncoder.h"
-static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NPPMD::CEncoder); }
+#include "PpmdEncoder.h"
+static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NPpmd::CEncoder); }
#else
#define CreateCodecOut 0
#endif
diff --git a/CPP/7zip/Compress/PPMD/PPMDSubAlloc.h b/CPP/7zip/Compress/PpmdSubAlloc.h
index 480ffa13..a7dd122c 100755
--- a/CPP/7zip/Compress/PPMD/PPMDSubAlloc.h
+++ b/CPP/7zip/Compress/PpmdSubAlloc.h
@@ -1,16 +1,16 @@
-// PPMDSubAlloc.h
+// PpmdSubAlloc.h
// This code is based on Dmitry Shkarin's PPMdH code
-#ifndef __PPMD_SUBALLOC_H
-#define __PPMD_SUBALLOC_H
-
-#include "PPMDType.h"
+#ifndef __COMPRESS_PPMD_SUB_ALLOC_H
+#define __COMPRESS_PPMD_SUB_ALLOC_H
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
+#include "PpmdType.h"
+
const UINT N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4;
const UINT UNIT_SIZE=12, N_INDEXES=N1+N2+N3+N4;
diff --git a/CPP/7zip/Compress/PPMD/PPMDType.h b/CPP/7zip/Compress/PpmdType.h
index aec68095..4f0e65e8 100755
--- a/CPP/7zip/Compress/PPMD/PPMDType.h
+++ b/CPP/7zip/Compress/PpmdType.h
@@ -7,8 +7,9 @@
* modified by Igor Pavlov (2004-08-29).
****************************************************************************/
-#ifndef __PPMD_TYPE_H
-#define __PPMD_TYPE_H
+
+#ifndef __COMPRESS_PPMD_TYPE_H
+#define __COMPRESS_PPMD_TYPE_H
const int kMaxOrderCompress = 32;
const int MAX_O = 255; /* maximum allowed model order */
diff --git a/CPP/7zip/Compress/Quantum/StdAfx.h b/CPP/7zip/Compress/Quantum/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Quantum/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Quantum/QuantumDecoder.cpp b/CPP/7zip/Compress/QuantumDecoder.cpp
index 03425578..b4c1c256 100755
--- a/CPP/7zip/Compress/Quantum/QuantumDecoder.cpp
+++ b/CPP/7zip/Compress/QuantumDecoder.cpp
@@ -2,8 +2,9 @@
#include "StdAfx.h"
+#include "../../Common/Defs.h"
+
#include "QuantumDecoder.h"
-#include "../../../Common/Defs.h"
namespace NCompress {
namespace NQuantum {
@@ -104,10 +105,8 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize)
return _rangeDecoder.Stream.WasFinished() ? S_FALSE : S_OK;
}
-HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (outSize == NULL)
return E_INVALIDARG;
@@ -139,13 +138,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
return Flush();
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Quantum/QuantumDecoder.h b/CPP/7zip/Compress/QuantumDecoder.h
index 5871f536..d9007a61 100755
--- a/CPP/7zip/Compress/Quantum/QuantumDecoder.h
+++ b/CPP/7zip/Compress/QuantumDecoder.h
@@ -1,13 +1,15 @@
// QuantumDecoder.h
-#ifndef __QUANTUM_DECODER_H
-#define __QUANTUM_DECODER_H
+#ifndef __COMPRESS_QUANTUM_DECODER_H
+#define __COMPRESS_QUANTUM_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../Common/InBuffer.h"
-#include "../../ICoder.h"
-#include "../LZ/LZOutWindow.h"
+#include "../ICoder.h"
+
+#include "../Common/InBuffer.h"
+
+#include "LzOutWindow.h"
namespace NCompress {
namespace NQuantum {
@@ -207,7 +209,7 @@ class CDecoder:
public ICompressSetOutStreamSize,
public CMyUnknownImp
{
- CLZOutWindow _outWindowStream;
+ CLzOutWindow _outWindowStream;
NRangeCoder::CDecoder _rangeDecoder;
///////////////////
@@ -256,13 +258,11 @@ public:
HRESULT Flush() { return _outWindowStream.Flush(); }
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetInStream)(ISequentialInStream *inStream);
STDMETHOD(ReleaseInStream)();
diff --git a/CPP/7zip/Compress/RangeCoder/RangeCoder.h b/CPP/7zip/Compress/RangeCoder.h
index b79c0fc8..1e14ac1f 100755
--- a/CPP/7zip/Compress/RangeCoder/RangeCoder.h
+++ b/CPP/7zip/Compress/RangeCoder.h
@@ -1,10 +1,10 @@
-// Compress/RangeCoder/RangeCoder.h
+// Compress/RangeCoder.h
-#ifndef __COMPRESS_RANGECODER_H
-#define __COMPRESS_RANGECODER_H
+#ifndef __COMPRESS_RANGE_CODER_H
+#define __COMPRESS_RANGE_CODER_H
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
+#include "../Common/InBuffer.h"
+#include "../Common/OutBuffer.h"
namespace NCompress {
namespace NRangeCoder {
diff --git a/CPP/7zip/Compress/RangeCoder/RangeCoderBit.cpp b/CPP/7zip/Compress/RangeCoder/RangeCoderBit.cpp
deleted file mode 100755
index 2bfae0b8..00000000
--- a/CPP/7zip/Compress/RangeCoder/RangeCoderBit.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-// Compress/RangeCoder/RangeCoderBit.cpp
-
-#include "StdAfx.h"
-
-#include "RangeCoderBit.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
-
-struct CPriceTables { CPriceTables()
-{
- for (UInt32 i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits))
- {
- const int kCyclesBits = kNumBitPriceShiftBits;
- UInt32 w = i;
- UInt32 bitCount = 0;
- for (int j = 0; j < kCyclesBits; j++)
- {
- w = w * w;
- bitCount <<= 1;
- while (w >= ((UInt32)1 << 16))
- {
- w >>= 1;
- bitCount++;
- }
- }
- ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
- }
-}
-};
-
-static CPriceTables g_PriceTables;
-
-}}
diff --git a/CPP/7zip/Compress/RangeCoder/RangeCoderBitTree.h b/CPP/7zip/Compress/RangeCoder/RangeCoderBitTree.h
deleted file mode 100755
index ee47eaad..00000000
--- a/CPP/7zip/Compress/RangeCoder/RangeCoderBitTree.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Compress/RangeCoder/RangeCoderBitTree.h
-
-#ifndef __COMPRESS_RANGECODER_BIT_TREE_H
-#define __COMPRESS_RANGECODER_BIT_TREE_H
-
-#include "RangeCoderBit.h"
-#include "RangeCoderOpt.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-template <int numMoveBits, int NumBitLevels>
-class CBitTreeEncoder
-{
- CBitEncoder<numMoveBits> Models[1 << NumBitLevels];
-public:
- void Init()
- {
- for(UInt32 i = 0; i < (1 << NumBitLevels); i++)
- Models[i].Init();
- }
- void Encode(CEncoder *rangeEncoder, UInt32 symbol)
- {
- UInt32 modelIndex = 1;
- for (int bitIndex = NumBitLevels; bitIndex != 0 ;)
- {
- bitIndex--;
- UInt32 bit = (symbol >> bitIndex) & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- };
- void ReverseEncode(CEncoder *rangeEncoder, UInt32 symbol)
- {
- UInt32 modelIndex = 1;
- for (int i = 0; i < NumBitLevels; i++)
- {
- UInt32 bit = symbol & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- symbol >>= 1;
- }
- }
- UInt32 GetPrice(UInt32 symbol) const
- {
- symbol |= (1 << NumBitLevels);
- UInt32 price = 0;
- while (symbol != 1)
- {
- price += Models[symbol >> 1].GetPrice(symbol & 1);
- symbol >>= 1;
- }
- return price;
- }
- UInt32 ReverseGetPrice(UInt32 symbol) const
- {
- UInt32 price = 0;
- UInt32 modelIndex = 1;
- for (int i = NumBitLevels; i != 0; i--)
- {
- UInt32 bit = symbol & 1;
- symbol >>= 1;
- price += Models[modelIndex].GetPrice(bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- return price;
- }
-};
-
-template <int numMoveBits, int NumBitLevels>
-class CBitTreeDecoder
-{
- CBitDecoder<numMoveBits> Models[1 << NumBitLevels];
-public:
- void Init()
- {
- for(UInt32 i = 0; i < (1 << NumBitLevels); i++)
- Models[i].Init();
- }
- UInt32 Decode(CDecoder *rangeDecoder)
- {
- UInt32 modelIndex = 1;
- RC_INIT_VAR
- for(int bitIndex = NumBitLevels; bitIndex != 0; bitIndex--)
- {
- // modelIndex = (modelIndex << 1) + Models[modelIndex].Decode(rangeDecoder);
- RC_GETBIT(numMoveBits, Models[modelIndex].Prob, modelIndex)
- }
- RC_FLUSH_VAR
- return modelIndex - (1 << NumBitLevels);
- };
- UInt32 ReverseDecode(CDecoder *rangeDecoder)
- {
- UInt32 modelIndex = 1;
- UInt32 symbol = 0;
- RC_INIT_VAR
- for(int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
- {
- // UInt32 bit = Models[modelIndex].Decode(rangeDecoder);
- // modelIndex <<= 1;
- // modelIndex += bit;
- // symbol |= (bit << bitIndex);
- RC_GETBIT2(numMoveBits, Models[modelIndex].Prob, modelIndex, ; , symbol |= (1 << bitIndex))
- }
- RC_FLUSH_VAR
- return symbol;
- }
-};
-
-template <int numMoveBits>
-void ReverseBitTreeEncode(CBitEncoder<numMoveBits> *Models,
- CEncoder *rangeEncoder, int NumBitLevels, UInt32 symbol)
-{
- UInt32 modelIndex = 1;
- for (int i = 0; i < NumBitLevels; i++)
- {
- UInt32 bit = symbol & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- symbol >>= 1;
- }
-}
-
-template <int numMoveBits>
-UInt32 ReverseBitTreeGetPrice(CBitEncoder<numMoveBits> *Models,
- UInt32 NumBitLevels, UInt32 symbol)
-{
- UInt32 price = 0;
- UInt32 modelIndex = 1;
- for (int i = NumBitLevels; i != 0; i--)
- {
- UInt32 bit = symbol & 1;
- symbol >>= 1;
- price += Models[modelIndex].GetPrice(bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- return price;
-}
-
-template <int numMoveBits>
-UInt32 ReverseBitTreeDecode(CBitDecoder<numMoveBits> *Models,
- CDecoder *rangeDecoder, int NumBitLevels)
-{
- UInt32 modelIndex = 1;
- UInt32 symbol = 0;
- RC_INIT_VAR
- for(int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
- {
- // UInt32 bit = Models[modelIndex].Decode(rangeDecoder);
- // modelIndex <<= 1;
- // modelIndex += bit;
- // symbol |= (bit << bitIndex);
- RC_GETBIT2(numMoveBits, Models[modelIndex].Prob, modelIndex, ; , symbol |= (1 << bitIndex))
- }
- RC_FLUSH_VAR
- return symbol;
-}
-
-}}
-
-#endif
diff --git a/CPP/7zip/Compress/RangeCoder/RangeCoderOpt.h b/CPP/7zip/Compress/RangeCoder/RangeCoderOpt.h
deleted file mode 100755
index 57792776..00000000
--- a/CPP/7zip/Compress/RangeCoder/RangeCoderOpt.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Compress/RangeCoder/RangeCoderOpt.h
-
-#ifndef __COMPRESS_RANGECODER_OPT_H
-#define __COMPRESS_RANGECODER_OPT_H
-
-#define RC_INIT_VAR \
- UInt32 range = rangeDecoder->Range; \
- UInt32 code = rangeDecoder->Code;
-
-#define RC_FLUSH_VAR \
- rangeDecoder->Range = range; \
- rangeDecoder->Code = code;
-
-#define RC_NORMALIZE \
- if (range < NCompress::NRangeCoder::kTopValue) \
- { code = (code << 8) | rangeDecoder->Stream.ReadByte(); range <<= 8; }
-
-#define RC_GETBIT2(numMoveBits, prob, mi, A0, A1) \
- { UInt32 bound = (range >> NCompress::NRangeCoder::kNumBitModelTotalBits) * prob; \
- if (code < bound) \
- { A0; range = bound; \
- prob += (NCompress::NRangeCoder::kBitModelTotal - prob) >> numMoveBits; \
- mi <<= 1; } \
- else \
- { A1; range -= bound; code -= bound; prob -= (prob) >> numMoveBits; \
- mi = (mi + mi) + 1; }} \
- RC_NORMALIZE
-
-#define RC_GETBIT(numMoveBits, prob, mi) RC_GETBIT2(numMoveBits, prob, mi, ; , ;)
-
-#endif
diff --git a/CPP/7zip/Compress/RangeCoder/RangeCoderBit.h b/CPP/7zip/Compress/RangeCoderBit.h
index 0ac50dfe..566cdd41 100755
--- a/CPP/7zip/Compress/RangeCoder/RangeCoderBit.h
+++ b/CPP/7zip/Compress/RangeCoderBit.h
@@ -1,7 +1,7 @@
-// Compress/RangeCoder/RangeCoderBit.h
+// Compress/RangeCoderBit.h
-#ifndef __COMPRESS_RANGECODER_BIT_H
-#define __COMPRESS_RANGECODER_BIT_H
+#ifndef __COMPRESS_RANGE_CODER_BIT_H
+#define __COMPRESS_RANGE_CODER_BIT_H
#include "RangeCoder.h"
diff --git a/CPP/7zip/Compress/Rar/Rar29.dsp b/CPP/7zip/Compress/Rar/Rar29.dsp
deleted file mode 100755
index 9eb36ac3..00000000
--- a/CPP/7zip/Compress/Rar/Rar29.dsp
+++ /dev/null
@@ -1,319 +0,0 @@
-# Microsoft Developer Studio Project File - Name="Rar29" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=Rar29 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Rar29.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Rar29.mak" CFG="Rar29 - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Rar29 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "Rar29 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Rar29 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 1
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAR29_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAR29_EXPORTS" /D "SILENT" /D "NOCRYPT" /D "NOVOLUME" /Yu"StdAfx.h" /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "NDEBUG"
-# ADD RSC /l 0x419 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-Zip\Codecs\Rar29.dll" /opt:NOWIN98
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "Rar29 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 1
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAR29_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAR29_EXPORTS" /D "SILENT" /D "NOCRYPT" /D "NOVOLUME" /Yu"StdAfx.h" /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "_DEBUG"
-# ADD RSC /l 0x419 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-Zip\Codecs\Rar29.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "Rar29 - Win32 Release"
-# Name "Rar29 - Win32 Debug"
-# Begin Group "Spec"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Codec.def
-# End Source File
-# Begin Source File
-
-SOURCE=..\CodecExports.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\DllExports.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\resource.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"StdAfx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# End Group
-# Begin Group "7zip Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\MSBFDecoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\RegisterCodec.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.h
-# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\LZ\LZOutWindow.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\LZ\LZOutWindow.h
-# End Source File
-# End Group
-# Begin Group "Huffman"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\Huffman\HuffmanDecoder.h
-# End Source File
-# End Group
-# Begin Group "Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\Common\CRC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\MyVector.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\MyVector.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\NewHandler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\NewHandler.h
-# End Source File
-# End Group
-# Begin Group "Rar3"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\PPMD\PPMDContext.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\PPMD\PPMDDecode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\PPMD\PPMDSubAlloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\PPMD\PPMDType.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar1Decoder.cpp
-
-!IF "$(CFG)" == "Rar29 - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Rar29 - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar1Decoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar2Decoder.cpp
-
-!IF "$(CFG)" == "Rar29 - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Rar29 - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar2Decoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar3Decoder.cpp
-
-!IF "$(CFG)" == "Rar29 - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Rar29 - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar3Decoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar3Vm.cpp
-
-!IF "$(CFG)" == "Rar29 - Win32 Release"
-
-# ADD CPP /O2
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "Rar29 - Win32 Debug"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\Rar3Vm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RarCodecsRegister.cpp
-# End Source File
-# End Group
-# Begin Group "C"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\..\C\7zCrc.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\7zCrc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Alloc.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\C\Alloc.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/CPP/7zip/Compress/Rar/Rar29.dsw b/CPP/7zip/Compress/Rar/Rar29.dsw
deleted file mode 100755
index 70172e1a..00000000
--- a/CPP/7zip/Compress/Rar/Rar29.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "Rar29"=.\Rar29.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/CPP/7zip/Compress/Rar/StdAfx.cpp b/CPP/7zip/Compress/Rar/StdAfx.cpp
deleted file mode 100755
index d0feea85..00000000
--- a/CPP/7zip/Compress/Rar/StdAfx.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-// StdAfx.cpp
-
-#include "StdAfx.h"
diff --git a/CPP/7zip/Compress/Rar/StdAfx.h b/CPP/7zip/Compress/Rar/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Rar/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Rar/makefile b/CPP/7zip/Compress/Rar/makefile
deleted file mode 100755
index 27cedbd9..00000000
--- a/CPP/7zip/Compress/Rar/makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-PROG = Rar29.dll
-DEF_FILE = ../Codec.def
-CFLAGS = $(CFLAGS) -I ../../../
-LIBS = $(LIBS) oleaut32.lib
-
-COMPRESS_OBJS = \
- $O\CodecExports.obj \
- $O\DllExports.obj \
-
-RAR29_OPT_OBJS = \
- $O\Rar1Decoder.obj \
- $O\Rar2Decoder.obj \
- $O\Rar3Decoder.obj \
- $O\Rar3Vm.obj \
- $O\RarCodecsRegister.obj \
-
-COMMON_OBJS = \
- $O\CRC.obj \
- $O\MyVector.obj \
-
-7ZIP_COMMON_OBJS = \
- $O\InBuffer.obj \
- $O\OutBuffer.obj \
- $O\StreamUtils.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-C_OBJS = \
- $O\Alloc.obj \
-
-!include "../../Crc2.mak"
-
-OBJS = \
- $O\StdAfx.obj \
- $(COMPRESS_OBJS) \
- $(RAR29_OPT_OBJS) \
- $(COMMON_OBJS) \
- $(7ZIP_COMMON_OBJS) \
- $(LZ_OBJS) \
- $(C_OBJS) \
- $(CRC_OBJS) \
- $O\resource.res
-
-!include "../../../Build.mak"
-
-$(COMPRESS_OBJS): ../$(*B).cpp
- $(COMPL)
-$(RAR29_OPT_OBJS): $(*B).cpp
- $(COMPL_O2)
-$(COMMON_OBJS): ../../../Common/$(*B).cpp
- $(COMPL)
-$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../LZ/$(*B).cpp
- $(COMPL)
-$(C_OBJS): ../../../../C/$(*B).c
- $(COMPL_O2)
-
-!include "../../Crc.mak"
diff --git a/CPP/7zip/Compress/Rar/resource.rc b/CPP/7zip/Compress/Rar/resource.rc
deleted file mode 100755
index bb5e2ec9..00000000
--- a/CPP/7zip/Compress/Rar/resource.rc
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../../MyVersionInfo.rc"
-
-MY_VERSION_INFO_DLL("Rar29 Codec", "Rar29")
diff --git a/CPP/7zip/Compress/Rar/Rar1Decoder.cpp b/CPP/7zip/Compress/Rar1Decoder.cpp
index 38d4f4a9..c7540b92 100755
--- a/CPP/7zip/Compress/Rar/Rar1Decoder.cpp
+++ b/CPP/7zip/Compress/Rar1Decoder.cpp
@@ -370,9 +370,8 @@ void CDecoder::InitHuff()
CorrHuff(ChSetB, NToPlB);
}
-STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo * /* progress */)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo * /* progress */)
{
if (inSize == NULL || outSize == NULL)
return E_INVALIDARG;
@@ -459,13 +458,12 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush();
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Rar/Rar1Decoder.h b/CPP/7zip/Compress/Rar1Decoder.h
index 185ef10a..f7c08b38 100755
--- a/CPP/7zip/Compress/Rar/Rar1Decoder.h
+++ b/CPP/7zip/Compress/Rar1Decoder.h
@@ -1,25 +1,26 @@
-// Rar15Decoder.h
+// Rar1Decoder.h
// According to unRAR license, this code may not be used to develop
// a program that creates RAR archives
-#ifndef __RAR10_DECODER_H
-#define __RAR10_DECODER_H
+#ifndef __COMPRESS_RAR1_DECODER_H
+#define __COMPRESS_RAR1_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
+#include "../ICoder.h"
-#include "../LZ/LZOutWindow.h"
-#include "../Huffman/HuffmanDecoder.h"
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "HuffmanDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NRar1 {
const UInt32 kNumRepDists = 4;
-typedef NStream::NMSBF::CDecoder<CInBuffer> CBitDecoder;
+typedef NBitm::CDecoder<CInBuffer> CBitDecoder;
class CDecoder :
public ICompressCoder,
@@ -27,7 +28,7 @@ class CDecoder :
public CMyUnknownImp
{
public:
- CLZOutWindow m_OutWindowStream;
+ CLzOutWindow m_OutWindowStream;
CBitDecoder m_InBitStream;
UInt32 m_RepDists[kNumRepDists];
@@ -61,6 +62,9 @@ public:
void InitStructures();
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+
public:
CDecoder();
@@ -72,13 +76,8 @@ public:
m_InBitStream.ReleaseStream();
}
- STDMETHOD(CodeReal)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
diff --git a/CPP/7zip/Compress/Rar/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp
index ed10a408..16d6b30c 100755
--- a/CPP/7zip/Compress/Rar/Rar2Decoder.cpp
+++ b/CPP/7zip/Compress/Rar2Decoder.cpp
@@ -297,9 +297,8 @@ bool CDecoder::DecodeLz(Int32 pos)
return true;
}
-HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
if (inSize == NULL || outSize == NULL)
return E_INVALIDARG;
@@ -370,13 +369,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream,
return m_OutWindowStream.Flush();
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
- catch(const CLZOutWindowException &e) { return e.ErrorCode; }
+ catch(const CLzOutWindowException &e) { return e.ErrorCode; }
catch(...) { return S_FALSE; }
}
diff --git a/CPP/7zip/Compress/Rar/Rar2Decoder.h b/CPP/7zip/Compress/Rar2Decoder.h
index 8626a7d9..61a8b4da 100755
--- a/CPP/7zip/Compress/Rar/Rar2Decoder.h
+++ b/CPP/7zip/Compress/Rar2Decoder.h
@@ -2,17 +2,18 @@
// According to unRAR license, this code may not be used to develop
// a program that creates RAR archives
-#ifndef __RAR2DECODER_H
-#define __RAR2DECODER_H
+#ifndef __COMPRESS_RAR2_DECODER_H
+#define __COMPRESS_RAR2_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
+#include "../ICoder.h"
-#include "../LZ/LZOutWindow.h"
-#include "../Huffman/HuffmanDecoder.h"
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "HuffmanDecoder.h"
+#include "LzOutWindow.h"
namespace NCompress {
namespace NRar2 {
@@ -107,7 +108,7 @@ public:
}
-typedef NStream::NMSBF::CDecoder<CInBuffer> CBitDecoder;
+typedef NBitm::CDecoder<CInBuffer> CBitDecoder;
const int kNumHuffmanBits = 15;
@@ -116,7 +117,7 @@ class CDecoder :
public ICompressSetDecoderProperties2,
public CMyUnknownImp
{
- CLZOutWindow m_OutWindowStream;
+ CLzOutWindow m_OutWindowStream;
CBitDecoder m_InBitStream;
NHuffman::CDecoder<kNumHuffmanBits, kMainTableSize> m_MainDecoder;
NHuffman::CDecoder<kNumHuffmanBits, kDistTableSize> m_DistDecoder;
@@ -147,9 +148,8 @@ class CDecoder :
bool DecodeMm(UInt32 pos);
bool DecodeLz(Int32 pos);
- HRESULT CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
public:
CDecoder();
@@ -162,9 +162,8 @@ public:
m_InBitStream.ReleaseStream();
}
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
diff --git a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar3Decoder.cpp
index c2b18fc9..b7345eb0 100755
--- a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp
+++ b/CPP/7zip/Compress/Rar3Decoder.cpp
@@ -4,8 +4,9 @@
#include "StdAfx.h"
+#include "../Common/StreamUtils.h"
+
#include "Rar3Decoder.h"
-#include "../../Common/StreamUtils.h"
namespace NCompress {
namespace NRar3 {
@@ -780,9 +781,8 @@ HRESULT CDecoder::CodeReal(ICompressProgressInfo *progress)
return S_OK;
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try
{
diff --git a/CPP/7zip/Compress/Rar/Rar3Decoder.h b/CPP/7zip/Compress/Rar3Decoder.h
index cac769bd..73d4c224 100755
--- a/CPP/7zip/Compress/Rar/Rar3Decoder.h
+++ b/CPP/7zip/Compress/Rar3Decoder.h
@@ -2,18 +2,18 @@
// According to unRAR license, this code may not be used to develop
// a program that creates RAR archives
-#ifndef __RAR3DECODER_H
-#define __RAR3DECODER_H
+#ifndef __COMPRESS_RAR3_DECODER_H
+#define __COMPRESS_RAR3_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../Common/MSBFDecoder.h"
-#include "../../Common/InBuffer.h"
+#include "../ICoder.h"
-// #include "../LZ/LZOutWindow.h"
-#include "../Huffman/HuffmanDecoder.h"
-#include "../PPMD/PPMDDecode.h"
+#include "../Common/InBuffer.h"
+
+#include "BitmDecoder.h"
+#include "HuffmanDecoder.h"
+#include "PpmdDecode.h"
#include "Rar3Vm.h"
namespace NCompress {
@@ -101,7 +101,7 @@ const int kNumTopBits = 24;
const UInt32 kTopValue = (1 << kNumTopBits);
const UInt32 kBot = (1 << 15);
-class CRangeDecoder:public NPPMD::CRangeDecoderVirt, public CBitDecoder
+class CRangeDecoder:public NPpmd::CRangeDecoderVirt, public CBitDecoder
{
public:
UInt32 Range;
@@ -219,7 +219,7 @@ class CDecoder:
bool TablesRead;
- NPPMD::CDecodeInfo _ppm;
+ NPpmd::CDecodeInfo _ppm;
int PpmEscChar;
HRESULT WriteDataToStream(const Byte *data, UInt32 size);
@@ -255,10 +255,8 @@ public:
m_InBitStream.ReleaseStream();
}
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
diff --git a/CPP/7zip/Compress/Rar/Rar3Vm.cpp b/CPP/7zip/Compress/Rar3Vm.cpp
index daa083e4..ffca79d0 100755
--- a/CPP/7zip/Compress/Rar/Rar3Vm.cpp
+++ b/CPP/7zip/Compress/Rar3Vm.cpp
@@ -12,14 +12,14 @@ Note:
#include "StdAfx.h"
-#include "Rar3Vm.h"
-
extern "C"
{
-#include "../../../../C/Alloc.h"
-#include "../../../../C/7zCrc.h"
+#include "../../../C/7zCrc.h"
+#include "../../../C/Alloc.h"
}
+#include "Rar3Vm.h"
+
namespace NCompress {
namespace NRar3 {
diff --git a/CPP/7zip/Compress/Rar/Rar3Vm.h b/CPP/7zip/Compress/Rar3Vm.h
index f6cf11b4..c02534c6 100755
--- a/CPP/7zip/Compress/Rar/Rar3Vm.h
+++ b/CPP/7zip/Compress/Rar3Vm.h
@@ -2,13 +2,13 @@
// According to unRAR license, this code may not be used to develop
// a program that creates RAR archives
-#ifndef __RAR3VM_H
-#define __RAR3VM_H
+#ifndef __COMPRESS_RAR3_VM_H
+#define __COMPRESS_RAR3_VM_H
-#include "Common/Types.h"
-#include "Common/MyVector.h"
+#include "../../../C/CpuArch.h"
-#include "../../../../C/CpuArch.h"
+#include "Common/MyVector.h"
+#include "Common/Types.h"
#define RARVM_STANDARD_FILTERS
diff --git a/CPP/7zip/Compress/Rar/RarCodecsRegister.cpp b/CPP/7zip/Compress/RarCodecsRegister.cpp
index 5cf32ac8..e3f6a05c 100755
--- a/CPP/7zip/Compress/Rar/RarCodecsRegister.cpp
+++ b/CPP/7zip/Compress/RarCodecsRegister.cpp
@@ -2,7 +2,7 @@
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
#include "Rar1Decoder.h"
#include "Rar2Decoder.h"
diff --git a/CPP/7zip/Compress/Shrink/StdAfx.h b/CPP/7zip/Compress/Shrink/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Shrink/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Shrink/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp
index 5079a51a..6eaacd4b 100755
--- a/CPP/7zip/Compress/Shrink/ShrinkDecoder.cpp
+++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
@@ -2,28 +2,27 @@
#include "StdAfx.h"
-#include "ShrinkDecoder.h"
-
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
-#include "../../Common/LSBFDecoder.h"
+
+#include "../Common/InBuffer.h"
+#include "../Common/OutBuffer.h"
+
+#include "BitlDecoder.h"
+#include "ShrinkDecoder.h"
namespace NCompress {
namespace NShrink {
static const UInt32 kBufferSize = (1 << 20);
-
static const int kNumMinBits = 9;
-STDMETHODIMP CDecoder ::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
- NStream::NLSBF::CBaseDecoder<CInBuffer> inBuffer;
+ NBitl::CBaseDecoder<CInBuffer> inBuffer;
COutBuffer outBuffer;
if (!inBuffer.Create(kBufferSize))
@@ -137,9 +136,8 @@ STDMETHODIMP CDecoder ::CodeReal(ISequentialInStream *inStream,
return outBuffer.Flush();
}
-STDMETHODIMP CDecoder ::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder ::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
diff --git a/CPP/7zip/Compress/Shrink/ShrinkDecoder.h b/CPP/7zip/Compress/ShrinkDecoder.h
index 0c1b8607..9bbecd41 100755
--- a/CPP/7zip/Compress/Shrink/ShrinkDecoder.h
+++ b/CPP/7zip/Compress/ShrinkDecoder.h
@@ -1,11 +1,11 @@
// ShrinkDecoder.h
-#ifndef __SHRINK_DECODER_H
-#define __SHRINK_DECODER_H
+#ifndef __COMPRESS_SHRINK_DECODER_H
+#define __COMPRESS_SHRINK_DECODER_H
-#include "../../../Common/MyCom.h"
+#include "../../Common/MyCom.h"
-#include "../../ICoder.h"
+#include "../ICoder.h"
namespace NCompress {
namespace NShrink {
@@ -22,16 +22,15 @@ class CDecoder :
Byte _stack[kNumItems];
bool _isFree[kNumItems];
bool _isParent[kNumItems];
+
public:
MY_UNKNOWN_IMP
- STDMETHOD(CodeReal)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
};
}}
diff --git a/CPP/7zip/Compress/Z/StdAfx.h b/CPP/7zip/Compress/Z/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Compress/Z/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Compress/Z/ZDecoder.h b/CPP/7zip/Compress/Z/ZDecoder.h
deleted file mode 100755
index 70e40c20..00000000
--- a/CPP/7zip/Compress/Z/ZDecoder.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// ZDecoder.h
-
-#ifndef __COMPRESS_ZDECODER_H
-#define __COMPRESS_ZDECODER_H
-
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-
-namespace NCompress {
-namespace NZ {
-
-class CDecoder :
- public ICompressCoder,
- public ICompressSetDecoderProperties2,
- public CMyUnknownImp
-{
- BYTE _properties;
- int _numMaxBits;
- UInt16 *_parents;
- Byte *_suffixes;
- Byte *_stack;
-
-public:
- CDecoder(): _properties(0), _numMaxBits(0), _parents(0), _suffixes(0), _stack(0) {};
- ~CDecoder();
- void Free();
-
- MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2)
-
- STDMETHOD(CodeReal)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
-};
-
-}}
-
-#endif
diff --git a/CPP/7zip/Compress/Z/ZDecoder.cpp b/CPP/7zip/Compress/ZDecoder.cpp
index 4d435b6c..6982a7e0 100755
--- a/CPP/7zip/Compress/Z/ZDecoder.cpp
+++ b/CPP/7zip/Compress/ZDecoder.cpp
@@ -2,15 +2,15 @@
#include "StdAfx.h"
-#include "ZDecoder.h"
-
extern "C"
{
-#include "../../../../C/Alloc.h"
+#include "../../../C/Alloc.h"
}
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
+#include "../Common/InBuffer.h"
+#include "../Common/OutBuffer.h"
+
+#include "ZDecoder.h"
namespace NCompress {
namespace NZ {
@@ -30,9 +30,8 @@ void CDecoder::Free()
CDecoder::~CDecoder() { Free(); }
-STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 * /* inSize */, const UInt64 * /* outSize */,
- ICompressProgressInfo *progress)
+HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
{
CInBuffer inBuffer;
COutBuffer outBuffer;
@@ -143,9 +142,8 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
return outBuffer.Flush();
}
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
try { return CodeReal(inStream, outStream, inSize, outSize, progress); }
catch(const CInBufferException &e) { return e.ErrorCode; }
diff --git a/CPP/7zip/Compress/ZDecoder.h b/CPP/7zip/Compress/ZDecoder.h
new file mode 100755
index 00000000..2bd83a17
--- /dev/null
+++ b/CPP/7zip/Compress/ZDecoder.h
@@ -0,0 +1,42 @@
+// ZDecoder.h
+
+#ifndef __COMPRESS_Z_DECODER_H
+#define __COMPRESS_Z_DECODER_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NZ {
+
+class CDecoder:
+ public ICompressCoder,
+ public ICompressSetDecoderProperties2,
+ public CMyUnknownImp
+{
+ UInt16 *_parents;
+ Byte *_suffixes;
+ Byte *_stack;
+ Byte _properties;
+ int _numMaxBits;
+
+public:
+ CDecoder(): _parents(0), _suffixes(0), _stack(0), _properties(0), _numMaxBits(0) {};
+ ~CDecoder();
+ void Free();
+
+ MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2)
+
+ HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+};
+
+}}
+
+#endif
diff --git a/CPP/7zip/Compress/Deflate/ZlibDecoder.cpp b/CPP/7zip/Compress/ZlibDecoder.cpp
index 6a55b717..a1bac27b 100755
--- a/CPP/7zip/Compress/Deflate/ZlibDecoder.cpp
+++ b/CPP/7zip/Compress/ZlibDecoder.cpp
@@ -2,9 +2,10 @@
#include "StdAfx.h"
-#include "ZlibDecoder.h"
+#include "../Common/StreamUtils.h"
+
#include "DeflateDecoder.h"
-#include "../../Common/StreamUtils.h"
+#include "ZlibDecoder.h"
namespace NCompress {
namespace NZlib {
@@ -46,9 +47,8 @@ STDMETHODIMP COutStreamWithAdler::Write(const void *data, UInt32 size, UInt32 *p
return result;
}
-HRESULT CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
{
DEFLATE_TRY_BEGIN
if (!AdlerStream)
diff --git a/CPP/7zip/Compress/Deflate/ZlibDecoder.h b/CPP/7zip/Compress/ZlibDecoder.h
index cb0cb3cc..906e241b 100755
--- a/CPP/7zip/Compress/Deflate/ZlibDecoder.h
+++ b/CPP/7zip/Compress/ZlibDecoder.h
@@ -35,9 +35,8 @@ class CDecoder:
NCompress::NDeflate::NDecoder::CCOMCoder *DeflateDecoderSpec;
CMyComPtr<ICompressCoder> DeflateDecoder;
public:
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
MY_UNKNOWN_IMP
};
diff --git a/CPP/7zip/Crypto/7zAES/StdAfx.h b/CPP/7zip/Crypto/7zAES/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/7zAES/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/7zAES/7zAES.cpp b/CPP/7zip/Crypto/7zAes.cpp
index f8034fd2..3a1cbd68 100755
--- a/CPP/7zip/Crypto/7zAES/7zAES.cpp
+++ b/CPP/7zip/Crypto/7zAes.cpp
@@ -1,21 +1,20 @@
-// 7zAES.cpp
+// 7zAes.cpp
#include "StdAfx.h"
-#include "Windows/Defs.h"
-#include "Windows/Synchronization.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/StreamUtils.h"
-#include "../AES/MyAES.h"
-#include "7zAES.h"
-
extern "C"
{
-#include "../../../../C/Sha256.h"
+#include "../../../C/Sha256.h"
}
+#include "Windows/Synchronization.h"
+#include "../Common/StreamObjects.h"
+#include "../Common/StreamUtils.h"
+#include "7zAes.h"
+#include "MyAes.h"
+
#ifndef EXTRACT_ONLY
-#include "../Hash/RandGen.h"
+#include "RandGen.h"
#endif
using namespace NWindows;
diff --git a/CPP/7zip/Crypto/7zAES/7zAES.h b/CPP/7zip/Crypto/7zAes.h
index ed2bb3cd..79d723fa 100755
--- a/CPP/7zip/Crypto/7zAES/7zAES.h
+++ b/CPP/7zip/Crypto/7zAes.h
@@ -1,15 +1,14 @@
-// 7zAES.h
+// 7zAes.h
#ifndef __CRYPTO_7Z_AES_H
#define __CRYPTO_7Z_AES_H
-#include "Common/MyCom.h"
-#include "Common/Types.h"
#include "Common/Buffer.h"
+#include "Common/MyCom.h"
#include "Common/MyVector.h"
-#include "../../ICoder.h"
-#include "../../IPassword.h"
+#include "../ICoder.h"
+#include "../IPassword.h"
namespace NCrypto {
namespace NSevenZ {
diff --git a/CPP/7zip/Crypto/7zAES/7zAESRegister.cpp b/CPP/7zip/Crypto/7zAesRegister.cpp
index a85fdbdf..5e57748f 100755
--- a/CPP/7zip/Crypto/7zAES/7zAESRegister.cpp
+++ b/CPP/7zip/Crypto/7zAesRegister.cpp
@@ -1,10 +1,10 @@
-// BranchRegister.cpp
+// 7zAesRegister.cpp
#include "StdAfx.h"
-#include "../../Common/RegisterCodec.h"
+#include "../Common/RegisterCodec.h"
+#include "7zAes.h"
-#include "7zAES.h"
static void *CreateCodec() { return (void *)(ICompressFilter *)(new NCrypto::NSevenZ::CDecoder()); }
#ifndef EXTRACT_ONLY
static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new NCrypto::NSevenZ::CEncoder()); }
diff --git a/CPP/7zip/Crypto/AES/StdAfx.h b/CPP/7zip/Crypto/AES/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/AES/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/Hash/StdAfx.h b/CPP/7zip/Crypto/Hash/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/Hash/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/Hash/HmacSha1.cpp b/CPP/7zip/Crypto/HmacSha1.cpp
index a66d6271..a66d6271 100755
--- a/CPP/7zip/Crypto/Hash/HmacSha1.cpp
+++ b/CPP/7zip/Crypto/HmacSha1.cpp
diff --git a/CPP/7zip/Crypto/Hash/HmacSha1.h b/CPP/7zip/Crypto/HmacSha1.h
index bca5bcf8..d7181329 100755
--- a/CPP/7zip/Crypto/Hash/HmacSha1.h
+++ b/CPP/7zip/Crypto/HmacSha1.h
@@ -1,8 +1,8 @@
// HmacSha1.h
// Implements HMAC-SHA-1 (RFC2104, FIPS-198)
-#ifndef _HMAC_H
-#define _HMAC_H
+#ifndef __CRYPTO_HMAC_SHA1_H
+#define __CRYPTO_HMAC_SHA1_H
#include "Sha1.h"
diff --git a/CPP/7zip/Crypto/AES/MyAES.cpp b/CPP/7zip/Crypto/MyAes.cpp
index 286570a9..5b0d1e8a 100755
--- a/CPP/7zip/Crypto/AES/MyAES.cpp
+++ b/CPP/7zip/Crypto/MyAes.cpp
@@ -1,8 +1,8 @@
-// Crypto/AES/MyAES.cpp
+// Crypto/MyAes.cpp
#include "StdAfx.h"
-#include "MyAES.h"
+#include "MyAes.h"
namespace NCrypto {
diff --git a/CPP/7zip/Crypto/AES/MyAES.h b/CPP/7zip/Crypto/MyAes.h
index 2e99f158..ffc6fea5 100755
--- a/CPP/7zip/Crypto/AES/MyAES.h
+++ b/CPP/7zip/Crypto/MyAes.h
@@ -1,18 +1,18 @@
-// Crypto/AES/MyAES.h
+// Crypto/MyAes.h
-#ifndef __CIPHER_MYAES_H
-#define __CIPHER_MYAES_H
-
-#include "Common/Types.h"
-#include "Common/MyCom.h"
-
-#include "../../ICoder.h"
+#ifndef __CRYPTO_MY_AES_H
+#define __CRYPTO_MY_AES_H
extern "C"
{
-#include "../../../../C/Aes.h"
+#include "../../../C/Aes.h"
}
+#include "../../Common/MyCom.h"
+#include "../../Common/Types.h"
+
+#include "../ICoder.h"
+
namespace NCrypto {
class CAesCbcEncoder:
diff --git a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp b/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp
index cbbdec89..cbbdec89 100755
--- a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.cpp
+++ b/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp
diff --git a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h b/CPP/7zip/Crypto/Pbkdf2HmacSha1.h
index 68e85ee3..bb90e121 100755
--- a/CPP/7zip/Crypto/Hash/Pbkdf2HmacSha1.h
+++ b/CPP/7zip/Crypto/Pbkdf2HmacSha1.h
@@ -1,11 +1,11 @@
// Pbkdf2HmacSha1.h
// Password-Based Key Derivation Function (RFC 2898, PKCS #5) based on HMAC-SHA-1
-#ifndef __PBKDF2HMACSHA1_H
-#define __PBKDF2HMACSHA1_H
+#ifndef __CRYPTO_PBKDF2_HMAC_SHA1_H
+#define __CRYPTO_PBKDF2_HMAC_SHA1_H
#include <stddef.h>
-#include "../../../Common/Types.h"
+#include "../../Common/Types.h"
namespace NCrypto {
namespace NSha1 {
diff --git a/CPP/7zip/Crypto/Hash/RandGen.cpp b/CPP/7zip/Crypto/RandGen.cpp
index a030a0d2..e0e2e3ab 100755
--- a/CPP/7zip/Crypto/Hash/RandGen.cpp
+++ b/CPP/7zip/Crypto/RandGen.cpp
@@ -3,9 +3,7 @@
#include "StdAfx.h"
#include <stdio.h>
-
#include "Windows/Synchronization.h"
-
#include "RandGen.h"
#ifndef _WIN32
diff --git a/CPP/7zip/Crypto/Hash/RandGen.h b/CPP/7zip/Crypto/RandGen.h
index 3f06b26b..209445c4 100755
--- a/CPP/7zip/Crypto/Hash/RandGen.h
+++ b/CPP/7zip/Crypto/RandGen.h
@@ -1,7 +1,7 @@
// RandGen.h
-#ifndef __RANDGEN_H
-#define __RANDGEN_H
+#ifndef __CRYPTO_RAND_GEN_H
+#define __CRYPTO_RAND_GEN_H
#include "Sha1.h"
diff --git a/CPP/7zip/Crypto/Rar20/Rar20Cipher.cpp b/CPP/7zip/Crypto/Rar20/Rar20Cipher.cpp
deleted file mode 100755
index 333ab61c..00000000
--- a/CPP/7zip/Crypto/Rar20/Rar20Cipher.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// Crypto/Rar20Cipher.cpp
-
-#include "StdAfx.h"
-
-#include "Rar20Cipher.h"
-#include "Windows/Defs.h"
-
-namespace NCrypto {
-namespace NRar20 {
-
-STDMETHODIMP CDecoder::CryptoSetPassword(const Byte *data, UInt32 size)
-{
- _coder.SetPassword(data, size);
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::Init()
-{
- return S_OK;
-}
-
-STDMETHODIMP_(UInt32) CDecoder::Filter(Byte *data, UInt32 size)
-{
- const UInt16 kBlockSize = 16;
- if (size > 0 && size < kBlockSize)
- return kBlockSize;
- UInt32 i;
- for (i = 0; i + kBlockSize <= size; i += kBlockSize)
- {
- _coder.DecryptBlock(data + i);
- }
- return i;
-}
-
-}}
diff --git a/CPP/7zip/Crypto/Rar20/Rar20Cipher.h b/CPP/7zip/Crypto/Rar20/Rar20Cipher.h
deleted file mode 100755
index 465cc42a..00000000
--- a/CPP/7zip/Crypto/Rar20/Rar20Cipher.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Crypto/Rar20Cipher.h
-
-#ifndef __CRYPTO_RAR20_CIPHER_H
-#define __CRYPTO_RAR20_CIPHER_H
-
-#include "../../ICoder.h"
-#include "../../IPassword.h"
-#include "Common/MyCom.h"
-
-#include "Common/Types.h"
-#include "Rar20Crypto.h"
-
-namespace NCrypto {
-namespace NRar20 {
-
-class CDecoder:
- public ICompressFilter,
- public ICryptoSetPassword,
- public CMyUnknownImp
-{
-public:
- CData _coder;
-
- MY_UNKNOWN_IMP1(ICryptoSetPassword)
-
- STDMETHOD(Init)();
- STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
-
- STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
-
-};
-
-}}
-
-#endif
diff --git a/CPP/7zip/Crypto/Rar20/StdAfx.h b/CPP/7zip/Crypto/Rar20/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/Rar20/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/Rar20/Rar20Crypto.cpp b/CPP/7zip/Crypto/Rar20Crypto.cpp
index d688644d..8fd2ab23 100755
--- a/CPP/7zip/Crypto/Rar20/Rar20Crypto.cpp
+++ b/CPP/7zip/Crypto/Rar20Crypto.cpp
@@ -1,15 +1,15 @@
-// Crypto/Rar20/Crypto.cpp
+// Crypto/Rar20Crypto.cpp
#include "StdAfx.h"
-#include "Rar20Crypto.h"
extern "C"
{
- #include "../../../../C/7zCrc.h"
+ #include "../../../C/7zCrc.h"
+ #include "../../../C/CpuArch.h"
+ #include "../../../C/RotateDefs.h"
}
-#define rol(x,n) (((x) << (n)) | ((x) >> (8 * sizeof(x) - (n))))
-#define ror(x,n) (((x) >> (n)) | ((x) << (8 * sizeof(x) - (n))))
+#include "Rar20Crypto.h"
namespace NCrypto {
namespace NRar20 {
@@ -49,10 +49,8 @@ static void Swap(Byte *b1, Byte *b2)
*b2 = b;
}
-void CData::SetPassword(const Byte *password, UInt32 passwordLength)
+void CData::SetPassword(const Byte *password, UInt32 passwordLen)
{
- // SetOldKeys(password);
-
Keys[0] = 0xD3A3B879L;
Keys[1] = 0x3F6D12F7L;
Keys[2] = 0x7515A235L;
@@ -60,54 +58,40 @@ void CData::SetPassword(const Byte *password, UInt32 passwordLength)
Byte psw[256];
memset(psw, 0, sizeof(psw));
-
- memmove(psw, password, passwordLength);
-
+ memcpy(psw, password, passwordLen);
memcpy(SubstTable, InitSubstTable, sizeof(SubstTable));
+
for (UInt32 j = 0; j < 256; j++)
- for (UInt32 i = 0; i < passwordLength; i += 2)
+ for (UInt32 i = 0; i < passwordLen; i += 2)
{
UInt32 n2 = (Byte)g_CrcTable[(psw[i + 1] + j) & 0xFF];
UInt32 n1 = (Byte)g_CrcTable[(psw[i] - j) & 0xFF];
for (UInt32 k = 1; (n1 & 0xFF) != n2; n1++, k++)
Swap(&SubstTable[n1 & 0xFF], &SubstTable[(n1 + i + k) & 0xFF]);
}
- for (UInt32 i = 0; i < passwordLength; i+= 16)
+ for (UInt32 i = 0; i < passwordLen; i+= 16)
EncryptBlock(&psw[i]);
}
-static inline UInt32 GetUInt32FromMemLE(const Byte *p)
-{
- return p[0] | (((UInt32)p[1]) << 8) | (((UInt32)p[2]) << 16) | (((UInt32)p[3]) << 24);
-}
-
-static inline void WriteUInt32ToMemLE(UInt32 v, Byte *p)
-{
- p[0] = (Byte)v;
- p[1] = (Byte)(v >> 8);
- p[2] = (Byte)(v >> 16);
- p[3] = (Byte)(v >> 24);
-}
-
void CData::CryptBlock(Byte *buf, bool encrypt)
{
Byte inBuf[16];
UInt32 A, B, C, D, T, TA, TB;
- A = GetUInt32FromMemLE(buf + 0) ^ Keys[0];
- B = GetUInt32FromMemLE(buf + 4) ^ Keys[1];
- C = GetUInt32FromMemLE(buf + 8) ^ Keys[2];
- D = GetUInt32FromMemLE(buf + 12) ^ Keys[3];
+ A = GetUi32(buf + 0) ^ Keys[0];
+ B = GetUi32(buf + 4) ^ Keys[1];
+ C = GetUi32(buf + 8) ^ Keys[2];
+ D = GetUi32(buf + 12) ^ Keys[3];
if (!encrypt)
memcpy(inBuf, buf, sizeof(inBuf));
- for(int i = 0; i < kNumRounds; i++)
+ for (int i = 0; i < kNumRounds; i++)
{
UInt32 key = Keys[(encrypt ? i : (kNumRounds - 1 - i)) & 3];
- T = ((C + rol(D, 11)) ^ key);
+ T = ((C + rotlFixed(D, 11)) ^ key);
TA = A ^ SubstLong(T);
- T = ((D ^ rol(C, 17)) + key);
+ T = ((D ^ rotlFixed(C, 17)) + key);
TB = B ^ SubstLong(T);
A = C;
B = D;
@@ -115,13 +99,38 @@ void CData::CryptBlock(Byte *buf, bool encrypt)
D = TB;
}
- WriteUInt32ToMemLE(C ^ Keys[0], buf + 0);
- WriteUInt32ToMemLE(D ^ Keys[1], buf + 4);
- WriteUInt32ToMemLE(A ^ Keys[2], buf + 8);
- WriteUInt32ToMemLE(B ^ Keys[3], buf + 12);
+ SetUi32(buf + 0, C ^ Keys[0]);
+ SetUi32(buf + 4, D ^ Keys[1]);
+ SetUi32(buf + 8, A ^ Keys[2]);
+ SetUi32(buf + 12, B ^ Keys[3]);
UpdateKeys(encrypt ? buf : inBuf);
}
+STDMETHODIMP CDecoder::CryptoSetPassword(const Byte *data, UInt32 size)
+{
+ _cipher.SetPassword(data, size);
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::Init()
+{
+ return S_OK;
+}
+
+static const UInt32 kBlockSize = 16;
+
+STDMETHODIMP_(UInt32) CDecoder::Filter(Byte *data, UInt32 size)
+{
+ if (size == 0)
+ return 0;
+ if (size < kBlockSize)
+ return kBlockSize;
+ UInt32 i;
+ size -= kBlockSize;
+ for (i = 0; i <= size; i += kBlockSize)
+ _cipher.DecryptBlock(data + i);
+ return i;
+}
}}
diff --git a/CPP/7zip/Crypto/Rar20/Rar20Crypto.h b/CPP/7zip/Crypto/Rar20Crypto.h
index 572db3dd..b9648f59 100755
--- a/CPP/7zip/Crypto/Rar20/Rar20Crypto.h
+++ b/CPP/7zip/Crypto/Rar20Crypto.h
@@ -1,9 +1,12 @@
-// Crypto/Rar20/Crypto.h
+// Crypto/Rar20Crypto.h
#ifndef __CRYPTO_RAR20_CRYPTO_H
#define __CRYPTO_RAR20_CRYPTO_H
-#include "../../../Common/Types.h"
+#include "Common/MyCom.h"
+
+#include "../ICoder.h"
+#include "../IPassword.h"
namespace NCrypto {
namespace NRar20 {
@@ -12,6 +15,7 @@ class CData
{
Byte SubstTable[256];
UInt32 Keys[4];
+
UInt32 SubstLong(UInt32 t)
{
return (UInt32)SubstTable[(int)t & 255] |
@@ -19,13 +23,26 @@ class CData
((UInt32)SubstTable[(int)(t >> 16) & 255] << 16) |
((UInt32)SubstTable[(int)(t >> 24) & 255] << 24);
}
-
void UpdateKeys(const Byte *data);
void CryptBlock(Byte *buf, bool encrypt);
public:
void EncryptBlock(Byte *buf) { CryptBlock(buf, true); }
void DecryptBlock(Byte *buf) { CryptBlock(buf, false); }
- void SetPassword(const Byte *password, UInt32 passwordLength);
+ void SetPassword(const Byte *password, UInt32 passwordLen);
+};
+
+class CDecoder:
+ public ICompressFilter,
+ public ICryptoSetPassword,
+ public CMyUnknownImp
+{
+ CData _cipher;
+public:
+ MY_UNKNOWN_IMP1(ICryptoSetPassword)
+
+ STDMETHOD(Init)();
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
};
}}
diff --git a/CPP/7zip/Crypto/RarAES/StdAfx.h b/CPP/7zip/Crypto/RarAES/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/RarAES/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/RarAES/RarAES.cpp b/CPP/7zip/Crypto/RarAes.cpp
index cb907ec2..bbb4ccef 100755
--- a/CPP/7zip/Crypto/RarAES/RarAES.cpp
+++ b/CPP/7zip/Crypto/RarAes.cpp
@@ -1,11 +1,10 @@
-// RarAES.cpp
-// Note: you must include Crypto/AES/MyAES.cpp to project to initialize AES tables
+// Crypto/RarAes.cpp
+// Note: you must include MyAes.cpp to project to initialize AES tables
#include "StdAfx.h"
-#include "RarAES.h"
-#include "../../Common/MethodId.h"
-#include "../Hash/Sha1.h"
+#include "RarAes.h"
+#include "Sha1.h"
namespace NCrypto {
namespace NRar29 {
diff --git a/CPP/7zip/Crypto/RarAES/RarAES.h b/CPP/7zip/Crypto/RarAes.h
index d43b3889..aa8e06ba 100755
--- a/CPP/7zip/Crypto/RarAES/RarAES.h
+++ b/CPP/7zip/Crypto/RarAes.h
@@ -1,20 +1,19 @@
-// RarAES.h
+// Crypto/RarAes.h
-#ifndef __CRYPTO_RARAES_H
-#define __CRYPTO_RARAES_H
-
-#include "Common/MyCom.h"
-#include "Common/Types.h"
-#include "Common/Buffer.h"
-
-#include "../../ICoder.h"
-#include "../../IPassword.h"
+#ifndef __CRYPTO_RAR_AES_H
+#define __CRYPTO_RAR_AES_H
extern "C"
{
-#include "../../../../C/Aes.h"
+#include "../../../C/Aes.h"
}
+#include "Common/Buffer.h"
+#include "Common/MyCom.h"
+
+#include "../ICoder.h"
+#include "../IPassword.h"
+
namespace NCrypto {
namespace NRar29 {
diff --git a/CPP/7zip/Crypto/Hash/Sha1.cpp b/CPP/7zip/Crypto/Sha1.cpp
index 2962c654..af211f6c 100755
--- a/CPP/7zip/Crypto/Hash/Sha1.cpp
+++ b/CPP/7zip/Crypto/Sha1.cpp
@@ -1,4 +1,4 @@
-// Sha1.cpp
+// Crypto/Sha1.cpp
// This file is based on public domain
// Steve Reid and Wei Dai's code from Crypto++
@@ -7,7 +7,7 @@
#include "Sha1.h"
extern "C"
{
-#include "../../../../C/RotateDefs.h"
+#include "../../../C/RotateDefs.h"
}
namespace NCrypto {
@@ -16,7 +16,7 @@ namespace NSha1 {
// define it for speed optimization
// #define _SHA1_UNROLL
-static const unsigned int kNumW =
+static const unsigned kNumW =
#ifdef _SHA1_UNROLL
16;
#else
@@ -103,9 +103,9 @@ void CContextBase::GetBlockDigest(UInt32 *data, UInt32 *destDigest, bool returnR
// a = b = c = d = e = 0;
}
-void CContextBase::PrepareBlock(UInt32 *block, unsigned int size) const
+void CContextBase::PrepareBlock(UInt32 *block, unsigned size) const
{
- unsigned int curBufferPos = size & 0xF;
+ unsigned curBufferPos = size & 0xF;
block[curBufferPos++] = 0x80000000;
while (curBufferPos != (16 - 2))
block[curBufferPos++] = 0;
@@ -117,7 +117,7 @@ void CContextBase::PrepareBlock(UInt32 *block, unsigned int size) const
void CContext::Update(Byte *data, size_t size, bool rar350Mode)
{
bool returnRes = false;
- unsigned int curBufferPos = _count2;
+ unsigned curBufferPos = _count2;
while (size-- > 0)
{
int pos = (int)(curBufferPos & 3);
@@ -146,7 +146,7 @@ void CContext::Update(Byte *data, size_t size, bool rar350Mode)
void CContext::Final(Byte *digest)
{
const UInt64 lenInBits = (_count << 9) + ((UInt64)_count2 << 3);
- unsigned int curBufferPos = _count2;
+ unsigned curBufferPos = _count2;
int pos = (int)(curBufferPos & 3);
curBufferPos >>= 2;
if (pos == 0)
@@ -195,7 +195,7 @@ void CContext32::Update(const UInt32 *data, size_t size)
void CContext32::Final(UInt32 *digest)
{
const UInt64 lenInBits = (_count << 9) + ((UInt64)_count2 << 5);
- unsigned int curBufferPos = _count2;
+ unsigned curBufferPos = _count2;
_buffer[curBufferPos++] = 0x80000000;
while (curBufferPos != (16 - 2))
{
diff --git a/CPP/7zip/Crypto/Hash/Sha1.h b/CPP/7zip/Crypto/Sha1.h
index 8ad8675b..405be216 100755
--- a/CPP/7zip/Crypto/Hash/Sha1.h
+++ b/CPP/7zip/Crypto/Sha1.h
@@ -1,12 +1,12 @@
-// Sha1.h
+// Crypto/Sha1.h
// This file is based on public domain
// Steve Reid and Wei Dai's code from Crypto++
-#ifndef __SHA1_H
-#define __SHA1_H
+#ifndef __CRYPTO_SHA1_H
+#define __CRYPTO_SHA1_H
#include <stddef.h>
-#include "../../../Common/Types.h"
+#include "../../Common/Types.h"
// Sha1 implementation in RAR before version 3.60 has bug:
// it changes data bytes in some cases.
@@ -15,11 +15,11 @@
namespace NCrypto {
namespace NSha1 {
-const unsigned int kBlockSize = 64;
-const unsigned int kDigestSize = 20;
+const unsigned kBlockSize = 64;
+const unsigned kDigestSize = 20;
-const unsigned int kBlockSizeInWords = (kBlockSize >> 2);
-const unsigned int kDigestSizeInWords = (kDigestSize >> 2);
+const unsigned kBlockSizeInWords = (kBlockSize >> 2);
+const unsigned kDigestSizeInWords = (kDigestSize >> 2);
class CContextBase
{
@@ -41,7 +41,7 @@ public:
class CContextBase2: public CContextBase
{
protected:
- unsigned int _count2;
+ unsigned _count2;
UInt32 _buffer[kBlockSizeInWords];
void UpdateBlock() { CContextBase::UpdateBlock(_buffer); }
public:
diff --git a/CPP/7zip/Compress/RangeCoder/StdAfx.h b/CPP/7zip/Crypto/StdAfx.h
index b637fd40..99a8aa46 100755
--- a/CPP/7zip/Compress/RangeCoder/StdAfx.h
+++ b/CPP/7zip/Crypto/StdAfx.h
@@ -3,4 +3,6 @@
#ifndef __STDAFX_H
#define __STDAFX_H
+#include "../../Common/MyWindows.h"
+
#endif
diff --git a/CPP/7zip/Crypto/WzAES/StdAfx.h b/CPP/7zip/Crypto/WzAES/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/WzAES/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/WzAES/WzAES.cpp b/CPP/7zip/Crypto/WzAes.cpp
index ba213626..beb24217 100755
--- a/CPP/7zip/Crypto/WzAES/WzAES.cpp
+++ b/CPP/7zip/Crypto/WzAes.cpp
@@ -1,26 +1,25 @@
-// WzAES.cpp
+// Crypto/WzAes.cpp
/*
This code implements Brian Gladman's scheme
specified in password Based File Encryption Utility.
-Note: you must include Crypto/AES/MyAES.cpp to project to initialize AES tables
+Note: you must include MyAes.cpp to project to initialize AES tables
*/
#include "StdAfx.h"
-#include "Windows/Defs.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/StreamUtils.h"
-#include "../Hash/Pbkdf2HmacSha1.h"
-#include "../Hash/RandGen.h"
+#include "../Common/StreamObjects.h"
+#include "../Common/StreamUtils.h"
-#include "WzAES.h"
+#include "Pbkdf2HmacSha1.h"
+#include "RandGen.h"
+#include "WzAes.h"
// define it if you don't want to use speed-optimized version of Pbkdf2HmacSha1
// #define _NO_WZAES_OPTIMIZATIONS
namespace NCrypto {
-namespace NWzAES {
+namespace NWzAes {
const unsigned int kAesKeySizeMax = 32;
diff --git a/CPP/7zip/Crypto/WzAES/WzAES.h b/CPP/7zip/Crypto/WzAes.h
index ad35035c..2c7a4b43 100755
--- a/CPP/7zip/Crypto/WzAES/WzAES.h
+++ b/CPP/7zip/Crypto/WzAes.h
@@ -1,4 +1,4 @@
-// WzAES.h
+// Crypto/WzAes.h
/*
This code implements Brian Gladman's scheme
specified in password Based File Encryption Utility:
@@ -12,22 +12,22 @@ specified in password Based File Encryption Utility:
#ifndef __CRYPTO_WZ_AES_H
#define __CRYPTO_WZ_AES_H
-#include "../Hash/HmacSha1.h"
+extern "C"
+{
+#include "../../../C/Aes.h"
+}
-#include "Common/MyCom.h"
#include "Common/Buffer.h"
+#include "Common/MyCom.h"
#include "Common/MyVector.h"
-#include "../../ICoder.h"
-#include "../../IPassword.h"
+#include "../ICoder.h"
+#include "../IPassword.h"
-extern "C"
-{
-#include "../../../../C/Aes.h"
-}
+#include "HmacSha1.h"
namespace NCrypto {
-namespace NWzAES {
+namespace NWzAes {
const unsigned int kSaltSizeMax = 16;
const unsigned int kMacSize = 10;
diff --git a/CPP/7zip/Crypto/Zip/StdAfx.h b/CPP/7zip/Crypto/Zip/StdAfx.h
deleted file mode 100755
index e7fb6986..00000000
--- a/CPP/7zip/Crypto/Zip/StdAfx.h
+++ /dev/null
@@ -1,8 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-
-#endif
diff --git a/CPP/7zip/Crypto/Zip/ZipCrypto.cpp b/CPP/7zip/Crypto/Zip/ZipCrypto.cpp
deleted file mode 100755
index 55ec8e54..00000000
--- a/CPP/7zip/Crypto/Zip/ZipCrypto.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// Crypto/ZipCrypto.cpp
-
-#include "StdAfx.h"
-
-#include "ZipCipher.h"
-extern "C"
-{
-#include "../../../../C/7zCrc.h"
-}
-
-namespace NCrypto {
-namespace NZip {
-
-void CCipher::UpdateKeys(Byte b)
-{
- Keys[0] = CRC_UPDATE_BYTE(Keys[0], b);
- Keys[1] += Keys[0] & 0xff;
- Keys[1] = Keys[1] * 134775813L + 1;
- Keys[2] = CRC_UPDATE_BYTE(Keys[2], (Byte)(Keys[1] >> 24));
-}
-
-void CCipher::SetPassword(const Byte *password, UInt32 passwordLength)
-{
- Keys[0] = 305419896L;
- Keys[1] = 591751049L;
- Keys[2] = 878082192L;
- for (UInt32 i = 0; i < passwordLength; i++)
- UpdateKeys(password[i]);
-}
-
-Byte CCipher::DecryptByteSpec()
-{
- UInt32 temp = Keys[2] | 2;
- return (Byte)((temp * (temp ^ 1)) >> 8);
-}
-
-Byte CCipher::DecryptByte(Byte encryptedByte)
-{
- Byte c = (Byte)(encryptedByte ^ DecryptByteSpec());
- UpdateKeys(c);
- return c;
-}
-
-Byte CCipher::EncryptByte(Byte b)
-{
- Byte c = (Byte)(b ^ DecryptByteSpec());
- UpdateKeys(b);
- return c;
-}
-
-void CCipher::DecryptHeader(Byte *buffer)
-{
- for (int i = 0; i < 12; i++)
- buffer[i] = DecryptByte(buffer[i]);
-}
-
-void CCipher::EncryptHeader(Byte *buffer)
-{
- for (int i = 0; i < 12; i++)
- buffer[i] = EncryptByte(buffer[i]);
-}
-
-}}
diff --git a/CPP/7zip/Crypto/Zip/ZipCrypto.h b/CPP/7zip/Crypto/Zip/ZipCrypto.h
deleted file mode 100755
index 6b4ecaaa..00000000
--- a/CPP/7zip/Crypto/Zip/ZipCrypto.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Crypto/ZipCrypto.h
-
-#ifndef __CRYPTO_ZIP_CRYPTO_H
-#define __CRYPTO_ZIP_CRYPTO_H
-
-namespace NCrypto {
-namespace NZip {
-
-const int kHeaderSize = 12;
-class CCipher
-{
- UInt32 Keys[3];
- void UpdateKeys(Byte b);
- Byte DecryptByteSpec();
-public:
- void SetPassword(const Byte *password, UInt32 passwordLength);
- Byte DecryptByte(Byte encryptedByte);
- Byte EncryptByte(Byte b);
- void DecryptHeader(Byte *buffer);
- void EncryptHeader(Byte *buffer);
-
-};
-
-}}
-
-#endif
diff --git a/CPP/7zip/Crypto/Zip/ZipCipher.cpp b/CPP/7zip/Crypto/ZipCrypto.cpp
index b466f8a7..fc9f8ac2 100755
--- a/CPP/7zip/Crypto/Zip/ZipCipher.cpp
+++ b/CPP/7zip/Crypto/ZipCrypto.cpp
@@ -1,16 +1,69 @@
-// Crypto/ZipCipher.h
+// Crypto/ZipCrypto.cpp
#include "StdAfx.h"
-#include "ZipCipher.h"
-#include "Windows/Defs.h"
+extern "C"
+{
+#include "../../../C/7zCrc.h"
+}
+
+#include "../Common/StreamUtils.h"
-#include "../../Common/StreamUtils.h"
-#include "../Hash/RandGen.h"
+#include "RandGen.h"
+#include "ZipCrypto.h"
namespace NCrypto {
namespace NZip {
+void CCipher::UpdateKeys(Byte b)
+{
+ Keys[0] = CRC_UPDATE_BYTE(Keys[0], b);
+ Keys[1] += Keys[0] & 0xff;
+ Keys[1] = Keys[1] * 134775813L + 1;
+ Keys[2] = CRC_UPDATE_BYTE(Keys[2], (Byte)(Keys[1] >> 24));
+}
+
+void CCipher::SetPassword(const Byte *password, UInt32 passwordLen)
+{
+ Keys[0] = 305419896L;
+ Keys[1] = 591751049L;
+ Keys[2] = 878082192L;
+ for (UInt32 i = 0; i < passwordLen; i++)
+ UpdateKeys(password[i]);
+}
+
+Byte CCipher::DecryptByteSpec()
+{
+ UInt32 temp = Keys[2] | 2;
+ return (Byte)((temp * (temp ^ 1)) >> 8);
+}
+
+Byte CCipher::DecryptByte(Byte b)
+{
+ Byte c = (Byte)(b ^ DecryptByteSpec());
+ UpdateKeys(c);
+ return c;
+}
+
+Byte CCipher::EncryptByte(Byte b)
+{
+ Byte c = (Byte)(b ^ DecryptByteSpec());
+ UpdateKeys(b);
+ return c;
+}
+
+void CCipher::DecryptHeader(Byte *buf)
+{
+ for (unsigned i = 0; i < kHeaderSize; i++)
+ buf[i] = DecryptByte(buf[i]);
+}
+
+void CCipher::EncryptHeader(Byte *buf)
+{
+ for (unsigned i = 0; i < kHeaderSize; i++)
+ buf[i] = EncryptByte(buf[i]);
+}
+
STDMETHODIMP CEncoder::CryptoSetPassword(const Byte *data, UInt32 size)
{
_cipher.SetPassword(data, size);
diff --git a/CPP/7zip/Crypto/Zip/ZipCipher.h b/CPP/7zip/Crypto/ZipCrypto.h
index 83732a41..040ebb09 100755
--- a/CPP/7zip/Crypto/Zip/ZipCipher.h
+++ b/CPP/7zip/Crypto/ZipCrypto.h
@@ -1,19 +1,32 @@
-// Crypto/ZipCipher.h
+// Crypto/ZipCrypto.h
-#ifndef __CRYPTO_ZIPCIPHER_H
-#define __CRYPTO_ZIPCIPHER_H
+#ifndef __CRYPTO_ZIP_CRYPTO_H
+#define __CRYPTO_ZIP_CRYPTO_H
#include "Common/MyCom.h"
-#include "Common/Types.h"
-#include "../../ICoder.h"
-#include "../../IPassword.h"
-
-#include "ZipCrypto.h"
+#include "../ICoder.h"
+#include "../IPassword.h"
namespace NCrypto {
namespace NZip {
+const unsigned kHeaderSize = 12;
+
+class CCipher
+{
+ UInt32 Keys[3];
+
+ void UpdateKeys(Byte b);
+ Byte DecryptByteSpec();
+public:
+ void SetPassword(const Byte *password, UInt32 passwordLen);
+ Byte DecryptByte(Byte b);
+ Byte EncryptByte(Byte b);
+ void DecryptHeader(Byte *buf);
+ void EncryptHeader(Byte *buf);
+};
+
class CEncoder :
public ICompressFilter,
public ICryptoSetPassword,
@@ -40,20 +53,19 @@ class CDecoder:
public ICompressFilter,
public ICryptoSetPassword,
public CMyUnknownImp
- // public CBuffer2
{
CCipher _cipher;
public:
-
MY_UNKNOWN_IMP1(ICryptoSetPassword)
STDMETHOD(Init)();
STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
HRESULT ReadHeader(ISequentialInStream *inStream);
- STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
};
+
}}
#endif
diff --git a/CPP/7zip/Crypto/ZipStrong.cpp b/CPP/7zip/Crypto/ZipStrong.cpp
new file mode 100755
index 00000000..e693febd
--- /dev/null
+++ b/CPP/7zip/Crypto/ZipStrong.cpp
@@ -0,0 +1,180 @@
+// Crypto/ZipStrong.cpp
+
+#include "StdAfx.h"
+
+extern "C"
+{
+#include "../../../C/7zCrc.h"
+#include "../../../C/CpuArch.h"
+}
+
+#include "../Common/StreamUtils.h"
+
+#include "MyAES.h"
+#include "Sha1.h"
+#include "ZipStrong.h"
+
+namespace NCrypto {
+namespace NZipStrong {
+
+static const UInt16 kAES128 = 0x660E;
+
+// DeriveKey* function is similar to CryptDeriveKey() from Windows.
+// But MSDN tells that we need such scheme only if
+// "the required key length is longer than the hash value"
+// but ZipStrong uses it always.
+
+static void DeriveKey2(const Byte *digest, Byte c, Byte *dest)
+{
+ Byte buf[64];
+ memset(buf, c, 64);
+ for (unsigned i = 0; i < NSha1::kDigestSize; i++)
+ buf[i] ^= digest[i];
+ NSha1::CContext sha;
+ sha.Init();
+ sha.Update(buf, 64);
+ sha.Final(dest);
+}
+
+static void DeriveKey(NSha1::CContext &sha, Byte *key)
+{
+ Byte digest[NSha1::kDigestSize];
+ sha.Final(digest);
+ Byte temp[NSha1::kDigestSize * 2];
+ DeriveKey2(digest, 0x36, temp);
+ DeriveKey2(digest, 0x5C, temp + NSha1::kDigestSize);
+ memcpy(key, temp, 32);
+}
+
+void CKeyInfo::SetPassword(const Byte *data, UInt32 size)
+{
+ NSha1::CContext sha;
+ sha.Init();
+ sha.Update(data, size);
+ DeriveKey(sha, MasterKey);
+}
+
+STDMETHODIMP CBaseCoder::CryptoSetPassword(const Byte *data, UInt32 size)
+{
+ _key.SetPassword(data, size);
+ return S_OK;
+}
+
+STDMETHODIMP CBaseCoder::Init()
+{
+ return S_OK;
+}
+
+HRESULT CDecoder::ReadHeader(ISequentialInStream *inStream, UInt32 /* crc */, UInt64 /* unpackSize */)
+{
+ Byte temp[4];
+ RINOK(ReadStream_FALSE(inStream, temp, 2));
+ _ivSize = GetUi16(temp);
+ if (_ivSize == 0)
+ {
+ return E_NOTIMPL;
+ /*
+ SetUi32(_iv, crc);
+ for (int i = 0; i < 8; i++)
+ _iv[4 + i] = (Byte)(unpackSize >> (8 * i));
+ SetUi32(_iv + 12, 0);
+ */
+ }
+ else if (_ivSize == 16)
+ {
+ RINOK(ReadStream_FALSE(inStream, _iv, _ivSize));
+ }
+ else
+ return E_NOTIMPL;
+ RINOK(ReadStream_FALSE(inStream, temp, 4));
+ _remSize = GetUi32(temp);
+ if (_remSize > _buf.GetCapacity())
+ {
+ _buf.Free();
+ _buf.SetCapacity(_remSize);
+ }
+ return ReadStream_FALSE(inStream, _buf, _remSize);
+}
+
+HRESULT CDecoder::CheckPassword(bool &passwOK)
+{
+ passwOK = false;
+ if (_remSize < 10)
+ return E_NOTIMPL;
+ Byte *p = _buf;
+ UInt16 format = GetUi16(p);
+ if (format != 3)
+ return E_NOTIMPL;
+ UInt16 algId = GetUi16(p + 2);
+ if (algId < kAES128)
+ return E_NOTIMPL;
+ algId -= kAES128;
+ if (algId > 2)
+ return E_NOTIMPL;
+ UInt16 bitLen = GetUi16(p + 4);
+ UInt16 flags = GetUi16(p + 6);
+ if (algId * 64 + 128 != bitLen)
+ return E_NOTIMPL;
+ _key.KeySize = 16 + algId * 8;
+ if ((flags & 1) == 0)
+ return E_NOTIMPL;
+ UInt32 rdSize = GetUi16(p + 8);
+ UInt32 pos = 10;
+ Byte *rd = p + pos;
+ pos += rdSize;
+ if (pos + 4 > _remSize)
+ return E_NOTIMPL;
+ UInt32 reserved = GetUi32(p + pos);
+ pos += 4;
+ if (reserved != 0)
+ return E_NOTIMPL;
+ if (pos + 2 > _remSize)
+ return E_NOTIMPL;
+ UInt32 validSize = GetUi16(p + pos);
+ pos += 2;
+ Byte *validData = p + pos;
+ if (pos + validSize != _remSize)
+ return E_NOTIMPL;
+
+ if (!_aesFilter)
+ _aesFilter = new CAesCbcDecoder;
+
+ CMyComPtr<ICryptoProperties> cp;
+ RINOK(_aesFilter.QueryInterface(IID_ICryptoProperties, &cp));
+ {
+ RINOK(cp->SetKey(_key.MasterKey, _key.KeySize));
+ RINOK(cp->SetInitVector(_iv, 16));
+ _aesFilter->Init();
+ if (_aesFilter->Filter(rd, rdSize) != rdSize)
+ return E_NOTIMPL;
+ }
+
+ Byte fileKey[32];
+ NSha1::CContext sha;
+ sha.Init();
+ sha.Update(_iv, 16);
+ sha.Update(rd, rdSize - 16); // we don't use last 16 bytes (PAD bytes)
+ DeriveKey(sha, fileKey);
+
+ RINOK(cp->SetKey(fileKey, _key.KeySize));
+ RINOK(cp->SetInitVector(_iv, 16));
+ _aesFilter->Init();
+ if (_aesFilter->Filter(validData, validSize) != validSize)
+ return E_NOTIMPL;
+
+ if (validSize < 4)
+ return E_NOTIMPL;
+ validSize -= 4;
+ if (GetUi32(validData + validSize) != CrcCalc(validData, validSize))
+ return S_OK;
+ passwOK = true;
+ _aesFilter->Init();
+ return S_OK;
+}
+
+STDMETHODIMP_(UInt32) CDecoder::Filter(Byte *data, UInt32 size)
+{
+ return _aesFilter->Filter(data, size);
+}
+
+}}
diff --git a/CPP/7zip/Crypto/ZipStrong.h b/CPP/7zip/Crypto/ZipStrong.h
new file mode 100755
index 00000000..6ea00b34
--- /dev/null
+++ b/CPP/7zip/Crypto/ZipStrong.h
@@ -0,0 +1,53 @@
+// Crypto/ZipStrong.h
+
+#ifndef __CRYPTO_ZIP_STRONG_H
+#define __CRYPTO_ZIP_STRONG_H
+
+#include "Common/MyCom.h"
+#include "Common/Buffer.h"
+
+#include "../ICoder.h"
+#include "../IPassword.h"
+
+namespace NCrypto {
+namespace NZipStrong {
+
+struct CKeyInfo
+{
+ Byte MasterKey[32];
+ UInt32 KeySize;
+ void SetPassword(const Byte *data, UInt32 size);
+};
+
+class CBaseCoder:
+ public ICompressFilter,
+ public ICryptoSetPassword,
+ public CMyUnknownImp
+{
+protected:
+ CKeyInfo _key;
+ CMyComPtr<ICompressFilter> _aesFilter;
+ CByteBuffer _buf;
+public:
+ STDMETHOD(Init)();
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size) = 0;
+
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
+};
+
+class CDecoder:
+ public CBaseCoder
+{
+ UInt32 _ivSize;
+ Byte _iv[16];
+ UInt32 _remSize;
+public:
+ MY_UNKNOWN_IMP1(ICryptoSetPassword)
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
+ HRESULT ReadHeader(ISequentialInStream *inStream, UInt32 crc, UInt64 unpackSize);
+ HRESULT CheckPassword(bool &passwOK);
+};
+
+}}
+
+#endif
diff --git a/CPP/7zip/Crypto/makefile b/CPP/7zip/Crypto/makefile
deleted file mode 100755
index 2969f309..00000000
--- a/CPP/7zip/Crypto/makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-DIRS = \
- 7zAES\~ \
-
-all: $(DIRS)
-
-$(DIRS):
-!include "../SubBuild.mak"
diff --git a/CPP/7zip/MyVersion.h b/CPP/7zip/MyVersion.h
index 298f1ba7..228f1015 100755
--- a/CPP/7zip/MyVersion.h
+++ b/CPP/7zip/MyVersion.h
@@ -1,8 +1,8 @@
#define MY_VER_MAJOR 4
-#define MY_VER_MINOR 62
+#define MY_VER_MINOR 63
#define MY_VER_BUILD 0
-#define MY_VERSION "4.62"
-#define MY_7ZIP_VERSION "7-Zip 4.62"
-#define MY_DATE "2008-12-02"
+#define MY_VERSION "4.63"
+#define MY_7ZIP_VERSION "7-Zip 4.63"
+#define MY_DATE "2008-12-31"
#define MY_COPYRIGHT "Copyright (c) 1999-2008 Igor Pavlov"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE
diff --git a/CPP/7zip/UI/Agent/AgentOut.cpp b/CPP/7zip/UI/Agent/AgentOut.cpp
index e4d34a72..ffeac1c6 100755
--- a/CPP/7zip/UI/Agent/AgentOut.cpp
+++ b/CPP/7zip/UI/Agent/AgentOut.cpp
@@ -11,14 +11,15 @@
#include "Windows/PropVariantConversions.h"
#include "Windows/Time.h"
-#include "../../Compress/Copy/CopyCoder.h"
+#include "../../Compress/CopyCoder.h"
+
#include "../../Common/FileStreams.h"
-#include "../Common/UpdatePair.h"
#include "../Common/EnumDirItems.h"
#include "../Common/HandlerLoader.h"
-#include "../Common/UpdateCallback.h"
#include "../Common/OpenArchive.h"
+#include "../Common/UpdateCallback.h"
+#include "../Common/UpdatePair.h"
#include "Agent.h"
#include "UpdateCallbackAgent.h"
@@ -143,6 +144,21 @@ static HRESULT EnumerateArchiveItems(CAgent *agent,
return S_OK;
}
+struct CAgUpCallbackImp: public IUpdateProduceCallback
+{
+ const CObjectVector<CArcItem> *_arcItems;
+ IFolderArchiveUpdateCallback *_callback;
+
+ CAgUpCallbackImp(const CObjectVector<CArcItem> *a,
+ IFolderArchiveUpdateCallback *callback): _arcItems(a), _callback(callback) {}
+ HRESULT ShowDeleteFile(int arcIndex);
+};
+
+HRESULT CAgUpCallbackImp::ShowDeleteFile(int arcIndex)
+{
+ return _callback->DeleteOperation((*_arcItems)[arcIndex].Name);
+}
+
STDMETHODIMP CAgent::DoOperation(
CCodecs *codecs,
int formatIndex,
@@ -221,7 +237,8 @@ STDMETHODIMP CAgent::DoOperation(
{
CRecordVector<CUpdatePair> updatePairs;
GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs);
- UpdateProduce(updatePairs, actionSet, updatePairs2);
+ CAgUpCallbackImp upCallback(&arcItems, updateCallback100);
+ UpdateProduce(updatePairs, actionSet, updatePairs2, &upCallback);
}
UInt32 numFiles = 0;
diff --git a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp
index 6f435b35..e14197d2 100755
--- a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp
+++ b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp
@@ -102,3 +102,10 @@ HRESULT CUpdateCallbackAgent::CryptoGetTextPassword2(Int32 *passwordIsDefined, B
}
return _cryptoGetTextPassword->CryptoGetTextPassword2(passwordIsDefined, password);
}
+
+/*
+HRESULT CUpdateCallbackAgent::ShowDeleteFile(const wchar_t *name)
+{
+ return Callback->DeleteOperation(name);
+}
+*/ \ No newline at end of file
diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp
index f2207557..1f88a6f0 100755
--- a/CPP/7zip/UI/Common/Update.cpp
+++ b/CPP/7zip/UI/Common/Update.cpp
@@ -19,7 +19,8 @@
#include "Windows/Time.h"
#include "../../Common/FileStreams.h"
-#include "../../Compress/Copy/CopyCoder.h"
+
+#include "../../Compress/CopyCoder.h"
#include "../Common/DirItem.h"
#include "../Common/EnumDirItems.h"
@@ -285,6 +286,22 @@ bool CUpdateOptions::Init(const CCodecs *codecs, const CIntVector &formatIndices
return true;
}
+/*
+struct CUpdateProduceCallbackImp: public IUpdateProduceCallback
+{
+ const CObjectVector<CArcItem> *_arcItems;
+ IUpdateCallbackUI *_callback;
+
+ CUpdateProduceCallbackImp(const CObjectVector<CArcItem> *a,
+ IUpdateCallbackUI *callback): _arcItems(a), _callback(callback) {}
+ virtual HRESULT ShowDeleteFile(int arcIndex);
+};
+
+HRESULT CUpdateProduceCallbackImp::ShowDeleteFile(int arcIndex)
+{
+ return _callback->ShowDeleteFile((*_arcItems)[arcIndex].Name);
+}
+*/
static HRESULT Compress(
CCodecs *codecs,
@@ -351,7 +368,8 @@ static HRESULT Compress(
{
CRecordVector<CUpdatePair> updatePairs;
GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs); // must be done only once!!!
- UpdateProduce(updatePairs, actionSet, updatePairs2);
+ // CUpdateProduceCallbackImp upCallback(&arcItems, callback);
+ UpdateProduce(updatePairs, actionSet, updatePairs2, NULL /* &upCallback */);
}
UInt32 numFiles = 0;
diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h
index 411ee011..2a814b37 100755
--- a/CPP/7zip/UI/Common/UpdateCallback.h
+++ b/CPP/7zip/UI/Common/UpdateCallback.h
@@ -23,7 +23,7 @@
virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) x; \
virtual HRESULT SetOperationResult(Int32 operationResult) x; \
virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \
-
+ // virtual HRESULT ShowDeleteFile(const wchar_t *name) x; \
// virtual HRESULT CloseProgress() { return S_OK; };
struct IUpdateCallbackUI
diff --git a/CPP/7zip/UI/Common/UpdateProduce.cpp b/CPP/7zip/UI/Common/UpdateProduce.cpp
index b2bc59a5..c21db3b2 100755
--- a/CPP/7zip/UI/Common/UpdateProduce.cpp
+++ b/CPP/7zip/UI/Common/UpdateProduce.cpp
@@ -10,8 +10,9 @@ static const char *kUpdateActionSetCollision = "Internal collision in update act
void UpdateProduce(
const CRecordVector<CUpdatePair> &updatePairs,
- const NUpdateArchive::CActionSet &actionSet,
- CRecordVector<CUpdatePair2> &operationChain)
+ const CActionSet &actionSet,
+ CRecordVector<CUpdatePair2> &operationChain,
+ IUpdateProduceCallback *callback)
{
for (int i = 0; i < updatePairs.Size(); i++)
{
@@ -22,6 +23,7 @@ void UpdateProduce(
up2.DirIndex = pair.DirIndex;
up2.ArcIndex = pair.ArcIndex;
up2.NewData = up2.NewProps = true;
+
switch(actionSet.StateActions[pair.State])
{
case NPairAction::kIgnore:
@@ -30,6 +32,8 @@ void UpdateProduce(
IgnoreArchiveItem(m_ArchiveItems[pair.ArcIndex]);
// cout << "deleting";
*/
+ if (callback)
+ callback->ShowDeleteFile(pair.ArcIndex);
continue;
case NPairAction::kCopy:
diff --git a/CPP/7zip/UI/Common/UpdateProduce.h b/CPP/7zip/UI/Common/UpdateProduce.h
index 7e1a4a3f..e18648cd 100755
--- a/CPP/7zip/UI/Common/UpdateProduce.h
+++ b/CPP/7zip/UI/Common/UpdateProduce.h
@@ -21,9 +21,15 @@ struct CUpdatePair2
CUpdatePair2(): IsAnti(false), DirIndex(-1), ArcIndex(-1), NewNameIndex(-1) {}
};
+struct IUpdateProduceCallback
+{
+ virtual HRESULT ShowDeleteFile(int arcIndex) = 0;
+};
+
void UpdateProduce(
const CRecordVector<CUpdatePair> &updatePairs,
const NUpdateArchive::CActionSet &actionSet,
- CRecordVector<CUpdatePair2> &operationChain);
+ CRecordVector<CUpdatePair2> &operationChain,
+ IUpdateProduceCallback *callback);
#endif
diff --git a/CPP/7zip/UI/Console/Console.dsp b/CPP/7zip/UI/Console/Console.dsp
index ba5cd727..bb2f0e1d 100755
--- a/CPP/7zip/UI/Console/Console.dsp
+++ b/CPP/7zip/UI/Console/Console.dsp
@@ -696,11 +696,11 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h
# End Group
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# End Group
# Begin Group "C"
diff --git a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
index f81b6491..bf22d34b 100755
--- a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
+++ b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
@@ -217,3 +217,22 @@ HRESULT CUpdateCallbackConsole::CryptoGetTextPassword2(Int32 *passwordIsDefined,
#endif
}
+
+/*
+HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name)
+{
+ // MT_LOCK
+ if (StdOutMode)
+ return S_OK;
+ RINOK(Finilize());
+ m_PercentPrinter.PrintString("Deleting ");
+ if (name[0] == 0)
+ name = kEmptyFileAlias;
+ m_PercentPrinter.PrintString(name);
+ if (EnablePercents)
+ m_PercentPrinter.RePrintRatio();
+ m_NeedBeClosed = true;
+ m_NeedNewLine = true;
+ return S_OK;
+}
+*/
diff --git a/CPP/7zip/UI/Console/makefile b/CPP/7zip/UI/Console/makefile
index 1fde7c66..01682e9a 100755
--- a/CPP/7zip/UI/Console/makefile
+++ b/CPP/7zip/UI/Console/makefile
@@ -111,7 +111,7 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
$(COMPL)
$(UI_COMMON_OBJS): ../Common/$(*B).cpp
$(COMPL)
-$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp
+$O\CopyCoder.obj: ../../Compress/$(*B).cpp
$(COMPL)
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL)
diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp
index 8c1d1357..7bb43ef7 100755
--- a/CPP/7zip/UI/Far/Far.dsp
+++ b/CPP/7zip/UI/Far/Far.dsp
@@ -518,11 +518,11 @@ SOURCE=..\Agent\UpdateCallbackAgent.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# End Group
# Begin Group "7-zip Common"
diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile
index 2c820077..dba62d63 100755
--- a/CPP/7zip/UI/Far/makefile
+++ b/CPP/7zip/UI/Far/makefile
@@ -101,7 +101,7 @@ $(UI_COMMON_OBJS): ../Common/$(*B).cpp
$(COMPL)
$(AGENT_OBJS): ../Agent/$(*B).cpp
$(COMPL)
-$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp
+$O\CopyCoder.obj: ../../Compress/$(*B).cpp
$(COMPL)
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
diff --git a/CPP/7zip/UI/FileManager/App.cpp b/CPP/7zip/UI/FileManager/App.cpp
index db5ef0da..11c76458 100755
--- a/CPP/7zip/UI/FileManager/App.cpp
+++ b/CPP/7zip/UI/FileManager/App.cpp
@@ -355,8 +355,10 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &ar
ReadListMode(listMode);
for (i = 0; i < kNumPanelsMax; i++)
{
- Panels[i]._ListViewMode = listMode.Panels[i];
- Panels[i]._xSize = xSizes[i];
+ CPanel &panel = Panels[i];
+ panel._ListViewMode = listMode.Panels[i];
+ panel._xSize = xSizes[i];
+ panel._flatModeForArc = ReadFlatView(i);
}
for (i = 0; i < kNumPanelsMax; i++)
if (NumPanels > 1 || i == LastFocusedPanel)
@@ -414,6 +416,7 @@ void CApp::Save()
path = GetFolderPath(panel._parentFolders[0].ParentFolder);
SavePanelPath(i, path);
listMode.Panels[i] = panel.GetListViewMode();
+ SaveFlatView(i, panel._flatModeForArc);
}
SaveListMode(listMode);
}
diff --git a/CPP/7zip/UI/FileManager/FM.dsp b/CPP/7zip/UI/FileManager/FM.dsp
index 38e3e19a..d13e0a1f 100755
--- a/CPP/7zip/UI/FileManager/FM.dsp
+++ b/CPP/7zip/UI/FileManager/FM.dsp
@@ -1319,11 +1319,11 @@ SOURCE=..\Agent\UpdateCallbackAgent.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# End Group
# Begin Group "Interface"
diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp
index cdb12ced..40192c5f 100755
--- a/CPP/7zip/UI/FileManager/Panel.cpp
+++ b/CPP/7zip/UI/FileManager/Panel.cpp
@@ -756,6 +756,10 @@ void CPanel::SetListViewMode(UInt32 index)
void CPanel::ChangeFlatMode()
{
_flatMode = !_flatMode;
+ if (_parentFolders.Size() > 0)
+ _flatModeForArc = _flatMode;
+ else
+ _flatModeForDisk = _flatMode;
RefreshListCtrlSaveFocused();
}
diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h
index 86f3dc25..4ba36a71 100755
--- a/CPP/7zip/UI/FileManager/Panel.h
+++ b/CPP/7zip/UI/FileManager/Panel.h
@@ -271,6 +271,8 @@ public:
int _xSize;
bool _flatMode;
+ bool _flatModeForDisk;
+ bool _flatModeForArc;
bool _dontShowMode;
@@ -336,6 +338,8 @@ public:
_selectionIsDefined(false),
_ListViewMode(3),
_flatMode(false),
+ _flatModeForDisk(false),
+ _flatModeForArc(false),
_xSize(300),
_mySelectMode(false),
_enableItemChangeNotify(true),
diff --git a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp
index f4d024b2..01fec329 100755
--- a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp
+++ b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp
@@ -501,6 +501,8 @@ void CPanel::OpenParentFolder()
if (_parentFolders.Size () > 1)
OpenParentArchiveFolder();
_parentFolders.DeleteBack();
+ if (_parentFolders.IsEmpty())
+ _flatMode = _flatModeForDisk;
}
}
@@ -528,6 +530,7 @@ void CPanel::CloseOpenFolders()
OpenParentArchiveFolder();
_parentFolders.DeleteBack();
}
+ _flatMode = _flatModeForDisk;
_folder.Release();
_library.Free();
}
diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
index 4d087a07..c40b0d18 100755
--- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
+++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp
@@ -105,6 +105,8 @@ HRESULT CPanel::OpenItemAsArchive(const UString &name,
_folder = newFolder;
_library.Attach(library.Detach());
+ _flatMode = _flatModeForArc;
+
return S_OK;
}
diff --git a/CPP/7zip/UI/FileManager/PanelItems.cpp b/CPP/7zip/UI/FileManager/PanelItems.cpp
index 3b309d27..58e14759 100755
--- a/CPP/7zip/UI/FileManager/PanelItems.cpp
+++ b/CPP/7zip/UI/FileManager/PanelItems.cpp
@@ -572,7 +572,8 @@ void CPanel::OpenSelectedItems(bool tryInternal)
if (focusedItem >= 0)
{
int realIndex = GetRealItemIndex(focusedItem);
- if (realIndex == kParentIndex && (tryInternal || indices.Size() == 0))
+ if (realIndex == kParentIndex && (tryInternal || indices.Size() == 0) &&
+ _listView.GetItemState(focusedItem, LVIS_SELECTED) == LVIS_SELECTED)
indices.Insert(0, realIndex);
}
diff --git a/CPP/7zip/UI/FileManager/RegistryUtils.cpp b/CPP/7zip/UI/FileManager/RegistryUtils.cpp
index f071a9c9..ed118457 100755
--- a/CPP/7zip/UI/FileManager/RegistryUtils.cpp
+++ b/CPP/7zip/UI/FileManager/RegistryUtils.cpp
@@ -3,6 +3,7 @@
#include "StdAfx.h"
#include "RegistryUtils.h"
+#include "Common/IntToString.h"
#include "Windows/Registry.h"
using namespace NWindows;
@@ -28,6 +29,8 @@ static const TCHAR *kLargePagesEnable = TEXT("LargePages");
// static const TCHAR *kSingleClick = TEXT("SingleClick");
// static const TCHAR *kUnderline = TEXT("Underline");
+static const TCHAR *kFlatViewName = TEXT("FlatViewArc");
+
void SaveRegLang(const UString &langFile)
{
CKey key;
@@ -149,4 +152,12 @@ bool ReadUnderline(){ return ReadOption(kUnderline, false); }
void SaveLockMemoryEnable(bool enable) { Save7ZipOption(kLargePagesEnable, enable); }
bool ReadLockMemoryEnable() { return Read7ZipOption(kLargePagesEnable, false); }
+static CSysString GetFlatViewName(UInt32 panelIndex)
+{
+ TCHAR panelString[32];
+ ConvertUInt64ToString(panelIndex, panelString);
+ return (CSysString)kFlatViewName + panelString;
+}
+void SaveFlatView(UInt32 panelIndex, bool enable) { SaveOption(GetFlatViewName(panelIndex), enable); }
+bool ReadFlatView(UInt32 panelIndex) { return ReadOption(GetFlatViewName(panelIndex), false); }
diff --git a/CPP/7zip/UI/FileManager/RegistryUtils.h b/CPP/7zip/UI/FileManager/RegistryUtils.h
index 0fec6f80..9b9c91cf 100755
--- a/CPP/7zip/UI/FileManager/RegistryUtils.h
+++ b/CPP/7zip/UI/FileManager/RegistryUtils.h
@@ -43,4 +43,7 @@ void SaveUnderline(bool enable);
bool ReadUnderline();
*/
+void SaveFlatView(UInt32 panelIndex, bool enable);
+bool ReadFlatView(UInt32 panelIndex);
+
#endif
diff --git a/CPP/7zip/UI/FileManager/UpdateCallback100.cpp b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp
index 8f6597f4..e23c7d34 100755
--- a/CPP/7zip/UI/FileManager/UpdateCallback100.cpp
+++ b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp
@@ -60,8 +60,9 @@ STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t *name)
return S_OK;
}
-STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t * /* name */)
+STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t *name)
{
+ ProgressDialog.ProgressSynch.SetCurrentFileName(name);
return S_OK;
}
diff --git a/CPP/7zip/UI/FileManager/makefile b/CPP/7zip/UI/FileManager/makefile
index 78921b90..bc1d2662 100755
--- a/CPP/7zip/UI/FileManager/makefile
+++ b/CPP/7zip/UI/FileManager/makefile
@@ -185,7 +185,7 @@ $(UI_COMMON_OBJS): ../Common/$(*B).cpp
$(AGENT_OBJS): ../Agent/$(*B).cpp
$(COMPL)
-$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp
+$O\CopyCoder.obj: ../../Compress/$(*B).cpp
$(COMPL)
$(C_OBJS): ../../../../C/$(*B).c
$(COMPL_O2)
diff --git a/CPP/7zip/UI/GUI/GUI.dsp b/CPP/7zip/UI/GUI/GUI.dsp
index 1de7ac97..e5fbec0e 100755
--- a/CPP/7zip/UI/GUI/GUI.dsp
+++ b/CPP/7zip/UI/GUI/GUI.dsp
@@ -629,11 +629,11 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.h
# End Group
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
+SOURCE=..\..\Compress\CopyCoder.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\Compress\Copy\CopyCoder.h
+SOURCE=..\..\Compress\CopyCoder.h
# End Source File
# End Group
# Begin Group "C"
diff --git a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp
index 8d63ee58..10c0a798 100755
--- a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp
+++ b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp
@@ -2,17 +2,18 @@
#include "StdAfx.h"
-#include "UpdateCallbackGUI.h"
-
-#include "Common/StringConvert.h"
-#include "Common/IntToString.h"
#include "Common/Defs.h"
+#include "Common/IntToString.h"
+#include "Common/StringConvert.h"
-#include "Windows/PropVariant.h"
#include "Windows/Error.h"
+#include "Windows/PropVariant.h"
+
#include "../FileManager/MessagesDialog.h"
#include "../FileManager/PasswordDialog.h"
+#include "UpdateCallbackGUI.h"
+
using namespace NWindows;
CUpdateCallbackGUI::~CUpdateCallbackGUI()
@@ -229,4 +230,12 @@ void CUpdateCallbackGUI::Open_ClearPasswordWasAskedFlag()
PasswordWasAsked = false;
}
+/*
+HRESULT CUpdateCallbackGUI::ShowDeleteFile(const wchar_t *name)
+{
+ ProgressDialog.ProgressSynch.SetCurrentFileName(name);
+ return S_OK;
+}
+*/
+
#endif
diff --git a/CPP/7zip/UI/GUI/makefile b/CPP/7zip/UI/GUI/makefile
index e2caf8ee..b92935ab 100755
--- a/CPP/7zip/UI/GUI/makefile
+++ b/CPP/7zip/UI/GUI/makefile
@@ -145,7 +145,7 @@ $O\MyMessages.obj: ../Explorer/MyMessages.cpp
$(COMPL)
-$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp
+$O\CopyCoder.obj: ../../Compress/$(*B).cpp
$(COMPL)
$(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp
$(COMPL)
diff --git a/CPP/Common/MyVector.cpp b/CPP/Common/MyVector.cpp
index 2a0aa15a..88d9993a 100755
--- a/CPP/Common/MyVector.cpp
+++ b/CPP/Common/MyVector.cpp
@@ -49,7 +49,7 @@ void CBaseRecordVector::Reserve(int newCapacity)
p = new unsigned char[newSize];
if (p == 0)
throw 1052355;
- int numRecordsToMove = _size;
+ int numRecordsToMove = (_size < newCapacity ? _size : newCapacity);
memcpy(p, _items, _itemSize * numRecordsToMove);
}
delete [](unsigned char *)_items;
diff --git a/DOC/7zip.nsi b/DOC/7zip.nsi
index edfa90f8..e6ba4a68 100755
--- a/DOC/7zip.nsi
+++ b/DOC/7zip.nsi
@@ -2,7 +2,7 @@
;Defines
!define VERSION_MAJOR 4
-!define VERSION_MINOR 62
+!define VERSION_MINOR 63
!define VERSION_POSTFIX_FULL ""
!ifdef WIN64
!ifdef IA64
diff --git a/DOC/7zip.wxs b/DOC/7zip.wxs
index 6c9c59ee..6f60f765 100755
--- a/DOC/7zip.wxs
+++ b/DOC/7zip.wxs
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?define VerMajor = "4" ?>
-<?define VerMinor = "62" ?>
+<?define VerMinor = "63" ?>
<?define VerBuild = "00" ?>
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
<?define MmHex = "0$(var.VerMajor)$(var.VerMinor)" ?>
diff --git a/DOC/lzma.txt b/DOC/lzma.txt
index ef6bd413..d3cbc85a 100755
--- a/DOC/lzma.txt
+++ b/DOC/lzma.txt
@@ -1,4 +1,4 @@
-LZMA SDK 4.62
+LZMA SDK 4.63
-------------
LZMA SDK provides the documentation, samples, header files, libraries,
@@ -413,7 +413,7 @@ Memory Requirements:
- LZMA dictionary (dictionary size is encoded in LZMA properties header)
1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
- unsigned char header[LZMA_PROPERTIES_SIZE + 8];
+ unsigned char header[LZMA_PROPS_SIZE + 8];
ReadFile(inFile, header, sizeof(header)
2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties