├── .classpath
├── .cproject
├── .gitignore
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── LGPL.txt
├── README.md
├── build.gradle
├── jni
├── 7za
│ ├── 7za.cpp
│ ├── 7za.h
│ ├── 7za_log.h
│ └── com_snda_Andro7z_Andro7za.h
├── Android.mk
├── Application.mk
├── C
│ ├── 7zBuf.h
│ ├── 7zBuf2.c
│ ├── 7zCrc.c
│ ├── 7zCrc.h
│ ├── 7zCrcOpt.c
│ ├── 7zCrcT8.c
│ ├── 7zStream.c
│ ├── 7zVersion.h
│ ├── Aes.c
│ ├── Aes.h
│ ├── Alloc.back3
│ ├── Alloc.c
│ ├── Alloc.c.back
│ ├── Alloc.c.back2
│ ├── Alloc.h
│ ├── Bra.c
│ ├── Bra.h
│ ├── Bra86.c
│ ├── BraIA64.c
│ ├── BwtSort.c
│ ├── BwtSort.h
│ ├── CpuArch.c
│ ├── CpuArch.h
│ ├── Delta.c
│ ├── Delta.h
│ ├── HuffEnc.c
│ ├── HuffEnc.h
│ ├── LzFind.c
│ ├── LzFind.h
│ ├── LzFindMt.c
│ ├── LzFindMt.h
│ ├── LzHash.h
│ ├── Lzma2Dec.c
│ ├── Lzma2Dec.h
│ ├── Lzma2Enc.c
│ ├── Lzma2Enc.h
│ ├── LzmaDec.c
│ ├── LzmaDec.h
│ ├── LzmaEnc.c
│ ├── LzmaEnc.h
│ ├── LzmaUtil
│ │ ├── Lzma86Dec.c
│ │ ├── Lzma86Dec.h
│ │ ├── Lzma86Enc.c
│ │ └── Lzma86Enc.h
│ ├── MtCoder.c
│ ├── MtCoder.h
│ ├── Ppmd.h
│ ├── Ppmd7.c
│ ├── Ppmd7.h
│ ├── Ppmd7Dec.c
│ ├── Ppmd7Enc.c
│ ├── Ppmd8.c
│ ├── Ppmd8.h
│ ├── Ppmd8Dec.c
│ ├── Ppmd8Enc.c
│ ├── RotateDefs.h
│ ├── Sha256.c
│ ├── Sha256.h
│ ├── Sort.c
│ ├── Sort.h
│ ├── Threads.c
│ ├── Threads.h
│ ├── Types.h
│ ├── Xz.c
│ ├── Xz.h
│ ├── XzCrc64.c
│ ├── XzCrc64.h
│ ├── XzDec.c
│ ├── XzEnc.c
│ ├── XzEnc.h
│ └── XzIn.c
├── CPP
│ ├── 7zip
│ │ ├── Archive
│ │ │ ├── 7z
│ │ │ │ ├── 7zCompressionMode.cpp
│ │ │ │ ├── 7zCompressionMode.h
│ │ │ │ ├── 7zDecode.cpp
│ │ │ │ ├── 7zDecode.h
│ │ │ │ ├── 7zEncode.cpp
│ │ │ │ ├── 7zEncode.h
│ │ │ │ ├── 7zExtract.cpp
│ │ │ │ ├── 7zFolderInStream.cpp
│ │ │ │ ├── 7zFolderInStream.h
│ │ │ │ ├── 7zFolderOutStream.cpp
│ │ │ │ ├── 7zFolderOutStream.h
│ │ │ │ ├── 7zHandler.cpp
│ │ │ │ ├── 7zHandler.h
│ │ │ │ ├── 7zHandlerOut.cpp
│ │ │ │ ├── 7zHeader.cpp
│ │ │ │ ├── 7zHeader.h
│ │ │ │ ├── 7zIn.cpp
│ │ │ │ ├── 7zIn.h
│ │ │ │ ├── 7zItem.h
│ │ │ │ ├── 7zOut.cpp
│ │ │ │ ├── 7zOut.h
│ │ │ │ ├── 7zProperties.cpp
│ │ │ │ ├── 7zProperties.h
│ │ │ │ ├── 7zRegister.cpp
│ │ │ │ ├── 7zSpecStream.cpp
│ │ │ │ ├── 7zSpecStream.h
│ │ │ │ ├── 7zUpdate.cpp
│ │ │ │ └── 7zUpdate.h
│ │ │ ├── ApmHandler.cpp
│ │ │ ├── ArchiveExports.cpp
│ │ │ ├── ArjHandler.cpp
│ │ │ ├── Bz2Handler.cpp
│ │ │ ├── Cab
│ │ │ │ ├── CabBlockInStream.cpp
│ │ │ │ ├── CabBlockInStream.h
│ │ │ │ ├── CabHandler.cpp
│ │ │ │ ├── CabHandler.h
│ │ │ │ ├── CabHeader.cpp
│ │ │ │ ├── CabHeader.h
│ │ │ │ ├── CabIn.cpp
│ │ │ │ ├── CabIn.h
│ │ │ │ ├── CabItem.h
│ │ │ │ └── CabRegister.cpp
│ │ │ ├── Chm
│ │ │ │ ├── ChmHandler.cpp
│ │ │ │ ├── ChmHandler.h
│ │ │ │ ├── ChmHeader.cpp
│ │ │ │ ├── ChmHeader.h
│ │ │ │ ├── ChmIn.cpp
│ │ │ │ ├── ChmIn.h
│ │ │ │ └── ChmRegister.cpp
│ │ │ ├── Com
│ │ │ │ ├── ComHandler.cpp
│ │ │ │ ├── ComHandler.h
│ │ │ │ ├── ComIn.cpp
│ │ │ │ ├── ComIn.h
│ │ │ │ └── ComRegister.cpp
│ │ │ ├── Common
│ │ │ │ ├── CoderMixer2.cpp
│ │ │ │ ├── CoderMixer2.h
│ │ │ │ ├── CoderMixer2MT.cpp
│ │ │ │ ├── CoderMixer2MT.h
│ │ │ │ ├── CoderMixer2ST.cpp
│ │ │ │ ├── CoderMixer2ST.h
│ │ │ │ ├── CrossThreadProgress.cpp
│ │ │ │ ├── CrossThreadProgress.h
│ │ │ │ ├── DummyOutStream.cpp
│ │ │ │ ├── DummyOutStream.h
│ │ │ │ ├── FindSignature.cpp
│ │ │ │ ├── FindSignature.h
│ │ │ │ ├── HandlerOut.cpp
│ │ │ │ ├── HandlerOut.h
│ │ │ │ ├── InStreamWithCRC.cpp
│ │ │ │ ├── InStreamWithCRC.h
│ │ │ │ ├── ItemNameUtils.cpp
│ │ │ │ ├── ItemNameUtils.h
│ │ │ │ ├── MultiStream.cpp
│ │ │ │ ├── MultiStream.h
│ │ │ │ ├── OutStreamWithCRC.cpp
│ │ │ │ ├── OutStreamWithCRC.h
│ │ │ │ ├── OutStreamWithSha1.cpp
│ │ │ │ ├── OutStreamWithSha1.h
│ │ │ │ ├── ParseProperties.cpp
│ │ │ │ └── ParseProperties.h
│ │ │ ├── CpioHandler.cpp
│ │ │ ├── CramfsHandler.cpp
│ │ │ ├── DebHandler.cpp
│ │ │ ├── DeflateProps.cpp
│ │ │ ├── DeflateProps.h
│ │ │ ├── DllExports2.cpp
│ │ │ ├── DmgHandler.cpp
│ │ │ ├── ElfHandler.cpp
│ │ │ ├── FatHandler.cpp
│ │ │ ├── FlvHandler.cpp
│ │ │ ├── GzHandler.cpp
│ │ │ ├── Hfs
│ │ │ │ ├── HfsHandler.cpp
│ │ │ │ ├── HfsHandler.h
│ │ │ │ ├── HfsIn.cpp
│ │ │ │ ├── HfsIn.h
│ │ │ │ └── HfsRegister.cpp
│ │ │ ├── IArchive.h
│ │ │ ├── Iso
│ │ │ │ ├── IsoHandler.cpp
│ │ │ │ ├── IsoHandler.h
│ │ │ │ ├── IsoHeader.cpp
│ │ │ │ ├── IsoHeader.h
│ │ │ │ ├── IsoIn.cpp
│ │ │ │ ├── IsoIn.h
│ │ │ │ ├── IsoItem.h
│ │ │ │ └── IsoRegister.cpp
│ │ │ ├── LzhHandler.cpp
│ │ │ ├── LzmaHandler.cpp
│ │ │ ├── MachoHandler.cpp
│ │ │ ├── MbrHandler.cpp
│ │ │ ├── MslzHandler.cpp
│ │ │ ├── MubHandler.cpp
│ │ │ ├── Nsis
│ │ │ │ ├── NsisDecode.cpp
│ │ │ │ ├── NsisDecode.h
│ │ │ │ ├── NsisHandler.cpp
│ │ │ │ ├── NsisHandler.h
│ │ │ │ ├── NsisIn.cpp
│ │ │ │ ├── NsisIn.h
│ │ │ │ └── NsisRegister.cpp
│ │ │ ├── NtfsHandler.cpp
│ │ │ ├── PeHandler.cpp
│ │ │ ├── PpmdHandler.cpp
│ │ │ ├── Rar
│ │ │ │ ├── RarHandler.cpp
│ │ │ │ ├── RarHandler.h
│ │ │ │ ├── RarHeader.cpp
│ │ │ │ ├── RarHeader.h
│ │ │ │ ├── RarIn.cpp
│ │ │ │ ├── RarIn.h
│ │ │ │ ├── RarItem.cpp
│ │ │ │ ├── RarItem.h
│ │ │ │ ├── RarRegister.cpp
│ │ │ │ ├── RarVolumeInStream.cpp
│ │ │ │ └── RarVolumeInStream.h
│ │ │ ├── RpmHandler.cpp
│ │ │ ├── SplitHandler.cpp
│ │ │ ├── SquashfsHandler.cpp
│ │ │ ├── SwfHandler.cpp
│ │ │ ├── Tar
│ │ │ │ ├── TarHandler.cpp
│ │ │ │ ├── TarHandler.h
│ │ │ │ ├── TarHandlerOut.cpp
│ │ │ │ ├── TarHeader.cpp
│ │ │ │ ├── TarHeader.h
│ │ │ │ ├── TarIn.cpp
│ │ │ │ ├── TarIn.h
│ │ │ │ ├── TarItem.h
│ │ │ │ ├── TarOut.cpp
│ │ │ │ ├── TarOut.h
│ │ │ │ ├── TarRegister.cpp
│ │ │ │ ├── TarUpdate.cpp
│ │ │ │ └── TarUpdate.h
│ │ │ ├── Udf
│ │ │ │ ├── UdfHandler.cpp
│ │ │ │ ├── UdfHandler.h
│ │ │ │ ├── UdfIn.cpp
│ │ │ │ ├── UdfIn.h
│ │ │ │ └── UdfRegister.cpp
│ │ │ ├── VhdHandler.cpp
│ │ │ ├── Wim
│ │ │ │ ├── WimHandler.cpp
│ │ │ │ ├── WimHandler.h
│ │ │ │ ├── WimHandlerOut.cpp
│ │ │ │ ├── WimIn.cpp
│ │ │ │ ├── WimIn.h
│ │ │ │ └── WimRegister.cpp
│ │ │ ├── XarHandler.cpp
│ │ │ ├── XzHandler.cpp
│ │ │ ├── ZHandler.cpp
│ │ │ └── Zip
│ │ │ │ ├── ZipAddCommon.cpp
│ │ │ │ ├── ZipAddCommon.h
│ │ │ │ ├── ZipCompressionMode.h
│ │ │ │ ├── ZipHandler.cpp
│ │ │ │ ├── ZipHandler.h
│ │ │ │ ├── ZipHandlerOut.cpp
│ │ │ │ ├── ZipHeader.cpp
│ │ │ │ ├── ZipHeader.h
│ │ │ │ ├── ZipIn.cpp
│ │ │ │ ├── ZipIn.h
│ │ │ │ ├── ZipItem.cpp
│ │ │ │ ├── ZipItem.h
│ │ │ │ ├── ZipItemEx.h
│ │ │ │ ├── ZipOut.cpp
│ │ │ │ ├── ZipOut.h
│ │ │ │ ├── ZipRegister.cpp
│ │ │ │ ├── ZipUpdate.cpp
│ │ │ │ └── ZipUpdate.h
│ │ ├── Bundles
│ │ │ ├── Alone
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ │ ├── Alone7z
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ │ ├── AloneGCOV
│ │ │ │ └── makefile
│ │ │ ├── Format7zFree
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ │ └── SFXCon
│ │ │ │ ├── Main.cpp
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ ├── CMAKE
│ │ │ ├── CMakeLists_7zFM.txt
│ │ │ ├── CMakeLists_7zG.txt
│ │ │ ├── CMakeLists_7za.txt
│ │ │ ├── CMakeLists_ALL.txt
│ │ │ ├── CMakeLists_Format7zFree.txt
│ │ │ ├── generate.sh
│ │ │ └── generate_xcode.sh
│ │ ├── Common
│ │ │ ├── CWrappers.cpp
│ │ │ ├── CWrappers.h
│ │ │ ├── CreateCoder.cpp
│ │ │ ├── CreateCoder.h
│ │ │ ├── FilePathAutoRename.cpp
│ │ │ ├── FilePathAutoRename.h
│ │ │ ├── FileStreams.cpp
│ │ │ ├── FileStreams.h
│ │ │ ├── FilterCoder.cpp
│ │ │ ├── FilterCoder.h
│ │ │ ├── InBuffer.cpp
│ │ │ ├── InBuffer.h
│ │ │ ├── InOutTempBuffer.cpp
│ │ │ ├── InOutTempBuffer.h
│ │ │ ├── LimitedStreams.cpp
│ │ │ ├── LimitedStreams.h
│ │ │ ├── LockedStream.cpp
│ │ │ ├── LockedStream.h
│ │ │ ├── MemBlocks.cpp
│ │ │ ├── MemBlocks.h
│ │ │ ├── MethodId.cpp
│ │ │ ├── MethodId.h
│ │ │ ├── MethodProps.cpp
│ │ │ ├── MethodProps.h
│ │ │ ├── OffsetStream.cpp
│ │ │ ├── OffsetStream.h
│ │ │ ├── OutBuffer.cpp
│ │ │ ├── OutBuffer.h
│ │ │ ├── OutMemStream.cpp
│ │ │ ├── OutMemStream.h
│ │ │ ├── ProgressMt.cpp
│ │ │ ├── ProgressMt.h
│ │ │ ├── ProgressUtils.cpp
│ │ │ ├── ProgressUtils.h
│ │ │ ├── RegisterArc.h
│ │ │ ├── RegisterCodec.h
│ │ │ ├── StreamBinder.cpp
│ │ │ ├── StreamBinder.h
│ │ │ ├── StreamObjects.cpp
│ │ │ ├── StreamObjects.h
│ │ │ ├── StreamUtils.cpp
│ │ │ ├── StreamUtils.h
│ │ │ ├── VirtThread.cpp
│ │ │ └── VirtThread.h
│ │ ├── Compress
│ │ │ ├── ArjDecoder1.cpp
│ │ │ ├── ArjDecoder1.h
│ │ │ ├── ArjDecoder2.cpp
│ │ │ ├── ArjDecoder2.h
│ │ │ ├── BZip2Const.h
│ │ │ ├── BZip2Crc.cpp
│ │ │ ├── BZip2Crc.h
│ │ │ ├── BZip2Decoder.cpp
│ │ │ ├── BZip2Decoder.h
│ │ │ ├── BZip2Encoder.cpp
│ │ │ ├── BZip2Encoder.h
│ │ │ ├── BZip2Register.cpp
│ │ │ ├── Bcj2Coder.cpp
│ │ │ ├── Bcj2Coder.h
│ │ │ ├── Bcj2Register.cpp
│ │ │ ├── BcjCoder.cpp
│ │ │ ├── BcjCoder.h
│ │ │ ├── BcjRegister.cpp
│ │ │ ├── BitlDecoder.cpp
│ │ │ ├── BitlDecoder.h
│ │ │ ├── BitlEncoder.h
│ │ │ ├── BitmDecoder.h
│ │ │ ├── BitmEncoder.h
│ │ │ ├── BranchCoder.cpp
│ │ │ ├── BranchCoder.h
│ │ │ ├── BranchMisc.cpp
│ │ │ ├── BranchMisc.h
│ │ │ ├── BranchRegister.cpp
│ │ │ ├── ByteSwap.cpp
│ │ │ ├── CodecExports.cpp
│ │ │ ├── CopyCoder.cpp
│ │ │ ├── CopyCoder.h
│ │ │ ├── CopyRegister.cpp
│ │ │ ├── Deflate64Register.cpp
│ │ │ ├── DeflateConst.h
│ │ │ ├── DeflateDecoder.cpp
│ │ │ ├── DeflateDecoder.h
│ │ │ ├── DeflateEncoder.cpp
│ │ │ ├── DeflateEncoder.h
│ │ │ ├── DeflateRegister.cpp
│ │ │ ├── DeltaFilter.cpp
│ │ │ ├── DllExports.cpp
│ │ │ ├── DllExports2.cpp
│ │ │ ├── HuffmanDecoder.h
│ │ │ ├── ImplodeDecoder.cpp
│ │ │ ├── ImplodeDecoder.h
│ │ │ ├── ImplodeHuffmanDecoder.cpp
│ │ │ ├── ImplodeHuffmanDecoder.h
│ │ │ ├── LZMA_Alone
│ │ │ │ ├── LzmaAlone.cpp
│ │ │ │ ├── LzmaBench.cpp
│ │ │ │ ├── LzmaBench.h
│ │ │ │ ├── LzmaBenchCon.cpp
│ │ │ │ ├── LzmaBenchCon.h
│ │ │ │ └── makefile
│ │ │ ├── LzOutWindow.cpp
│ │ │ ├── LzOutWindow.h
│ │ │ ├── LzhDecoder.cpp
│ │ │ ├── LzhDecoder.h
│ │ │ ├── Lzma2Decoder.cpp
│ │ │ ├── Lzma2Decoder.h
│ │ │ ├── Lzma2Encoder.cpp
│ │ │ ├── Lzma2Encoder.h
│ │ │ ├── Lzma2Register.cpp
│ │ │ ├── LzmaDecoder.cpp
│ │ │ ├── LzmaDecoder.h
│ │ │ ├── LzmaEncoder.cpp
│ │ │ ├── LzmaEncoder.h
│ │ │ ├── LzmaRegister.cpp
│ │ │ ├── Lzx.h
│ │ │ ├── Lzx86Converter.cpp
│ │ │ ├── Lzx86Converter.h
│ │ │ ├── LzxDecoder.cpp
│ │ │ ├── LzxDecoder.h
│ │ │ ├── Mtf8.h
│ │ │ ├── PpmdDecoder.cpp
│ │ │ ├── PpmdDecoder.h
│ │ │ ├── PpmdEncoder.cpp
│ │ │ ├── PpmdEncoder.h
│ │ │ ├── PpmdRegister.cpp
│ │ │ ├── PpmdZip.cpp
│ │ │ ├── PpmdZip.h
│ │ │ ├── QuantumDecoder.cpp
│ │ │ ├── QuantumDecoder.h
│ │ │ ├── RangeCoder.h
│ │ │ ├── RangeCoderBit.h
│ │ │ ├── Rar
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ │ ├── Rar1Decoder.cpp
│ │ │ ├── Rar1Decoder.h
│ │ │ ├── Rar2Decoder.cpp
│ │ │ ├── Rar2Decoder.h
│ │ │ ├── Rar3Decoder.cpp
│ │ │ ├── Rar3Decoder.h
│ │ │ ├── Rar3Vm.cpp
│ │ │ ├── Rar3Vm.h
│ │ │ ├── RarCodecsRegister.cpp
│ │ │ ├── ShrinkDecoder.cpp
│ │ │ ├── ShrinkDecoder.h
│ │ │ ├── ZDecoder.cpp
│ │ │ ├── ZDecoder.h
│ │ │ ├── ZlibDecoder.cpp
│ │ │ ├── ZlibDecoder.h
│ │ │ ├── ZlibEncoder.cpp
│ │ │ └── ZlibEncoder.h
│ │ ├── Crypto
│ │ │ ├── 7zAes.cpp
│ │ │ ├── 7zAes.h
│ │ │ ├── 7zAesRegister.cpp
│ │ │ ├── HmacSha1.cpp
│ │ │ ├── HmacSha1.h
│ │ │ ├── MyAes.cpp
│ │ │ ├── MyAes.h
│ │ │ ├── Pbkdf2HmacSha1.cpp
│ │ │ ├── Pbkdf2HmacSha1.h
│ │ │ ├── RandGen.cpp
│ │ │ ├── RandGen.h
│ │ │ ├── Rar20Crypto.cpp
│ │ │ ├── Rar20Crypto.h
│ │ │ ├── RarAes.cpp
│ │ │ ├── RarAes.h
│ │ │ ├── Sha1.cpp
│ │ │ ├── Sha1.h
│ │ │ ├── WzAes.cpp
│ │ │ ├── WzAes.h
│ │ │ ├── ZipCrypto.cpp
│ │ │ ├── ZipCrypto.h
│ │ │ ├── ZipStrong.cpp
│ │ │ └── ZipStrong.h
│ │ ├── Guid.txt
│ │ ├── ICoder.h
│ │ ├── IDecl.h
│ │ ├── IPassword.h
│ │ ├── IProgress.h
│ │ ├── IStream.h
│ │ ├── MyVersion.h
│ │ ├── PREMAKE
│ │ │ ├── generate.sh
│ │ │ └── premake4.lua
│ │ ├── PropID.h
│ │ ├── QMAKE
│ │ │ ├── 7ZA
│ │ │ │ ├── 7ZA.pro
│ │ │ │ └── 7ZA_osx.pro
│ │ │ └── test_emul
│ │ │ │ └── test_emul.pro
│ │ ├── TEST
│ │ │ └── TestUI
│ │ │ │ ├── TestUI.cpp
│ │ │ │ ├── makefile
│ │ │ │ ├── makefile.depend
│ │ │ │ └── makefile.list
│ │ └── UI
│ │ │ ├── Agent
│ │ │ ├── Agent.cpp
│ │ │ ├── Agent.h
│ │ │ ├── AgentOut.cpp
│ │ │ ├── AgentProxy.cpp
│ │ │ ├── AgentProxy.h
│ │ │ ├── ArchiveFolder.cpp
│ │ │ ├── ArchiveFolderOpen.cpp
│ │ │ ├── ArchiveFolderOut.cpp
│ │ │ ├── IFolderArchive.h
│ │ │ ├── UpdateCallbackAgent.cpp
│ │ │ └── UpdateCallbackAgent.h
│ │ │ ├── Client7z
│ │ │ ├── Client7z.cpp
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ └── makefile.list
│ │ │ ├── ClientCodec
│ │ │ ├── ClientCodec.cpp
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ └── makefile.list
│ │ │ ├── Common
│ │ │ ├── ArchiveCommandLine.cpp
│ │ │ ├── ArchiveCommandLine.h
│ │ │ ├── ArchiveExtractCallback.cpp
│ │ │ ├── ArchiveExtractCallback.h
│ │ │ ├── ArchiveName.cpp
│ │ │ ├── ArchiveName.h
│ │ │ ├── ArchiveOpenCallback.cpp
│ │ │ ├── ArchiveOpenCallback.h
│ │ │ ├── Bench.cpp
│ │ │ ├── Bench.h
│ │ │ ├── CompressCall.cpp
│ │ │ ├── CompressCall.h
│ │ │ ├── DefaultName.cpp
│ │ │ ├── DefaultName.h
│ │ │ ├── DirItem.h
│ │ │ ├── EnumDirItems.cpp
│ │ │ ├── EnumDirItems.h
│ │ │ ├── ExitCode.h
│ │ │ ├── Extract.cpp
│ │ │ ├── Extract.h
│ │ │ ├── ExtractMode.h
│ │ │ ├── ExtractingFilePath.cpp
│ │ │ ├── ExtractingFilePath.h
│ │ │ ├── IFileExtractCallback.h
│ │ │ ├── LoadCodecs.cpp
│ │ │ ├── LoadCodecs.h
│ │ │ ├── OpenArchive.cpp
│ │ │ ├── OpenArchive.h
│ │ │ ├── PropIDUtils.cpp
│ │ │ ├── PropIDUtils.h
│ │ │ ├── Property.h
│ │ │ ├── SetProperties.cpp
│ │ │ ├── SetProperties.h
│ │ │ ├── SortUtils.cpp
│ │ │ ├── SortUtils.h
│ │ │ ├── TempFiles.cpp
│ │ │ ├── TempFiles.h
│ │ │ ├── Update.cpp
│ │ │ ├── Update.h
│ │ │ ├── UpdateAction.cpp
│ │ │ ├── UpdateAction.h
│ │ │ ├── UpdateCallback.cpp
│ │ │ ├── UpdateCallback.h
│ │ │ ├── UpdatePair.cpp
│ │ │ ├── UpdatePair.h
│ │ │ ├── UpdateProduce.cpp
│ │ │ ├── UpdateProduce.h
│ │ │ ├── WorkDir.cpp
│ │ │ ├── WorkDir.h
│ │ │ ├── ZipRegistry.cpp
│ │ │ └── ZipRegistry.h
│ │ │ ├── Console
│ │ │ ├── BenchCon.cpp
│ │ │ ├── BenchCon.h
│ │ │ ├── ConsoleClose.cpp
│ │ │ ├── ConsoleClose.h
│ │ │ ├── ExtractCallbackConsole.cpp
│ │ │ ├── ExtractCallbackConsole.h
│ │ │ ├── List.cpp
│ │ │ ├── List.h
│ │ │ ├── Main.cpp
│ │ │ ├── MainAr.cpp
│ │ │ ├── OpenCallbackConsole.cpp
│ │ │ ├── OpenCallbackConsole.h
│ │ │ ├── PercentPrinter.cpp
│ │ │ ├── PercentPrinter.h
│ │ │ ├── UpdateCallbackConsole.cpp
│ │ │ ├── UpdateCallbackConsole.h
│ │ │ ├── UserInputUtils.cpp
│ │ │ ├── UserInputUtils.h
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ └── makefile.list
│ │ │ ├── Explorer
│ │ │ ├── ContextMenu.h
│ │ │ ├── MyMessages.cpp
│ │ │ └── MyMessages.h
│ │ │ ├── FileManager
│ │ │ ├── App.cpp
│ │ │ ├── App.h
│ │ │ ├── AppState.h
│ │ │ ├── BrowseDialog.h
│ │ │ ├── ClassDefs.cpp
│ │ │ ├── ComboDialog.cpp
│ │ │ ├── ComboDialog.h
│ │ │ ├── ComboDialogRes.h
│ │ │ ├── ComboDialog_rc.cpp
│ │ │ ├── CopyDialog.cpp
│ │ │ ├── CopyDialog.h
│ │ │ ├── CopyDialogRes.h
│ │ │ ├── CopyDialog_rc.cpp
│ │ │ ├── DialogSize.h
│ │ │ ├── ExtractCallback.cpp
│ │ │ ├── ExtractCallback.h
│ │ │ ├── FM.cpp
│ │ │ ├── FM_rc.cpp
│ │ │ ├── FSDrives.cpp
│ │ │ ├── FSDrives.h
│ │ │ ├── FSFolder.cpp
│ │ │ ├── FSFolder.h
│ │ │ ├── FSFolderCopy.cpp
│ │ │ ├── FileFolderPluginOpen.cpp
│ │ │ ├── FileFolderPluginOpen.h
│ │ │ ├── FormatUtils.cpp
│ │ │ ├── FormatUtils.h
│ │ │ ├── HelpUtils.h
│ │ │ ├── IFolder.h
│ │ │ ├── LangUtils.cpp
│ │ │ ├── LangUtils.h
│ │ │ ├── ListViewDialog.cpp
│ │ │ ├── ListViewDialog.h
│ │ │ ├── ListViewDialogRes.h
│ │ │ ├── ListViewDialog_rc.cpp
│ │ │ ├── MessagesDialog.cpp
│ │ │ ├── MessagesDialog.h
│ │ │ ├── MessagesDialogRes.h
│ │ │ ├── MessagesDialog_rc.cpp
│ │ │ ├── MyLoadMenu.cpp
│ │ │ ├── MyLoadMenu.h
│ │ │ ├── NetFolder.h.OUT
│ │ │ ├── OpenCallback.cpp
│ │ │ ├── OpenCallback.h
│ │ │ ├── OverwriteDialog.cpp
│ │ │ ├── OverwriteDialog.h
│ │ │ ├── OverwriteDialogRes.h
│ │ │ ├── OverwriteDialog_rc.cpp
│ │ │ ├── Panel.cpp
│ │ │ ├── Panel.h
│ │ │ ├── PanelCopy.cpp
│ │ │ ├── PanelCrc.cpp
│ │ │ ├── PanelCrc.cpp.back
│ │ │ ├── PanelFolderChange.cpp
│ │ │ ├── PanelItemOpen.cpp
│ │ │ ├── PanelItems.cpp
│ │ │ ├── PanelListNotify.cpp
│ │ │ ├── PanelMenu.cpp
│ │ │ ├── PanelOperations.cpp
│ │ │ ├── PanelSelect.cpp
│ │ │ ├── PanelSort.cpp
│ │ │ ├── PanelSplitFile.cpp
│ │ │ ├── PasswordDialog.cpp
│ │ │ ├── PasswordDialog.h
│ │ │ ├── PasswordDialogRes.h
│ │ │ ├── PasswordDialog_rc.cpp
│ │ │ ├── PluginInterface.h
│ │ │ ├── PluginLoader.h
│ │ │ ├── ProgramLocation.cpp
│ │ │ ├── ProgramLocation.h
│ │ │ ├── ProgressDialog2.cpp
│ │ │ ├── ProgressDialog2.h
│ │ │ ├── ProgressDialog2Res.h
│ │ │ ├── ProgressDialog2_rc.cpp
│ │ │ ├── ProgressDialogRes.h
│ │ │ ├── PropertyName.cpp
│ │ │ ├── PropertyName.h
│ │ │ ├── PropertyNameRes.h
│ │ │ ├── RegistryAssociations.cpp
│ │ │ ├── RegistryAssociations.h
│ │ │ ├── RegistryPlugins.h
│ │ │ ├── RegistryUtils.cpp
│ │ │ ├── RegistryUtils.h
│ │ │ ├── RootFolder.cpp
│ │ │ ├── RootFolder.h
│ │ │ ├── SplitDialog.cpp
│ │ │ ├── SplitDialog.h
│ │ │ ├── SplitDialogRes.h
│ │ │ ├── SplitDialog_rc.cpp
│ │ │ ├── SplitUtils.cpp
│ │ │ ├── SplitUtils.h
│ │ │ ├── StringUtils.cpp
│ │ │ ├── StringUtils.h
│ │ │ ├── SysIconUtils.cpp
│ │ │ ├── SysIconUtils.h
│ │ │ ├── TextPairs.cpp
│ │ │ ├── TextPairs.h
│ │ │ ├── UpdateCallback100.cpp
│ │ │ ├── UpdateCallback100.h
│ │ │ ├── ViewSettings.cpp
│ │ │ ├── ViewSettings.h
│ │ │ ├── err
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ ├── makefile.list
│ │ │ ├── res
│ │ │ │ ├── Add2PNG.h
│ │ │ │ ├── AddPNG.h
│ │ │ │ ├── Copy2PNG.h
│ │ │ │ ├── CopyPNG.h
│ │ │ │ ├── Delete2PNG.h
│ │ │ │ ├── DeletePNG.h
│ │ │ │ ├── Extract2PNG.h
│ │ │ │ ├── ExtractPNG.h
│ │ │ │ ├── Info2PNG.h
│ │ │ │ ├── InfoPNG.h
│ │ │ │ ├── Move2PNG.h
│ │ │ │ ├── MovePNG.h
│ │ │ │ ├── ParentFolder.h
│ │ │ │ ├── Test2PNG.h
│ │ │ │ └── TestPNG.h
│ │ │ ├── resource.h
│ │ │ ├── resourceGui.h
│ │ │ └── wxFM.cpp
│ │ │ ├── GUI
│ │ │ ├── BenchmarkDialog.cpp
│ │ │ ├── BenchmarkDialog.h
│ │ │ ├── BenchmarkDialogRes.h
│ │ │ ├── BenchmarkDialog_rc.cpp
│ │ │ ├── CompressDialog.cpp
│ │ │ ├── CompressDialog.h
│ │ │ ├── CompressDialogRes.h
│ │ │ ├── CompressDialog_rc.cpp
│ │ │ ├── ExtractDialog.cpp
│ │ │ ├── ExtractDialog.h
│ │ │ ├── ExtractDialogRes.h
│ │ │ ├── ExtractDialog_rc.cpp
│ │ │ ├── ExtractGUI.cpp
│ │ │ ├── ExtractGUI.h
│ │ │ ├── ExtractRes.h
│ │ │ ├── GUI.cpp
│ │ │ ├── UpdateCallbackGUI.cpp
│ │ │ ├── UpdateCallbackGUI.h
│ │ │ ├── UpdateGUI.cpp
│ │ │ ├── UpdateGUI.h
│ │ │ ├── err
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ ├── makefile.list
│ │ │ ├── resource2.h
│ │ │ └── wxGUI.cpp
│ │ │ └── P7ZIP
│ │ │ ├── makefile
│ │ │ ├── makefile.depend
│ │ │ ├── makefile.list
│ │ │ └── wxP7ZIP.cpp
│ ├── Common
│ │ ├── AutoPtr.h
│ │ ├── Buffer.h
│ │ ├── CRC.cpp
│ │ ├── C_FileIO.cpp
│ │ ├── C_FileIO.h
│ │ ├── ComTry.h
│ │ ├── CommandLineParser.cpp
│ │ ├── CommandLineParser.h
│ │ ├── Defs.h
│ │ ├── DynamicBuffer.h
│ │ ├── IntToString.cpp
│ │ ├── IntToString.h
│ │ ├── Lang.cpp
│ │ ├── Lang.h
│ │ ├── ListFileUtils.cpp
│ │ ├── ListFileUtils.h
│ │ ├── MyCom.h
│ │ ├── MyException.h
│ │ ├── MyGuidDef.h
│ │ ├── MyInitGuid.h
│ │ ├── MyMap.cpp
│ │ ├── MyMap.h
│ │ ├── MyString.cpp
│ │ ├── MyString.h
│ │ ├── MyUnknown.h
│ │ ├── MyVector.cpp
│ │ ├── MyVector.h
│ │ ├── MyWindows.cpp
│ │ ├── MyWindows.h
│ │ ├── MyXml.cpp
│ │ ├── MyXml.h
│ │ ├── NewHandler.h
│ │ ├── StdInStream.cpp
│ │ ├── StdInStream.h
│ │ ├── StdOutStream.cpp
│ │ ├── StdOutStream.h
│ │ ├── StringConvert.cpp
│ │ ├── StringConvert.h
│ │ ├── StringToInt.cpp
│ │ ├── StringToInt.h
│ │ ├── TextConfig.cpp
│ │ ├── TextConfig.h
│ │ ├── Types.h
│ │ ├── UTFConvert.cpp
│ │ ├── UTFConvert.h
│ │ ├── Wildcard.cpp
│ │ └── Wildcard.h
│ ├── Windows
│ │ ├── COM.cpp
│ │ ├── COM.h
│ │ ├── Clipboard.cpp
│ │ ├── Clipboard.h
│ │ ├── CommonDialog.h
│ │ ├── Control
│ │ │ ├── ComboBox.h
│ │ │ ├── Controls.cpp
│ │ │ ├── Dialog.cpp
│ │ │ ├── Dialog.h
│ │ │ ├── DialogImpl.h
│ │ │ ├── Edit.h
│ │ │ ├── ListView.h
│ │ │ ├── ProgressBar.h
│ │ │ ├── Static.h
│ │ │ ├── StatusBar.h
│ │ │ ├── Window2.cpp
│ │ │ └── Window2.h
│ │ ├── DLL.cpp
│ │ ├── DLL.h
│ │ ├── Defs.h
│ │ ├── Error.cpp
│ │ ├── Error.h
│ │ ├── FileDir.cpp
│ │ ├── FileDir.h
│ │ ├── FileFind.cpp
│ │ ├── FileFind.h
│ │ ├── FileIO.cpp
│ │ ├── FileIO.h
│ │ ├── FileName.cpp
│ │ ├── FileName.h
│ │ ├── Menu.h
│ │ ├── NtCheck.h
│ │ ├── PropVariant.cpp
│ │ ├── PropVariant.h
│ │ ├── PropVariantConversions.cpp
│ │ ├── PropVariantConversions.h
│ │ ├── PropVariantUtils.cpp
│ │ ├── PropVariantUtils.h
│ │ ├── Registry.cpp
│ │ ├── Registry.h
│ │ ├── ResourceString.h
│ │ ├── Shell.h
│ │ ├── Synchronization.cpp
│ │ ├── Synchronization.h
│ │ ├── Synchronization2.h
│ │ ├── System.cpp
│ │ ├── System.h
│ │ ├── Thread.h
│ │ ├── Time.cpp
│ │ ├── Time.h
│ │ ├── Window.cpp
│ │ └── Window.h
│ ├── include_windows
│ │ ├── basetyps.h
│ │ ├── tchar.h
│ │ └── windows.h
│ └── myWindows
│ │ ├── StdAfx.h
│ │ ├── config.h
│ │ ├── initguid.h
│ │ ├── makefile
│ │ ├── makefile.depend
│ │ ├── makefile.list
│ │ ├── myAddExeFlag.cpp
│ │ ├── myGetTickCount.cpp
│ │ ├── myPrivate.h
│ │ ├── mySplitCommandLine.cpp
│ │ ├── test_emul.cpp
│ │ ├── wine_GetXXXDefaultLangID.cpp
│ │ └── wine_date_and_time.cpp
├── makefile
├── makefile.crc32
├── makefile.glb
├── makefile.machine
└── makefile.rules
├── license-unrar.txt
├── proguard-project.txt
├── proguard.cfg
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
└── values
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
├── github
└── junrar
│ ├── Archive.java
│ ├── MVTest.java
│ ├── UnrarCallback.java
│ ├── Volume.java
│ ├── VolumeManager.java
│ ├── crc
│ └── RarCRC.java
│ ├── crypt
│ └── Rijndael.java
│ ├── exception
│ └── RarException.java
│ ├── impl
│ ├── FileVolume.java
│ └── FileVolumeManager.java
│ ├── io
│ ├── IReadOnlyAccess.java
│ ├── InputStreamReadOnlyAccessFile.java
│ ├── RandomAccessStream.java
│ ├── Raw.java
│ ├── ReadOnlyAccessByteArray.java
│ ├── ReadOnlyAccessFile.java
│ └── ReadOnlyAccessInputStream.java
│ ├── rarfile
│ ├── AVHeader.java
│ ├── BaseBlock.java
│ ├── BlockHeader.java
│ ├── CommentHeader.java
│ ├── EAHeader.java
│ ├── EndArcHeader.java
│ ├── FileHeader.java
│ ├── FileNameDecoder.java
│ ├── HostSystem.java
│ ├── MacInfoHeader.java
│ ├── MainHeader.java
│ ├── MarkHeader.java
│ ├── NewSubHeaderType.java
│ ├── ProtectHeader.java
│ ├── SignHeader.java
│ ├── SubBlockHeader.java
│ ├── SubBlockHeaderType.java
│ ├── UnixOwnersHeader.java
│ └── UnrarHeadertype.java
│ ├── testutil
│ └── ExtractArchive.java
│ ├── unpack
│ ├── ComprDataIO.java
│ ├── Unpack.java
│ ├── Unpack15.java
│ ├── Unpack20.java
│ ├── UnpackFilter.java
│ ├── decode
│ │ ├── AudioVariables.java
│ │ ├── BitDecode.java
│ │ ├── CodeType.java
│ │ ├── Compress.java
│ │ ├── Decode.java
│ │ ├── DistDecode.java
│ │ ├── FilterType.java
│ │ ├── LitDecode.java
│ │ ├── LowDistDecode.java
│ │ ├── MultDecode.java
│ │ └── RepDecode.java
│ ├── ppm
│ │ ├── AnalyzeHeapDump.java
│ │ ├── BlockTypes.java
│ │ ├── FreqData.java
│ │ ├── ModelPPM.java
│ │ ├── PPMContext.java
│ │ ├── Pointer.java
│ │ ├── RangeCoder.java
│ │ ├── RarMemBlock.java
│ │ ├── RarNode.java
│ │ ├── SEE2Context.java
│ │ ├── State.java
│ │ ├── StateRef.java
│ │ └── SubAllocator.java
│ └── vm
│ │ ├── BitInput.java
│ │ ├── RarVM.java
│ │ ├── VMCmdFlags.java
│ │ ├── VMCommands.java
│ │ ├── VMFlags.java
│ │ ├── VMOpType.java
│ │ ├── VMPreparedCommand.java
│ │ ├── VMPreparedOperand.java
│ │ ├── VMPreparedProgram.java
│ │ ├── VMStandardFilterSignature.java
│ │ └── VMStandardFilters.java
│ ├── unsigned
│ ├── UnsignedByte.java
│ ├── UnsignedInteger.java
│ ├── UnsignedLong.java
│ └── UnsignedShort.java
│ └── util
│ └── VolumeHelper.java
├── hostzi
└── blenderviking
│ ├── extractarchiveandroid
│ └── ExtractFile.java
│ └── zip
│ └── ManipZip.java
└── snda
└── Andro7z
└── Andro7za.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.apk
3 | *.ap_
4 | *.dll
5 | *.so
6 |
7 | # files for the dex VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 | !*.classpath
13 |
14 | # generated files
15 | bin/
16 | gen/
17 | obj/
18 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.2'
9 | }
10 | }
11 |
12 |
13 | android {
14 | compileSdkVersion 8
15 | buildToolsVersion '25.0.2'
16 |
17 | defaultConfig {
18 | minSdkVersion 8
19 | targetSdkVersion 8
20 |
21 | ndk {
22 | moduleName "7za"
23 | }
24 | }
25 |
26 | buildTypes {
27 | release {
28 | minifyEnabled false
29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
30 | }
31 | }
32 | externalNativeBuild {
33 | ndkBuild {
34 | path 'src/main/jni/Android.mk'
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/jni/7za/7za.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "7za.h"
3 | #include "com_snda_Andro7z_Andro7za.h"
4 |
5 | #define ARGC 4
6 | static const char *test_args[ARGC + 1] =
7 | { "7za", "x", "-o/mnt/sdcard/extractarchiveandroid",
8 | "/mnt/sdcard/7za123456789.7z", 0 };
9 |
10 | JNIEXPORT jint JNICALL Java_com_snda_Andro7z_Andro7za_a7za_1print_1usage(
11 | JNIEnv *env, jobject obj, jstring _pathArchive,
12 | jstring _pathToExtract) {
13 | const char *pathArchive = env->GetStringUTFChars(_pathArchive, 0);
14 | const char *pathToExtract = env->GetStringUTFChars(_pathToExtract, 0);
15 |
16 | test_args[2] = pathToExtract;
17 | test_args[3] = pathArchive;
18 |
19 | // process
20 | jint ret = andro7za_main(ARGC, test_args);
21 |
22 | // Release strings
23 | env->ReleaseStringUTFChars(_pathArchive, pathArchive);
24 | env->ReleaseStringUTFChars(_pathToExtract, pathToExtract);
25 |
26 | return ret;
27 | }
28 |
--------------------------------------------------------------------------------
/jni/7za/7za.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2011, SNDA
2 | //
3 | // JNI interface header
4 | //
5 | // @author: tangyaguang@snda.com
6 | //
7 | // @date: 2011-08-14
8 |
9 | #ifndef _7ZA_H_
10 | #define _7ZA_H_
11 |
12 | extern int andro7za_main(int numArgs, const char *argv[]);
13 |
14 | #ifdef __cplusplus
15 | extern "C"{
16 | #endif
17 |
18 | // Port 7zip main entry.
19 | int run_7za(int argc , const char *argv[]);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 | #endif // _7ZA_H_
26 |
--------------------------------------------------------------------------------
/jni/7za/com_snda_Andro7z_Andro7za.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class com_snda_Andro7z_Andro7za */
4 |
5 | #ifndef _Included_com_snda_Andro7z_Andro7za
6 | #define _Included_com_snda_Andro7z_Andro7za
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: com_snda_Andro7z_Andro7za
12 | * Method: a7za_print_usage
13 | * Signature: ()I
14 | */
15 | JNIEXPORT jint JNICALL Java_com_snda_Andro7z_Andro7za_a7za_1print_1usage(JNIEnv *env, jobject obj, jstring _pathArchive, jstring _pathToExtract);
16 |
17 | #ifdef __cplusplus
18 | }
19 | #endif
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2011, SNDA
2 | # ndk application configuration for 7za
3 | # Author: tangyaguang@snda.com
4 | #APP_ABI := armeabi armeabi-v7a
5 | APP_ABI := all
6 | # Add stl port support, this setting is not automatically added
7 | APP_STL := gnustl_static
8 |
9 | APP_PLATFORM := android-8
10 |
--------------------------------------------------------------------------------
/jni/C/7zBuf.h:
--------------------------------------------------------------------------------
1 | /* 7zBuf.h -- Byte Buffer
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __7Z_BUF_H
5 | #define __7Z_BUF_H
6 |
7 | #include "Types.h"
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | typedef struct
14 | {
15 | Byte *data;
16 | size_t size;
17 | } CBuf;
18 |
19 | void Buf_Init(CBuf *p);
20 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc);
21 | void Buf_Free(CBuf *p, ISzAlloc *alloc);
22 |
23 | typedef struct
24 | {
25 | Byte *data;
26 | size_t size;
27 | size_t pos;
28 | } CDynBuf;
29 |
30 | void DynBuf_Construct(CDynBuf *p);
31 | void DynBuf_SeekToBeg(CDynBuf *p);
32 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc);
33 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/jni/C/7zBuf2.c:
--------------------------------------------------------------------------------
1 | /* 7zBuf2.c -- Byte Buffer
2 | 2008-10-04 : Igor Pavlov : Public domain */
3 |
4 | #include
5 | #include "7zBuf.h"
6 |
7 | void DynBuf_Construct(CDynBuf *p)
8 | {
9 | p->data = 0;
10 | p->size = 0;
11 | p->pos = 0;
12 | }
13 |
14 | void DynBuf_SeekToBeg(CDynBuf *p)
15 | {
16 | p->pos = 0;
17 | }
18 |
19 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc)
20 | {
21 | if (size > p->size - p->pos)
22 | {
23 | size_t newSize = p->pos + size;
24 | Byte *data;
25 | newSize += newSize / 4;
26 | data = (Byte *)alloc->Alloc(alloc, newSize);
27 | if (data == 0)
28 | return 0;
29 | p->size = newSize;
30 | memcpy(data, p->data, p->pos);
31 | alloc->Free(alloc, p->data);
32 | p->data = data;
33 | }
34 | memcpy(p->data + p->pos, buf, size);
35 | p->pos += size;
36 | return 1;
37 | }
38 |
39 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc)
40 | {
41 | alloc->Free(alloc, p->data);
42 | p->data = 0;
43 | p->size = 0;
44 | p->pos = 0;
45 | }
46 |
--------------------------------------------------------------------------------
/jni/C/7zCrc.h:
--------------------------------------------------------------------------------
1 | /* 7zCrc.h -- CRC32 calculation
2 | 2009-11-21 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __7Z_CRC_H
5 | #define __7Z_CRC_H
6 |
7 | #include "Types.h"
8 |
9 | EXTERN_C_BEGIN
10 |
11 | extern UInt32 g_CrcTable[];
12 |
13 | /* Call CrcGenerateTable one time before other CRC functions */
14 | void MY_FAST_CALL CrcGenerateTable(void);
15 |
16 | #define CRC_INIT_VAL 0xFFFFFFFF
17 | #define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
18 | #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
19 |
20 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
21 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
22 |
23 | EXTERN_C_END
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/jni/C/7zCrcOpt.c:
--------------------------------------------------------------------------------
1 | /* 7zCrcOpt.c -- CRC32 calculation : optimized version
2 | 2009-11-23 : Igor Pavlov : Public domain */
3 |
4 | #include "CpuArch.h"
5 |
6 | #ifdef MY_CPU_LE
7 |
8 | #define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
9 |
10 | UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
11 | {
12 | const Byte *p = (const Byte *)data;
13 | for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
14 | v = CRC_UPDATE_BYTE_2(v, *p);
15 | for (; size >= 4; size -= 4, p += 4)
16 | {
17 | v ^= *(const UInt32 *)p;
18 | v =
19 | table[0x300 + (v & 0xFF)] ^
20 | table[0x200 + ((v >> 8) & 0xFF)] ^
21 | table[0x100 + ((v >> 16) & 0xFF)] ^
22 | table[0x000 + ((v >> 24))];
23 | }
24 | for (; size > 0; size--, p++)
25 | v = CRC_UPDATE_BYTE_2(v, *p);
26 | return v;
27 | }
28 |
29 | UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
30 | {
31 | return CrcUpdateT4(v, data, size, table);
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/C/7zCrcT8.c:
--------------------------------------------------------------------------------
1 | /* 7zCrcT8.c -- CRC32 calculation with 8 tables
2 | 2008-03-19
3 | Igor Pavlov
4 | Public domain */
5 |
6 | #include "7zCrc.h"
7 |
8 | #define kCrcPoly 0xEDB88320
9 | #define CRC_NUM_TABLES 8
10 |
11 | UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
12 |
13 | void MY_FAST_CALL CrcGenerateTable()
14 | {
15 | UInt32 i;
16 | for (i = 0; i < 256; i++)
17 | {
18 | UInt32 r = i;
19 | int j;
20 | for (j = 0; j < 8; j++)
21 | r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
22 | g_CrcTable[i] = r;
23 | }
24 | #if CRC_NUM_TABLES > 1
25 | for (; i < 256 * CRC_NUM_TABLES; i++)
26 | {
27 | UInt32 r = g_CrcTable[i - 256];
28 | g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
29 | }
30 | #endif
31 | }
32 |
33 | UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
34 |
35 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
36 | {
37 | return CrcUpdateT8(v, data, size, g_CrcTable);
38 | }
39 |
40 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
41 | {
42 | return CrcUpdateT8(CRC_INIT_VAL, data, size, g_CrcTable) ^ 0xFFFFFFFF;
43 | }
44 |
--------------------------------------------------------------------------------
/jni/C/7zVersion.h:
--------------------------------------------------------------------------------
1 | #define MY_VER_MAJOR 9
2 | #define MY_VER_MINOR 20
3 | #define MY_VER_BUILD 0
4 | #define MY_VERSION "9.20"
5 | #define MY_DATE "2010-11-18"
6 | #define MY_COPYRIGHT ": Igor Pavlov : Public domain"
7 | #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE
8 |
--------------------------------------------------------------------------------
/jni/C/Alloc.h:
--------------------------------------------------------------------------------
1 | /* Alloc.h -- Memory allocation functions
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __COMMON_ALLOC_H
5 | #define __COMMON_ALLOC_H
6 |
7 | #include
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | void *MyAlloc(size_t size);
14 | void MyFree(void *address);
15 |
16 | void SetLargePageSize();
17 |
18 | void *MidAlloc(size_t size);
19 | void MidFree(void *address);
20 | void *BigAlloc(size_t size);
21 | void BigFree(void *address);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/jni/C/BwtSort.h:
--------------------------------------------------------------------------------
1 | /* BwtSort.h -- BWT block sorting
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __BWT_SORT_H
5 | #define __BWT_SORT_H
6 |
7 | #include "Types.h"
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | /* use BLOCK_SORT_EXTERNAL_FLAGS if blockSize can be > 1M */
14 | /* #define BLOCK_SORT_EXTERNAL_FLAGS */
15 |
16 | #ifdef BLOCK_SORT_EXTERNAL_FLAGS
17 | #define BLOCK_SORT_EXTERNAL_SIZE(blockSize) ((((blockSize) + 31) >> 5))
18 | #else
19 | #define BLOCK_SORT_EXTERNAL_SIZE(blockSize) 0
20 | #endif
21 |
22 | #define BLOCK_SORT_BUF_SIZE(blockSize) ((blockSize) * 2 + BLOCK_SORT_EXTERNAL_SIZE(blockSize) + (1 << 16))
23 |
24 | UInt32 BlockSort(UInt32 *indices, const Byte *data, UInt32 blockSize);
25 |
26 | #ifdef __cplusplus
27 | }
28 | #endif
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/jni/C/Delta.h:
--------------------------------------------------------------------------------
1 | /* Delta.h -- Delta converter
2 | 2009-04-15 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __DELTA_H
5 | #define __DELTA_H
6 |
7 | #include "Types.h"
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | #define DELTA_STATE_SIZE 256
14 |
15 | void Delta_Init(Byte *state);
16 | void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size);
17 | void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size);
18 |
19 | #ifdef __cplusplus
20 | }
21 | #endif
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/jni/C/HuffEnc.h:
--------------------------------------------------------------------------------
1 | /* HuffEnc.h -- Huffman encoding
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __HUFF_ENC_H
5 | #define __HUFF_ENC_H
6 |
7 | #include "Types.h"
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | /*
14 | Conditions:
15 | num <= 1024 = 2 ^ NUM_BITS
16 | Sum(freqs) < 4M = 2 ^ (32 - NUM_BITS)
17 | maxLen <= 16 = kMaxLen
18 | Num_Items(p) >= HUFFMAN_TEMP_SIZE(num)
19 | */
20 |
21 | void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 num, UInt32 maxLen);
22 |
23 | #ifdef __cplusplus
24 | }
25 | #endif
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/jni/C/RotateDefs.h:
--------------------------------------------------------------------------------
1 | /* RotateDefs.h -- Rotate functions
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __ROTATE_DEFS_H
5 | #define __ROTATE_DEFS_H
6 |
7 | #ifdef _MSC_VER
8 |
9 | #include
10 | #define rotlFixed(x, n) _rotl((x), (n))
11 | #define rotrFixed(x, n) _rotr((x), (n))
12 |
13 | #else
14 |
15 | #define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
16 | #define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n))))
17 |
18 | #endif
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/C/Sha256.h:
--------------------------------------------------------------------------------
1 | /* Sha256.h -- SHA-256 Hash
2 | 2010-06-11 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __CRYPTO_SHA256_H
5 | #define __CRYPTO_SHA256_H
6 |
7 | #include "Types.h"
8 |
9 | EXTERN_C_BEGIN
10 |
11 | #define SHA256_DIGEST_SIZE 32
12 |
13 | typedef struct
14 | {
15 | UInt32 state[8];
16 | UInt64 count;
17 | Byte buffer[64];
18 | } CSha256;
19 |
20 | void Sha256_Init(CSha256 *p);
21 | void Sha256_Update(CSha256 *p, const Byte *data, size_t size);
22 | void Sha256_Final(CSha256 *p, Byte *digest);
23 |
24 | EXTERN_C_END
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/C/Sort.h:
--------------------------------------------------------------------------------
1 | /* Sort.h -- Sort functions
2 | 2009-02-07 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __7Z_SORT_H
5 | #define __7Z_SORT_H
6 |
7 | #include "Types.h"
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | void HeapSort(UInt32 *p, UInt32 size);
14 | /* void HeapSortRef(UInt32 *p, UInt32 *vals, UInt32 size); */
15 |
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/C/XzCrc64.c:
--------------------------------------------------------------------------------
1 | /* XzCrc64.c -- CRC64 calculation
2 | 2010-04-16 : Igor Pavlov : Public domain */
3 |
4 | #include "XzCrc64.h"
5 |
6 | #define kCrc64Poly UINT64_CONST(0xC96C5795D7870F42)
7 | UInt64 g_Crc64Table[256];
8 |
9 | void MY_FAST_CALL Crc64GenerateTable(void)
10 | {
11 | UInt32 i;
12 | for (i = 0; i < 256; i++)
13 | {
14 | UInt64 r = i;
15 | int j;
16 | for (j = 0; j < 8; j++)
17 | r = (r >> 1) ^ ((UInt64)kCrc64Poly & ~((r & 1) - 1));
18 | g_Crc64Table[i] = r;
19 | }
20 | }
21 |
22 | UInt64 MY_FAST_CALL Crc64Update(UInt64 v, const void *data, size_t size)
23 | {
24 | const Byte *p = (const Byte *)data;
25 | for (; size > 0 ; size--, p++)
26 | v = CRC64_UPDATE_BYTE(v, *p);
27 | return v;
28 | }
29 |
30 | UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size)
31 | {
32 | return CRC64_GET_DIGEST(Crc64Update(CRC64_INIT_VAL, data, size));
33 | }
34 |
--------------------------------------------------------------------------------
/jni/C/XzCrc64.h:
--------------------------------------------------------------------------------
1 | /* XzCrc64.h -- CRC64 calculation
2 | 2010-04-16 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __XZ_CRC64_H
5 | #define __XZ_CRC64_H
6 |
7 | #include
8 |
9 | #include "Types.h"
10 |
11 | EXTERN_C_BEGIN
12 |
13 | extern UInt64 g_Crc64Table[];
14 |
15 | void MY_FAST_CALL Crc64GenerateTable(void);
16 |
17 | #define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)
18 | #define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)
19 | #define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
20 |
21 | UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);
22 | UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);
23 |
24 | EXTERN_C_END
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/C/XzEnc.h:
--------------------------------------------------------------------------------
1 | /* XzEnc.h -- Xz Encode
2 | 2009-04-15 : Igor Pavlov : Public domain */
3 |
4 | #ifndef __XZ_ENC_H
5 | #define __XZ_ENC_H
6 |
7 | #include "Lzma2Enc.h"
8 |
9 | #include "Xz.h"
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif
14 |
15 | SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,
16 | const CLzma2EncProps *lzma2Props, Bool useSubblock,
17 | ICompressProgress *progress);
18 |
19 | SRes Xz_EncodeEmpty(ISeqOutStream *outStream);
20 |
21 | #ifdef __cplusplus
22 | }
23 | #endif
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zCompressionMode.cpp:
--------------------------------------------------------------------------------
1 | // CompressionMethod.cpp
2 |
3 | #include "StdAfx.h"
4 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zCompressionMode.h:
--------------------------------------------------------------------------------
1 | // 7zCompressionMode.h
2 |
3 | #ifndef __7Z_COMPRESSION_MODE_H
4 | #define __7Z_COMPRESSION_MODE_H
5 |
6 | #include "../../../Common/MyString.h"
7 |
8 | #include "../../../Windows/PropVariant.h"
9 |
10 | #include "../../Common/MethodProps.h"
11 |
12 | namespace NArchive {
13 | namespace N7z {
14 |
15 | struct CMethodFull: public CMethod
16 | {
17 | UInt32 NumInStreams;
18 | UInt32 NumOutStreams;
19 | bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); }
20 | };
21 |
22 | struct CBind
23 | {
24 | UInt32 InCoder;
25 | UInt32 InStream;
26 | UInt32 OutCoder;
27 | UInt32 OutStream;
28 | };
29 |
30 | struct CCompressionMethodMode
31 | {
32 | CObjectVector Methods;
33 | CRecordVector Binds;
34 | #ifndef _7ZIP_ST
35 | UInt32 NumThreads;
36 | #endif
37 | bool PasswordIsDefined;
38 | UString Password;
39 |
40 | bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); }
41 | CCompressionMethodMode(): PasswordIsDefined(false)
42 | #ifndef _7ZIP_ST
43 | , NumThreads(1)
44 | #endif
45 | {}
46 | };
47 |
48 | }}
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zHeader.cpp:
--------------------------------------------------------------------------------
1 | // 7zHeader.cpp
2 |
3 | #include "StdAfx.h"
4 | #include "7zHeader.h"
5 |
6 | namespace NArchive {
7 | namespace N7z {
8 |
9 | Byte kSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
10 | #ifdef _7Z_VOL
11 | Byte kFinishSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C + 1};
12 | #endif
13 |
14 | }}
15 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zProperties.h:
--------------------------------------------------------------------------------
1 | // 7zProperties.h
2 |
3 | #ifndef __7Z_PROPERTIES_H
4 | #define __7Z_PROPERTIES_H
5 |
6 | #include "../../PropID.h"
7 |
8 | namespace NArchive {
9 | namespace N7z {
10 |
11 | enum
12 | {
13 | kpidPackedSize0 = kpidUserDefined,
14 | kpidPackedSize1,
15 | kpidPackedSize2,
16 | kpidPackedSize3,
17 | kpidPackedSize4
18 | };
19 |
20 | }}
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zRegister.cpp:
--------------------------------------------------------------------------------
1 | // 7zRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "7zHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::N7z::CHandler; }
9 | #ifndef EXTRACT_ONLY
10 | static IOutArchive *CreateArcOut() { return new NArchive::N7z::CHandler; }
11 | #else
12 | #define CreateArcOut 0
13 | #endif
14 |
15 | static CArcInfo g_ArcInfo =
16 | { L"7z", L"7z", 0, 7, {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C}, 6, false, CreateArc, CreateArcOut };
17 |
18 | REGISTER_ARC(7z)
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zSpecStream.cpp:
--------------------------------------------------------------------------------
1 | // 7zSpecStream.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "7zSpecStream.h"
6 |
7 | STDMETHODIMP CSequentialInStreamSizeCount2::Read(void *data, UInt32 size, UInt32 *processedSize)
8 | {
9 | UInt32 realProcessedSize;
10 | HRESULT result = _stream->Read(data, size, &realProcessedSize);
11 | _size += realProcessedSize;
12 | if (processedSize != 0)
13 | *processedSize = realProcessedSize;
14 | return result;
15 | }
16 |
17 | STDMETHODIMP CSequentialInStreamSizeCount2::GetSubStreamSize(
18 | UInt64 subStream, UInt64 *value)
19 | {
20 | if (_getSubStreamSize == NULL)
21 | return E_NOTIMPL;
22 | return _getSubStreamSize->GetSubStreamSize(subStream, value);
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/7z/7zSpecStream.h:
--------------------------------------------------------------------------------
1 | // 7zSpecStream.h
2 |
3 | #ifndef __7Z_SPEC_STREAM_H
4 | #define __7Z_SPEC_STREAM_H
5 |
6 | #include "../../IStream.h"
7 | #include "../../ICoder.h"
8 | #include "../../../Common/MyCom.h"
9 |
10 | class CSequentialInStreamSizeCount2:
11 | public ISequentialInStream,
12 | public ICompressGetSubStreamSize,
13 | public CMyUnknownImp
14 | {
15 | CMyComPtr _stream;
16 | CMyComPtr _getSubStreamSize;
17 | UInt64 _size;
18 | public:
19 | void Init(ISequentialInStream *stream)
20 | {
21 | _stream = stream;
22 | _getSubStreamSize = 0;
23 | _stream.QueryInterface(IID_ICompressGetSubStreamSize, &_getSubStreamSize);
24 | _size = 0;
25 | }
26 | UInt64 GetSize() const { return _size; }
27 |
28 | MY_UNKNOWN_IMP1(ICompressGetSubStreamSize)
29 |
30 | STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
31 |
32 | STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Cab/CabBlockInStream.h:
--------------------------------------------------------------------------------
1 | // CabBlockInStream.cpp
2 |
3 | #ifndef __CABBLOCKINSTREAM_H
4 | #define __CABBLOCKINSTREAM_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../../IStream.h"
8 |
9 | namespace NArchive {
10 | namespace NCab {
11 |
12 | class CCabBlockInStream:
13 | public ISequentialInStream,
14 | public CMyUnknownImp
15 | {
16 | CMyComPtr _stream;
17 | Byte *_buffer;
18 | UInt32 _pos;
19 | UInt32 _size;
20 |
21 | public:
22 | UInt32 TotalPackSize;
23 | UInt32 ReservedSize;
24 | bool DataError;
25 | bool MsZip;
26 |
27 | CCabBlockInStream(): _buffer(0), ReservedSize(0), MsZip(false), DataError(false), TotalPackSize(0) {}
28 | ~CCabBlockInStream();
29 | bool Create();
30 | void SetStream(ISequentialInStream *stream) { _stream = stream; }
31 |
32 | void InitForNewFolder() { TotalPackSize = 0; }
33 | void InitForNewBlock() { _size = 0; }
34 |
35 | MY_UNKNOWN_IMP
36 |
37 | STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
38 |
39 | HRESULT PreRead(UInt32 &packSize, UInt32 &unpackSize);
40 | };
41 |
42 | }}
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Cab/CabHandler.h:
--------------------------------------------------------------------------------
1 | // CabHandler.h
2 |
3 | #ifndef __CAB_HANDLER_H
4 | #define __CAB_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 | #include "CabIn.h"
9 |
10 | namespace NArchive {
11 | namespace NCab {
12 |
13 | class CHandler:
14 | public IInArchive,
15 | public CMyUnknownImp
16 | {
17 | public:
18 | MY_UNKNOWN_IMP1(IInArchive)
19 |
20 | INTERFACE_IInArchive(;)
21 |
22 | private:
23 | CMvDatabaseEx m_Database;
24 | };
25 |
26 | }}
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Cab/CabHeader.cpp:
--------------------------------------------------------------------------------
1 | // CabHeader.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "CabHeader.h"
6 |
7 | namespace NArchive {
8 | namespace NCab {
9 | namespace NHeader {
10 |
11 | Byte kMarker[kMarkerSize] = {'M', 'S', 'C', 'F', 0, 0, 0, 0 };
12 |
13 | // struct CSignatureInitializer { CSignatureInitializer() { kMarker[0]--; }; } g_SignatureInitializer;
14 |
15 | }}}
16 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Cab/CabHeader.h:
--------------------------------------------------------------------------------
1 | // Archive/Cab/Header.h
2 |
3 | #ifndef __ARCHIVE_CAB_HEADER_H
4 | #define __ARCHIVE_CAB_HEADER_H
5 |
6 | #include "Common/Types.h"
7 |
8 | namespace NArchive {
9 | namespace NCab {
10 | namespace NHeader {
11 |
12 | const unsigned kMarkerSize = 8;
13 | extern Byte kMarker[kMarkerSize];
14 |
15 | namespace NArchive
16 | {
17 | namespace NFlags
18 | {
19 | const int kPrevCabinet = 0x0001;
20 | const int kNextCabinet = 0x0002;
21 | const int kReservePresent = 0x0004;
22 | }
23 | }
24 |
25 | namespace NCompressionMethodMajor
26 | {
27 | const Byte kNone = 0;
28 | const Byte kMSZip = 1;
29 | const Byte kQuantum = 2;
30 | const Byte kLZX = 3;
31 | }
32 |
33 | const int kFileNameIsUTFAttributeMask = 0x80;
34 |
35 | namespace NFolderIndex
36 | {
37 | const int kContinuedFromPrev = 0xFFFD;
38 | const int kContinuedToNext = 0xFFFE;
39 | const int kContinuedPrevAndNext = 0xFFFF;
40 | }
41 |
42 | }}}
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Cab/CabRegister.cpp:
--------------------------------------------------------------------------------
1 | // CabRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "CabHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NCab::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Cab", L"cab", 0, 8, { 0x4D, 0x53, 0x43, 0x46 }, 4, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Cab)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Chm/ChmHandler.h:
--------------------------------------------------------------------------------
1 | // ChmHandler.h
2 |
3 | #ifndef __ARCHIVE_CHM_HANDLER_H
4 | #define __ARCHIVE_CHM_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 | #include "ChmIn.h"
9 |
10 | namespace NArchive {
11 | namespace NChm {
12 |
13 | class CHandler:
14 | public IInArchive,
15 | public CMyUnknownImp
16 | {
17 | public:
18 | MY_UNKNOWN_IMP1(IInArchive)
19 |
20 | INTERFACE_IInArchive(;)
21 |
22 | private:
23 | CFilesDatabase m_Database;
24 | CMyComPtr m_Stream;
25 | };
26 |
27 | }}
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Chm/ChmHeader.cpp:
--------------------------------------------------------------------------------
1 | // Archive/Chm/Header.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "ChmHeader.h"
6 |
7 | namespace NArchive{
8 | namespace NChm{
9 | namespace NHeader{
10 |
11 | UInt32 kItsfSignature = 0x46535449 + 1;
12 | UInt32 kItolSignature = 0x4C4F5449 + 1;
13 | static class CSignatureInitializer
14 | {
15 | public:
16 | CSignatureInitializer()
17 | {
18 | kItsfSignature--;
19 | kItolSignature--;
20 | }
21 | }g_SignatureInitializer;
22 |
23 |
24 | }}}
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Chm/ChmHeader.h:
--------------------------------------------------------------------------------
1 | // Archive/Chm/Header.h
2 |
3 | #ifndef __ARCHIVE_CHM_HEADER_H
4 | #define __ARCHIVE_CHM_HEADER_H
5 |
6 | #include "Common/Types.h"
7 |
8 | namespace NArchive {
9 | namespace NChm {
10 | namespace NHeader{
11 |
12 | const UInt32 kItspSignature = 0x50535449;
13 | const UInt32 kPmglSignature = 0x4C474D50;
14 | const UInt32 kLzxcSignature = 0x43585A4C;
15 |
16 | const UInt32 kIfcmSignature = 0x4D434649;
17 | const UInt32 kAollSignature = 0x4C4C4F41;
18 | const UInt32 kCaolSignature = 0x4C4F4143;
19 |
20 | extern UInt32 kItsfSignature;
21 |
22 | extern UInt32 kItolSignature;
23 | const UInt32 kItlsSignature = 0x534C5449;
24 | UInt64 inline GetHxsSignature() { return ((UInt64)kItlsSignature << 32) | kItolSignature; }
25 |
26 | }}}
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Chm/ChmRegister.cpp:
--------------------------------------------------------------------------------
1 | // ChmRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "ChmHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NChm::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Chm", L"chm chi chq chw hxs hxi hxr hxq hxw lit", 0, 0xE9, { 'I', 'T', 'S', 'F' }, 4, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Chm)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Com/ComHandler.h:
--------------------------------------------------------------------------------
1 | // ComHandler.h
2 |
3 | #ifndef __ARCHIVE_COM_HANDLER_H
4 | #define __ARCHIVE_COM_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 | #include "ComIn.h"
9 |
10 | namespace NArchive {
11 | namespace NCom {
12 |
13 | class CHandler:
14 | public IInArchive,
15 | public IInArchiveGetStream,
16 | public CMyUnknownImp
17 | {
18 | CMyComPtr _stream;
19 | CDatabase _db;
20 | public:
21 | MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
22 | INTERFACE_IInArchive(;)
23 | STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
24 | };
25 |
26 | }}
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Com/ComRegister.cpp:
--------------------------------------------------------------------------------
1 | // ComRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "ComHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NCom::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Compound", L"msi msp doc xls ppt", 0, 0xE5, { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }, 8, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Com)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/CrossThreadProgress.cpp:
--------------------------------------------------------------------------------
1 | // CrossThreadProgress.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "CrossThreadProgress.h"
6 |
7 | STDMETHODIMP CCrossThreadProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
8 | {
9 | InSize = inSize;
10 | OutSize = outSize;
11 | ProgressEvent.Set();
12 | WaitEvent.Lock();
13 | return Result;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/CrossThreadProgress.h:
--------------------------------------------------------------------------------
1 | // CrossThreadProgress.h
2 |
3 | #ifndef __CROSSTHREADPROGRESS_H
4 | #define __CROSSTHREADPROGRESS_H
5 |
6 | #include "../../ICoder.h"
7 | #include "../../../Windows/Synchronization.h"
8 | #include "../../../Common/MyCom.h"
9 |
10 | class CCrossThreadProgress:
11 | public ICompressProgressInfo,
12 | public CMyUnknownImp
13 | {
14 | public:
15 | const UInt64 *InSize;
16 | const UInt64 *OutSize;
17 | HRESULT Result;
18 | NWindows::NSynchronization::CAutoResetEvent ProgressEvent;
19 | NWindows::NSynchronization::CAutoResetEvent WaitEvent;
20 |
21 | HRes Create()
22 | {
23 | RINOK(ProgressEvent.CreateIfNotCreated());
24 | return WaitEvent.CreateIfNotCreated();
25 | }
26 | void Init()
27 | {
28 | ProgressEvent.Reset();
29 | WaitEvent.Reset();
30 | }
31 |
32 | MY_UNKNOWN_IMP
33 |
34 | STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/DummyOutStream.cpp:
--------------------------------------------------------------------------------
1 | // DummyOutStream.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "DummyOutStream.h"
6 |
7 | STDMETHODIMP CDummyOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
8 | {
9 | UInt32 realProcessedSize;
10 | HRESULT result;
11 | if(!_stream)
12 | {
13 | realProcessedSize = size;
14 | result = S_OK;
15 | }
16 | else
17 | result = _stream->Write(data, size, &realProcessedSize);
18 | _size += realProcessedSize;
19 | if(processedSize != NULL)
20 | *processedSize = realProcessedSize;
21 | return result;
22 | }
23 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/DummyOutStream.h:
--------------------------------------------------------------------------------
1 | // DummyOutStream.h
2 |
3 | #ifndef __DUMMYOUTSTREAM_H
4 | #define __DUMMYOUTSTREAM_H
5 |
6 | #include "../../IStream.h"
7 | #include "Common/MyCom.h"
8 |
9 | class CDummyOutStream:
10 | public ISequentialOutStream,
11 | public CMyUnknownImp
12 | {
13 | CMyComPtr _stream;
14 | UInt64 _size;
15 | public:
16 | void SetStream(ISequentialOutStream *outStream) { _stream = outStream; }
17 | void ReleaseStream() { _stream.Release(); }
18 | void Init() { _size = 0; }
19 | MY_UNKNOWN_IMP
20 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
21 | UInt64 GetSize() const { return _size; }
22 | };
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/FindSignature.h:
--------------------------------------------------------------------------------
1 | // FindSignature.h
2 |
3 | #ifndef __FINDSIGNATURE_H
4 | #define __FINDSIGNATURE_H
5 |
6 | #include "../../IStream.h"
7 |
8 | HRESULT FindSignatureInStream(ISequentialInStream *stream,
9 | const Byte *signature, unsigned signatureSize,
10 | const UInt64 *limit, UInt64 &resPos);
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/ItemNameUtils.h:
--------------------------------------------------------------------------------
1 | // Archive/Common/ItemNameUtils.h
2 |
3 | #ifndef __ARCHIVE_ITEMNAMEUTILS_H
4 | #define __ARCHIVE_ITEMNAMEUTILS_H
5 |
6 | #include "../../../Common/MyString.h"
7 |
8 | namespace NArchive {
9 | namespace NItemName {
10 |
11 | UString MakeLegalName(const UString &name);
12 | UString GetOSName(const UString &name);
13 | UString GetOSName2(const UString &name);
14 | bool HasTailSlash(const AString &name, UINT codePage);
15 |
16 | #ifdef _WIN32
17 | inline UString WinNameToOSName(const UString &name) { return name; }
18 | #else
19 | UString WinNameToOSName(const UString &name);
20 | #endif
21 |
22 | }}
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp:
--------------------------------------------------------------------------------
1 | // OutStreamWithCRC.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "OutStreamWithCRC.h"
6 |
7 | STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
8 | {
9 | HRESULT result = S_OK;
10 | if (_stream)
11 | result = _stream->Write(data, size, &size);
12 | if (_calculate)
13 | _crc = CrcUpdate(_crc, data, size);
14 | _size += size;
15 | if (processedSize != NULL)
16 | *processedSize = size;
17 | return result;
18 | }
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/OutStreamWithCRC.h:
--------------------------------------------------------------------------------
1 | // OutStreamWithCRC.h
2 |
3 | #ifndef __OUT_STREAM_WITH_CRC_H
4 | #define __OUT_STREAM_WITH_CRC_H
5 |
6 | #include "../../../../C/7zCrc.h"
7 |
8 | #include "../../../Common/MyCom.h"
9 |
10 | #include "../../IStream.h"
11 |
12 | class COutStreamWithCRC:
13 | public ISequentialOutStream,
14 | public CMyUnknownImp
15 | {
16 | CMyComPtr _stream;
17 | UInt64 _size;
18 | UInt32 _crc;
19 | bool _calculate;
20 | public:
21 | MY_UNKNOWN_IMP
22 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
23 | void SetStream(ISequentialOutStream *stream) { _stream = stream; }
24 | void ReleaseStream() { _stream.Release(); }
25 | void Init(bool calculate = true)
26 | {
27 | _size = 0;
28 | _calculate = calculate;
29 | _crc = CRC_INIT_VAL;
30 | }
31 | void InitCRC() { _crc = CRC_INIT_VAL; }
32 | UInt64 GetSize() const { return _size; }
33 | UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp:
--------------------------------------------------------------------------------
1 | // OutStreamWithSha1.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "OutStreamWithSha1.h"
6 |
7 | STDMETHODIMP COutStreamWithSha1::Write(const void *data, UInt32 size, UInt32 *processedSize)
8 | {
9 | HRESULT result = S_OK;
10 | if (_stream)
11 | result = _stream->Write(data, size, &size);
12 | if (_calculate)
13 | _sha.Update((const Byte *)data, size);
14 | _size += size;
15 | if (processedSize != NULL)
16 | *processedSize = size;
17 | return result;
18 | }
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/OutStreamWithSha1.h:
--------------------------------------------------------------------------------
1 | // OutStreamWithSha1.h
2 |
3 | #ifndef __OUT_STREAM_WITH_SHA1_H
4 | #define __OUT_STREAM_WITH_SHA1_H
5 |
6 | #include "../../Crypto/Sha1.h"
7 |
8 | #include "../../../Common/MyCom.h"
9 |
10 | #include "../../IStream.h"
11 |
12 | class COutStreamWithSha1:
13 | public ISequentialOutStream,
14 | public CMyUnknownImp
15 | {
16 | CMyComPtr _stream;
17 | UInt64 _size;
18 | NCrypto::NSha1::CContext _sha;
19 | bool _calculate;
20 | public:
21 | MY_UNKNOWN_IMP
22 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
23 | void SetStream(ISequentialOutStream *stream) { _stream = stream; }
24 | void ReleaseStream() { _stream.Release(); }
25 | void Init(bool calculate = true)
26 | {
27 | _size = 0;
28 | _calculate = calculate;
29 | _sha.Init();
30 | }
31 | void InitSha1() { _sha.Init(); }
32 | UInt64 GetSize() const { return _size; }
33 | void Final(Byte *digest) { _sha.Final(digest); }
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Common/ParseProperties.h:
--------------------------------------------------------------------------------
1 | // ParseProperties.h
2 |
3 | #ifndef __PARSEPROPERTIES_H
4 | #define __PARSEPROPERTIES_H
5 |
6 | #include "Common/MyString.h"
7 | #include "Common/Types.h"
8 |
9 | HRESULT ParsePropValue(const UString &name, const PROPVARIANT &prop, UInt32 &resValue);
10 | HRESULT ParsePropDictionaryValue(const UString &srcStringSpec, UInt32 &dicSize);
11 | HRESULT ParsePropDictionaryValue(const UString &name, const PROPVARIANT &prop, UInt32 &resValue);
12 |
13 | bool StringToBool(const UString &s, bool &res);
14 | HRESULT SetBoolProperty(bool &dest, const PROPVARIANT &value);
15 | int ParseStringToUInt32(const UString &srcString, UInt32 &number);
16 | HRESULT ParseMtProp(const UString &name, const PROPVARIANT &prop, UInt32 defaultNumThreads, UInt32 &numThreads);
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/DeflateProps.h:
--------------------------------------------------------------------------------
1 | // DeflateProps.h
2 |
3 | #ifndef __DEFLATE_PROPS_H
4 | #define __DEFLATE_PROPS_H
5 |
6 | #include "../ICoder.h"
7 |
8 | namespace NArchive {
9 |
10 | class CDeflateProps
11 | {
12 | UInt32 Level;
13 | UInt32 NumPasses;
14 | UInt32 Fb;
15 | UInt32 Algo;
16 | UInt32 Mc;
17 | bool McDefined;
18 |
19 | void Init()
20 | {
21 | Level = NumPasses = Fb = Algo = Mc = 0xFFFFFFFF;
22 | McDefined = false;
23 | }
24 | void Normalize();
25 | public:
26 | CDeflateProps() { Init(); }
27 | bool IsMaximum() const { return Algo > 0; }
28 |
29 | HRESULT SetCoderProperties(ICompressSetCoderProperties *setCoderProperties);
30 | HRESULT SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProps);
31 | };
32 |
33 | }
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Hfs/HfsHandler.h:
--------------------------------------------------------------------------------
1 | // HfsHandler.h
2 |
3 | #ifndef __ARCHIVE_HFS_HANDLER_H
4 | #define __ARCHIVE_HFS_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 | #include "HfsIn.h"
9 |
10 | namespace NArchive {
11 | namespace NHfs {
12 |
13 | class CHandler:
14 | public IInArchive,
15 | public CMyUnknownImp
16 | {
17 | CMyComPtr _stream;
18 | CDatabase _db;
19 | public:
20 | MY_UNKNOWN_IMP1(IInArchive)
21 | INTERFACE_IInArchive(;)
22 | };
23 |
24 | }}
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Hfs/HfsRegister.cpp:
--------------------------------------------------------------------------------
1 | // HfsRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "HfsHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NHfs::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"HFS", L"hfs", 0, 0xE3, { 'H', '+', 0, 4 }, 4, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Hfs)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Iso/IsoHandler.h:
--------------------------------------------------------------------------------
1 | // IsoHandler.h
2 |
3 | #ifndef __ISO_HANDLER_H
4 | #define __ISO_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 |
9 | #include "IsoIn.h"
10 | #include "IsoItem.h"
11 |
12 | namespace NArchive {
13 | namespace NIso {
14 |
15 | class CHandler:
16 | public IInArchive,
17 | public IInArchiveGetStream,
18 | public CMyUnknownImp
19 | {
20 | CMyComPtr _stream;
21 | CInArchive _archive;
22 | public:
23 | MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
24 | INTERFACE_IInArchive(;)
25 | STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
26 | };
27 |
28 | }}
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Iso/IsoHeader.cpp:
--------------------------------------------------------------------------------
1 | // Archive/Iso/Header.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "IsoHeader.h"
6 |
7 | namespace NArchive {
8 | namespace NIso {
9 |
10 | const char *kElToritoSpec = "EL TORITO SPECIFICATION\0\0\0\0\0\0\0\0\0";
11 |
12 | const wchar_t *kMediaTypes[5] =
13 | {
14 | L"NoEmulation",
15 | L"1.2M",
16 | L"1.44M",
17 | L"2.88M",
18 | L"HardDisk"
19 | };
20 |
21 | }}
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Iso/IsoIn.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlenderViking/extract-archive-android-lib/54081a5bbbd9f3eb62847c577df65207872100cd/jni/CPP/7zip/Archive/Iso/IsoIn.h
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Iso/IsoRegister.cpp:
--------------------------------------------------------------------------------
1 | // IsoRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "IsoHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NIso::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Iso", L"iso img", 0, 0xE7, { 'C', 'D', '0', '0', '1', 0x1 }, 7, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Iso)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Nsis/NsisDecode.h:
--------------------------------------------------------------------------------
1 | // NsisDecode.h
2 |
3 | #ifndef __NSIS_DECODE_H
4 | #define __NSIS_DECODE_H
5 |
6 | #include "../../IStream.h"
7 |
8 | #include "../../Common/CreateCoder.h"
9 |
10 | namespace NArchive {
11 | namespace NNsis {
12 |
13 | namespace NMethodType
14 | {
15 | enum EEnum
16 | {
17 | kCopy,
18 | kDeflate,
19 | kBZip2,
20 | kLZMA
21 | };
22 | }
23 |
24 | class CDecoder
25 | {
26 | NMethodType::EEnum _method;
27 |
28 | CMyComPtr _filterInStream;
29 | CMyComPtr _codecInStream;
30 | CMyComPtr _decoderInStream;
31 |
32 | public:
33 | void Release()
34 | {
35 | _filterInStream.Release();
36 | _codecInStream.Release();
37 | _decoderInStream.Release();
38 | }
39 | HRESULT Init(
40 | DECL_EXTERNAL_CODECS_LOC_VARS
41 | IInStream *inStream, NMethodType::EEnum method, bool thereIsFilterFlag, bool &useFilter);
42 | HRESULT Read(void *data, size_t *processedSize);
43 | };
44 |
45 | }}
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Nsis/NsisHandler.h:
--------------------------------------------------------------------------------
1 | // NSisHandler.h
2 |
3 | #ifndef __NSIS_HANDLER_H
4 | #define __NSIS_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 |
9 | #include "NsisIn.h"
10 |
11 | #include "../../Common/CreateCoder.h"
12 |
13 | namespace NArchive {
14 | namespace NNsis {
15 |
16 | class CHandler:
17 | public IInArchive,
18 | PUBLIC_ISetCompressCodecsInfo
19 | public CMyUnknownImp
20 | {
21 | CMyComPtr _inStream;
22 | CInArchive _archive;
23 |
24 | DECL_EXTERNAL_CODECS_VARS
25 |
26 | bool GetUncompressedSize(int index, UInt32 &size);
27 | bool GetCompressedSize(int index, UInt32 &size);
28 |
29 | AString GetMethod(bool useItemFilter, UInt32 dictionary) const;
30 | public:
31 | MY_QUERYINTERFACE_BEGIN2(IInArchive)
32 | QUERY_ENTRY_ISetCompressCodecsInfo
33 | MY_QUERYINTERFACE_END
34 | MY_ADDREF_RELEASE
35 |
36 | INTERFACE_IInArchive(;)
37 |
38 | DECL_ISetCompressCodecsInfo
39 | };
40 |
41 | }}
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Nsis/NsisRegister.cpp:
--------------------------------------------------------------------------------
1 | // NsisRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "NsisHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NNsis::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Nsis", L"", 0, 0x9, NSIS_SIGNATURE, NArchive::NNsis::kSignatureSize, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Nsis)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Rar/RarHeader.cpp:
--------------------------------------------------------------------------------
1 | // Archive/Rar/Headers.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "RarHeader.h"
6 |
7 | namespace NArchive{
8 | namespace NRar{
9 | namespace NHeader{
10 |
11 | Byte kMarker[kMarkerSize] = {0x52 + 1, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00};
12 |
13 | class CMarkerInitializer
14 | {
15 | public:
16 | CMarkerInitializer() { kMarker[0]--; };
17 | };
18 |
19 | static CMarkerInitializer markerInitializer;
20 |
21 | }}}
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Rar/RarRegister.cpp:
--------------------------------------------------------------------------------
1 | // RarRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "RarHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NRar::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Rar", L"rar r00", 0, 3, {0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00}, 7, false, CreateArc, 0, };
12 |
13 | REGISTER_ARC(Rar)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Rar/RarVolumeInStream.h:
--------------------------------------------------------------------------------
1 | // RarVolumeInStream.h
2 |
3 | #ifndef __RAR_VOLUME_IN_STREAM_H
4 | #define __RAR_VOLUME_IN_STREAM_H
5 |
6 | #include "../../IStream.h"
7 | #include "RarIn.h"
8 |
9 | namespace NArchive {
10 | namespace NRar {
11 |
12 | struct CRefItem
13 | {
14 | int VolumeIndex;
15 | int ItemIndex;
16 | int NumItems;
17 | };
18 |
19 | class CFolderInStream:
20 | public ISequentialInStream,
21 | public CMyUnknownImp
22 | {
23 | public:
24 | MY_UNKNOWN_IMP
25 |
26 | STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
27 |
28 | private:
29 | CObjectVector *_archives;
30 | const CObjectVector *_items;
31 | CRefItem _refItem;
32 | int _curIndex;
33 | UInt32 _crc;
34 | bool _fileIsOpen;
35 | CMyComPtr _stream;
36 |
37 | HRESULT OpenStream();
38 | HRESULT CloseStream();
39 | public:
40 | void Init(CObjectVector *archives,
41 | const CObjectVector *items,
42 | const CRefItem &refItem);
43 |
44 | CRecordVector CRCs;
45 | };
46 |
47 | }}
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Tar/TarHeader.cpp:
--------------------------------------------------------------------------------
1 | // Archive/Tar/Header.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "TarHeader.h"
6 |
7 | namespace NArchive {
8 | namespace NTar {
9 | namespace NFileHeader {
10 |
11 | // The checksum field is filled with this while the checksum is computed.
12 | const char *kCheckSumBlanks = " "; // 8 blanks, no null
13 |
14 | const char *kLongLink = "././@LongLink";
15 | const char *kLongLink2 = "@LongLink";
16 |
17 | // The magic field is filled with this if uname and gname are valid.
18 | namespace NMagic
19 | {
20 | const char *kUsTar = "ustar"; // 5 chars
21 | const char *kGNUTar = "GNUtar "; // 7 chars and a null
22 | const char *kEmpty = "\0\0\0\0\0\0\0\0"; // 7 chars and a null
23 | }
24 |
25 | }}}
26 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Tar/TarIn.h:
--------------------------------------------------------------------------------
1 | // TarIn.h
2 |
3 | #ifndef __ARCHIVE_TAR_IN_H
4 | #define __ARCHIVE_TAR_IN_H
5 |
6 | #include "../../IStream.h"
7 |
8 | #include "TarItem.h"
9 |
10 | namespace NArchive {
11 | namespace NTar {
12 |
13 | HRESULT ReadItem(ISequentialInStream *stream, bool &filled, CItemEx &itemInfo, AString &error);
14 |
15 | }}
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Tar/TarOut.h:
--------------------------------------------------------------------------------
1 | // Archive/TarOut.h
2 |
3 | #ifndef __ARCHIVE_TAR_OUT_H
4 | #define __ARCHIVE_TAR_OUT_H
5 |
6 | #include "TarItem.h"
7 |
8 | #include "Common/MyCom.h"
9 | #include "../../IStream.h"
10 |
11 | namespace NArchive {
12 | namespace NTar {
13 |
14 | class COutArchive
15 | {
16 | CMyComPtr m_Stream;
17 | HRESULT WriteBytes(const void *buffer, UInt32 size);
18 | public:
19 | void Create(ISequentialOutStream *outStream);
20 | HRESULT WriteHeaderReal(const CItem &item);
21 | HRESULT WriteHeader(const CItem &item);
22 | HRESULT FillDataResidual(UInt64 dataSize);
23 | HRESULT WriteFinishHeader();
24 | };
25 |
26 | }}
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Tar/TarRegister.cpp:
--------------------------------------------------------------------------------
1 | // TarRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "TarHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NTar::CHandler; }
9 | #ifndef EXTRACT_ONLY
10 | static IOutArchive *CreateArcOut() { return new NArchive::NTar::CHandler; }
11 | #else
12 | #define CreateArcOut 0
13 | #endif
14 |
15 | static CArcInfo g_ArcInfo =
16 | { L"tar", L"tar", 0, 0xEE, { 'u', 's', 't', 'a', 'r' }, 5, false, CreateArc, CreateArcOut };
17 |
18 | REGISTER_ARC(Tar)
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Tar/TarUpdate.h:
--------------------------------------------------------------------------------
1 | // TarUpdate.h
2 |
3 | #ifndef __TAR_UPDATE_H
4 | #define __TAR_UPDATE_H
5 |
6 | #include "../IArchive.h"
7 | #include "TarItem.h"
8 |
9 | namespace NArchive {
10 | namespace NTar {
11 |
12 | struct CUpdateItem
13 | {
14 | int IndexInArchive;
15 | int IndexInClient;
16 | UInt32 Time;
17 | UInt32 Mode;
18 | UInt64 Size;
19 | AString Name;
20 | AString User;
21 | AString Group;
22 | bool NewData;
23 | bool NewProps;
24 | bool IsDir;
25 | };
26 |
27 | HRESULT UpdateArchive(IInStream *inStream, ISequentialOutStream *outStream,
28 | const CObjectVector &inputItems,
29 | const CObjectVector &updateItems,
30 | IArchiveUpdateCallback *updateCallback);
31 |
32 | }}
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Udf/UdfHandler.h:
--------------------------------------------------------------------------------
1 | // Udf/Handler.h
2 |
3 | #ifndef __UDF_HANDLER_H
4 | #define __UDF_HANDLER_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IArchive.h"
8 |
9 | #include "UdfIn.h"
10 |
11 | namespace NArchive {
12 | namespace NUdf {
13 |
14 | struct CRef2
15 | {
16 | int Vol;
17 | int Fs;
18 | int Ref;
19 | };
20 |
21 | class CHandler:
22 | public IInArchive,
23 | public IInArchiveGetStream,
24 | public CMyUnknownImp
25 | {
26 | CMyComPtr _inStream;
27 | CInArchive _archive;
28 | CRecordVector _refs2;
29 | public:
30 | MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
31 | INTERFACE_IInArchive(;)
32 | STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
33 | };
34 |
35 | }}
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Udf/UdfRegister.cpp:
--------------------------------------------------------------------------------
1 | // UdfRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "UdfHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NUdf::CHandler; }
9 |
10 | static CArcInfo g_ArcInfo =
11 | { L"Udf", L"iso img", 0, 0xE0, { 0, 'N', 'S', 'R', '0' }, 5, false, CreateArc, 0 };
12 |
13 | REGISTER_ARC(Udf)
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Wim/WimRegister.cpp:
--------------------------------------------------------------------------------
1 | // WimRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "WimHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NWim::CHandler; }
9 | #ifndef EXTRACT_ONLY
10 | static IOutArchive *CreateArcOut() { return new NArchive::NWim::COutHandler; }
11 | #else
12 | #define CreateArcOut 0
13 | #endif
14 |
15 | static CArcInfo g_ArcInfo =
16 | { L"wim", L"wim swm", 0, 0xE6, { 'M', 'S', 'W', 'I', 'M', 0, 0, 0 }, 8, false, CreateArc, CreateArcOut };
17 |
18 | REGISTER_ARC(Wim)
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Zip/ZipCompressionMode.h:
--------------------------------------------------------------------------------
1 | // CompressionMode.h
2 |
3 | #ifndef __ZIP_COMPRESSION_MODE_H
4 | #define __ZIP_COMPRESSION_MODE_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | namespace NArchive {
9 | namespace NZip {
10 |
11 | struct CCompressionMethodMode
12 | {
13 | CRecordVector MethodSequence;
14 | UString MatchFinder;
15 | UInt32 Algo;
16 | UInt32 NumPasses;
17 | UInt32 NumFastBytes;
18 | bool NumMatchFinderCyclesDefined;
19 | UInt32 NumMatchFinderCycles;
20 | UInt32 DicSize;
21 | UInt32 MemSize;
22 | UInt32 Order;
23 |
24 | #ifndef _7ZIP_ST
25 | UInt32 NumThreads;
26 | #endif
27 | bool PasswordIsDefined;
28 | AString Password;
29 | bool IsAesMode;
30 | Byte AesKeyMode;
31 |
32 | CCompressionMethodMode():
33 | NumMatchFinderCyclesDefined(false),
34 | PasswordIsDefined(false),
35 | IsAesMode(false),
36 | AesKeyMode(3)
37 | {}
38 | };
39 |
40 | }}
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Zip/ZipHeader.cpp:
--------------------------------------------------------------------------------
1 | // Archive/Zip/Header.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "ZipHeader.h"
6 |
7 | namespace NArchive {
8 | namespace NZip {
9 |
10 | namespace NSignature
11 | {
12 | UInt32 kLocalFileHeader = 0x04034B50 + 1;
13 | UInt32 kDataDescriptor = 0x08074B50 + 1;
14 | UInt32 kCentralFileHeader = 0x02014B50 + 1;
15 | UInt32 kEndOfCentralDir = 0x06054B50 + 1;
16 | UInt32 kZip64EndOfCentralDir = 0x06064B50 + 1;
17 | UInt32 kZip64EndOfCentralDirLocator = 0x07064B50 + 1;
18 |
19 | class CMarkersInitializer
20 | {
21 | public:
22 | CMarkersInitializer()
23 | {
24 | kLocalFileHeader--;
25 | kDataDescriptor--;
26 | kCentralFileHeader--;
27 | kEndOfCentralDir--;
28 | kZip64EndOfCentralDir--;
29 | kZip64EndOfCentralDirLocator--;
30 | }
31 | };
32 | static CMarkersInitializer g_MarkerInitializer;
33 | }
34 |
35 | }}
36 |
37 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Zip/ZipItemEx.h:
--------------------------------------------------------------------------------
1 | // Archive/ZipItemEx.h
2 |
3 | #ifndef __ARCHIVE_ZIP_ITEMEX_H
4 | #define __ARCHIVE_ZIP_ITEMEX_H
5 |
6 | #include "ZipHeader.h"
7 | #include "ZipItem.h"
8 |
9 | namespace NArchive {
10 | namespace NZip {
11 |
12 | class CItemEx: public CItem
13 | {
14 | public:
15 | UInt32 FileHeaderWithNameSize;
16 | UInt16 LocalExtraSize;
17 |
18 | UInt64 GetLocalFullSize() const
19 | { return FileHeaderWithNameSize + LocalExtraSize + PackSize +
20 | (HasDescriptor() ? NFileHeader::kDataDescriptorSize : 0); };
21 | /*
22 | UInt64 GetLocalFullSize(bool isZip64) const
23 | { return FileHeaderWithNameSize + LocalExtraSize + PackSize +
24 | (HasDescriptor() ? (isZip64 ? NFileHeader::kDataDescriptor64Size : NFileHeader::kDataDescriptorSize) : 0); };
25 | */
26 | UInt64 GetLocalExtraPosition() const
27 | { return LocalHeaderPosition + FileHeaderWithNameSize; };
28 | UInt64 GetDataPosition() const
29 | { return GetLocalExtraPosition() + LocalExtraSize; };
30 | };
31 |
32 | }}
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Archive/Zip/ZipRegister.cpp:
--------------------------------------------------------------------------------
1 | // ZipRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/RegisterArc.h"
6 |
7 | #include "ZipHandler.h"
8 | static IInArchive *CreateArc() { return new NArchive::NZip::CHandler; }
9 | #ifndef EXTRACT_ONLY
10 | static IOutArchive *CreateArcOut() { return new NArchive::NZip::CHandler; }
11 | #else
12 | #define CreateArcOut 0
13 | #endif
14 |
15 | static CArcInfo g_ArcInfo =
16 | { L"zip", L"zip jar xpi odt ods docx xlsx", 0, 1, { 0x50, 0x4B, 0x03, 0x04 }, 4, false, CreateArc, CreateArcOut };
17 |
18 | REGISTER_ARC(Zip)
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/CMAKE/CMakeLists_ALL.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.6)
2 |
3 | project(p7zip)
4 |
5 | SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
6 | CACHE STRING "Where binaries and .dll files go" FORCE)
7 |
8 |
9 | IF(HAVE_WCHAR_H)
10 | OPTION(HAVE_UNICODE_WCHAR "Enable Unicode Support" YES)
11 | MARK_AS_ADVANCED(HAVE_UNICODE_WCHAR)
12 | ELSE(HAVE_WCHAR_H)
13 | SET(HAVE_UNICODE_WCHAR 0)
14 | ENDIF(HAVE_WCHAR_H)
15 |
16 | SET(HAVE_PTHREADS 0)
17 | FIND_PACKAGE(Threads)
18 | IF(WIN32 OR CMAKE_USE_PTHREADS_INIT)
19 | SET(HAVE_PTHREADS 1)
20 | ENDIF(WIN32 OR CMAKE_USE_PTHREADS_INIT)
21 |
22 | add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -DBREAK_HANDLER -DUNICODE -D_UNICODE)
23 |
24 |
25 | add_subdirectory(7za)
26 |
27 | add_subdirectory(7zG)
28 |
29 | add_subdirectory(7zFM)
30 |
31 |
32 | add_subdirectory(Format7zFree bin)
33 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/CMAKE/generate.sh:
--------------------------------------------------------------------------------
1 |
2 | doit()
3 | {
4 | cd ..
5 | rm -fr "$3.$1"
6 | mkdir "$3.$1"
7 | cd "$3.$1"
8 | cp ../CMAKE/$4 CMakeLists.txt
9 |
10 | mkdir 7za 7zFM 7zG Format7zFree
11 |
12 | cp ../CMAKE/CMakeLists_7za.txt 7za/CMakeLists.txt
13 |
14 | cp ../CMAKE/CMakeLists_7zFM.txt 7zFM/CMakeLists.txt
15 |
16 | cp ../CMAKE/CMakeLists_7zG.txt 7zG/CMakeLists.txt
17 |
18 | cp ../CMAKE/CMakeLists_Format7zFree.txt Format7zFree/CMakeLists.txt
19 |
20 |
21 | cmake -G "$2" -DCMAKE_BUILD_TYPE=Debug
22 | #cmake -G "$2" -DCMAKE_BUILD_TYPE=Release
23 | }
24 |
25 | CURDIR=$PWD
26 |
27 | cd $CURDIR
28 | doit "Unix" "Unix Makefiles" "P7ZIP" "CMakeLists_ALL.txt"
29 |
30 | cd $CURDIR
31 | doit "codeblocks" "CodeBlocks - Unix Makefiles" "P7ZIP" "CMakeLists_ALL.txt"
32 |
33 | cd $CURDIR
34 | doit "KDevelop3" "KDevelop3" "P7ZIP" "CMakeLists_ALL.txt"
35 |
36 | cd $CURDIR
37 | doit "EclipseCDT4" "Eclipse CDT4 - Unix Makefiles" "P7ZIP" "CMakeLists_ALL.txt"
38 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/CMAKE/generate_xcode.sh:
--------------------------------------------------------------------------------
1 |
2 | doit()
3 | {
4 | cd ..
5 | rm -fr "$3.$1"
6 | mkdir "$3.$1"
7 | cd "$3.$1"
8 | cp ../CMAKE/$4 CMakeLists.txt
9 |
10 | mkdir 7za 7zFM 7zG Format7zFree
11 |
12 | cp ../CMAKE/CMakeLists_7za.txt 7za/CMakeLists.txt
13 |
14 | cp ../CMAKE/CMakeLists_7zFM.txt 7zFM/CMakeLists.txt
15 |
16 | cp ../CMAKE/CMakeLists_7zG.txt 7zG/CMakeLists.txt
17 |
18 | cp ../CMAKE/CMakeLists_Format7zFree.txt Format7zFree/CMakeLists.txt
19 |
20 |
21 | cmake -G "$2" -DCMAKE_BUILD_TYPE=Debug
22 | #cmake -G "$2" -DCMAKE_BUILD_TYPE=Release
23 | }
24 |
25 |
26 | CMAKE_OSX_ARCHITECTURES=i386
27 | export CMAKE_OSX_ARCHITECTURES
28 |
29 | CURDIR=$PWD
30 |
31 | cd $CURDIR
32 | doit "Xcode" "Xcode" "P7ZIP" "CMakeLists_ALL.txt"
33 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/FilePathAutoRename.h:
--------------------------------------------------------------------------------
1 | // Util/FilePathAutoRename.h
2 |
3 | #ifndef __FILEPATHAUTORENAME_H
4 | #define __FILEPATHAUTORENAME_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | bool AutoRenamePath(UString &fullProcessedPath);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/InOutTempBuffer.h:
--------------------------------------------------------------------------------
1 | // InOutTempBuffer.h
2 |
3 | #ifndef __IN_OUT_TEMP_BUFFER_H
4 | #define __IN_OUT_TEMP_BUFFER_H
5 |
6 | #include "../../Common/MyCom.h"
7 | #include "../../Windows/FileDir.h"
8 | #include "../../Windows/FileIO.h"
9 |
10 | #include "../IStream.h"
11 |
12 | class CInOutTempBuffer
13 | {
14 | NWindows::NFile::NDirectory::CTempFile _tempFile;
15 | NWindows::NFile::NIO::COutFile _outFile;
16 | Byte *_buf;
17 | UInt32 _bufPos;
18 | CSysString _tempFileName;
19 | bool _tempFileCreated;
20 | UInt64 _size;
21 | UInt32 _crc;
22 |
23 | bool WriteToFile(const void *data, UInt32 size);
24 | public:
25 | CInOutTempBuffer();
26 | ~CInOutTempBuffer();
27 | void Create();
28 |
29 | void InitWriting();
30 | bool Write(const void *data, UInt32 size);
31 |
32 | HRESULT WriteToStream(ISequentialOutStream *stream);
33 | UInt64 GetDataSize() const { return _size; }
34 | };
35 |
36 | class CSequentialOutTempBufferImp:
37 | public ISequentialOutStream,
38 | public CMyUnknownImp
39 | {
40 | CInOutTempBuffer *_buf;
41 | public:
42 | void Init(CInOutTempBuffer *buffer) { _buf = buffer; }
43 | MY_UNKNOWN_IMP
44 |
45 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
46 | };
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/LockedStream.cpp:
--------------------------------------------------------------------------------
1 | // LockedStream.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "LockedStream.h"
6 |
7 | HRESULT CLockedInStream::Read(UInt64 startPos, void *data, UInt32 size,
8 | UInt32 *processedSize)
9 | {
10 | NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
11 | RINOK(_stream->Seek(startPos, STREAM_SEEK_SET, NULL));
12 | return _stream->Read(data, size, processedSize);
13 | }
14 |
15 | STDMETHODIMP CLockedSequentialInStreamImp::Read(void *data, UInt32 size, UInt32 *processedSize)
16 | {
17 | UInt32 realProcessedSize = 0;
18 | HRESULT result = _lockedInStream->Read(_pos, data, size, &realProcessedSize);
19 | _pos += realProcessedSize;
20 | if (processedSize != NULL)
21 | *processedSize = realProcessedSize;
22 | return result;
23 | }
24 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/LockedStream.h:
--------------------------------------------------------------------------------
1 | // LockedStream.h
2 |
3 | #ifndef __LOCKEDSTREAM_H
4 | #define __LOCKEDSTREAM_H
5 |
6 | #include "../../Windows/Synchronization.h"
7 | #include "../../Common/MyCom.h"
8 | #include "../IStream.h"
9 |
10 | class CLockedInStream
11 | {
12 | CMyComPtr _stream;
13 | NWindows::NSynchronization::CCriticalSection _criticalSection;
14 | public:
15 | void Init(IInStream *stream)
16 | { _stream = stream; }
17 | HRESULT Read(UInt64 startPos, void *data, UInt32 size, UInt32 *processedSize);
18 | };
19 |
20 | class CLockedSequentialInStreamImp:
21 | public ISequentialInStream,
22 | public CMyUnknownImp
23 | {
24 | CLockedInStream *_lockedInStream;
25 | UInt64 _pos;
26 | public:
27 | void Init(CLockedInStream *lockedInStream, UInt64 startPos)
28 | {
29 | _lockedInStream = lockedInStream;
30 | _pos = startPos;
31 | }
32 |
33 | MY_UNKNOWN_IMP
34 |
35 | STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/MethodId.cpp:
--------------------------------------------------------------------------------
1 | // MethodId.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "MethodId.h"
6 | #include "../../Common/MyString.h"
7 |
8 | static inline wchar_t GetHex(Byte value)
9 | {
10 | return (wchar_t)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
11 | }
12 |
13 | UString ConvertMethodIdToString(UInt64 id)
14 | {
15 | wchar_t s[32];
16 | int len = 32;
17 | s[--len] = 0;
18 | do
19 | {
20 | s[--len] = GetHex((Byte)id & 0xF);
21 | id >>= 4;
22 | s[--len] = GetHex((Byte)id & 0xF);
23 | id >>= 4;
24 | }
25 | while (id != 0);
26 | return s + len;
27 | }
28 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/MethodId.h:
--------------------------------------------------------------------------------
1 | // MethodId.h
2 |
3 | #ifndef __7Z_METHOD_ID_H
4 | #define __7Z_METHOD_ID_H
5 |
6 | #include "../../Common/Types.h"
7 |
8 | typedef UInt64 CMethodId;
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/MethodProps.h:
--------------------------------------------------------------------------------
1 | // MethodProps.h
2 |
3 | #ifndef __7Z_METHOD_PROPS_H
4 | #define __7Z_METHOD_PROPS_H
5 |
6 | #include "../../Common/MyVector.h"
7 |
8 | #include "../../Windows/PropVariant.h"
9 |
10 | #include "MethodId.h"
11 |
12 | struct CProp
13 | {
14 | PROPID Id;
15 | NWindows::NCOM::CPropVariant Value;
16 | };
17 |
18 | struct CMethod
19 | {
20 | CMethodId Id;
21 | CObjectVector Props;
22 | };
23 |
24 | struct CMethodsMode
25 | {
26 | CObjectVector Methods;
27 | #ifndef _7ZIP_ST
28 | UInt32 NumThreads;
29 | #endif
30 |
31 | CMethodsMode()
32 | #ifndef _7ZIP_ST
33 | : NumThreads(1)
34 | #endif
35 | {}
36 | bool IsEmpty() const { return Methods.IsEmpty() ; }
37 | };
38 |
39 | HRESULT SetMethodProperties(const CMethod &method, const UInt64 *inSizeForReduce, IUnknown *coder);
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/OffsetStream.cpp:
--------------------------------------------------------------------------------
1 | // OffsetStream.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "Common/Defs.h"
6 | #include "OffsetStream.h"
7 |
8 | HRESULT COffsetOutStream::Init(IOutStream *stream, UInt64 offset)
9 | {
10 | _offset = offset;
11 | _stream = stream;
12 | return _stream->Seek(offset, STREAM_SEEK_SET, NULL);
13 | }
14 |
15 | STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
16 | {
17 | return _stream->Write(data, size, processedSize);
18 | }
19 |
20 | STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin,
21 | UInt64 *newPosition)
22 | {
23 | UInt64 absoluteNewPosition;
24 | if (seekOrigin == STREAM_SEEK_SET)
25 | offset += _offset;
26 | HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
27 | if (newPosition != NULL)
28 | *newPosition = absoluteNewPosition - _offset;
29 | return result;
30 | }
31 |
32 | STDMETHODIMP COffsetOutStream::SetSize(UInt64 newSize)
33 | {
34 | return _stream->SetSize(_offset + newSize);
35 | }
36 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/OffsetStream.h:
--------------------------------------------------------------------------------
1 | // OffsetStream.h
2 |
3 | #ifndef __OFFSETSTREAM_H
4 | #define __OFFSETSTREAM_H
5 |
6 | #include "Common/MyCom.h"
7 | #include "../IStream.h"
8 |
9 | class COffsetOutStream:
10 | public IOutStream,
11 | public CMyUnknownImp
12 | {
13 | UInt64 _offset;
14 | CMyComPtr _stream;
15 | public:
16 | HRESULT Init(IOutStream *stream, UInt64 offset);
17 |
18 | MY_UNKNOWN_IMP
19 |
20 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
21 | STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
22 | STDMETHOD(SetSize)(UInt64 newSize);
23 | };
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/ProgressMt.h:
--------------------------------------------------------------------------------
1 | // ProgressMt.h
2 |
3 | #ifndef __PROGRESSMT_H
4 | #define __PROGRESSMT_H
5 |
6 | #include "../../Common/MyCom.h"
7 | #include "../../Common/MyVector.h"
8 | #include "../../Windows/Synchronization.h"
9 |
10 | #include "../ICoder.h"
11 | #include "../IProgress.h"
12 |
13 | class CMtCompressProgressMixer
14 | {
15 | CMyComPtr _progress;
16 | CRecordVector InSizes;
17 | CRecordVector OutSizes;
18 | UInt64 TotalInSize;
19 | UInt64 TotalOutSize;
20 | public:
21 | NWindows::NSynchronization::CCriticalSection CriticalSection;
22 | void Init(int numItems, ICompressProgressInfo *progress);
23 | void Reinit(int index);
24 | HRESULT SetRatioInfo(int index, const UInt64 *inSize, const UInt64 *outSize);
25 | };
26 |
27 | class CMtCompressProgress:
28 | public ICompressProgressInfo,
29 | public CMyUnknownImp
30 | {
31 | CMtCompressProgressMixer *_progress;
32 | int _index;
33 | public:
34 | void Init(CMtCompressProgressMixer *progress, int index)
35 | {
36 | _progress = progress;
37 | _index = index;
38 | }
39 | void Reinit() { _progress->Reinit(_index); }
40 |
41 | MY_UNKNOWN_IMP
42 |
43 | STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
44 | };
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/ProgressUtils.cpp:
--------------------------------------------------------------------------------
1 | // ProgressUtils.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "ProgressUtils.h"
6 |
7 | CLocalProgress::CLocalProgress()
8 | {
9 | ProgressOffset = InSize = OutSize = 0;
10 | SendRatio = SendProgress = true;
11 | }
12 |
13 | void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
14 | {
15 | _ratioProgress.Release();
16 | _progress = progress;
17 | _progress.QueryInterface(IID_ICompressProgressInfo, &_ratioProgress);
18 | _inSizeIsMain = inSizeIsMain;
19 | }
20 |
21 | STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
22 | {
23 | UInt64 inSizeNew = InSize, outSizeNew = OutSize;
24 | if (inSize)
25 | inSizeNew += (*inSize);
26 | if (outSize)
27 | outSizeNew += (*outSize);
28 | if (SendRatio && _ratioProgress)
29 | {
30 | RINOK(_ratioProgress->SetRatioInfo(&inSizeNew, &outSizeNew));
31 | }
32 | inSizeNew += ProgressOffset;
33 | outSizeNew += ProgressOffset;
34 | if (SendProgress)
35 | return _progress->SetCompleted(_inSizeIsMain ? &inSizeNew : &outSizeNew);
36 | return S_OK;
37 | }
38 |
39 | HRESULT CLocalProgress::SetCur()
40 | {
41 | return SetRatioInfo(NULL, NULL);
42 | }
43 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/ProgressUtils.h:
--------------------------------------------------------------------------------
1 | // ProgressUtils.h
2 |
3 | #ifndef __PROGRESSUTILS_H
4 | #define __PROGRESSUTILS_H
5 |
6 | #include "../../Common/MyCom.h"
7 |
8 | #include "../ICoder.h"
9 | #include "../IProgress.h"
10 |
11 | class CLocalProgress:
12 | public ICompressProgressInfo,
13 | public CMyUnknownImp
14 | {
15 | CMyComPtr _progress;
16 | CMyComPtr _ratioProgress;
17 | bool _inSizeIsMain;
18 | public:
19 | UInt64 ProgressOffset;
20 | UInt64 InSize;
21 | UInt64 OutSize;
22 | bool SendRatio;
23 | bool SendProgress;
24 |
25 | CLocalProgress();
26 | void Init(IProgress *progress, bool inSizeIsMain);
27 | HRESULT SetCur();
28 |
29 | MY_UNKNOWN_IMP
30 |
31 | STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
32 | };
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/RegisterArc.h:
--------------------------------------------------------------------------------
1 | // RegisterArc.h
2 |
3 | #ifndef __REGISTER_ARC_H
4 | #define __REGISTER_ARC_H
5 |
6 | #include "../Archive/IArchive.h"
7 |
8 | typedef IInArchive * (*CreateInArchiveP)();
9 | typedef IOutArchive * (*CreateOutArchiveP)();
10 |
11 | struct CArcInfo
12 | {
13 | const wchar_t *Name;
14 | const wchar_t *Ext;
15 | const wchar_t *AddExt;
16 | Byte ClassId;
17 | Byte Signature[28]; // FIXME Byte Signature[16]; adding 22 bytes to insure kSignature[0x1A]!= 0 and kSignature[0x1B] != 0
18 | int SignatureSize;
19 | bool KeepName;
20 | CreateInArchiveP CreateInArchive;
21 | CreateOutArchiveP CreateOutArchive;
22 | };
23 |
24 | void RegisterArc(const CArcInfo *arcInfo);
25 |
26 | #define REGISTER_ARC_NAME(x) CRegister ## x
27 |
28 | #define REGISTER_ARC(x) struct REGISTER_ARC_NAME(x) { \
29 | REGISTER_ARC_NAME(x)() { RegisterArc(&g_ArcInfo); }}; \
30 | static REGISTER_ARC_NAME(x) g_RegisterArc;
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/RegisterCodec.h:
--------------------------------------------------------------------------------
1 | // RegisterCodec.h
2 |
3 | #ifndef __REGISTERCODEC_H
4 | #define __REGISTERCODEC_H
5 |
6 | #include "../Common/MethodId.h"
7 |
8 | typedef void * (*CreateCodecP)();
9 | struct CCodecInfo
10 | {
11 | CreateCodecP CreateDecoder;
12 | CreateCodecP CreateEncoder;
13 | CMethodId Id;
14 | const wchar_t *Name;
15 | UInt32 NumInStreams;
16 | bool IsFilter;
17 | };
18 |
19 | void RegisterCodec(const CCodecInfo *codecInfo);
20 |
21 | #define REGISTER_CODEC_NAME(x) CRegisterCodec ## x
22 |
23 | #define REGISTER_CODEC(x) struct REGISTER_CODEC_NAME(x) { \
24 | REGISTER_CODEC_NAME(x)() { RegisterCodec(&g_CodecInfo); }}; \
25 | static REGISTER_CODEC_NAME(x) g_RegisterCodec;
26 |
27 | #define REGISTER_CODECS_NAME(x) CRegisterCodecs ## x
28 | #define REGISTER_CODECS(x) struct REGISTER_CODECS_NAME(x) { \
29 | REGISTER_CODECS_NAME(x)() { for (int i = 0; i < sizeof(g_CodecsInfo) / sizeof(g_CodecsInfo[0]); i++) \
30 | RegisterCodec(&g_CodecsInfo[i]); }}; \
31 | static REGISTER_CODECS_NAME(x) g_RegisterCodecs;
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/StreamUtils.h:
--------------------------------------------------------------------------------
1 | // StreamUtils.h
2 |
3 | #ifndef __STREAMUTILS_H
4 | #define __STREAMUTILS_H
5 |
6 | #include "../IStream.h"
7 |
8 | HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size);
9 | HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size);
10 | HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size);
11 | HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size);
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/VirtThread.cpp:
--------------------------------------------------------------------------------
1 | // VirtThread.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "VirtThread.h"
6 |
7 | static THREAD_FUNC_DECL CoderThread(void *p)
8 | {
9 | for (;;)
10 | {
11 | CVirtThread *t = (CVirtThread *)p;
12 | t->StartEvent.Lock();
13 | if (t->ExitEvent)
14 | return 0;
15 | t->Execute();
16 | t->FinishedEvent.Set();
17 | }
18 | }
19 |
20 | WRes CVirtThread::Create()
21 | {
22 | RINOK(StartEvent.CreateIfNotCreated());
23 | RINOK(FinishedEvent.CreateIfNotCreated());
24 | StartEvent.Reset();
25 | FinishedEvent.Reset();
26 | ExitEvent = false;
27 | if (Thread.IsCreated())
28 | return S_OK;
29 | return Thread.Create(CoderThread, this);
30 | }
31 |
32 | void CVirtThread::Start()
33 | {
34 | ExitEvent = false;
35 | StartEvent.Set();
36 | }
37 |
38 | CVirtThread::~CVirtThread()
39 | {
40 | ExitEvent = true;
41 | if (StartEvent.IsCreated())
42 | StartEvent.Set();
43 | if (Thread.IsCreated())
44 | Thread.Wait();
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Common/VirtThread.h:
--------------------------------------------------------------------------------
1 | // VirtThread.h
2 |
3 | #ifndef __VIRTTHREAD_H
4 | #define __VIRTTHREAD_H
5 |
6 | #include "../../Windows/Synchronization.h"
7 | #include "../../Windows/Thread.h"
8 |
9 | struct CVirtThread
10 | {
11 | NWindows::NSynchronization::CAutoResetEvent StartEvent;
12 | NWindows::NSynchronization::CAutoResetEvent FinishedEvent;
13 | NWindows::CThread Thread;
14 | bool ExitEvent;
15 |
16 | ~CVirtThread();
17 | WRes Create();
18 | void Start();
19 | void WaitFinish() { FinishedEvent.Lock(); }
20 | virtual void Execute() = 0;
21 | };
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BZip2Crc.cpp:
--------------------------------------------------------------------------------
1 | // BZip2Crc.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "BZip2Crc.h"
6 |
7 | UInt32 CBZip2Crc::Table[256];
8 |
9 | static const UInt32 kBZip2CrcPoly = 0x04c11db7; /* AUTODIN II, Ethernet, & FDDI */
10 |
11 | void CBZip2Crc::InitTable()
12 | {
13 | for (UInt32 i = 0; i < 256; i++)
14 | {
15 | UInt32 r = (i << 24);
16 | for (int j = 8; j > 0; j--)
17 | r = (r & 0x80000000) ? ((r << 1) ^ kBZip2CrcPoly) : (r << 1);
18 | Table[i] = r;
19 | }
20 | }
21 |
22 | class CBZip2CrcTableInit
23 | {
24 | public:
25 | CBZip2CrcTableInit() { CBZip2Crc::InitTable(); }
26 | } g_BZip2CrcTableInit;
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BZip2Crc.h:
--------------------------------------------------------------------------------
1 | // BZip2Crc.h
2 |
3 | #ifndef __BZIP2_CRC_H
4 | #define __BZIP2_CRC_H
5 |
6 | #include "Common/Types.h"
7 |
8 | class CBZip2Crc
9 | {
10 | UInt32 _value;
11 | static UInt32 Table[256];
12 | public:
13 | static void InitTable();
14 | CBZip2Crc(): _value(0xFFFFFFFF) {};
15 | void Init() { _value = 0xFFFFFFFF; }
16 | void UpdateByte(Byte b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
17 | void UpdateByte(unsigned int b) { _value = Table[(_value >> 24) ^ b] ^ (_value << 8); }
18 | UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
19 | };
20 |
21 | class CBZip2CombinedCrc
22 | {
23 | UInt32 _value;
24 | public:
25 | CBZip2CombinedCrc(): _value(0){};
26 | void Init() { _value = 0; }
27 | void Update(UInt32 v) { _value = ((_value << 1) | (_value >> 31)) ^ v; }
28 | UInt32 GetDigest() const { return _value ; }
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BZip2Register.cpp:
--------------------------------------------------------------------------------
1 | // BZip2Register.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "BZip2Decoder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NBZip2::CDecoder); }
10 | #if !defined(EXTRACT_ONLY) && !defined(BZIP2_EXTRACT_ONLY)
11 | #include "BZip2Encoder.h"
12 | static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NBZip2::CEncoder); }
13 | #else
14 | #define CreateCodecOut 0
15 | #endif
16 |
17 | static CCodecInfo g_CodecInfo =
18 | { CreateCodec, CreateCodecOut, 0x040202, L"BZip2", 1, false };
19 |
20 | REGISTER_CODEC(BZip2)
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Bcj2Register.cpp:
--------------------------------------------------------------------------------
1 | // Bcj2Register.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "Bcj2Coder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CDecoder()); }
10 | #ifndef EXTRACT_ONLY
11 | static void *CreateCodecOut() { return (void *)(ICompressCoder2 *)(new NCompress::NBcj2::CEncoder()); }
12 | #else
13 | #define CreateCodecOut 0
14 | #endif
15 |
16 | static CCodecInfo g_CodecInfo =
17 | { CreateCodec, CreateCodecOut, 0x0303011B, L"BCJ2", 4, false };
18 |
19 | REGISTER_CODEC(BCJ2)
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BcjCoder.cpp:
--------------------------------------------------------------------------------
1 | // BcjCoder.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "BcjCoder.h"
6 |
7 | UInt32 CBCJ_x86_Encoder::SubFilter(Byte *data, UInt32 size)
8 | {
9 | return (UInt32)::x86_Convert(data, size, _bufferPos, &_prevMask, 1);
10 | }
11 |
12 | UInt32 CBCJ_x86_Decoder::SubFilter(Byte *data, UInt32 size)
13 | {
14 | return (UInt32)::x86_Convert(data, size, _bufferPos, &_prevMask, 0);
15 | }
16 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BcjCoder.h:
--------------------------------------------------------------------------------
1 | // BcjCoder.h
2 |
3 | #ifndef __COMPRESS_BCJ_CODER_H
4 | #define __COMPRESS_BCJ_CODER_H
5 |
6 | #include "../../../C/Bra.h"
7 |
8 | #include "BranchCoder.h"
9 |
10 | struct CBranch86
11 | {
12 | UInt32 _prevMask;
13 | void x86Init() { x86_Convert_Init(_prevMask); }
14 | };
15 |
16 | MyClassB(BCJ_x86, 0x01, 3, CBranch86 ,
17 | virtual void SubInit() { x86Init(); })
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BcjRegister.cpp:
--------------------------------------------------------------------------------
1 | // BcjRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "BcjCoder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressFilter *)(new CBCJ_x86_Decoder()); }
10 | #ifndef EXTRACT_ONLY
11 | static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new CBCJ_x86_Encoder()); }
12 | #else
13 | #define CreateCodecOut 0
14 | #endif
15 |
16 | static CCodecInfo g_CodecInfo =
17 | { CreateCodec, CreateCodecOut, 0x03030103, L"BCJ", 1, true };
18 |
19 | REGISTER_CODEC(BCJ)
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BitlDecoder.cpp:
--------------------------------------------------------------------------------
1 | // BitlDecoder.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "BitlDecoder.h"
6 |
7 | namespace NBitl {
8 |
9 | Byte kInvertTable[256];
10 |
11 | struct CInverterTableInitializer
12 | {
13 | CInverterTableInitializer()
14 | {
15 | for (int i = 0; i < 256; i++)
16 | {
17 | int x = ((i & 0x55) << 1) | ((i & 0xAA) >> 1);
18 | x = ((x & 0x33) << 2) | ((x & 0xCC) >> 2);
19 | kInvertTable[i] = (Byte)(((x & 0x0F) << 4) | ((x & 0xF0) >> 4));
20 | }
21 | }
22 | } g_InverterTableInitializer;
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BranchCoder.cpp:
--------------------------------------------------------------------------------
1 | // BranchCoder.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "BranchCoder.h"
6 |
7 | STDMETHODIMP CBranchConverter::Init()
8 | {
9 | _bufferPos = 0;
10 | SubInit();
11 | return S_OK;
12 | }
13 |
14 | STDMETHODIMP_(UInt32) CBranchConverter::Filter(Byte *data, UInt32 size)
15 | {
16 | UInt32 processedSize = SubFilter(data, size);
17 | _bufferPos += processedSize;
18 | return processedSize;
19 | }
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BranchMisc.h:
--------------------------------------------------------------------------------
1 | // BranchMisc.h
2 |
3 | #ifndef __COMPRESS_BRANCH_MISC_H
4 | #define __COMPRESS_BRANCH_MISC_H
5 |
6 | #include "BranchCoder.h"
7 |
8 | MyClassA(BC_ARM, 0x05, 1)
9 | MyClassA(BC_ARMT, 0x07, 1)
10 | MyClassA(BC_PPC, 0x02, 5)
11 | MyClassA(BC_SPARC, 0x08, 5)
12 | MyClassA(BC_IA64, 0x04, 1)
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/BranchRegister.cpp:
--------------------------------------------------------------------------------
1 | // BranchRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "BranchMisc.h"
8 |
9 | #define CREATE_CODEC(x) \
10 | static void *CreateCodec ## x() { return (void *)(ICompressFilter *)(new C ## x ## _Decoder); } \
11 | static void *CreateCodec ## x ## Out() { return (void *)(ICompressFilter *)(new C ## x ## _Encoder); }
12 |
13 | CREATE_CODEC(BC_PPC)
14 | CREATE_CODEC(BC_IA64)
15 | CREATE_CODEC(BC_ARM)
16 | CREATE_CODEC(BC_ARMT)
17 | CREATE_CODEC(BC_SPARC)
18 |
19 | #define METHOD_ITEM(x, id1, id2, name) { CreateCodec ## x, CreateCodec ## x ## Out, 0x03030000 + (id1 * 256) + id2, name, 1, true }
20 |
21 | static CCodecInfo g_CodecsInfo[] =
22 | {
23 | METHOD_ITEM(BC_PPC, 0x02, 0x05, L"PPC"),
24 | METHOD_ITEM(BC_IA64, 0x04, 1, L"IA64"),
25 | METHOD_ITEM(BC_ARM, 0x05, 1, L"ARM"),
26 | METHOD_ITEM(BC_ARMT, 0x07, 1, L"ARMT"),
27 | METHOD_ITEM(BC_SPARC, 0x08, 0x05, L"SPARC")
28 | };
29 |
30 | REGISTER_CODECS(Branch)
31 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/CopyCoder.h:
--------------------------------------------------------------------------------
1 | // Compress/CopyCoder.h
2 |
3 | #ifndef __COMPRESS_COPY_CODER_H
4 | #define __COMPRESS_COPY_CODER_H
5 |
6 | #include "../../Common/MyCom.h"
7 |
8 | #include "../ICoder.h"
9 |
10 | namespace NCompress {
11 |
12 | class CCopyCoder:
13 | public ICompressCoder,
14 | public ICompressGetInStreamProcessedSize,
15 | public CMyUnknownImp
16 | {
17 | Byte *_buffer;
18 | public:
19 | UInt64 TotalSize;
20 | CCopyCoder(): TotalSize(0), _buffer(0) {};
21 | ~CCopyCoder();
22 |
23 | MY_UNKNOWN_IMP1(ICompressGetInStreamProcessedSize)
24 |
25 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
26 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
27 | STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
28 | };
29 |
30 | HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
31 |
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/CopyRegister.cpp:
--------------------------------------------------------------------------------
1 | // CopyRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "CopyCoder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::CCopyCoder); }
10 |
11 | static CCodecInfo g_CodecInfo =
12 | { CreateCodec, CreateCodec, 0x00, L"Copy", 1, false };
13 |
14 | REGISTER_CODEC(Copy)
15 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Deflate64Register.cpp:
--------------------------------------------------------------------------------
1 | // Deflate64Register.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "DeflateDecoder.h"
8 |
9 | static void *CreateCodecDeflate64() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder64); }
10 | #if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
11 | #include "DeflateEncoder.h"
12 | static void *CreateCodecOutDeflate64() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NEncoder::CCOMCoder64); }
13 | #else
14 | #define CreateCodecOutDeflate64 0
15 | #endif
16 |
17 | static CCodecInfo g_CodecInfo =
18 | { CreateCodecDeflate64, CreateCodecOutDeflate64, 0x040109, L"Deflate64", 1, false };
19 |
20 | REGISTER_CODEC(Deflate64)
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/DeflateRegister.cpp:
--------------------------------------------------------------------------------
1 | // DeflateRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "DeflateDecoder.h"
8 |
9 | static void *CreateCodecDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NDecoder::CCOMCoder); }
10 |
11 | #if !defined(EXTRACT_ONLY) && !defined(DEFLATE_EXTRACT_ONLY)
12 | #include "DeflateEncoder.h"
13 | static void *CreateCodecOutDeflate() { return (void *)(ICompressCoder *)(new NCompress::NDeflate::NEncoder::CCOMCoder); }
14 | #else
15 | #define CreateCodecOutDeflate 0
16 | #endif
17 |
18 | static CCodecInfo g_CodecInfo =
19 | { CreateCodecDeflate, CreateCodecOutDeflate, 0x040108, L"Deflate", 1, false };
20 |
21 | REGISTER_CODEC(Deflate)
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/DllExports.cpp:
--------------------------------------------------------------------------------
1 | // DllExports.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/MyInitGuid.h"
6 |
7 | #include "../ICoder.h"
8 |
9 | #include "../Common/RegisterCodec.h"
10 |
11 | static const unsigned int kNumCodecsMax = 32;
12 | unsigned int g_NumCodecs = 0;
13 | const CCodecInfo *g_Codecs[kNumCodecsMax];
14 | void RegisterCodec(const CCodecInfo *codecInfo)
15 | {
16 | if (g_NumCodecs < kNumCodecsMax)
17 | g_Codecs[g_NumCodecs++] = codecInfo;
18 | }
19 |
20 | #ifdef _WIN32
21 | extern "C"
22 | BOOL WINAPI DllMain(HINSTANCE /* hInstance */, DWORD /* dwReason */, LPVOID /*lpReserved*/)
23 | {
24 | return TRUE;
25 | }
26 | #endif
27 |
28 | static const UInt16 kDecodeId = 0x2790;
29 |
30 | DEFINE_GUID(CLSID_CCodec,
31 | 0x23170F69, 0x40C1, kDecodeId, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
32 |
33 | STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject);
34 |
35 | STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
36 | {
37 | return CreateCoder(clsid, iid, outObject);
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/DllExports2.cpp:
--------------------------------------------------------------------------------
1 | // DllExports.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../Common/MyInitGuid.h"
6 |
7 | #include "../ICoder.h"
8 |
9 | #include "../Common/RegisterCodec.h"
10 |
11 | extern "C"
12 | BOOL WINAPI DllMain(HINSTANCE /* hInstance */, DWORD /* dwReason */, LPVOID /*lpReserved*/)
13 | {
14 | return TRUE;
15 | }
16 |
17 | static const UInt16 kDecodeId = 0x2790;
18 |
19 | DEFINE_GUID(CLSID_CCodec,
20 | 0x23170F69, 0x40C1, kDecodeId, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
21 |
22 | STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject);
23 |
24 | STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
25 | {
26 | return CreateCoder(clsid, iid, outObject);
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/ImplodeHuffmanDecoder.h:
--------------------------------------------------------------------------------
1 | // ImplodeHuffmanDecoder.h
2 |
3 | #ifndef __IMPLODE_HUFFMAN_DECODER_H
4 | #define __IMPLODE_HUFFMAN_DECODER_H
5 |
6 | #include "../Common/InBuffer.h"
7 |
8 | #include "BitlDecoder.h"
9 |
10 | namespace NCompress {
11 | namespace NImplode {
12 | namespace NHuffman {
13 |
14 | const int kNumBitsInLongestCode = 16;
15 |
16 | typedef NBitl::CDecoder CInBit;
17 |
18 | class CDecoder
19 | {
20 | UInt32 m_Limitits[kNumBitsInLongestCode + 2]; // m_Limitits[i] = value limit for symbols with length = i
21 | UInt32 m_Positions[kNumBitsInLongestCode + 2]; // m_Positions[i] = index in m_Symbols[] of first symbol with length = i
22 | UInt32 m_NumSymbols; // number of symbols in m_Symbols
23 | UInt32 *m_Symbols; // symbols: at first with len=1 then 2, ... 15.
24 | public:
25 | CDecoder(UInt32 numSymbols);
26 | ~CDecoder();
27 |
28 | bool SetCodeLengths(const Byte *codeLengths);
29 | UInt32 DecodeSymbol(CInBit *inStream);
30 | };
31 |
32 | }}}
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h:
--------------------------------------------------------------------------------
1 | // LzmaBenchCon.h
2 |
3 | #ifndef __LZMABENCHCON_H
4 | #define __LZMABENCHCON_H
5 |
6 | #include
7 | #include "../../../Common/Types.h"
8 | #ifdef EXTERNAL_LZMA
9 | #include "../../UI/Common/LoadCodecs.h"
10 | #endif
11 | HRESULT LzmaBenchCon(
12 | #ifdef EXTERNAL_LZMA
13 | CCodecs *codecs,
14 | #endif
15 | FILE *f, UInt32 numIterations, UInt32 numThreads, UInt32 dictionary);
16 |
17 | HRESULT CrcBenchCon(FILE *f, UInt32 numIterations, UInt32 numThreads, UInt32 dictionary);
18 |
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/LzOutWindow.cpp:
--------------------------------------------------------------------------------
1 | // LzOutWindow.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "LzOutWindow.h"
6 |
7 | void CLzOutWindow::Init(bool solid)
8 | {
9 | if (!solid)
10 | COutBuffer::Init();
11 | #ifdef _NO_EXCEPTIONS
12 | ErrorCode = S_OK;
13 | #endif
14 | }
15 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Lzma2Encoder.h:
--------------------------------------------------------------------------------
1 | // Lzma2Encoder.h
2 |
3 | #ifndef __LZMA2_ENCODER_H
4 | #define __LZMA2_ENCODER_H
5 |
6 | #include "../../../C/Lzma2Enc.h"
7 |
8 | #include "../../Common/MyCom.h"
9 |
10 | #include "../ICoder.h"
11 |
12 | namespace NCompress {
13 | namespace NLzma2 {
14 |
15 | class CEncoder:
16 | public ICompressCoder,
17 | public ICompressSetCoderProperties,
18 | public ICompressWriteCoderProperties,
19 | public CMyUnknownImp
20 | {
21 | CLzma2EncHandle _encoder;
22 | public:
23 | MY_UNKNOWN_IMP2(ICompressSetCoderProperties, ICompressWriteCoderProperties)
24 |
25 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
26 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
27 | STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
28 | STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
29 |
30 | CEncoder();
31 | virtual ~CEncoder();
32 | };
33 |
34 | }}
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Lzma2Register.cpp:
--------------------------------------------------------------------------------
1 | // Lzma2Register.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "Lzma2Decoder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NLzma2::CDecoder); }
10 | #ifndef EXTRACT_ONLY
11 | #include "Lzma2Encoder.h"
12 | static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NLzma2::CEncoder); }
13 | #else
14 | #define CreateCodecOut 0
15 | #endif
16 |
17 | static CCodecInfo g_CodecInfo =
18 | { CreateCodec, CreateCodecOut, 0x21, L"LZMA2", 1, false };
19 |
20 | REGISTER_CODEC(LZMA2)
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/LzmaEncoder.h:
--------------------------------------------------------------------------------
1 | // LzmaEncoder.h
2 |
3 | #ifndef __LZMA_ENCODER_H
4 | #define __LZMA_ENCODER_H
5 |
6 | #include "../../../C/LzmaEnc.h"
7 |
8 | #include "../../Common/MyCom.h"
9 |
10 | #include "../ICoder.h"
11 |
12 | namespace NCompress {
13 | namespace NLzma {
14 |
15 | class CEncoder:
16 | public ICompressCoder,
17 | public ICompressSetCoderProperties,
18 | public ICompressWriteCoderProperties,
19 | public CMyUnknownImp
20 | {
21 | CLzmaEncHandle _encoder;
22 | public:
23 | MY_UNKNOWN_IMP2(ICompressSetCoderProperties, ICompressWriteCoderProperties)
24 |
25 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
26 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
27 | STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
28 | STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
29 |
30 | CEncoder();
31 | virtual ~CEncoder();
32 | };
33 |
34 | }}
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/LzmaRegister.cpp:
--------------------------------------------------------------------------------
1 | // LzmaRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "LzmaDecoder.h"
8 |
9 | static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NLzma::CDecoder); }
10 | #ifndef EXTRACT_ONLY
11 | #include "LzmaEncoder.h"
12 | static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NLzma::CEncoder); }
13 | #else
14 | #define CreateCodecOut 0
15 | #endif
16 |
17 | static CCodecInfo g_CodecInfo =
18 | { CreateCodec, CreateCodecOut, 0x030101, L"LZMA", 1, false };
19 |
20 | REGISTER_CODEC(LZMA)
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Lzx86Converter.h:
--------------------------------------------------------------------------------
1 | // Lzx86Converter.h
2 |
3 | #ifndef __LZX_86_CONVERTER_H
4 | #define __LZX_86_CONVERTER_H
5 |
6 | #include "../../Common/MyCom.h"
7 |
8 | #include "../IStream.h"
9 |
10 | namespace NCompress {
11 | namespace NLzx {
12 |
13 | const int kUncompressedBlockSize = 1 << 15;
14 |
15 | class Cx86ConvertOutStream:
16 | public ISequentialOutStream,
17 | public CMyUnknownImp
18 | {
19 | CMyComPtr m_Stream;
20 | UInt32 m_ProcessedSize;
21 | UInt32 m_Pos;
22 | UInt32 m_TranslationSize;
23 | bool m_TranslationMode;
24 | Byte m_Buffer[kUncompressedBlockSize];
25 |
26 | void MakeTranslation();
27 | public:
28 | void SetStream(ISequentialOutStream *outStream) { m_Stream = outStream; }
29 | void ReleaseStream() { m_Stream.Release(); }
30 | void Init(bool translationMode, UInt32 translationSize)
31 | {
32 | m_TranslationMode = translationMode;
33 | m_TranslationSize = translationSize;
34 | m_ProcessedSize = 0;
35 | m_Pos = 0;
36 | }
37 | HRESULT Flush();
38 |
39 | MY_UNKNOWN_IMP
40 |
41 | STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
42 | };
43 |
44 | }}
45 |
46 | #endif
47 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/PpmdEncoder.h:
--------------------------------------------------------------------------------
1 | // PpmdEncoder.h
2 | // 2009-03-11 : Igor Pavlov : Public domain
3 |
4 | #ifndef __COMPRESS_PPMD_ENCODER_H
5 | #define __COMPRESS_PPMD_ENCODER_H
6 |
7 | #include "../../../C/Ppmd7.h"
8 |
9 | #include "../../Common/MyCom.h"
10 |
11 | #include "../ICoder.h"
12 |
13 | #include "../Common/CWrappers.h"
14 |
15 | namespace NCompress {
16 | namespace NPpmd {
17 |
18 | class CEncoder :
19 | public ICompressCoder,
20 | public ICompressSetCoderProperties,
21 | public ICompressWriteCoderProperties,
22 | public CMyUnknownImp
23 | {
24 | Byte *_inBuf;
25 | CByteOutBufWrap _outStream;
26 | CPpmd7z_RangeEnc _rangeEnc;
27 | CPpmd7 _ppmd;
28 |
29 | UInt32 _usedMemSize;
30 | Byte _order;
31 |
32 | public:
33 | MY_UNKNOWN_IMP2(
34 | ICompressSetCoderProperties,
35 | ICompressWriteCoderProperties)
36 |
37 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
38 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
39 | STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
40 | STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
41 |
42 | CEncoder();
43 | ~CEncoder();
44 | };
45 |
46 | }}
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/PpmdRegister.cpp:
--------------------------------------------------------------------------------
1 | // PpmdRegister.cpp
2 | // 2009-05-30 : Igor Pavlov : Public domain
3 |
4 | #include "StdAfx.h"
5 |
6 | #include "../Common/RegisterCodec.h"
7 |
8 | #include "PpmdDecoder.h"
9 |
10 | static void *CreateCodec() { return (void *)(ICompressCoder *)(new NCompress::NPpmd::CDecoder); }
11 | #ifndef EXTRACT_ONLY
12 | #include "PpmdEncoder.h"
13 | static void *CreateCodecOut() { return (void *)(ICompressCoder *)(new NCompress::NPpmd::CEncoder); }
14 | #else
15 | #define CreateCodecOut 0
16 | #endif
17 |
18 | static CCodecInfo g_CodecInfo =
19 | { CreateCodec, CreateCodecOut, 0x030401, L"PPMD", 1, false };
20 |
21 | REGISTER_CODEC(PPMD)
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/Rar/makefile:
--------------------------------------------------------------------------------
1 | PROG=../../../../bin/Codecs/Rar29.so
2 |
3 | LOCAL_FLAGS=$(CC_SHARED) -DUNICODE -D_UNICODE
4 |
5 | MY_WINDOWS=
6 |
7 | include ../../../../makefile.crc32
8 | include ../../../../makefile.machine
9 |
10 | LOCAL_SHARED=$(LINK_SHARED)
11 | LIBS=$(LOCAL_LIBS)
12 |
13 | OBJS = \
14 | MyWindows.o \
15 | CRC.o\
16 | MyVector.o\
17 | CodecExports.o \
18 | DllExports.o \
19 | Rar1Decoder.o \
20 | Rar2Decoder.o \
21 | Rar3Decoder.o \
22 | Rar3Vm.o \
23 | RarCodecsRegister.o \
24 | $(OBJ_CRC32) \
25 | InBuffer.o \
26 | OutBuffer.o \
27 | StreamUtils.o \
28 | LzOutWindow.o \
29 | Ppmd7.o \
30 | Ppmd7Dec.o \
31 | Alloc.o
32 |
33 | include ../../../../makefile.glb
34 |
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/RarCodecsRegister.cpp:
--------------------------------------------------------------------------------
1 | // RarCodecsRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 |
7 | #include "Rar1Decoder.h"
8 | #include "Rar2Decoder.h"
9 | #include "Rar3Decoder.h"
10 |
11 | #define CREATE_CODEC(x) static void *CreateCodec ## x() { return (void *)(ICompressCoder *)(new NCompress::NRar ## x::CDecoder); }
12 |
13 | CREATE_CODEC(1)
14 | CREATE_CODEC(2)
15 | CREATE_CODEC(3)
16 |
17 | #define RAR_CODEC(x, name) { CreateCodec ## x, 0, 0x040300 + x, L"Rar" name, 1, false }
18 |
19 | static CCodecInfo g_CodecsInfo[] =
20 | {
21 | RAR_CODEC(1, L"1"),
22 | RAR_CODEC(2, L"2"),
23 | RAR_CODEC(3, L"3"),
24 | };
25 |
26 | REGISTER_CODECS(Rar)
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/ShrinkDecoder.h:
--------------------------------------------------------------------------------
1 | // ShrinkDecoder.h
2 |
3 | #ifndef __COMPRESS_SHRINK_DECODER_H
4 | #define __COMPRESS_SHRINK_DECODER_H
5 |
6 | #include "../../Common/MyCom.h"
7 |
8 | #include "../ICoder.h"
9 |
10 | namespace NCompress {
11 | namespace NShrink {
12 |
13 | const int kNumMaxBits = 13;
14 | const UInt32 kNumItems = 1 << kNumMaxBits;
15 |
16 | class CDecoder :
17 | public ICompressCoder,
18 | public CMyUnknownImp
19 | {
20 | UInt16 _parents[kNumItems];
21 | Byte _suffixes[kNumItems];
22 | Byte _stack[kNumItems];
23 | bool _isFree[kNumItems];
24 | bool _isParent[kNumItems];
25 |
26 | public:
27 | MY_UNKNOWN_IMP
28 |
29 | HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
30 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
31 |
32 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
33 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
34 | };
35 |
36 | }}
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Compress/ZDecoder.h:
--------------------------------------------------------------------------------
1 | // ZDecoder.h
2 |
3 | #ifndef __COMPRESS_Z_DECODER_H
4 | #define __COMPRESS_Z_DECODER_H
5 |
6 | #include "../../Common/MyCom.h"
7 |
8 | #include "../ICoder.h"
9 |
10 | namespace NCompress {
11 | namespace NZ {
12 |
13 | class CDecoder:
14 | public ICompressCoder,
15 | public ICompressSetDecoderProperties2,
16 | public CMyUnknownImp
17 | {
18 | UInt16 *_parents;
19 | Byte *_suffixes;
20 | Byte *_stack;
21 | Byte _properties;
22 | int _numMaxBits;
23 |
24 | public:
25 | CDecoder(): _parents(0), _suffixes(0), _stack(0), _properties(0), _numMaxBits(0) {};
26 | ~CDecoder();
27 | void Free();
28 |
29 | MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2)
30 |
31 | HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
32 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
33 |
34 | STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
35 | const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
36 |
37 | STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
38 | };
39 |
40 | }}
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/7zAesRegister.cpp:
--------------------------------------------------------------------------------
1 | // 7zAesRegister.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../Common/RegisterCodec.h"
6 | #include "7zAes.h"
7 |
8 | static void *CreateCodec() { return (void *)(ICompressFilter *)(new NCrypto::NSevenZ::CDecoder()); }
9 | #ifndef EXTRACT_ONLY
10 | static void *CreateCodecOut() { return (void *)(ICompressFilter *)(new NCrypto::NSevenZ::CEncoder()); }
11 | #else
12 | #define CreateCodecOut 0
13 | #endif
14 |
15 | static CCodecInfo g_CodecInfo =
16 | { CreateCodec, CreateCodecOut, 0x06F10701, L"7zAES", 1, true };
17 |
18 | REGISTER_CODEC(7zAES)
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/HmacSha1.h:
--------------------------------------------------------------------------------
1 | // HmacSha1.h
2 | // Implements HMAC-SHA-1 (RFC2104, FIPS-198)
3 |
4 | #ifndef __CRYPTO_HMAC_SHA1_H
5 | #define __CRYPTO_HMAC_SHA1_H
6 |
7 | #include "Sha1.h"
8 |
9 | namespace NCrypto {
10 | namespace NSha1 {
11 |
12 | // Use: SetKey(key, keySize); for () Update(data, size); Final(mac, macSize);
13 |
14 | class CHmac
15 | {
16 | CContext _sha;
17 | CContext _sha2;
18 | public:
19 | void SetKey(const Byte *key, size_t keySize);
20 | void Update(const Byte *data, size_t dataSize) { _sha.Update(data, dataSize); }
21 | void Final(Byte *mac, size_t macSize = kDigestSize);
22 | };
23 |
24 | class CHmac32
25 | {
26 | CContext32 _sha;
27 | CContext32 _sha2;
28 | public:
29 | void SetKey(const Byte *key, size_t keySize);
30 | void Update(const UInt32 *data, size_t dataSize) { _sha.Update(data, dataSize); }
31 | void Final(UInt32 *mac, size_t macSize = kDigestSizeInWords);
32 |
33 | // It'sa for hmac function. in,out: mac[kDigestSizeInWords].
34 | void GetLoopXorDigest(UInt32 *mac, UInt32 numIteration);
35 | };
36 |
37 | }}
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/MyAes.h:
--------------------------------------------------------------------------------
1 | // Crypto/MyAes.h
2 |
3 | #ifndef __CRYPTO_MY_AES_H
4 | #define __CRYPTO_MY_AES_H
5 |
6 | #include "../../../C/Aes.h"
7 |
8 | #include "../../Common/MyCom.h"
9 |
10 | #include "../ICoder.h"
11 |
12 | namespace NCrypto {
13 |
14 | class CAesCbcCoder:
15 | public ICompressFilter,
16 | public ICryptoProperties,
17 | public CMyUnknownImp
18 | {
19 | protected:
20 | AES_CODE_FUNC _codeFunc;
21 | AES_SET_KEY_FUNC _setKeyFunc;
22 | unsigned _offset;
23 | UInt32 _aes[AES_NUM_IVMRK_WORDS + 3];
24 | public:
25 | CAesCbcCoder();
26 | MY_UNKNOWN_IMP1(ICryptoProperties)
27 | STDMETHOD(Init)();
28 | STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
29 | STDMETHOD(SetKey)(const Byte *data, UInt32 size);
30 | STDMETHOD(SetInitVector)(const Byte *data, UInt32 size);
31 | };
32 |
33 | struct CAesCbcEncoder: public CAesCbcCoder { CAesCbcEncoder(); };
34 | struct CAesCbcDecoder: public CAesCbcCoder { CAesCbcDecoder(); };
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/Pbkdf2HmacSha1.h:
--------------------------------------------------------------------------------
1 | // Pbkdf2HmacSha1.h
2 | // Password-Based Key Derivation Function (RFC 2898, PKCS #5) based on HMAC-SHA-1
3 |
4 | #ifndef __CRYPTO_PBKDF2_HMAC_SHA1_H
5 | #define __CRYPTO_PBKDF2_HMAC_SHA1_H
6 |
7 | #include
8 | #include "../../Common/Types.h"
9 |
10 | namespace NCrypto {
11 | namespace NSha1 {
12 |
13 | void Pbkdf2Hmac(const Byte *pwd, size_t pwdSize, const Byte *salt, size_t saltSize,
14 | UInt32 numIterations, Byte *key, size_t keySize);
15 |
16 | void Pbkdf2Hmac32(const Byte *pwd, size_t pwdSize, const UInt32 *salt, size_t saltSize,
17 | UInt32 numIterations, UInt32 *key, size_t keySize);
18 |
19 | }}
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/RandGen.h:
--------------------------------------------------------------------------------
1 | // RandGen.h
2 |
3 | #ifndef __CRYPTO_RAND_GEN_H
4 | #define __CRYPTO_RAND_GEN_H
5 |
6 | #include "Sha1.h"
7 |
8 | class CRandomGenerator
9 | {
10 | Byte _buff[NCrypto::NSha1::kDigestSize];
11 | bool _needInit;
12 |
13 | void Init();
14 | public:
15 | CRandomGenerator(): _needInit(true) {};
16 | void Generate(Byte *data, unsigned size);
17 | };
18 |
19 | extern CRandomGenerator g_RandomGenerator;
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/RarAes.h:
--------------------------------------------------------------------------------
1 | // Crypto/RarAes.h
2 |
3 | #ifndef __CRYPTO_RAR_AES_H
4 | #define __CRYPTO_RAR_AES_H
5 |
6 | #include "../../../C/Aes.h"
7 |
8 | #include "Common/Buffer.h"
9 |
10 | #include "../IPassword.h"
11 |
12 | #include "MyAes.h"
13 |
14 | namespace NCrypto {
15 | namespace NRar29 {
16 |
17 | const UInt32 kRarAesKeySize = 16;
18 |
19 | class CDecoder:
20 | public CAesCbcDecoder,
21 | public ICompressSetDecoderProperties2,
22 | public ICryptoSetPassword
23 | {
24 | Byte _salt[8];
25 | bool _thereIsSalt;
26 | CByteBuffer buffer;
27 | Byte aesKey[kRarAesKeySize];
28 | Byte _aesInit[AES_BLOCK_SIZE];
29 | bool _needCalculate;
30 | bool _rar350Mode;
31 |
32 | void Calculate();
33 | public:
34 | MY_UNKNOWN_IMP2(
35 | ICryptoSetPassword,
36 | ICompressSetDecoderProperties2)
37 | STDMETHOD(Init)();
38 | STDMETHOD(CryptoSetPassword)(const Byte *aData, UInt32 aSize);
39 | STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
40 |
41 | CDecoder();
42 | void SetRar350Mode(bool rar350Mode) { _rar350Mode = rar350Mode; }
43 | };
44 |
45 | }}
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/Crypto/ZipStrong.h:
--------------------------------------------------------------------------------
1 | // Crypto/ZipStrong.h
2 |
3 | #ifndef __CRYPTO_ZIP_STRONG_H
4 | #define __CRYPTO_ZIP_STRONG_H
5 |
6 | #include "Common/Buffer.h"
7 |
8 | #include "../IPassword.h"
9 |
10 | #include "MyAes.h"
11 |
12 | namespace NCrypto {
13 | namespace NZipStrong {
14 |
15 | struct CKeyInfo
16 | {
17 | Byte MasterKey[32];
18 | UInt32 KeySize;
19 | void SetPassword(const Byte *data, UInt32 size);
20 | };
21 |
22 | class CBaseCoder:
23 | public CAesCbcDecoder,
24 | public ICryptoSetPassword
25 | {
26 | protected:
27 | CKeyInfo _key;
28 | CByteBuffer _buf;
29 | Byte *_bufAligned;
30 | public:
31 | STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
32 | };
33 |
34 | class CDecoder: public CBaseCoder
35 | {
36 | UInt32 _ivSize;
37 | Byte _iv[16];
38 | UInt32 _remSize;
39 | public:
40 | MY_UNKNOWN_IMP1(ICryptoSetPassword)
41 | HRESULT ReadHeader(ISequentialInStream *inStream, UInt32 crc, UInt64 unpackSize);
42 | HRESULT CheckPassword(bool &passwOK);
43 | };
44 |
45 | }}
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/IDecl.h:
--------------------------------------------------------------------------------
1 | // IDecl.h
2 |
3 | #ifndef __IDECL_H
4 | #define __IDECL_H
5 |
6 | #include "../Common/MyUnknown.h"
7 |
8 | #define DECL_INTERFACE_SUB(i, base, groupId, subId) \
9 | DEFINE_GUID(IID_ ## i, \
10 | 0x23170F69, 0x40C1, 0x278A, 0, 0, 0, (groupId), 0, (subId), 0, 0); \
11 | struct i: public base
12 |
13 | #define DECL_INTERFACE(i, groupId, subId) DECL_INTERFACE_SUB(i, IUnknown, groupId, subId)
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/IPassword.h:
--------------------------------------------------------------------------------
1 | // IPassword.h
2 |
3 | #ifndef __IPASSWORD_H
4 | #define __IPASSWORD_H
5 |
6 | #include "../Common/MyUnknown.h"
7 | #include "../Common/Types.h"
8 |
9 | #include "IDecl.h"
10 |
11 | #define PASSWORD_INTERFACE(i, x) DECL_INTERFACE(i, 5, x)
12 |
13 | PASSWORD_INTERFACE(ICryptoGetTextPassword, 0x10)
14 | {
15 | STDMETHOD(CryptoGetTextPassword)(BSTR *password) PURE;
16 | };
17 |
18 | PASSWORD_INTERFACE(ICryptoGetTextPassword2, 0x11)
19 | {
20 | STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password) PURE;
21 | };
22 |
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/IProgress.h:
--------------------------------------------------------------------------------
1 | // Interface/IProgress.h
2 |
3 | #ifndef __IPROGRESS_H
4 | #define __IPROGRESS_H
5 |
6 | #include "../Common/MyUnknown.h"
7 | #include "../Common/Types.h"
8 |
9 | #include "IDecl.h"
10 |
11 | #define INTERFACE_IProgress(x) \
12 | STDMETHOD(SetTotal)(UInt64 total) x; \
13 | STDMETHOD(SetCompleted)(const UInt64 *completeValue) x; \
14 |
15 | DECL_INTERFACE(IProgress, 0, 5)
16 | {
17 | INTERFACE_IProgress(PURE)
18 | };
19 |
20 | /*
21 | // {23170F69-40C1-278A-0000-000000050002}
22 | DEFINE_GUID(IID_IProgress2,
23 | 0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02);
24 | MIDL_INTERFACE("23170F69-40C1-278A-0000-000000050002")
25 | IProgress2: public IUnknown
26 | {
27 | public:
28 | STDMETHOD(SetTotal)(const UInt64 *total) PURE;
29 | STDMETHOD(SetCompleted)(const UInt64 *completeValue) PURE;
30 | };
31 | */
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/MyVersion.h:
--------------------------------------------------------------------------------
1 | #define MY_VER_MAJOR 9
2 | #define MY_VER_MINOR 20
3 | #define MY_VER_BUILD 0
4 | #define MY_VERSION "9.20"
5 | #define MY_7ZIP_VERSION "7-Zip 9.20"
6 | #define MY_DATE "2010-11-18"
7 | #define MY_COPYRIGHT "Copyright (c) 1999-2010 Igor Pavlov"
8 | #define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE
9 |
10 | #define P7ZIP_VERSION "9.20"
11 |
12 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/PREMAKE/generate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -x
4 |
5 | doit()
6 | {
7 | rm -fr P7ZIP.$1
8 | mkdir P7ZIP.$1
9 | cd P7ZIP.$1
10 | cp ../premake4.lua premake4.lua
11 | ${HOME}/PREMAKE/premake4 $1
12 | cd ..
13 | }
14 |
15 | doit codeblocks
16 | doit codelite
17 | doit gmake
18 |
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/QMAKE/test_emul/test_emul.pro:
--------------------------------------------------------------------------------
1 |
2 | QT -= core \
3 | gui
4 | TARGET = test_emul.x
5 | CONFIG += console
6 | CONFIG -= app_bundle
7 | TEMPLATE = app
8 | SOURCES += \
9 | ../../../myWindows/myGetTickCount.cpp \
10 | ../../../myWindows/wine_date_and_time.cpp \
11 | ../../../myWindows/myAddExeFlag.cpp \
12 | ../../../myWindows/mySplitCommandLine.cpp \
13 | ../../../myWindows/wine_GetXXXDefaultLangID.cpp \
14 | ../../../myWindows/test_emul.cpp \
15 | ../../../Common/MyString.cpp \
16 | ../../../Common/MyWindows.cpp \
17 | ../../../Common/MyVector.cpp \
18 | ../../../../C/7zCrc.c \
19 | ../../../../C/7zCrcOpt.c
20 |
21 |
22 | INCLUDEPATH = ../../../myWindows \
23 | ../../../ \
24 | ../../../include_windows
25 |
26 | DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE NDEBUG _REENTRANT ENV_UNIX BREAK_HANDLER UNICODE _UNICODE
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/TEST/TestUI/makefile:
--------------------------------------------------------------------------------
1 | PROG=../../../../bin/TestUI$(BINSUFFIX)
2 |
3 | LOCAL_FLAGS=\
4 | -DUNICODE -D_UNICODE \
5 | -DLANG \
6 | -DEXTERNAL_LZMA \
7 | -DEXTERNAL_CODECS \
8 | -DBENCH_MT \
9 | -I. \
10 | `wx-config --unicode=yes --cxxflags`
11 |
12 | include ../../../../makefile.crc32
13 | include ../../../../makefile.machine
14 |
15 | PCH_NAME=$(PRE_COMPILED_HEADER)
16 |
17 | LIBS=`wx-config --unicode=yes --libs` $(LOCAL_LIBS_DLL)
18 |
19 | C_OBJS = \
20 | Threads.o \
21 |
22 | OBJS=\
23 | PasswordDialog.o \
24 | PasswordDialog_rc.o \
25 | Window.o \
26 | Dialog.o \
27 | Controls.o \
28 | $(C_OBJS) \
29 | TestUI.o
30 |
31 |
32 | include ../../../../makefile.glb
33 |
34 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/TEST/TestUI/makefile.list:
--------------------------------------------------------------------------------
1 | SRCS=\
2 | ../../UI/FileManager/PasswordDialog.cpp \
3 | ../../UI/FileManager/PasswordDialog_rc.cpp \
4 | ../../../Windows/Window.cpp \
5 | ../../../Windows/Control/Dialog.cpp \
6 | ../../../Windows/Control/Controls.cpp \
7 | TestUI.cpp \
8 |
9 | SRCS_C=\
10 | ../../../../C/Threads.c
11 |
12 | include ../../../../makefile.rules
13 |
14 | TestUI.o : TestUI.cpp
15 | $(CXX) $(CXXFLAGS) TestUI.cpp
16 |
17 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Agent/UpdateCallbackAgent.h:
--------------------------------------------------------------------------------
1 | // UpdateCallbackAgent.h
2 |
3 | #ifndef __UPDATECALLBACKAGENT_H
4 | #define __UPDATECALLBACKAGENT_H
5 |
6 | #include "../Common/UpdateCallback.h"
7 | #include "IFolderArchive.h"
8 |
9 | class CUpdateCallbackAgent: public IUpdateCallbackUI
10 | {
11 | INTERFACE_IUpdateCallbackUI(;)
12 | CMyComPtr _cryptoGetTextPassword;
13 | CMyComPtr Callback;
14 | CMyComPtr _compressProgress;
15 | public:
16 | void SetCallback(IFolderArchiveUpdateCallback *callback);
17 | };
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Client7z/makefile:
--------------------------------------------------------------------------------
1 | PROG=../../../../bin/Client7z$(BINSUFFIX)
2 |
3 | LOCAL_FLAGS=-DUNICODE -D_UNICODE
4 |
5 | include ../../../../makefile.crc32
6 | include ../../../../makefile.machine
7 |
8 | PCH_NAME=$(PRE_COMPILED_HEADER)
9 |
10 | LIBS=$(LOCAL_LIBS_DLL)
11 |
12 | OBJS = \
13 | wine_date_and_time.o \
14 | MyWindows.o \
15 | DLL.o \
16 | FileDir.o \
17 | FileFind.o \
18 | FileIO.o \
19 | FileName.o \
20 | PropVariant.o \
21 | PropVariantConversions.o \
22 | IntToString.o \
23 | MyString.o \
24 | StringConvert.o \
25 | UTFConvert.o \
26 | MyVector.o \
27 | Wildcard.o \
28 | FileStreams.o \
29 | Threads.o \
30 | Client7z.o
31 |
32 | include ../../../../makefile.glb
33 |
34 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Client7z/makefile.list:
--------------------------------------------------------------------------------
1 | SRCS=\
2 | ../../../myWindows/wine_date_and_time.cpp \
3 | ../../../Windows/DLL.cpp \
4 | ../../../Windows/FileDir.cpp \
5 | ../../../Windows/FileFind.cpp \
6 | ../../../Windows/FileIO.cpp \
7 | ../../../Windows/FileName.cpp \
8 | ../../../Windows/PropVariant.cpp \
9 | ../../../Windows/PropVariantConversions.cpp \
10 | ../../../Common/IntToString.cpp \
11 | ../../../Common/MyWindows.cpp \
12 | ../../../Common/MyString.cpp \
13 | ../../../Common/StringConvert.cpp \
14 | ../../../Common/UTFConvert.cpp \
15 | ../../../Common/MyVector.cpp \
16 | ../../../Common/Wildcard.cpp \
17 | ../../Common/FileStreams.cpp \
18 | ./Client7z.cpp
19 |
20 | include ../../../../makefile.rules
21 |
22 | Client7z.o : ./Client7z.cpp
23 | $(CXX) $(CXXFLAGS) ./Client7z.cpp
24 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/ClientCodec/makefile:
--------------------------------------------------------------------------------
1 | PROG=../../../../bin/ClientCodec
2 |
3 | LOCAL_FLAGS=-DUNICODE -D_UNICODE
4 |
5 | include ../../../../makefile.crc32
6 | include ../../../../makefile.machine
7 |
8 | LIBS=$(LOCAL_LIBS_DLL)
9 |
10 | OBJS = \
11 | wine_date_and_time.o \
12 | MyWindows.o \
13 | ClientCodec.o \
14 | MyString.o \
15 | StringConvert.o \
16 | PropVariant.o \
17 | DLL.o
18 |
19 |
20 |
21 | .PHONY: test
22 |
23 | #CODER=../../../bin/Codecs/BZip2.so # OK - ICompressWriteCoderProperties : NOT Found
24 | #CODER=../../../bin/Codecs/Copy.so # OK - ICompressWriteCoderProperties : NOT Found
25 | #CODER=../../../bin/Codecs/Deflate.so # OK - ICompressWriteCoderProperties : NOT Found
26 | CODER=../../../bin/Codecs/LZMA.so # OK - ICompressWriteCoderProperties=5
27 | #CODER=../../../bin/Codecs/PPMD.so # KO Encoder - ICompressWriteCoderProperties=5
28 |
29 |
30 | test : all
31 | cp ClientCodec.cpp f1
32 | ../../../../bin/ClientCodec $(CODER) i
33 | ../../../../bin/ClientCodec $(CODER) e f1 f2
34 | ../../../../bin/ClientCodec $(CODER) d f2 f3
35 | diff -q f1 f3
36 |
37 | clean2:
38 | rm -f f1 f2 f3
39 |
40 | include ../../../../makefile.glb
41 |
42 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/ClientCodec/makefile.list:
--------------------------------------------------------------------------------
1 | SRCS=\
2 | ../../../myWindows/wine_date_and_time.cpp \
3 | ../../../Common/MyWindows.cpp \
4 | ../../../Common/MyString.cpp \
5 | ../../../Common/StringConvert.cpp \
6 | ../../../Windows/PropVariant.cpp \
7 | ../../../Windows/DLL.cpp \
8 | ./ClientCodec.cpp
9 |
10 | wine_date_and_time.o : ../../../myWindows/wine_date_and_time.cpp
11 | $(CXX) $(CXXFLAGS) ../../../myWindows/wine_date_and_time.cpp
12 | MyWindows.o : ../../../Common/MyWindows.cpp
13 | $(CXX) $(CXXFLAGS) ../../../Common/MyWindows.cpp
14 | MyString.o : ../../../Common/MyString.cpp
15 | $(CXX) $(CXXFLAGS) ../../../Common/MyString.cpp
16 | StringConvert.o : ../../../Common/StringConvert.cpp
17 | $(CXX) $(CXXFLAGS) ../../../Common/StringConvert.cpp
18 | PropVariant.o : ../../../Windows/PropVariant.cpp
19 | $(CXX) $(CXXFLAGS) ../../../Windows/PropVariant.cpp
20 | DLL.o : ../../../Windows/DLL.cpp
21 | $(CXX) $(CXXFLAGS) ../../../Windows/DLL.cpp
22 | ClientCodec.o : ./ClientCodec.cpp
23 | $(CXX) $(CXXFLAGS) ./ClientCodec.cpp
24 |
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/ArchiveName.h:
--------------------------------------------------------------------------------
1 | // ArchiveName.h
2 |
3 | #ifndef __ARCHIVENAME_H
4 | #define __ARCHIVENAME_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | UString CreateArchiveName(const UString &srcName, bool fromPrev, bool keepName);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/CompressCall.h:
--------------------------------------------------------------------------------
1 | // CompressCall.h
2 |
3 | #ifndef __COMPRESS_CALL_H
4 | #define __COMPRESS_CALL_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | UString GetQuotedString(const UString &s);
9 |
10 | extern HWND g_HWND;
11 | UString HResultToMessage(HRESULT errorCode);
12 |
13 | HRESULT CompressFiles(
14 | const UString &arcPathPrefix,
15 | const UString &arcName,
16 | const UString &arcType,
17 | const UStringVector &names,
18 | bool email, bool showDialog, bool waitFinish);
19 |
20 | HRESULT ExtractArchives(const UStringVector &arcPaths, const UString &outFolder, bool showDialog);
21 | HRESULT TestArchives(const UStringVector &arcPaths);
22 | HRESULT Benchmark();
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/DefaultName.cpp:
--------------------------------------------------------------------------------
1 | // DefaultName.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "DefaultName.h"
6 |
7 | static UString GetDefaultName3(const UString &fileName,
8 | const UString &extension, const UString &addSubExtension)
9 | {
10 | int extLength = extension.Length();
11 | int fileNameLength = fileName.Length();
12 | if (fileNameLength > extLength + 1)
13 | {
14 | int dotPos = fileNameLength - (extLength + 1);
15 | if (fileName[dotPos] == '.')
16 | if (extension.CompareNoCase(fileName.Mid(dotPos + 1)) == 0)
17 | return fileName.Left(dotPos) + addSubExtension;
18 | }
19 | int dotPos = fileName.ReverseFind(L'.');
20 | if (dotPos > 0)
21 | return fileName.Left(dotPos) + addSubExtension;
22 |
23 | if (addSubExtension.IsEmpty())
24 | return fileName + L"~";
25 | else
26 | return fileName + addSubExtension;
27 | }
28 |
29 | UString GetDefaultName2(const UString &fileName,
30 | const UString &extension, const UString &addSubExtension)
31 | {
32 | UString name = GetDefaultName3(fileName, extension, addSubExtension);
33 | name.TrimRight();
34 | return name;
35 | }
36 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/DefaultName.h:
--------------------------------------------------------------------------------
1 | // DefaultName.h
2 |
3 | #ifndef __DEFAULTNAME_H
4 | #define __DEFAULTNAME_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | UString GetDefaultName2(const UString &fileName,
9 | const UString &extension, const UString &addSubExtension);
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/EnumDirItems.h:
--------------------------------------------------------------------------------
1 | // EnumDirItems.h
2 |
3 | #ifndef __ENUM_DIR_ITEMS_H
4 | #define __ENUM_DIR_ITEMS_H
5 |
6 | #include "Common/Wildcard.h"
7 | #include "Windows/FileFind.h"
8 | #include "DirItem.h"
9 |
10 | void AddDirFileInfo(int phyParent, int logParent,
11 | const NWindows::NFile::NFind::CFileInfoW &fi, CObjectVector &dirItems);
12 |
13 | struct IEnumDirItemCallback
14 | {
15 | virtual HRESULT ScanProgress(UInt64 numFolders, UInt64 numFiles, const wchar_t *path) = 0;
16 | };
17 |
18 | HRESULT EnumerateItems(
19 | const NWildcard::CCensor &censor,
20 | CDirItems &dirItems,
21 | IEnumDirItemCallback *callback,
22 | UStringVector &errorPaths,
23 | CRecordVector &errorCodes);
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/ExitCode.h:
--------------------------------------------------------------------------------
1 | // ExitCode.h
2 |
3 | #ifndef __EXIT_CODE_H
4 | #define __EXIT_CODE_H
5 |
6 | namespace NExitCode {
7 |
8 | enum EEnum {
9 |
10 | kSuccess = 0, // Successful operation
11 | kWarning = 1, // Non fatal error(s) occurred
12 | kFatalError = 2, // A fatal error occurred
13 | // kCRCError = 3, // A CRC error occurred when unpacking
14 | // kLockedArchive = 4, // Attempt to modify an archive previously locked
15 | // kWriteError = 5, // Write to disk error
16 | // kOpenError = 6, // Open file error
17 | kUserError = 7, // Command line option error
18 | kMemoryError = 8, // Not enough memory for operation
19 | // kCreateFileError = 9, // Create file error
20 |
21 | kUserBreak = 255 // User stopped the process
22 |
23 | };
24 |
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/ExtractMode.h:
--------------------------------------------------------------------------------
1 | // ExtractMode.h
2 |
3 | #ifndef __EXTRACT_MODE_H
4 | #define __EXTRACT_MODE_H
5 |
6 | namespace NExtract {
7 |
8 | namespace NPathMode
9 | {
10 | enum EEnum
11 | {
12 | kFullPathnames,
13 | kCurrentPathnames,
14 | kNoPathnames
15 | };
16 | }
17 |
18 | namespace NOverwriteMode
19 | {
20 | enum EEnum
21 | {
22 | kAskBefore,
23 | kWithoutPrompt,
24 | kSkipExisting,
25 | kAutoRename,
26 | kAutoRenameExisting
27 | };
28 | }
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/ExtractingFilePath.h:
--------------------------------------------------------------------------------
1 | // ExtractingFilePath.h
2 |
3 | #ifndef __EXTRACTING_FILE_PATH_H
4 | #define __EXTRACTING_FILE_PATH_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | UString MakePathNameFromParts(const UStringVector &parts);
9 | void MakeCorrectPath(UStringVector &pathParts);
10 | UString GetCorrectFsPath(const UString &path);
11 | UString GetCorrectFullFsPath(const UString &path);
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/PropIDUtils.h:
--------------------------------------------------------------------------------
1 | // PropIDUtils.h
2 |
3 | #ifndef __PROPID_UTILS_H
4 | #define __PROPID_UTILS_H
5 |
6 | #include "Common/MyString.h"
7 | #include "Common/Types.h"
8 |
9 | void ConvertUInt32ToHex(UInt32 value, wchar_t *s);
10 | UString ConvertPropertyToString(const PROPVARIANT &propVariant, PROPID propID, bool full = true);
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/Property.h:
--------------------------------------------------------------------------------
1 | // Property.h
2 |
3 | #ifndef __PROPERTY_H
4 | #define __PROPERTY_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | struct CProperty
9 | {
10 | UString Name;
11 | UString Value;
12 | };
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/SetProperties.h:
--------------------------------------------------------------------------------
1 | // SetProperties.h
2 |
3 | #ifndef __SETPROPERTIES_H
4 | #define __SETPROPERTIES_H
5 |
6 | #include "Property.h"
7 |
8 | HRESULT SetProperties(IUnknown *unknown, const CObjectVector &properties);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/SortUtils.cpp:
--------------------------------------------------------------------------------
1 | // SortUtils.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "SortUtils.h"
6 | #include "Common/Wildcard.h"
7 |
8 | static int CompareStrings(const int *p1, const int *p2, void *param)
9 | {
10 | const UStringVector &strings = *(const UStringVector *)param;
11 | return CompareFileNames(strings[*p1], strings[*p2]);
12 | }
13 |
14 | void SortFileNames(const UStringVector &strings, CIntVector &indices)
15 | {
16 | indices.Clear();
17 | int numItems = strings.Size();
18 | indices.Reserve(numItems);
19 | for(int i = 0; i < numItems; i++)
20 | indices.Add(i);
21 | indices.Sort(CompareStrings, (void *)&strings);
22 | }
23 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/SortUtils.h:
--------------------------------------------------------------------------------
1 | // SortUtils.h
2 |
3 | #ifndef __SORTUTLS_H
4 | #define __SORTUTLS_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | void SortFileNames(const UStringVector &strings, CIntVector &indices);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/TempFiles.cpp:
--------------------------------------------------------------------------------
1 | // TempFiles.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "TempFiles.h"
6 |
7 | #include "Windows/FileDir.h"
8 | #include "Windows/FileIO.h"
9 |
10 | using namespace NWindows;
11 | using namespace NFile;
12 |
13 | void CTempFiles::Clear()
14 | {
15 | while(!Paths.IsEmpty())
16 | {
17 | NDirectory::DeleteFileAlways((LPCWSTR)Paths.Back());
18 | Paths.DeleteBack();
19 | }
20 | }
21 |
22 |
23 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/TempFiles.h:
--------------------------------------------------------------------------------
1 | // TempFiles.h
2 |
3 | #ifndef __TEMPFILES_H
4 | #define __TEMPFILES_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | class CTempFiles
9 | {
10 | void Clear();
11 | public:
12 | UStringVector Paths;
13 | ~CTempFiles() { Clear(); }
14 | };
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/UpdatePair.h:
--------------------------------------------------------------------------------
1 | // UpdatePair.h
2 |
3 | #ifndef __UPDATE_PAIR_H
4 | #define __UPDATE_PAIR_H
5 |
6 | #include "DirItem.h"
7 | #include "UpdateAction.h"
8 |
9 | #include "../../Archive/IArchive.h"
10 |
11 | struct CUpdatePair
12 | {
13 | NUpdateArchive::NPairState::EEnum State;
14 | int ArcIndex;
15 | int DirIndex;
16 | CUpdatePair(): ArcIndex(-1), DirIndex(-1) {}
17 | };
18 |
19 | void GetUpdatePairInfoList(
20 | const CDirItems &dirItems,
21 | const CObjectVector &arcItems,
22 | NFileTimeType::EEnum fileTimeType,
23 | CRecordVector &updatePairs);
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/UpdateProduce.h:
--------------------------------------------------------------------------------
1 | // UpdateProduce.h
2 |
3 | #ifndef __UPDATE_PRODUCE_H
4 | #define __UPDATE_PRODUCE_H
5 |
6 | #include "UpdatePair.h"
7 |
8 | struct CUpdatePair2
9 | {
10 | bool NewData;
11 | bool NewProps;
12 | bool IsAnti;
13 |
14 | int DirIndex;
15 | int ArcIndex;
16 | int NewNameIndex;
17 |
18 | bool ExistOnDisk() const { return DirIndex != -1; }
19 | bool ExistInArchive() const { return ArcIndex != -1; }
20 |
21 | CUpdatePair2(): IsAnti(false), DirIndex(-1), ArcIndex(-1), NewNameIndex(-1) {}
22 | };
23 |
24 | struct IUpdateProduceCallback
25 | {
26 | virtual HRESULT ShowDeleteFile(int arcIndex) = 0;
27 | };
28 |
29 | void UpdateProduce(
30 | const CRecordVector &updatePairs,
31 | const NUpdateArchive::CActionSet &actionSet,
32 | CRecordVector &operationChain,
33 | IUpdateProduceCallback *callback);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Common/WorkDir.h:
--------------------------------------------------------------------------------
1 | // WorkDir.h
2 |
3 | #ifndef __WORKDIR_H
4 | #define __WORKDIR_H
5 |
6 | #include "ZipRegistry.h"
7 |
8 | UString GetWorkDir(const NWorkDir::CInfo &workDirInfo, const UString &path);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/BenchCon.h:
--------------------------------------------------------------------------------
1 | // BenchCon.h
2 |
3 | #ifndef __BENCH_CON_H
4 | #define __BENCH_CON_H
5 |
6 | #include
7 |
8 | #include "../../Common/CreateCoder.h"
9 |
10 | HRESULT LzmaBenchCon(
11 | DECL_EXTERNAL_CODECS_LOC_VARS
12 | FILE *f, UInt32 numIterations, UInt32 numThreads, UInt32 dictionary);
13 |
14 | HRESULT CrcBenchCon(FILE *f, UInt32 numIterations, UInt32 numThreads, UInt32 dictionary);
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/ConsoleClose.cpp:
--------------------------------------------------------------------------------
1 | // ConsoleClose.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "ConsoleClose.h"
6 |
7 | #include
8 |
9 | static int g_BreakCounter = 0;
10 | static const int kBreakAbortThreshold = 2;
11 |
12 | namespace NConsoleClose {
13 |
14 | static void HandlerRoutine(int)
15 | {
16 | g_BreakCounter++;
17 | if (g_BreakCounter < kBreakAbortThreshold)
18 | return ;
19 | exit(EXIT_FAILURE);
20 | }
21 |
22 | bool TestBreakSignal()
23 | {
24 | return (g_BreakCounter > 0);
25 | }
26 |
27 | void CheckCtrlBreak()
28 | {
29 | if (TestBreakSignal())
30 | throw CCtrlBreakException();
31 | }
32 |
33 | CCtrlHandlerSetter::CCtrlHandlerSetter()
34 | {
35 | memo_sig_int = signal(SIGINT,HandlerRoutine); // CTRL-C
36 | if (memo_sig_int == SIG_ERR)
37 | throw "SetConsoleCtrlHandler fails (SIGINT)";
38 | memo_sig_term = signal(SIGTERM,HandlerRoutine); // for kill -15 (before "kill -9")
39 | if (memo_sig_term == SIG_ERR)
40 | throw "SetConsoleCtrlHandler fails (SIGTERM)";
41 | }
42 |
43 | CCtrlHandlerSetter::~CCtrlHandlerSetter()
44 | {
45 | signal(SIGINT,memo_sig_int); // CTRL-C
46 | signal(SIGTERM,memo_sig_term); // kill {pid}
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/ConsoleClose.h:
--------------------------------------------------------------------------------
1 | // ConsoleCloseUtils.h
2 |
3 | #ifndef __CONSOLECLOSEUTILS_H
4 | #define __CONSOLECLOSEUTILS_H
5 |
6 | namespace NConsoleClose {
7 |
8 | bool TestBreakSignal();
9 |
10 | class CCtrlHandlerSetter
11 | {
12 | void (*memo_sig_int)(int);
13 | void (*memo_sig_term)(int);
14 | public:
15 | CCtrlHandlerSetter();
16 | virtual ~CCtrlHandlerSetter();
17 | };
18 |
19 | class CCtrlBreakException
20 | {};
21 |
22 | void CheckCtrlBreak();
23 |
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/List.h:
--------------------------------------------------------------------------------
1 | // List.h
2 |
3 | #ifndef __LIST_H
4 | #define __LIST_H
5 |
6 | #include "Common/Wildcard.h"
7 | #include "../Common/LoadCodecs.h"
8 |
9 | HRESULT ListArchives(CCodecs *codecs, const CIntVector &formatIndices,
10 | bool stdInMode,
11 | UStringVector &archivePaths, UStringVector &archivePathsFull,
12 | const NWildcard::CCensorNode &wildcardCensor,
13 | bool enableHeaders, bool techMode,
14 | #ifndef _NO_CRYPTO
15 | bool &passwordEnabled, UString &password,
16 | #endif
17 | UInt64 &errors);
18 |
19 | #endif
20 |
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/OpenCallbackConsole.h:
--------------------------------------------------------------------------------
1 | // OpenCallbackConsole.h
2 |
3 | #ifndef __OPENCALLBACKCONSOLE_H
4 | #define __OPENCALLBACKCONSOLE_H
5 |
6 | #include "Common/StdOutStream.h"
7 | #include "../Common/ArchiveOpenCallback.h"
8 |
9 | class COpenCallbackConsole: public IOpenCallbackUI
10 | {
11 | public:
12 | INTERFACE_IOpenCallbackUI(;)
13 |
14 | CStdOutStream *OutStream;
15 |
16 | #ifndef _NO_CRYPTO
17 | bool PasswordIsDefined;
18 | bool PasswordWasAsked;
19 | UString Password;
20 | COpenCallbackConsole(): PasswordIsDefined(false), PasswordWasAsked(false) {}
21 | #endif
22 | };
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/PercentPrinter.h:
--------------------------------------------------------------------------------
1 | // PercentPrinter.h
2 |
3 | #ifndef __PERCENTPRINTER_H
4 | #define __PERCENTPRINTER_H
5 |
6 | #include "Common/Types.h"
7 | #include "Common/StdOutStream.h"
8 |
9 | class CPercentPrinter
10 | {
11 | UInt64 m_MinStepSize;
12 | UInt64 m_PrevValue;
13 | UInt64 m_CurValue;
14 | UInt64 m_Total;
15 | int m_NumExtraChars;
16 | public:
17 | CStdOutStream *OutStream;
18 |
19 | CPercentPrinter(UInt64 minStepSize = 1): m_MinStepSize(minStepSize),
20 | m_PrevValue(0), m_CurValue(0), m_Total(1), m_NumExtraChars(0) {}
21 | void SetTotal(UInt64 total) { m_Total = total; m_PrevValue = 0; }
22 | void SetRatio(UInt64 doneValue) { m_CurValue = doneValue; }
23 | void PrintString(const char *s);
24 | void PrintString(const wchar_t *s);
25 | void PrintNewLine();
26 | void ClosePrint();
27 | void RePrintRatio();
28 | void PrintRatio();
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Console/UserInputUtils.h:
--------------------------------------------------------------------------------
1 | // UserInputUtils.h
2 |
3 | #ifndef __USERINPUTUTILS_H
4 | #define __USERINPUTUTILS_H
5 |
6 | #include "Common/StdOutStream.h"
7 |
8 | namespace NUserAnswerMode {
9 |
10 | enum EEnum
11 | {
12 | kYes,
13 | kNo,
14 | kYesAll,
15 | kNoAll,
16 | kAutoRenameAll,
17 | kQuit
18 | };
19 | }
20 |
21 | NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream);
22 | UString GetPassword(CStdOutStream *outStream,bool verify = false);
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Explorer/ContextMenu.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | /* TODO */
4 |
5 |
6 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Explorer/MyMessages.cpp:
--------------------------------------------------------------------------------
1 | // MyMessages.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "MyMessages.h"
6 |
7 | #include "Windows/Error.h"
8 | #include "Windows/ResourceString.h"
9 |
10 | #ifdef LANG
11 | #include "../FileManager/LangUtils.h"
12 | #endif
13 |
14 | using namespace NWindows;
15 |
16 | void ShowErrorMessage(HWND window, LPCWSTR message)
17 | {
18 | ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP);
19 | }
20 |
21 | void ShowErrorMessageHwndRes(HWND window, UINT resID
22 | #ifdef LANG
23 | , UInt32 langID
24 | #endif
25 | )
26 | {
27 | ShowErrorMessage(window,
28 | #ifdef LANG
29 | LangString(resID, langID)
30 | #else
31 | MyLoadStringW(resID)
32 | #endif
33 | );
34 | }
35 |
36 | void ShowErrorMessageRes(UINT resID
37 | #ifdef LANG
38 | , UInt32 langID
39 | #endif
40 | )
41 | {
42 | ShowErrorMessageHwndRes(0, resID
43 | #ifdef LANG
44 | , langID
45 | #endif
46 | );
47 | }
48 |
49 | void ShowErrorMessageDWORD(HWND window, DWORD errorCode)
50 | {
51 | ShowErrorMessage(window, NError::MyFormatMessageW(errorCode));
52 | }
53 |
54 | void ShowLastErrorMessage(HWND window)
55 | {
56 | ShowErrorMessageDWORD(window, ::GetLastError());
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/Explorer/MyMessages.h:
--------------------------------------------------------------------------------
1 | // MyMessages.h
2 |
3 | #ifndef __MYMESSAGES_H
4 | #define __MYMESSAGES_H
5 |
6 | #include "Common/MyString.h"
7 | #include "Common/Types.h"
8 |
9 | void ShowErrorMessage(HWND window, LPCWSTR message);
10 | inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(0, message); }
11 |
12 | void ShowErrorMessageHwndRes(HWND window, UINT resID
13 | #ifdef LANG
14 | , UInt32 langID
15 | #endif
16 | );
17 |
18 | void ShowErrorMessageRes(UINT resID
19 | #ifdef LANG
20 | , UInt32 langID
21 | #endif
22 | );
23 |
24 | // void ShowErrorMessageDWORD(HWND window, DWORD errorCode);
25 | // inline void ErrorMessageDWORD(DWORD errorCode) { ShowErrorMessageDWORD(0, errorCode); }
26 | void ShowLastErrorMessage(HWND window = 0);
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ClassDefs.cpp:
--------------------------------------------------------------------------------
1 | // ClassDefs.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "Common/MyInitGuid.h"
6 |
7 | #include "../Agent/Agent.h"
8 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ComboDialog.h:
--------------------------------------------------------------------------------
1 | // ComboDialog.h
2 |
3 | #ifndef __COMBO_DIALOG_H
4 | #define __COMBO_DIALOG_H
5 |
6 | #include "Windows/Control/ComboBox.h"
7 | #include "Windows/Control/Dialog.h"
8 |
9 | #include "ComboDialogRes.h"
10 |
11 | class CComboDialog: public NWindows::NControl::CModalDialog
12 | {
13 | NWindows::NControl::CComboBox _comboBox;
14 | virtual void OnOK();
15 | virtual bool OnInit();
16 | public:
17 | // bool Sorted;
18 | UString Title;
19 | UString Static;
20 | UString Value;
21 | UStringVector Strings;
22 | // CComboDialog(): Sorted(false) {};
23 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_COMBO, parentWindow); }
24 | };
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ComboDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_COMBO 505
2 |
3 | #define IDC_COMBO_STATIC 1000
4 | #define IDC_COMBO_COMBO 1001
5 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/CopyDialog.h:
--------------------------------------------------------------------------------
1 | // CopyDialog.h
2 |
3 | #ifndef __COPY_DIALOG_H
4 | #define __COPY_DIALOG_H
5 |
6 | #include "Windows/Control/ComboBox.h"
7 | #include "Windows/Control/Dialog.h"
8 |
9 | #include "CopyDialogRes.h"
10 |
11 | const int kCopyDialog_NumInfoLines = 11;
12 |
13 | class CCopyDialog: public NWindows::NControl::CModalDialog
14 | {
15 | NWindows::NControl::CComboBox _path;
16 | virtual void OnOK();
17 | virtual bool OnInit();
18 | void OnButtonSetPath();
19 | bool OnButtonClicked(int buttonID, HWND buttonHWND);
20 | public:
21 | UString Title;
22 | UString Static;
23 | UString Value;
24 | UString Info;
25 | UStringVector Strings;
26 |
27 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_COPY, parentWindow); }
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/CopyDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_COPY 506
2 |
3 | #define IDC_COPY_STATIC 1000
4 | #define IDC_COPY_COMBO 1001
5 | #define IDC_COPY_SET_PATH 1002
6 | #define IDC_COPY_INFO 1003
7 |
8 | #define IDS_SET_FOLDER 210
9 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/DialogSize.h:
--------------------------------------------------------------------------------
1 | // DialogSize.h
2 |
3 | #ifndef __DIALOG_SIZE_H
4 | #define __DIALOG_SIZE_H
5 |
6 | #include "Windows/Control/Dialog.h"
7 |
8 | #ifdef UNDER_CE
9 | #define BIG_DIALOG_SIZE(x, y) bool isBig = NWindows::NControl::IsDialogSizeOK(x, y);
10 | #define SIZED_DIALOG(big) (isBig ? big : big ## _2)
11 | #else
12 | #define BIG_DIALOG_SIZE(x, y)
13 | #define SIZED_DIALOG(big) big
14 | #endif
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h:
--------------------------------------------------------------------------------
1 | // FileFolderPluginOpen.h
2 |
3 | #ifndef __FILE_FOLDER_PLUGIN_OPEN_H
4 | #define __FILE_FOLDER_PLUGIN_OPEN_H
5 |
6 | HRESULT OpenFileFolderPlugin(IInStream *inStream, const UString &path, const UString &arcFormat,
7 | HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, bool &encrypted, UString &password);
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/FormatUtils.cpp:
--------------------------------------------------------------------------------
1 | // FormatUtils.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "FormatUtils.h"
6 | #include "Common/IntToString.h"
7 | #include "Windows/ResourceString.h"
8 |
9 | #ifdef LANG
10 | #include "LangUtils.h"
11 | #endif
12 |
13 | UString NumberToString(UInt64 number)
14 | {
15 | wchar_t numberString[32];
16 | ConvertUInt64ToString(number, numberString);
17 | return numberString;
18 | }
19 |
20 | UString MyFormatNew(const UString &format, const UString &argument)
21 | {
22 | UString result = format;
23 | result.Replace(L"{0}", argument);
24 | return result;
25 | }
26 |
27 | UString MyFormatNew(UINT resourceID,
28 | #ifdef LANG
29 | UInt32 langID,
30 | #endif
31 | const UString &argument)
32 | {
33 | return MyFormatNew(
34 | #ifdef LANG
35 | LangString(resourceID, langID),
36 | #else
37 | NWindows::MyLoadStringW(resourceID),
38 | #endif
39 | argument);
40 | }
41 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/FormatUtils.h:
--------------------------------------------------------------------------------
1 | // FormatUtils.h
2 |
3 | #ifndef __FORMATUTILS_H
4 | #define __FORMATUTILS_H
5 |
6 | #include "Common/Types.h"
7 | #include "Common/MyString.h"
8 |
9 | UString NumberToString(UInt64 number);
10 |
11 | UString MyFormatNew(const UString &format, const UString &argument);
12 | UString MyFormatNew(UINT resourceID,
13 | #ifdef LANG
14 | UInt32 langID,
15 | #endif
16 | const UString &argument);
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/HelpUtils.h:
--------------------------------------------------------------------------------
1 | // HelpUtils.h
2 |
3 | #ifndef __HELPUTILS_H
4 | #define __HELPUTILS_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/LangUtils.h:
--------------------------------------------------------------------------------
1 | // LangUtils.h
2 |
3 | #ifndef __LANGUTILS_H
4 | #define __LANGUTILS_H
5 |
6 | #include "Common/Lang.h"
7 | #include "Windows/ResourceString.h"
8 |
9 | extern UString g_LangID;
10 |
11 | struct CIDLangPair
12 | {
13 | int ControlID;
14 | UInt32 LangID;
15 | };
16 |
17 | void ReloadLang();
18 | void LoadLangOneTime();
19 | void ReloadLangSmart();
20 |
21 | struct CLangEx
22 | {
23 | CLang Lang;
24 | UString ShortName;
25 | };
26 |
27 | void LoadLangs(CObjectVector &langs);
28 |
29 | void LangSetDlgItemsText(HWND dialogWindow, CIDLangPair *idLangPairs, int numItems);
30 | void LangSetWindowText(HWND window, UInt32 langID);
31 |
32 | UString LangString(UInt32 langID);
33 | UString LangString(UINT resourceID, UInt32 langID);
34 |
35 | #ifdef LANG
36 | #define LangStringSpec(resourceID, langID) LangString(resourceID, langID)
37 | #else
38 | #define LangStringSpec(resourceID, langID) NWindows::MyLoadStringW(resourceID)
39 | #endif
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ListViewDialog.h:
--------------------------------------------------------------------------------
1 | // ListViewDialog.h
2 |
3 | #ifndef __LISTVIEW_DIALOG_H
4 | #define __LISTVIEW_DIALOG_H
5 |
6 | #include "Windows/Control/Dialog.h"
7 | #include "Windows/Control/ListView.h"
8 |
9 | #include "ListViewDialogRes.h"
10 |
11 | class CListViewDialog: public NWindows::NControl::CModalDialog
12 | {
13 | NWindows::NControl::CListView _listView;
14 | virtual void OnOK();
15 | virtual bool OnInit();
16 | #ifdef _WIN32 // FIXME
17 | virtual bool OnNotify(UINT controlID, LPNMHDR header);
18 | #endif
19 |
20 | public:
21 | UString Title;
22 | bool DeleteIsAllowed;
23 | bool StringsWereChanged;
24 | UStringVector Strings;
25 | int FocusedItemIndex;
26 |
27 | INT_PTR Create(HWND wndParent = 0) { return CModalDialog::Create(IDD_DIALOG_LISTVIEW, wndParent); }
28 |
29 | CListViewDialog(): DeleteIsAllowed(false) {}
30 | };
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ListViewDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_LISTVIEW 508
2 | #define IDC_LISTVIEW_LIST 1000
3 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/MessagesDialog.h:
--------------------------------------------------------------------------------
1 | // MessagesDialog.h
2 |
3 | #ifndef __MESSAGES_DIALOG_H
4 | #define __MESSAGES_DIALOG_H
5 |
6 | #include "Windows/Control/Dialog.h"
7 | #include "Windows/Control/ListView.h"
8 |
9 | #include "MessagesDialogRes.h"
10 |
11 | class CMessagesDialog: public NWindows::NControl::CModalDialog
12 | {
13 | NWindows::NControl::CListView _messageList;
14 | void AddMessageDirect(LPCWSTR message);
15 | void AddMessage(LPCWSTR message);
16 | virtual bool OnInit();
17 | public:
18 | const UStringVector *Messages;
19 | INT_PTR Create(HWND parent = 0) { return CModalDialog::Create(IDD_DIALOG_MESSAGES, parent); }
20 | };
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/MessagesDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDS_MESSAGES_DIALOG_MESSAGE_COLUMN 503
2 | #define IDD_DIALOG_MESSAGES 503
3 | #define IDC_MESSAGE_LIST 1000
4 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/MyLoadMenu.h:
--------------------------------------------------------------------------------
1 | // MyLoadMenu.h
2 |
3 | #ifndef __MYLOADMENU_H
4 | #define __MYLOADMENU_H
5 |
6 | class myHMENU; // FIXME
7 | typedef myHMENU * HMENU; // FIXME
8 |
9 | void OnMenuActivating(HWND hWnd, HMENU hMenu, int position);
10 | // void OnMenuUnActivating(HWND hWnd, HMENU hMenu, int id);
11 | // void OnMenuUnActivating(HWND hWnd);
12 |
13 | void MyLoadMenu(HWND hWnd);
14 | bool OnMenuCommand(HWND hWnd, int id);
15 | void MyLoadMenu();
16 | void LoadFileMenu(HMENU hMenu, int startPos, bool programMenu,
17 | bool isFsFolder, int numItems, bool allAreFiles);
18 | bool ExecuteFileCommand(int id);
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/OverwriteDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_OVERWRITE 502
2 | #define IDD_DIALOG_OVERWRITE_2 602
3 |
4 | #define IDS_FILE_MODIFIED 600
5 | #define IDS_FILE_SIZE 601
6 |
7 | #define IDC_STATIC_OVERWRITE_HEADER 1000
8 |
9 | #define IDC_STATIC_OVERWRITE_QUESTION_BEGIN 1001
10 | #define IDC_STATIC_OVERWRITE_QUESTION_END 1002
11 |
12 | #define IDC_STATIC_OVERWRITE_OLD_FILE_ICON 1003
13 | #define IDC_STATIC_OVERWRITE_NEW_FILE_ICON 1004
14 |
15 | #define IDC_STATIC_OVERWRITE_OLD_FILE_SIZE_TIME 1005
16 | #define IDC_STATIC_OVERWRITE_NEW_FILE_SIZE_TIME 1006
17 |
18 | #define IDC_BUTTON_OVERWRITE_YES_TO_ALL 1010
19 | #define IDC_BUTTON_OVERWRITE_NO_TO_ALL 1011
20 | #define IDC_BUTTON_OVERWRITE_AUTO_RENAME 1012
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/PasswordDialog.h:
--------------------------------------------------------------------------------
1 | // PasswordDialog.h
2 |
3 | #ifndef __PASSWORDDIALOG_H
4 | #define __PASSWORDDIALOG_H
5 |
6 | #include "Windows/Control/Dialog.h"
7 | #include "Windows/Control/Edit.h"
8 | #include "PasswordDialogRes.h"
9 |
10 | class CPasswordDialog: public NWindows::NControl::CModalDialog
11 | {
12 | NWindows::NControl::CEdit _passwordControl;
13 | virtual void OnOK();
14 | virtual bool OnInit();
15 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
16 | public:
17 | UString Password;
18 | INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_PASSWORD, parentWindow); }
19 | };
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/PasswordDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_PASSWORD 501
2 | #define IDC_STATIC_PASSWORD_HEADER 1000
3 | #define IDC_EDIT_PASSWORD 1001
4 | #define IDC_CHECK_PASSWORD_SHOW 1002
5 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/PluginInterface.h:
--------------------------------------------------------------------------------
1 | // PluginInterface.h
2 |
3 | #ifndef __PLUGIN_INTERFACE_H
4 | #define __PLUGIN_INTERFACE_H
5 |
6 | /*
7 | #include "../../../Common/Types.h"
8 | #include "../../IDecl.h"
9 |
10 | #define PLUGIN_INTERFACE(i, x) DECL_INTERFACE(i, 0x0A, x)
11 |
12 | PLUGIN_INTERFACE(IInitContextMenu, 0x00)
13 | {
14 | STDMETHOD(InitContextMenu)(const wchar_t *folder, const wchar_t **names, UINT32 numFiles) PURE;
15 | };
16 |
17 | PLUGIN_INTERFACE(IPluginOptionsCallback, 0x01)
18 | {
19 | STDMETHOD(GetProgramFolderPath)(BSTR *value) PURE;
20 | STDMETHOD(GetProgramPath)(BSTR *value) PURE;
21 | STDMETHOD(GetRegistryCUPath)(BSTR *value) PURE;
22 | };
23 |
24 | PLUGIN_INTERFACE(IPluginOptions, 0x02)
25 | {
26 | STDMETHOD(PluginOptions)(HWND hWnd, IPluginOptionsCallback *callback) PURE;
27 | // STDMETHOD(GetFileExtensions)(BSTR *extensions) PURE;
28 | };
29 | */
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/PluginLoader.h:
--------------------------------------------------------------------------------
1 | // PluginLoader.h
2 |
3 | #ifndef __PLUGIN_LOADER_H
4 | #define __PLUGIN_LOADER_H
5 |
6 | #include "Windows/DLL.h"
7 |
8 | typedef UINT32 (WINAPI * CreateObjectPointer)(const GUID *clsID, const GUID *interfaceID, void **outObject);
9 |
10 | class CPluginLibrary: public NWindows::NDLL::CLibrary
11 | {
12 | public:
13 | HRESULT CreateManager(REFGUID clsID, IFolderManager **manager)
14 | {
15 | CreateObjectPointer createObject = (CreateObjectPointer)GetProc("CreateObject");
16 | if (createObject == NULL)
17 | return GetLastError();
18 | return createObject(&clsID, &IID_IFolderManager, (void **)manager);
19 | }
20 | HRESULT LoadAndCreateManager(LPCWSTR filePath, REFGUID clsID, IFolderManager **manager)
21 | {
22 | if (!Load(filePath))
23 | return GetLastError();
24 | return CreateManager(clsID, manager);
25 | }
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ProgramLocation.cpp:
--------------------------------------------------------------------------------
1 | // ProgramLocation.h
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "ProgramLocation.h"
6 |
7 | // #include "Windows/FileName.h"
8 | #include "Common/StringConvert.h"
9 |
10 |
11 | bool GetProgramFolderPath(UString &folder)
12 | {
13 | const char *p7zip_home_dir = getenv("P7ZIP_HOME_DIR");
14 | if (p7zip_home_dir == 0) p7zip_home_dir="./";
15 |
16 | folder = MultiByteToUnicodeString(p7zip_home_dir);
17 |
18 | return true;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ProgramLocation.h:
--------------------------------------------------------------------------------
1 | // ProgramLocation.h
2 |
3 | #ifndef __PROGRAM_LOCATION_H
4 | #define __PROGRAM_LOCATION_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | bool GetProgramFolderPath(UString &folder); // normalized
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/ProgressDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_PROGRESS 500
2 |
3 | #define IDC_PROGRESS1 1000
4 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/PropertyName.h:
--------------------------------------------------------------------------------
1 | // PropertyName.h
2 |
3 | #ifndef __PROPERTYNAME_H
4 | #define __PROPERTYNAME_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | UString GetNameOfProperty(PROPID propID, const wchar_t *name);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/RegistryPlugins.h:
--------------------------------------------------------------------------------
1 | // RegistryPlugins.h
2 |
3 | #ifndef __REGISTRYPLUGINS_H
4 | #define __REGISTRYPLUGINS_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | enum EPluginType
9 | {
10 | kPluginTypeFF = 0
11 | };
12 |
13 | struct CPluginInfo
14 | {
15 | UString FilePath;
16 | EPluginType Type;
17 | UString Name;
18 | CLSID ClassID;
19 | CLSID OptionsClassID;
20 | bool ClassIDDefined;
21 | bool OptionsClassIDDefined;
22 |
23 | // CSysString Extension;
24 | // CSysString AddExtension;
25 | // bool UpdateEnabled;
26 | // bool KeepName;
27 | };
28 |
29 | void ReadPluginInfoList(CObjectVector &plugins);
30 | void ReadFileFolderPluginInfoList(CObjectVector &plugins);
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/RootFolder.h:
--------------------------------------------------------------------------------
1 | // RootFolder.h
2 |
3 | #ifndef __ROOTFOLDER_H
4 | #define __ROOTFOLDER_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | #include "Windows/PropVariant.h"
9 |
10 | #include "FSFolder.h"
11 |
12 | #ifdef _WIN32
13 | const int kNumRootFolderItems = 3;
14 | #endif
15 |
16 | class CRootFolder:
17 | public IFolderFolder,
18 | public IFolderGetSystemIconIndex,
19 | public CMyUnknownImp
20 | {
21 | public:
22 | MY_UNKNOWN_IMP1(
23 | IFolderGetSystemIconIndex
24 | )
25 |
26 | INTERFACE_FolderFolder(;)
27 |
28 | STDMETHOD(GetSystemIconIndex)(UInt32 index, INT32 *iconIndex);
29 |
30 | void Init();
31 | private:
32 | #ifdef _WIN32
33 | UString _names[kNumRootFolderItems];
34 | int _iconIndices[kNumRootFolderItems];
35 | #endif
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/SplitDialog.h:
--------------------------------------------------------------------------------
1 | // SplitDialog.h
2 |
3 | #ifndef __SPLIT_DIALOG_H
4 | #define __SPLIT_DIALOG_H
5 |
6 | #include "Windows/Control/Dialog.h"
7 | #include "Windows/Control/ComboBox.h"
8 |
9 | #include "SplitDialogRes.h"
10 |
11 | class CSplitDialog: public NWindows::NControl::CModalDialog
12 | {
13 | NWindows::NControl::CComboBox _pathCombo;
14 | NWindows::NControl::CComboBox _volumeCombo;
15 | virtual void OnOK();
16 | virtual bool OnInit();
17 | // FIXME virtual bool OnSize(WPARAM wParam, int xSize, int ySize);
18 | virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
19 | void OnButtonSetPath();
20 | public:
21 | UString FilePath;
22 | UString Path;
23 | CRecordVector VolumeSizes;
24 | INT_PTR Create(HWND parentWindow = 0)
25 | { return CModalDialog::Create(IDD_DIALOG_SPLIT, parentWindow); }
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/SplitDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_SPLIT 504
2 | #define IDC_STATIC_SPLIT_PATH 1000
3 | #define IDC_COMBO_SPLIT_PATH 1001
4 | #define IDC_BUTTON_SPLIT_PATH 1002
5 | #define IDC_STATIC_SPLIT_VOLUME 1010
6 | #define IDC_COMBO_SPLIT_VOLUME 1011
7 |
8 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/SplitUtils.h:
--------------------------------------------------------------------------------
1 | // SplitUtils.h
2 |
3 | #ifndef __SPLITUTILS_H
4 | #define __SPLITUTILS_H
5 |
6 | #include "Common/MyString.h"
7 | #include "Common/Types.h"
8 | #include "Windows/Control/ComboBox.h"
9 |
10 | bool ParseVolumeSizes(const UString &s, CRecordVector &values);
11 | void AddVolumeItems(NWindows::NControl::CComboBox &volumeCombo);
12 |
13 | UInt64 GetNumberOfVolumes(UInt64 size, CRecordVector &volSizes);
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/StringUtils.h:
--------------------------------------------------------------------------------
1 | // StringUtils.h
2 |
3 | #ifndef __STRINGUTILS_H
4 | #define __STRINGUTILS_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | void SplitStringToTwoStrings(const UString &src, UString &dest1, UString &dest2);
9 |
10 | void SplitString(const UString &srcString, UStringVector &destStrings);
11 | UString JoinStrings(const UStringVector &srcStrings);
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/TextPairs.h:
--------------------------------------------------------------------------------
1 | // TextPairs.h
2 |
3 | #ifndef __FM_TEXT_PAIRS_H
4 | #define __FM_TEXT_PAIRS_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | struct CTextPair
9 | {
10 | UString ID;
11 | UString Value;
12 | };
13 |
14 | class CPairsStorage
15 | {
16 | CObjectVector Pairs;
17 | int FindID(const UString &id, int &insertPos);
18 | int FindID(const UString &id);
19 | void Sort();
20 | public:
21 | void Clear() { Pairs.Clear(); };
22 | bool ReadFromString(const UString &text);
23 | void SaveToString(UString &text);
24 |
25 | bool GetValue(const UString &id, UString &value);
26 | UString GetValue(const UString &id);
27 | void AddPair(const CTextPair &pair);
28 | void DeletePair(const UString &id);
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/res/Extract2PNG.h:
--------------------------------------------------------------------------------
1 | static const unsigned char EXTRACT2_png[] = {
2 | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
3 | 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18,
4 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x12, 0x59, 0x20, 0xcb, 0x00, 0x00, 0x00,
5 | 0x30, 0x50, 0x4c, 0x54, 0x45, 0xff, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00,
6 | 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00,
7 | 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xff, 0x00, 0x00, 0x00,
8 | 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
9 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x14, 0x3b, 0x9d, 0x00, 0x00, 0x00,
10 | 0x01, 0x74, 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00,
11 | 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
12 | 0x00, 0x00, 0x01, 0xea, 0x65, 0x16, 0xa4, 0x00, 0x00, 0x00, 0x22, 0x49,
13 | 0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x60, 0xa0, 0x17, 0xe0, 0xbd, 0x0b,
14 | 0x05, 0x17, 0x40, 0x9c, 0x33, 0x50, 0x70, 0x9d, 0x5c, 0x0e, 0xcc, 0x34,
15 | 0x10, 0x87, 0xa1, 0x1c, 0x06, 0xe8, 0xe6, 0x1b, 0x00, 0xa6, 0x78, 0x38,
16 | 0x15, 0x21, 0xee, 0x22, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
17 | 0x44, 0xae, 0x42, 0x60, 0x82, 0x00,
18 | };
19 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/FileManager/resourceGui.h:
--------------------------------------------------------------------------------
1 | #define IDI_ICON 1
2 |
3 | #define IDS_INCORRECT_VOLUME_SIZE 95
4 |
5 | #define IDS_FILES_COLON 2274
6 | #define IDS_FOLDERS_COLON 2275
7 | #define IDS_SIZE_COLON 2276
8 |
9 | #define IDS_PROGRESS_TESTING 4100
10 | #define IDS_MESSAGE_NO_ERRORS 4200
11 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/ExtractDialogRes.h:
--------------------------------------------------------------------------------
1 | #define IDD_DIALOG_EXTRACT 552
2 | #define IDD_DIALOG_EXTRACT_2 652
3 |
4 | #define IDC_STATIC_EXTRACT_EXTRACT_TO 1020
5 | #define IDC_EXTRACT_COMBO_PATH 1021
6 | #define IDC_EXTRACT_BUTTON_SET_PATH 1022
7 |
8 | #define IDC_EXTRACT_COMBO_PATH_MODE 1030
9 | #define IDC_EXTRACT_COMBO_OVERWRITE_MODE 1031
10 |
11 | #define IDC_EXTRACT_PATH_MODE 1040
12 | #define IDC_EXTRACT_OVERWRITE_MODE 1050
13 |
14 | #define IDC_EXTRACT_FILES 1060
15 |
16 | #define IDC_EXTRACT_PASSWORD 1100
17 | #define IDC_EXTRACT_EDIT_PASSWORD 1101
18 | #define IDC_EXTRACT_CHECK_SHOW_PASSWORD 1102
19 |
20 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/ExtractGUI.h:
--------------------------------------------------------------------------------
1 | // GUI/ExtractGUI.h
2 |
3 | #ifndef __EXTRACT_GUI_H
4 | #define __EXTRACT_GUI_H
5 |
6 | #include "../Common/Extract.h"
7 |
8 | #include "../FileManager/ExtractCallback.h"
9 |
10 | /*
11 | RESULT can be S_OK, even if there are errors!!!
12 | if RESULT == S_OK, check extractCallback->IsOK() after ExtractGUI().
13 |
14 | RESULT = E_ABORT - user break.
15 | RESULT != E_ABORT:
16 | {
17 | messageWasDisplayed = true - message was displayed already.
18 | messageWasDisplayed = false - there was some internal error, so you must show error message.
19 | }
20 | */
21 |
22 | HRESULT ExtractGUI(
23 | CCodecs *codecs,
24 | const CIntVector &formatIndices,
25 | UStringVector &archivePaths,
26 | UStringVector &archivePathsFull,
27 | const NWildcard::CCensorNode &wildcardCensor,
28 | CExtractOptions &options,
29 | bool showDialog,
30 | bool &messageWasDisplayed,
31 | CExtractCallbackImp *extractCallback,
32 | HWND hwndParent = NULL);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/ExtractRes.h:
--------------------------------------------------------------------------------
1 | #define IDS_UPDATE_NOT_SUPPORTED 199
2 | #define IDS_CANNOT_CREATE_FOLDER 200
3 | #define IDS_OPEN_IS_NOT_SUPORTED_ARCHIVE 201
4 |
5 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC 202
6 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR 203
7 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_UNSUPPORTED_METHOD 204
8 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CRC_ENCRYPTED 205
9 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED 206
10 |
11 | #define IDS_EXTRACT_SET_FOLDER 207
12 | #define IDS_MESSAGES_DIALOG_EXTRACT_MESSAGE_CANNOT_OPEN_FILE 208
13 | #define IDS_PROGRESS_EXTRACTING 209
14 |
15 | #define IDS_CANT_OPEN_ARCHIVE 103
16 | #define IDS_CANT_OPEN_ENCRYPTED_ARCHIVE 104
17 | #define IDS_MEM_ERROR 105
18 | #define IDS_UNKNOWN_ERROR 106
19 | #define IDS_UNSUPPORTED_ARCHIVE_TYPE 107
20 |
21 | #define IDC_EXTRACT_RADIO_FULL_PATHNAMES 1041
22 | #define IDC_EXTRACT_RADIO_CURRENT_PATHNAMES 1042
23 | #define IDC_EXTRACT_RADIO_NO_PATHNAMES 1043
24 |
25 | #define IDC_EXTRACT_RADIO_ASK_BEFORE_OVERWRITE 1051
26 | #define IDC_EXTRACT_RADIO_OVERWRITE_WITHOUT_PROMPT 1052
27 | #define IDC_EXTRACT_RADIO_SKIP_EXISTING_FILES 1053
28 | #define IDC_EXTRACT_RADIO_AUTO_RENAME 1056
29 | #define IDC_EXTRACT_RADIO_AUTO_RENAME_EXISTING 1057
30 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/UpdateCallbackGUI.h:
--------------------------------------------------------------------------------
1 | // UpdateCallbackGUI.h
2 |
3 | #ifndef __UPDATE_CALLBACK_GUI_H
4 | #define __UPDATE_CALLBACK_GUI_H
5 |
6 | #include "../Common/Update.h"
7 | #include "../Common/ArchiveOpenCallback.h"
8 | #include "../FileManager/ProgressDialog2.h"
9 |
10 | class CUpdateCallbackGUI:
11 | public IOpenCallbackUI,
12 | public IUpdateCallbackUI2
13 | {
14 | public:
15 | bool PasswordIsDefined;
16 | UString Password;
17 | bool AskPassword;
18 | bool PasswordWasAsked;
19 | UInt64 NumFiles;
20 |
21 | CUpdateCallbackGUI():
22 | PasswordIsDefined(false),
23 | PasswordWasAsked(false),
24 | AskPassword(false)
25 | {}
26 |
27 | ~CUpdateCallbackGUI();
28 | void Init();
29 |
30 | INTERFACE_IUpdateCallbackUI2(;)
31 | INTERFACE_IOpenCallbackUI(;)
32 |
33 | UStringVector FailedFiles;
34 |
35 | CProgressDialog *ProgressDialog;
36 |
37 | void AddErrorMessage(LPCWSTR message);
38 | void AddErrorMessage(const wchar_t *name, DWORD systemError);
39 | };
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/UpdateGUI.h:
--------------------------------------------------------------------------------
1 | // GUI/UpdateGUI.h
2 |
3 | #ifndef __UPDATE_GUI_H
4 | #define __UPDATE_GUI_H
5 |
6 | #include "../Common/Update.h"
7 |
8 | #include "UpdateCallbackGUI.h"
9 |
10 | /*
11 | callback->FailedFiles contains names of files for that there were problems.
12 | RESULT can be S_OK, even if there are such warnings!!!
13 |
14 | RESULT = E_ABORT - user break.
15 | RESULT != E_ABORT:
16 | {
17 | messageWasDisplayed = true - message was displayed already.
18 | messageWasDisplayed = false - there was some internal error, so you must show error message.
19 | }
20 | */
21 |
22 | HRESULT UpdateGUI(
23 | CCodecs *codecs,
24 | const NWildcard::CCensor &censor,
25 | CUpdateOptions &options,
26 | bool showDialog,
27 | bool &messageWasDisplayed,
28 | CUpdateCallbackGUI *callback,
29 | HWND hwndParent = NULL);
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/GUI/resource2.h:
--------------------------------------------------------------------------------
1 | #define IDS_COMPRESSED_COLON 2277
2 | #define IDS_ARCHIVES_COLON 2278
3 | #define IDS_PROGRESS_COMPRESSING 98
4 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/P7ZIP/makefile:
--------------------------------------------------------------------------------
1 | PROG=../../../../bin/p7zip$(BINSUFFIX)
2 |
3 | LOCAL_FLAGS=\
4 | -DUNICODE -D_UNICODE \
5 | -I. \
6 | `wx-config --unicode=yes --cxxflags`
7 |
8 | include ../../../../makefile.crc32
9 | include ../../../../makefile.machine
10 |
11 | PCH_NAME=$(PRE_COMPILED_HEADER)
12 |
13 | LIBS=`wx-config --unicode=yes --libs` $(LOCAL_LIBS_DLL)
14 |
15 | OBJS=\
16 | FileDir.o \
17 | FileFind.o \
18 | MyString.o \
19 | MyVector.o \
20 | IntToString.o \
21 | StringConvert.o \
22 | wine_date_and_time.o \
23 | Threads.o \
24 | wxP7ZIP.o
25 |
26 | include ../../../../makefile.glb
27 |
28 |
--------------------------------------------------------------------------------
/jni/CPP/7zip/UI/P7ZIP/makefile.list:
--------------------------------------------------------------------------------
1 | SRCS=\
2 | wxP7ZIP.cpp
3 |
4 |
5 | SRCS_C=
6 |
7 | include ../../../../makefile.rules
8 |
9 | wxP7ZIP.o : wxP7ZIP.cpp
10 | $(CXX) $(CXXFLAGS) wxP7ZIP.cpp
11 |
--------------------------------------------------------------------------------
/jni/CPP/Common/AutoPtr.h:
--------------------------------------------------------------------------------
1 | // Common/AutoPtr.h
2 |
3 | #ifndef __COMMON_AUTOPTR_H
4 | #define __COMMON_AUTOPTR_H
5 |
6 | template class CMyAutoPtr
7 | {
8 | T *_p;
9 | public:
10 | CMyAutoPtr(T *p = 0) : _p(p) {}
11 | CMyAutoPtr(CMyAutoPtr& p): _p(p.release()) {}
12 | CMyAutoPtr& operator=(CMyAutoPtr& p)
13 | {
14 | reset(p.release());
15 | return (*this);
16 | }
17 | ~CMyAutoPtr() { delete _p; }
18 | T& operator*() const { return *_p; }
19 | // T* operator->() const { return (&**this); }
20 | T* get() const { return _p; }
21 | T* release()
22 | {
23 | T *tmp = _p;
24 | _p = 0;
25 | return tmp;
26 | }
27 | void reset(T* p = 0)
28 | {
29 | if (p != _p)
30 | delete _p;
31 | _p = p;
32 | }
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/CPP/Common/CRC.cpp:
--------------------------------------------------------------------------------
1 | // Common/CRC.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "../../C/7zCrc.h"
6 |
7 | struct CCRCTableInit { CCRCTableInit() { CrcGenerateTable(); } } g_CRCTableInit;
8 |
--------------------------------------------------------------------------------
/jni/CPP/Common/C_FileIO.h:
--------------------------------------------------------------------------------
1 | // Common/C_FileIO.h
2 |
3 | #ifndef __COMMON_C_FILEIO_H
4 | #define __COMMON_C_FILEIO_H
5 |
6 | #include
7 | #include
8 |
9 | #include "Types.h"
10 | #include "MyWindows.h"
11 |
12 | namespace NC {
13 | namespace NFile {
14 | namespace NIO {
15 |
16 | class CFileBase
17 | {
18 | protected:
19 | int _handle;
20 | bool OpenBinary(const char *name, int flags);
21 | public:
22 | CFileBase(): _handle(-1) {};
23 | ~CFileBase() { Close(); }
24 | bool Close();
25 | bool GetLength(UInt64 &length) const;
26 | off_t Seek(off_t distanceToMove, int moveMethod) const;
27 | };
28 |
29 | class CInFile: public CFileBase
30 | {
31 | public:
32 | bool Open(const char *name);
33 | bool OpenShared(const char *name, bool shareForWrite);
34 | ssize_t Read(void *data, size_t size);
35 | };
36 |
37 | class COutFile: public CFileBase
38 | {
39 | public:
40 | bool Create(const char *name, bool createAlways);
41 | bool Open(const char *name, DWORD creationDisposition);
42 | ssize_t Write(const void *data, size_t size);
43 | };
44 |
45 | }}}
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/jni/CPP/Common/ComTry.h:
--------------------------------------------------------------------------------
1 | // ComTry.h
2 |
3 | #ifndef __COM_TRY_H
4 | #define __COM_TRY_H
5 |
6 | #include "MyWindows.h"
7 | // #include "Exception.h"
8 | // #include "NewHandler.h"
9 |
10 | #define COM_TRY_BEGIN try {
11 | #define COM_TRY_END } catch(const char * s) { throw s ; } \
12 | catch(...) { return E_OUTOFMEMORY; }
13 |
14 | // catch(const CNewException &) { return E_OUTOFMEMORY; }
15 | // catch(const CSystemException &e) { return e.ErrorCode; }
16 | // catch(...) { return E_FAIL; }
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/jni/CPP/Common/Defs.h:
--------------------------------------------------------------------------------
1 | // Common/Defs.h
2 |
3 | #ifndef __COMMON_DEFS_H
4 | #define __COMMON_DEFS_H
5 |
6 | template inline T MyMin(T a, T b)
7 | { return a < b ? a : b; }
8 | template inline T MyMax(T a, T b)
9 | { return a > b ? a : b; }
10 |
11 | template inline int MyCompare(T a, T b)
12 | { return a < b ? -1 : (a == b ? 0 : 1); }
13 |
14 | inline int BoolToInt(bool value)
15 | { return (value ? 1: 0); }
16 |
17 | inline bool IntToBool(int value)
18 | { return (value != 0); }
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/CPP/Common/IntToString.h:
--------------------------------------------------------------------------------
1 | // Common/IntToString.h
2 |
3 | #ifndef __COMMON_INT_TO_STRING_H
4 | #define __COMMON_INT_TO_STRING_H
5 |
6 | #include
7 | #include "Types.h"
8 |
9 | void ConvertUInt64ToString(UInt64 value, char *s, UInt32 base = 10);
10 | void ConvertUInt64ToString(UInt64 value, wchar_t *s);
11 | void ConvertInt64ToString(Int64 value, char *s);
12 | void ConvertInt64ToString(Int64 value, wchar_t *s);
13 |
14 | void ConvertUInt32ToString(UInt32 value, char *s);
15 | void ConvertUInt32ToString(UInt32 value, wchar_t *s);
16 |
17 | void ConvertUInt32ToHexWithZeros(UInt32 value, char *s);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/jni/CPP/Common/Lang.h:
--------------------------------------------------------------------------------
1 | // Common/Lang.h
2 |
3 | #ifndef __COMMON_LANG_H
4 | #define __COMMON_LANG_H
5 |
6 | #include "MyVector.h"
7 | #include "MyString.h"
8 | #include "Types.h"
9 |
10 | struct CLangPair
11 | {
12 | UInt32 Value;
13 | UString String;
14 | };
15 |
16 | class CLang
17 | {
18 | CObjectVector _langPairs;
19 | public:
20 | bool Open(LPCWSTR fileName);
21 | void Clear() { _langPairs.Clear(); }
22 | int FindItem(UInt32 value) const;
23 | bool GetMessage(UInt32 value, UString &message) const;
24 | };
25 |
26 | #endif
27 |
28 |
29 |
--------------------------------------------------------------------------------
/jni/CPP/Common/ListFileUtils.h:
--------------------------------------------------------------------------------
1 | // Common/ListFileUtils.h
2 |
3 | #ifndef __COMMON_LISTFILEUTILS_H
4 | #define __COMMON_LISTFILEUTILS_H
5 |
6 | #include "MyString.h"
7 | #include "Types.h"
8 |
9 | bool ReadNamesFromListFile(LPCWSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP);
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/jni/CPP/Common/MyException.h:
--------------------------------------------------------------------------------
1 | // Common/Exception.h
2 |
3 | #ifndef __COMMON_EXCEPTION_H
4 | #define __COMMON_EXCEPTION_H
5 |
6 | #include "MyWindows.h"
7 |
8 | struct CSystemException
9 | {
10 | HRESULT ErrorCode;
11 | CSystemException(HRESULT errorCode): ErrorCode(errorCode) {}
12 | };
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/jni/CPP/Common/MyInitGuid.h:
--------------------------------------------------------------------------------
1 | // Common/MyInitGuid.h
2 |
3 | #ifndef __COMMON_MY_INITGUID_H
4 | #define __COMMON_MY_INITGUID_H
5 |
6 | #ifdef _WIN32
7 | #ifdef UNDER_CE
8 | #include
9 | #endif
10 | #include
11 | #ifdef UNDER_CE
12 | DEFINE_GUID(IID_IUnknown,
13 | 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
14 | #endif
15 | #else
16 | #define INITGUID
17 | #include "MyGuidDef.h"
18 | DEFINE_GUID(IID_IUnknown,
19 | 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
20 | #endif
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/jni/CPP/Common/MyMap.h:
--------------------------------------------------------------------------------
1 | // MyMap.h
2 |
3 | #ifndef __COMMON_MYMAP_H
4 | #define __COMMON_MYMAP_H
5 |
6 | #include "MyVector.h"
7 | #include "Types.h"
8 |
9 | class CMap32
10 | {
11 | struct CNode
12 | {
13 | UInt32 Key;
14 | UInt32 Keys[2];
15 | UInt32 Values[2];
16 | UInt16 Len;
17 | Byte IsLeaf[2];
18 | };
19 | CRecordVector Nodes;
20 |
21 | public:
22 |
23 | void Clear() { Nodes.Clear(); }
24 | bool Find(UInt32 key, UInt32 &valueRes) const;
25 | bool Set(UInt32 key, UInt32 value); // returns true, if there is such key already
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/Common/MyUnknown.h:
--------------------------------------------------------------------------------
1 | // MyUnknown.h
2 |
3 | #ifndef __MY_UNKNOWN_H
4 | #define __MY_UNKNOWN_H
5 |
6 | #ifdef _WIN32
7 | #include
8 | #include
9 | #else
10 | #include "MyWindows.h"
11 | #endif
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/jni/CPP/Common/MyXml.h:
--------------------------------------------------------------------------------
1 | // MyXml.h
2 |
3 | #ifndef __MYXML_H
4 | #define __MYXML_H
5 |
6 | #include "MyString.h"
7 |
8 | struct CXmlProp
9 | {
10 | AString Name;
11 | AString Value;
12 | };
13 |
14 | class CXmlItem
15 | {
16 | bool ParseItems(const AString &s, int &pos, int numAllowedLevels);
17 |
18 | public:
19 | AString Name;
20 | bool IsTag;
21 | CObjectVector Props;
22 | CObjectVector SubItems;
23 |
24 | bool ParseItem(const AString &s, int &pos, int numAllowedLevels);
25 |
26 | bool IsTagged(const AString &tag) const;
27 | int FindProperty(const AString &propName) const;
28 | AString GetPropertyValue(const AString &propName) const;
29 | AString GetSubString() const;
30 | int FindSubTag(const AString &tag) const;
31 | AString GetSubStringForTag(const AString &tag) const;
32 | };
33 |
34 | struct CXml
35 | {
36 | CXmlItem Root;
37 | bool Parse(const AString &s);
38 | };
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/jni/CPP/Common/NewHandler.h:
--------------------------------------------------------------------------------
1 | // Common/NewHandler.h
2 |
3 | #ifndef __COMMON_NEWHANDLER_H
4 | #define __COMMON_NEWHANDLER_H
5 |
6 | class CNewException {};
7 |
8 | #ifdef _WIN32
9 | void
10 | #ifdef _MSC_VER
11 | __cdecl
12 | #endif
13 | operator delete(void *p) throw();
14 | #endif
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/CPP/Common/StdInStream.h:
--------------------------------------------------------------------------------
1 | // Common/StdInStream.h
2 |
3 | #ifndef __COMMON_STDINSTREAM_H
4 | #define __COMMON_STDINSTREAM_H
5 |
6 | #include
7 |
8 | #include "MyString.h"
9 | #include "Types.h"
10 |
11 | class CStdInStream
12 | {
13 | bool _streamIsOpen;
14 | FILE *_stream;
15 | public:
16 | CStdInStream(): _streamIsOpen(false) {};
17 | CStdInStream(FILE *stream): _streamIsOpen(false), _stream(stream) {};
18 | ~CStdInStream();
19 | bool Open(LPCTSTR fileName);
20 | bool Close();
21 |
22 | AString ScanStringUntilNewLine(bool allowEOF = false);
23 | void ReadToString(AString &resultString);
24 | UString ScanUStringUntilNewLine();
25 |
26 | bool Eof();
27 | int GetChar();
28 | };
29 |
30 | extern CStdInStream g_StdIn;
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/jni/CPP/Common/StdOutStream.h:
--------------------------------------------------------------------------------
1 | // Common/StdOutStream.h
2 |
3 | #ifndef __COMMON_STDOUTSTREAM_H
4 | #define __COMMON_STDOUTSTREAM_H
5 |
6 | #include
7 |
8 | #include "Types.h"
9 |
10 | class CStdOutStream
11 | {
12 | bool _streamIsOpen;
13 | FILE *_stream;
14 | public:
15 | CStdOutStream (): _streamIsOpen(false), _stream(0) {};
16 | CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {};
17 | ~CStdOutStream ();
18 | operator FILE *() { return _stream; }
19 | bool Open(const char *fileName);
20 | bool Close();
21 | bool Flush();
22 | CStdOutStream & operator<<(CStdOutStream & (* aFunction)(CStdOutStream &));
23 | CStdOutStream & operator<<(const char *string);
24 | CStdOutStream & operator<<(const wchar_t *string);
25 | CStdOutStream & operator<<(char c);
26 | CStdOutStream & operator<<(int number);
27 | CStdOutStream & operator<<(UInt64 number);
28 | };
29 |
30 | CStdOutStream & endl(CStdOutStream & outStream);
31 |
32 | extern CStdOutStream g_StdOut;
33 | extern CStdOutStream g_StdErr;
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/CPP/Common/StringToInt.h:
--------------------------------------------------------------------------------
1 | // Common/StringToInt.h
2 |
3 | #ifndef __COMMON_STRINGTOINT_H
4 | #define __COMMON_STRINGTOINT_H
5 |
6 | #include
7 | #include "Types.h"
8 |
9 | UInt64 ConvertStringToUInt64(const char *s, const char **end);
10 | UInt64 ConvertOctStringToUInt64(const char *s, const char **end);
11 | UInt64 ConvertHexStringToUInt64(const char *s, const char **end);
12 | UInt64 ConvertStringToUInt64(const wchar_t *s, const wchar_t **end);
13 |
14 | Int64 ConvertStringToInt64(const char *s, const char **end);
15 |
16 | #endif
17 |
18 |
19 |
--------------------------------------------------------------------------------
/jni/CPP/Common/TextConfig.h:
--------------------------------------------------------------------------------
1 | // Common/TextConfig.h
2 |
3 | #ifndef __COMMON_TEXTCONFIG_H
4 | #define __COMMON_TEXTCONFIG_H
5 |
6 | #include "MyVector.h"
7 | #include "MyString.h"
8 |
9 | struct CTextConfigPair
10 | {
11 | UString ID;
12 | UString String;
13 | };
14 |
15 | bool GetTextConfig(const AString &text, CObjectVector &pairs);
16 |
17 | int FindTextConfigItem(const CObjectVector &pairs, const UString &id);
18 | UString GetTextConfigValue(const CObjectVector &pairs, const UString &id);
19 |
20 | #endif
21 |
22 |
23 |
--------------------------------------------------------------------------------
/jni/CPP/Common/Types.h:
--------------------------------------------------------------------------------
1 | // Common/Types.h
2 |
3 | #ifndef __COMMON_TYPES_H
4 | #define __COMMON_TYPES_H
5 |
6 | #include "../../C/Types.h"
7 |
8 | typedef int HRes;
9 |
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/jni/CPP/Common/UTFConvert.h:
--------------------------------------------------------------------------------
1 | // Common/UTFConvert.h
2 |
3 | #ifndef __COMMON_UTFCONVERT_H
4 | #define __COMMON_UTFCONVERT_H
5 |
6 | #include "MyString.h"
7 |
8 | bool ConvertUTF8ToUnicode(const AString &utfString, UString &resultString);
9 | bool ConvertUnicodeToUTF8(const UString &unicodeString, AString &resultString);
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/COM.cpp:
--------------------------------------------------------------------------------
1 | // Windows/COM.cpp
2 |
3 | #include "StdAfx.h"
4 |
5 | #include "Windows/COM.h"
6 | #include "Common/StringConvert.h"
7 |
8 | namespace NWindows {
9 | namespace NCOM {
10 |
11 | // CoInitialize (NULL); must be called!
12 |
13 | UString GUIDToStringW(REFGUID guid)
14 | {
15 | UString string;
16 | const int kStringSize = 48;
17 | StringFromGUID2(guid, string.GetBuffer(kStringSize), kStringSize);
18 | string.ReleaseBuffer();
19 | return string;
20 | }
21 |
22 | AString GUIDToStringA(REFGUID guid)
23 | {
24 | return UnicodeStringToMultiByte(GUIDToStringW(guid));
25 | }
26 |
27 | HRESULT StringToGUIDW(const wchar_t *string, GUID &classID)
28 | {
29 | return CLSIDFromString((wchar_t *)string, &classID);
30 | }
31 |
32 | HRESULT StringToGUIDA(const char *string, GUID &classID)
33 | {
34 | return StringToGUIDW(MultiByteToUnicodeString(string), classID);
35 | }
36 |
37 | }}
38 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Clipboard.h:
--------------------------------------------------------------------------------
1 | // Windows/Clipboard.h
2 |
3 | #ifndef __CLIPBOARD_H
4 | #define __CLIPBOARD_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | namespace NWindows {
9 |
10 | class CClipboard
11 | {
12 | bool m_Open;
13 | public:
14 | CClipboard(): m_Open(false) {};
15 | ~CClipboard();
16 | bool Open(HWND wndNewOwner);
17 | bool Close();
18 | };
19 |
20 | bool ClipboardIsFormatAvailableHDROP();
21 |
22 | // bool ClipboardGetFileNames(UStringVector &names);
23 | // bool ClipboardGetTextString(AString &s);
24 | bool ClipboardSetText(HWND owner, const UString &s);
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/CommonDialog.h:
--------------------------------------------------------------------------------
1 | // Windows/CommonDialog.h
2 |
3 | #ifndef __WINDOWS_COMMON_DIALOG_H
4 | #define __WINDOWS_COMMON_DIALOG_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | namespace NWindows{
9 |
10 | bool MyGetOpenFileName(HWND hwnd, LPCWSTR title, LPCWSTR fullFileName,
11 | LPCWSTR s, UString &resPath
12 | #ifdef UNDER_CE
13 | , bool openFolder = false
14 | #endif
15 | );
16 |
17 | }
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Control/Edit.h:
--------------------------------------------------------------------------------
1 | // Windows/Control/Edit.h
2 |
3 | #ifndef __WINDOWS_CONTROL_EDIT_H
4 | #define __WINDOWS_CONTROL_EDIT_H
5 |
6 | #include "Windows/Window.h"
7 | #include "Windows/Defs.h"
8 |
9 | namespace NWindows {
10 | namespace NControl {
11 |
12 | class CEdit: public CWindow
13 | {
14 | public:
15 | void SetPasswordChar(WPARAM c);
16 | void Show(int cmdShow);
17 | virtual void SetText(LPCWSTR s);
18 | virtual bool GetText(CSysString &s);
19 | };
20 |
21 | }}
22 |
23 | #endif
24 |
25 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Control/ProgressBar.h:
--------------------------------------------------------------------------------
1 | // Windows/Control/ProgressBar.h
2 |
3 | #ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
4 | #define __WINDOWS_CONTROL_PROGRESSBAR_H
5 |
6 | #include "Windows/Window.h"
7 | #include "Windows/Defs.h"
8 |
9 | class wxGauge;
10 |
11 | namespace NWindows {
12 | namespace NControl {
13 |
14 |
15 | class CProgressBar : public CWindow
16 | {
17 | protected:
18 | wxGauge* _window;
19 | int _minValue;
20 | int _range;
21 | public:
22 | CProgressBar(wxWindow* newWindow = NULL);
23 |
24 | void Attach(wxWindow* newWindow);
25 |
26 | void SetRange32(int minValue, int maxValue);
27 |
28 | void SetPos(int pos);
29 | };
30 |
31 | }}
32 |
33 | #endif
34 |
35 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Control/Static.h:
--------------------------------------------------------------------------------
1 | // Windows/Control/Static.h
2 |
3 | #ifndef __WINDOWS_CONTROL_STATIC_H
4 | #define __WINDOWS_CONTROL_STATIC_H
5 |
6 | #include "Windows/Window.h"
7 | #include "Windows/Defs.h"
8 |
9 | typedef void * HICON;
10 |
11 | namespace NWindows {
12 | namespace NControl {
13 |
14 | class CStatic : public CWindow
15 | {
16 | public:
17 |
18 | HICON SetIcon(HICON icon) { return 0; } // FIXME
19 | };
20 |
21 | }}
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/DLL.h:
--------------------------------------------------------------------------------
1 | // Windows/DLL.h
2 |
3 | #ifndef __WINDOWS_DLL_H
4 | #define __WINDOWS_DLL_H
5 |
6 | #include "../Common/MyString.h"
7 |
8 | typedef void * HMODULE;
9 |
10 | typedef int (*FARPROC)();
11 |
12 | namespace NWindows {
13 | namespace NDLL {
14 |
15 | class CLibrary
16 | {
17 | bool LoadOperations(HMODULE newModule);
18 | HMODULE _module;
19 | public:
20 | operator HMODULE() const { return _module; }
21 | HMODULE* operator&() { return &_module; }
22 |
23 |
24 | CLibrary():_module(NULL) {};
25 | ~CLibrary();
26 |
27 | bool Free();
28 |
29 | void Attach(HMODULE m)
30 | {
31 | Free();
32 | _module = m;
33 | }
34 | HMODULE Detach()
35 | {
36 | HMODULE m = _module;
37 | _module = NULL;
38 | return m;
39 | }
40 |
41 |
42 | bool Load(LPCTSTR fileName);
43 | FARPROC GetProc(LPCSTR procName) const;
44 | };
45 |
46 | }}
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Defs.h:
--------------------------------------------------------------------------------
1 | // Windows/Defs.h
2 |
3 | #ifndef __WINDOWS_DEFS_H
4 | #define __WINDOWS_DEFS_H
5 |
6 | #include "../Common/MyWindows.h"
7 |
8 | // #ifdef _WIN32
9 | inline bool LRESULTToBool(LRESULT v) { return (v != FALSE); }
10 | inline bool BOOLToBool(BOOL v) { return (v != FALSE); }
11 | inline BOOL BoolToBOOL(bool v) { return (v ? TRUE: FALSE); }
12 | // #endif
13 |
14 | inline VARIANT_BOOL BoolToVARIANT_BOOL(bool v) { return (v ? VARIANT_TRUE: VARIANT_FALSE); }
15 | inline bool VARIANT_BOOLToBool(VARIANT_BOOL v) { return (v != VARIANT_FALSE); }
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Error.h:
--------------------------------------------------------------------------------
1 | // Windows/Error.h
2 |
3 | #ifndef __WINDOWS_ERROR_H
4 | #define __WINDOWS_ERROR_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | namespace NWindows {
9 | namespace NError {
10 |
11 | bool MyFormatMessage(DWORD messageID, CSysString &message);
12 | inline CSysString MyFormatMessage(DWORD messageID)
13 | {
14 | CSysString message;
15 | MyFormatMessage(messageID, message);
16 | return message;
17 | }
18 | #ifdef _UNICODE
19 | inline UString MyFormatMessageW(DWORD messageID)
20 | { return MyFormatMessage(messageID); }
21 | #else
22 | bool MyFormatMessage(DWORD messageID, UString &message);
23 | inline UString MyFormatMessageW(DWORD messageID)
24 | {
25 | UString message;
26 | MyFormatMessage(messageID, message);
27 | return message;
28 | }
29 | #endif
30 |
31 | }}
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/FileName.h:
--------------------------------------------------------------------------------
1 | // Windows/FileName.h
2 |
3 | #ifndef __WINDOWS_FILENAME_H
4 | #define __WINDOWS_FILENAME_H
5 |
6 | #include "../../C/Types.h"
7 |
8 | #include "../Common/MyString.h"
9 |
10 | namespace NWindows {
11 | namespace NFile {
12 | namespace NName {
13 |
14 | const TCHAR kDirDelimiter = CHAR_PATH_SEPARATOR;
15 | const TCHAR kAnyStringWildcard = '*';
16 |
17 | void NormalizeDirPathPrefix(CSysString &dirPath); // ensures that it ended with '\\'
18 | #ifndef _UNICODE
19 | void NormalizeDirPathPrefix(UString &dirPath); // ensures that it ended with '\\'
20 | #endif
21 |
22 | void SplitNameToPureNameAndExtension(const UString &fullName,
23 | UString &pureName, UString &extensionDelimiter, UString &extension);
24 |
25 | }}}
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Menu.h:
--------------------------------------------------------------------------------
1 |
2 | /* TODO */
3 |
4 |
5 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/NtCheck.h:
--------------------------------------------------------------------------------
1 | // Windows/NtCheck.h
2 |
3 | #ifndef __WINDOWS_NT_CHECK_H
4 | #define __WINDOWS_NT_CHECK_H
5 |
6 | #ifdef _WIN32
7 |
8 | #if !defined(_WIN64) && !defined(UNDER_CE)
9 | static inline bool IsItWindowsNT()
10 | {
11 | OSVERSIONINFO vi;
12 | vi.dwOSVersionInfoSize = sizeof(vi);
13 | return (::GetVersionEx(&vi) && vi.dwPlatformId == VER_PLATFORM_WIN32_NT);
14 | }
15 | #endif
16 |
17 | #ifndef _UNICODE
18 | #if defined(_WIN64) || defined(UNDER_CE)
19 | bool g_IsNT = true;
20 | #define SET_IS_NT
21 | #else
22 | bool g_IsNT = false;
23 | #define SET_IS_NT g_IsNT = IsItWindowsNT();
24 | #endif
25 | #define NT_CHECK_ACTION
26 | // #define NT_CHECK_ACTION { NT_CHECK_FAIL_ACTION }
27 | #else
28 | #if !defined(_WIN64) && !defined(UNDER_CE)
29 | #define NT_CHECK_ACTION if (!IsItWindowsNT()) { NT_CHECK_FAIL_ACTION }
30 | #else
31 | #define NT_CHECK_ACTION
32 | #endif
33 | #define SET_IS_NT
34 | #endif
35 |
36 | #define NT_CHECK NT_CHECK_ACTION SET_IS_NT
37 |
38 | #else
39 |
40 | #define NT_CHECK
41 |
42 | #endif
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/PropVariantConversions.h:
--------------------------------------------------------------------------------
1 | // Windows/PropVariantConversions.h
2 |
3 | #ifndef __PROP_VARIANT_CONVERSIONS_H
4 | #define __PROP_VARIANT_CONVERSIONS_H
5 |
6 | #include "Common/MyString.h"
7 | #include "Common/Types.h"
8 |
9 | bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime = true, bool includeSeconds = true);
10 | UString ConvertFileTimeToString(const FILETIME &ft, bool includeTime = true, bool includeSeconds = true);
11 | UString ConvertPropVariantToString(const PROPVARIANT &prop);
12 | UInt64 ConvertPropVariantToUInt64(const PROPVARIANT &prop);
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/PropVariantUtils.h:
--------------------------------------------------------------------------------
1 | // Windows/PropVariantUtils.h
2 |
3 | #ifndef __PROP_VARIANT_UTILS_H
4 | #define __PROP_VARIANT_UTILS_H
5 |
6 | #include "Common/MyString.h"
7 | #include "PropVariant.h"
8 |
9 | struct CUInt32PCharPair
10 | {
11 | UInt32 Value;
12 | const char *Name;
13 | };
14 |
15 | void StringToProp(const AString &s, NWindows::NCOM::CPropVariant &prop);
16 | void PairToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
17 |
18 | AString FlagsToString(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags);
19 | void FlagsToProp(const CUInt32PCharPair *pairs, unsigned num, UInt32 flags, NWindows::NCOM::CPropVariant &prop);
20 |
21 | AString TypeToString(const char *table[], unsigned num, UInt32 value);
22 | void TypeToProp(const char *table[], unsigned num, UInt32 value, NWindows::NCOM::CPropVariant &prop);
23 |
24 | #define PAIR_TO_PROP(pairs, value, prop) PairToProp(pairs, sizeof(pairs) / sizeof(pairs[0]), value, prop)
25 | #define FLAGS_TO_PROP(pairs, value, prop) FlagsToProp(pairs, sizeof(pairs) / sizeof(pairs[0]), value, prop)
26 | #define TYPE_TO_PROP(table, value, prop) TypeToProp(table, sizeof(table) / sizeof(table[0]), value, prop)
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/ResourceString.h:
--------------------------------------------------------------------------------
1 | // Windows/ResourceString.h
2 |
3 | #ifndef __WINDOWS_RESOURCESTRING_H
4 | #define __WINDOWS_RESOURCESTRING_H
5 |
6 | #include "Common/MyString.h"
7 |
8 | namespace NWindows {
9 |
10 | CSysString MyLoadString(HINSTANCE hInstance, UINT resourceID);
11 | CSysString MyLoadString(UINT resourceID);
12 | #ifdef _UNICODE
13 | inline UString MyLoadStringW(HINSTANCE hInstance, UINT resourceID) { return MyLoadString(hInstance, resourceID); }
14 | inline UString MyLoadStringW(UINT resourceID) { return MyLoadString(resourceID); }
15 | #else
16 | UString MyLoadStringW(HINSTANCE hInstance, UINT resourceID);
17 | UString MyLoadStringW(UINT resourceID);
18 | #endif
19 |
20 | }
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Shell.h:
--------------------------------------------------------------------------------
1 | // Windows/Shell.h
2 |
3 | #ifndef __WINDOWS_SHELL_H
4 | #define __WINDOWS_SHELL_H
5 |
6 | #include
7 | // #include
8 |
9 | #include "Common/MyString.h"
10 | #include "Windows/Defs.h"
11 |
12 |
13 | namespace NWindows{
14 | namespace NShell{
15 |
16 | bool BrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR initialFolder, UString &resultPath);
17 |
18 | }}
19 |
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/System.h:
--------------------------------------------------------------------------------
1 | // Windows/System.h
2 |
3 | #ifndef __WINDOWS_SYSTEM_H
4 | #define __WINDOWS_SYSTEM_H
5 |
6 | #include "../Common/Types.h"
7 |
8 | namespace NWindows {
9 | namespace NSystem {
10 |
11 | UInt32 GetNumberOfProcessors();
12 | UInt64 GetRamSize();
13 |
14 | }}
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Time.h:
--------------------------------------------------------------------------------
1 | // Windows/Time.h
2 |
3 | #ifndef __WINDOWS_TIME_H
4 | #define __WINDOWS_TIME_H
5 |
6 | #include "Common/Types.h"
7 |
8 | namespace NWindows {
9 | namespace NTime {
10 |
11 | bool DosTimeToFileTime(UInt32 dosTime, FILETIME &fileTime);
12 | bool FileTimeToDosTime(const FILETIME &fileTime, UInt32 &dosTime);
13 | void UnixTimeToFileTime(UInt32 unixTime, FILETIME &fileTime);
14 | bool FileTimeToUnixTime(const FILETIME &fileTime, UInt32 &unixTime);
15 | bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day,
16 | unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds);
17 | void GetCurUtcFileTime(FILETIME &ft);
18 |
19 | }}
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/CPP/Windows/Window.h:
--------------------------------------------------------------------------------
1 | // Windows/Window.h
2 |
3 | #ifndef __WINDOWS_WINDOW_H
4 | #define __WINDOWS_WINDOW_H
5 |
6 | #include "Windows/Defs.h"
7 | #include "Common/MyString.h"
8 |
9 | namespace NWindows {
10 |
11 | HWND GetDlgItem(HWND dialogWindow, int ControlID);
12 | void MySetWindowText(HWND wnd, LPCWSTR s);
13 |
14 | class CWindow
15 | {
16 | private:
17 | // bool ModifyStyleBase(int styleOffset, DWORD remove, DWORD add, UINT flags);
18 | protected:
19 | HWND _window;
20 | public:
21 | CWindow(HWND newWindow = NULL): _window(newWindow){};
22 | CWindow& operator=(HWND newWindow)
23 | {
24 | _window = newWindow;
25 | return *this;
26 | }
27 | operator HWND() const { return _window; }
28 | void Attach(HWND newWindow) { _window = newWindow; }
29 | HWND Detach()
30 | {
31 | HWND window = _window;
32 | _window = NULL;
33 | return window;
34 | }
35 | virtual void SetText(LPCWSTR s) { MySetWindowText(_window, s); }
36 | virtual bool GetText(CSysString &s);
37 | bool IsEnabled();
38 | };
39 |
40 | }
41 |
42 | #endif
43 |
44 |
--------------------------------------------------------------------------------
/jni/CPP/include_windows/basetyps.h:
--------------------------------------------------------------------------------
1 | #ifndef _BASETYPS_H
2 | #define _BASETYPS_H
3 |
4 | #ifdef ENV_HAVE_GCCVISIBILITYPATCH
5 | #define DLLEXPORT __attribute__ ((visibility("default")))
6 | #else
7 | #define DLLEXPORT
8 | #endif
9 |
10 | #ifdef __cplusplus
11 | #define STDAPI extern "C" DLLEXPORT HRESULT
12 | #else
13 | #define STDAPI extern DLLEXPORT HRESULT
14 | #endif /* __cplusplus */
15 |
16 | typedef GUID IID;
17 | typedef GUID CLSID;
18 | #endif
19 |
20 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/initguid.h:
--------------------------------------------------------------------------------
1 | // initguid.h
2 |
3 | #include "Common/MyInitGuid.h"
4 |
5 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/makefile:
--------------------------------------------------------------------------------
1 | PROG=test_emul
2 |
3 | LOCAL_FLAGS=-I. -I.. -I../include_windows -DUNICODE -D_UNICODE
4 |
5 | include ../../makefile.crc32
6 | include ../../makefile.machine
7 |
8 | LIBS=$(LOCAL_LIBS)
9 |
10 | OBJS=myGetTickCount.o \
11 | wine_date_and_time.o \
12 | mySplitCommandLine.o \
13 | myAddExeFlag.o \
14 | wine_GetXXXDefaultLangID.o \
15 | test_emul.o \
16 | MyVector.o \
17 | MyString.o \
18 | MyWindows.o
19 |
20 | include ../../makefile.glb
21 |
22 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/makefile.list:
--------------------------------------------------------------------------------
1 | SRCS=myGetTickCount.cpp \
2 | mySplitCommandLine.cpp \
3 | myAddExeFlag.cpp \
4 | test_emul.cpp \
5 | wine_date_and_time.cpp \
6 | wine_GetXXXDefaultLangID.cpp \
7 | ../Common/MyVector.cpp \
8 | ../Common/MyString.cpp \
9 | ../Common/MyWindows.cpp
10 |
11 | mySplitCommandLine.o : mySplitCommandLine.cpp
12 | $(CXX) $(CXXFLAGS) mySplitCommandLine.cpp
13 | myAddExeFlag.o : myAddExeFlag.cpp
14 | $(CXX) $(CXXFLAGS) myAddExeFlag.cpp
15 | myGetTickCount.o : myGetTickCount.cpp
16 | $(CXX) $(CXXFLAGS) myGetTickCount.cpp
17 | test_emul.o : test_emul.cpp
18 | $(CXX) $(CXXFLAGS) test_emul.cpp
19 | wine_date_and_time.o : wine_date_and_time.cpp
20 | $(CXX) $(CXXFLAGS) wine_date_and_time.cpp
21 | wine_GetXXXDefaultLangID.o : wine_GetXXXDefaultLangID.cpp
22 | $(CXX) $(CXXFLAGS) wine_GetXXXDefaultLangID.cpp
23 | MyVector.o : ../Common/MyVector.cpp
24 | $(CXX) $(CXXFLAGS) ../Common/MyVector.cpp
25 | MyString.o : ../Common/MyString.cpp
26 | $(CXX) $(CXXFLAGS) ../Common/MyString.cpp
27 | MyWindows.o : ../Common/MyWindows.cpp
28 | $(CXX) $(CXXFLAGS) ../Common/MyWindows.cpp
29 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/myAddExeFlag.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | #define NEED_NAME_WINDOWS_TO_UNIX
9 | #include "myPrivate.h"
10 |
11 | #include "Common/StringConvert.h"
12 |
13 | void myAddExeFlag(const UString &u_name)
14 | {
15 | AString filename = UnicodeStringToMultiByte(u_name, CP_ACP); // FIXME
16 | const char * name = nameWindowToUnix(filename);
17 | // printf("myAddExeFlag(%s)\n",name);
18 | chmod(name,0700);
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/myGetTickCount.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 |
3 | #include
4 |
5 | DWORD WINAPI GetTickCount(VOID) {
6 | return (DWORD)time(0); // FIXME : but only for the seed of the random generator
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/jni/CPP/myWindows/myPrivate.h:
--------------------------------------------------------------------------------
1 |
2 | void WINAPI RtlSecondsSince1970ToFileTime( DWORD Seconds, FILETIME * ft );
3 |
4 | extern "C" int global_use_utf16_conversion;
5 | #ifdef ENV_HAVE_LSTAT
6 | extern "C" int global_use_lstat;
7 | #endif
8 |
9 | const char *my_getlocale(void);
10 |
11 | #ifdef NEED_NAME_WINDOWS_TO_UNIX
12 | static inline const char * nameWindowToUnix(const char * lpFileName) {
13 | if ((lpFileName[0] == 'c') && (lpFileName[1] == ':')) return lpFileName+2;
14 | return lpFileName;
15 | }
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/jni/makefile.crc32:
--------------------------------------------------------------------------------
1 |
2 | # CRC32, C version
3 | OBJ_CRC32_C=7zCrc.o 7zCrcOpt.o
4 |
5 | # CRC32, ASM version
6 | OBJ_CRC32_x86=7zCrcT8.o 7zCrcT8U.o
7 | OBJ_CRC32_x86_64=7zCrcT8.o 7zCrcT8U.o
8 |
9 |
--------------------------------------------------------------------------------
/jni/makefile.glb:
--------------------------------------------------------------------------------
1 |
2 | RM=rm -f
3 | CFLAGS=-c -I. \
4 | -I../../../../C \
5 | -I../../../myWindows \
6 | -I../../../include_windows \
7 | -I../../..
8 |
9 | CXXFLAGS=-c -I. \
10 | -I../../../myWindows \
11 | -I../../../ \
12 | -I../../../include_windows
13 |
14 | DFLAGS=-MM -I. \
15 | -I../../../myWindows \
16 | -I../../../ \
17 | -I../../../include_windows
18 |
19 | all: $(PCH_NAME) $(PROG)
20 |
21 | shared: $(PCH_NAME) $(SHARED_LIB)
22 |
23 | $(PROG): $(OBJS)
24 | $(CXX) $(LOCAL_SHARED) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
25 |
26 | $(SHARED_LIB): $(OBJS)
27 | $(CXX) $(LINK_SHARED) $(LOCAL_SHARED) -o $@ $(LDFLAGS) $^ $(LIBS)
28 |
29 | include makefile.list
30 | include makefile.depend
31 |
32 | depend:
33 | rm -f makefile.depend
34 | $(CXX) $(DFLAGS) $(SRCS) > makefile.depend
35 |
36 | clean:
37 | -@$(RM) $(PROG) core *.exe *.o *~ .*.swp *.orig *.gch $(PROGS)
38 | -@$(RM) $(SHARED_LIB)
39 | -@$(RM) -fr SunWS_cache/
40 | -@$(RM) -r .inslog2 pchdir/ tca.map ir.out
41 | -@$(RM) make.log tags 1 2
42 |
43 | # CRC32, ASM version
44 | 7zCrcT8U.o : ../../../../Asm/$(CPU)/7zCrcT8U.asm
45 | $(ASM) ../../../../Asm/$(CPU)/7zCrcT8U.asm -o 7zCrcT8U.o
46 |
--------------------------------------------------------------------------------
/jni/makefile.machine:
--------------------------------------------------------------------------------
1 | #
2 | # makefile for Linux (x86, PPC, alpha ...)
3 | #
4 |
5 | OPTFLAGS=-O
6 |
7 | ALLFLAGS=${OPTFLAGS} -pipe -s \
8 | -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
9 | -DNDEBUG -D_REENTRANT -DENV_UNIX \
10 | -D_7ZIP_LARGE_PAGES \
11 | $(CC_SHARED) $(LOCAL_FLAGS)
12 |
13 | CXX=g++ $(ALLFLAGS)
14 | CC=gcc $(ALLFLAGS)
15 | CC_SHARED=-fPIC
16 | LINK_SHARED=-fPIC -shared
17 |
18 | LOCAL_LIBS=-lpthread
19 | LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
20 |
21 | OBJ_CRC32=$(OBJ_CRC32_C)
22 |
23 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-8
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlenderViking/extract-archive-android-lib/54081a5bbbd9f3eb62847c577df65207872100cd/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlenderViking/extract-archive-android-lib/54081a5bbbd9f3eb62847c577df65207872100cd/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlenderViking/extract-archive-android-lib/54081a5bbbd9f3eb62847c577df65207872100cd/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Extract-archive-android-lib
4 | File not found !
5 | File isn\'t a directory !
6 | File is a directory !
7 | Loading file complete !
8 | Error on loading file, please use a compatible format !
9 | Not enough memory for operation !
10 |
11 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/github/junrar/UnrarCallback.java:
--------------------------------------------------------------------------------
1 | package com.github.junrar;
2 |
3 | /**
4 | *
5 | * @author alban
6 | */
7 | public interface UnrarCallback {
8 |
9 | /**
10 | * Return true if the next volume is ready to be processed,
11 | * false otherwise.
12 | */
13 | boolean isNextVolumeReady(Volume nextVolume);
14 |
15 | /**
16 | * This method is invoked each time the progress of the current volume
17 | * changes.
18 | */
19 | void volumeProgressChanged(long current, long total);
20 | }
21 |
--------------------------------------------------------------------------------
/src/com/github/junrar/VolumeManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of seedbox .
3 | *
4 | * seedbox is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * seedbox is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with seedbox. If not, see .
16 | */
17 | package com.github.junrar;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * @author Rogiel
23 | *
24 | */
25 | public interface VolumeManager {
26 | public Volume nextArchive(Archive archive, Volume lastVolume)
27 | throws IOException;
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/github/junrar/crypt/Rijndael.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 31.05.2007
5 | *
6 | * the unrar licence applies to all junrar source and binary distributions
7 | * you are not allowed to use this source to re-create the RAR compression algorithm
8 | * Source: $HeadURL$
9 | * Last changed: $LastChangedDate$
10 | *
11 | * Here some html entities which can be used for escaping javadoc tags:
12 | * "&": "&" or "&"
13 | * "<": "<" or "<"
14 | * ">": ">" or ">"
15 | * "@": "@"
16 | */
17 | package com.github.junrar.crypt;
18 |
19 | /**
20 | * DOCUMENT ME
21 | *
22 | * @author $LastChangedBy$
23 | * @version $LastChangedRevision$
24 | */
25 | public class Rijndael {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/BitDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class BitDecode extends Decode {
27 | /**
28 | *
29 | */
30 | public BitDecode() {
31 | decodeNum = new int[Compress.BC];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/CodeType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * Here some html entities which can be used for escaping javadoc tags:
10 | * "&": "&" or "&"
11 | * "<": "<" or "<"
12 | * ">": ">" or ">"
13 | * "@": "@"
14 | */
15 | package com.github.junrar.unpack.decode;
16 |
17 | /**
18 | * DOCUMENT ME
19 | *
20 | * the unrar licence applies to all junrar source and binary distributions you
21 | * are not allowed to use this source to re-create the RAR compression algorithm
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public enum CodeType {
27 | CODE_HUFFMAN, CODE_LZ, CODE_LZ2, CODE_REPEATLZ, CODE_CACHELZ, CODE_STARTFILE, CODE_ENDFILE, CODE_VM, CODE_VMDATA;
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/DistDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class DistDecode extends Decode {
27 |
28 | /**
29 | *
30 | */
31 | public DistDecode() {
32 | decodeNum = new int[Compress.DC];
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/FilterType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public enum FilterType {
27 | FILTER_NONE, FILTER_PPM /* dummy */, FILTER_E8, FILTER_E8E9, FILTER_UPCASETOLOW, FILTER_AUDIO, FILTER_RGB, FILTER_DELTA, FILTER_ITANIUM, FILTER_E8E9V2;
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/LitDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class LitDecode extends Decode {
27 | /**
28 | *
29 | */
30 | public LitDecode() {
31 | decodeNum = new int[Compress.NC];
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/LowDistDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class LowDistDecode extends Decode {
27 |
28 | /**
29 | *
30 | */
31 | public LowDistDecode() {
32 | decodeNum = new int[Compress.LDC];
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/MultDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class MultDecode extends Decode {
27 |
28 | /**
29 | *
30 | */
31 | public MultDecode() {
32 | decodeNum = new int[Compress.MC20];
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unpack/decode/RepDecode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 01.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | * the unrar licence applies to all junrar source and binary distributions
10 | * you are not allowed to use this source to re-create the RAR compression algorithm
11 | *
12 | * Here some html entities which can be used for escaping javadoc tags:
13 | * "&": "&" or "&"
14 | * "<": "<" or "<"
15 | * ">": ">" or ">"
16 | * "@": "@"
17 | */
18 | package com.github.junrar.unpack.decode;
19 |
20 | /**
21 | * DOCUMENT ME
22 | *
23 | * @author $LastChangedBy$
24 | * @version $LastChangedRevision$
25 | */
26 | public class RepDecode extends Decode {
27 | /**
28 | *
29 | */
30 | public RepDecode() {
31 | decodeNum = new int[Compress.RC];
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unsigned/UnsignedInteger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 04.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | *
10 | * the unrar licence applies to all junrar source and binary distributions
11 | * you are not allowed to use this source to re-create the RAR compression algorithm
12 | *
13 | * Here some html entities which can be used for escaping javadoc tags:
14 | * "&": "&" or "&"
15 | * "<": "<" or "<"
16 | * ">": ">" or ">"
17 | * "@": "@"
18 | */
19 | package com.github.junrar.unsigned;
20 |
21 | /**
22 | * DOCUMENT ME
23 | *
24 | * @author $LastChangedBy$
25 | * @version $LastChangedRevision$
26 | */
27 | public class UnsignedInteger {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unsigned/UnsignedLong.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 04.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | *
10 | * the unrar licence applies to all junrar source and binary distributions
11 | * you are not allowed to use this source to re-create the RAR compression algorithm
12 | *
13 | * Here some html entities which can be used for escaping javadoc tags:
14 | * "&": "&" or "&"
15 | * "<": "<" or "<"
16 | * ">": ">" or ">"
17 | * "@": "@"
18 | */
19 | package com.github.junrar.unsigned;
20 |
21 | /**
22 | * DOCUMENT ME
23 | *
24 | * @author $LastChangedBy$
25 | * @version $LastChangedRevision$
26 | */
27 | public class UnsignedLong {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/github/junrar/unsigned/UnsignedShort.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved.
3 | * Original author: Edmund Wagner
4 | * Creation date: 04.06.2007
5 | *
6 | * Source: $HeadURL$
7 | * Last changed: $LastChangedDate$
8 | *
9 | *
10 | * the unrar licence applies to all junrar source and binary distributions
11 | * you are not allowed to use this source to re-create the RAR compression algorithm
12 | *
13 | * Here some html entities which can be used for escaping javadoc tags:
14 | * "&": "&" or "&"
15 | * "<": "<" or "<"
16 | * ">": ">" or ">"
17 | * "@": "@"
18 | */
19 | package com.github.junrar.unsigned;
20 |
21 | /**
22 | * DOCUMENT ME
23 | *
24 | * @author $LastChangedBy$
25 | * @version $LastChangedRevision$
26 | */
27 | public class UnsignedShort {
28 |
29 | }
30 |
--------------------------------------------------------------------------------