react-native-update 10.34.3 → 10.34.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +34 -172
- package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +4 -4
- package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +63 -379
- package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +170 -415
- package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +10 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +1 -13
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +18 -171
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +4 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +7 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +4 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +4 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffPatch.workspace +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffZ.cbp +219 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HPatchZ.cbp +156 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/unitTest.cbp +65 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +105 -155
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +236 -363
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +317 -347
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +181 -295
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj.user +3 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +0 -9
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +14 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +32 -162
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +22 -89
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +13 -237
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +14 -194
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +10 -30
- package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +3 -458
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +71 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +3 -3
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +110 -484
- package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +193 -835
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +50 -99
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +8 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +6 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +25 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +113 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +97 -163
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +39 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +15 -15
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +2 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +4 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +57 -72
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +13 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +2 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +100 -311
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +72 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +487 -888
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +28 -45
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +247 -812
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +544 -1265
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +38 -123
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +0 -115
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +102 -272
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +12 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +4 -18
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +5 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/{divsufsort.cpp → divsufsort.c} +8 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +164 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +102 -5
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.c +13 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +97 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +44 -23
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +89 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +55 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/utils.c.inc.h +381 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +47 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +4 -11
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +26 -53
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +25 -103
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +130 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +7 -17
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +37 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +43 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +10 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +7 -22
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +46 -132
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +9 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +299 -650
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +82 -120
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +7 -87
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +9 -119
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +6 -2
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +15 -192
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.cpp +367 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +56 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +31 -225
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +94 -566
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +28 -222
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +117 -228
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +173 -678
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +22 -103
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +167 -485
- package/harmony/pushy/src/main/cpp/lzma/C/7z.h +6 -8
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +30 -39
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +217 -232
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +68 -404
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +79 -163
- package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +78 -160
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +58 -215
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +6 -15
- package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +23 -46
- package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +89 -311
- package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +68 -191
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +8 -30
- package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +108 -926
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +96 -246
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +8 -33
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +144 -177
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +42 -228
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +182 -377
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +143 -622
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +40 -81
- package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +58 -163
- package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +48 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +15 -228
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +133 -885
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +78 -428
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +31 -136
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +62 -53
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +495 -1114
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +25 -64
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +400 -969
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +24 -37
- package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +48 -25
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +7 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +7 -8
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +83 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +9 -11
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +92 -96
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +9 -12
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +4 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +6 -3
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +206 -384
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +315 -489
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +14 -21
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +87 -90
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +25 -28
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +88 -74
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +20 -21
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +34 -118
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +293 -712
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +70 -109
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +116 -237
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +95 -245
- package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +5 -122
- package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +4 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +143 -387
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +7 -67
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +114 -241
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +7 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +14 -731
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +14 -204
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.c +396 -0
- package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +2 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +79 -282
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +3 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +75 -32
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +56 -111
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +0 -24
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +0 -2
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +41 -18
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +2 -30
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +6 -7
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +2 -27
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +7 -10
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +22 -39
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +2 -9
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +1 -3
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +3 -5
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +47 -129
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +43 -97
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +8 -8
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +36 -228
- package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +295 -405
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +139 -194
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +11 -15
- package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +134 -200
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +13 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +90 -120
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +6 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +140 -183
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +57 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +44 -169
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +17 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +109 -141
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +57 -54
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +116 -336
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +9 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +136 -234
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +26 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +5 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +155 -280
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +40 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +59 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +2 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +3 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +9 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +387 -975
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +16 -44
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +0 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +8 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +87 -106
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +57 -57
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +43 -126
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +18 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +9 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +23 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +9 -61
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +27 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +26 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +10 -63
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +173 -319
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +113 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +53 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +208 -352
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +3 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +47 -227
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +5 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +1 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +53 -71
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +22 -85
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +4 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +166 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +4 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +30 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +7 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +1 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +12 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +9 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +5 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +51 -58
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +10 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +5 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +6 -92
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +19 -46
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +11 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +5 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +0 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +28 -136
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +5 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +62 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +24 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +100 -548
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +86 -125
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +116 -258
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +76 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +15 -34
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +9 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +82 -192
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +28 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +52 -78
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +83 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +67 -323
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +38 -123
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +8 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +13 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +12 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +7 -74
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +13 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +1 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +14 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +16 -16
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +50 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +21 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +42 -47
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +53 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +4 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +2 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +5 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +9 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +355 -556
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +59 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +13 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +5 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +18 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +16 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +53 -52
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +30 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +22 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +26 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +28 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +28 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +54 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +12 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +22 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +51 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +40 -232
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +14 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +35 -84
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +41 -42
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +25 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +17 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +12 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +32 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +16 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +20 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +32 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +18 -30
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +43 -208
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +25 -90
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +4 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +21 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +3 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +3 -26
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +172 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +7 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +12 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +9 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +50 -133
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +2 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +2 -53
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +177 -329
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +1 -97
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +183 -687
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +15 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +913 -2275
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +115 -353
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +106 -127
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +3 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +35 -272
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +64 -134
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +1200 -2608
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +20 -64
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +36 -253
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +233 -774
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +6 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +63 -156
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +10 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +2 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +6 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +65 -1991
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +29 -241
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +47 -45
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +179 -442
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +89 -147
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +380 -529
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +42 -75
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +86 -163
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +15 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +368 -595
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +47 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +146 -444
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +68 -103
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +42 -111
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +3 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +6 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +35 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +4 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +9 -91
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +1 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +19 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +12 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +41 -162
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +41 -88
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +81 -140
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +17 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +124 -182
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +7 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +109 -590
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +2 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +10 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +10 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +9 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +24 -320
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +26 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +6 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +195 -302
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +4 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +181 -416
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +197 -216
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +5 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +49 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +30 -50
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +1 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +3 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +0 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +10 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +17 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +130 -276
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +52 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +1 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +3 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +89 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +20 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +1 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +33 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +15 -15
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +22 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +3 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +13 -109
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +14 -25
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +1 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +90 -1
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +49 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +7 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +29 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +45 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +110 -132
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +9 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +5 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +31 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +21 -59
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +10 -95
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +81 -497
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +9 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +5 -17
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +2 -35
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +164 -347
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +35 -246
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +8 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +11 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +94 -184
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +11 -158
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +54 -148
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +27 -204
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +5 -38
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +16 -43
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +11 -20
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +5 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +39 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +11 -27
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +15 -458
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +2 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +89 -99
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +2 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +11 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +102 -677
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +5 -377
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +84 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +25 -107
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +14 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +8 -24
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +113 -197
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +12 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +10 -22
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +6 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +47 -242
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +51 -94
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +26 -33
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +22 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +13 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +34 -56
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +9 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +5 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +6 -8
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +7 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +8 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +10 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +2 -69
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +80 -728
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +7 -62
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +56 -756
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +19 -205
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +47 -569
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +28 -283
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +112 -369
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +3 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +113 -185
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +14 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +10 -66
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +2 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +4 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +14 -29
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +2 -2
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +2 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +56 -102
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +9 -68
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +14 -150
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +3 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +128 -212
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +20 -32
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +4 -4
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +2 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +18 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +56 -39
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +58 -539
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +14 -49
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +2 -5
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +0 -77
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +18 -240
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +38 -317
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +5 -154
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +10 -18
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +37 -291
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +10 -124
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +7 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +19 -98
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj +90 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +2 -6
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +0 -205
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +13 -93
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +13 -30
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
- package/package.json +1 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +0 -547
- package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +0 -112
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +0 -389
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +0 -73
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +0 -266
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +0 -58
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +0 -1
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +0 -215
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +0 -256
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +0 -7
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +0 -271
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +0 -228
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +0 -242
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +0 -287
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -8
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +0 -286
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +0 -308
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +0 -33
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +0 -774
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +0 -478
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +0 -222
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +0 -14
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +0 -168
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +0 -243
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +0 -51
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +0 -153
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +0 -54
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +0 -158
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +0 -49
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +0 -294
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +0 -59
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +0 -217
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +0 -349
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +0 -110
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +0 -366
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +0 -91
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +0 -31
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +0 -497
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +0 -106
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +0 -254
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +0 -39
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +0 -37
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +0 -62
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +0 -44
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +0 -156
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +0 -440
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +0 -88
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +0 -332
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +0 -48
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +0 -198
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +0 -697
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +0 -74
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +0 -262
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +0 -174
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +0 -252
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +0 -67
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +0 -680
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +0 -137
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +0 -83
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +0 -125
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +0 -56
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +0 -147
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +0 -354
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +0 -76
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +0 -521
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +0 -69
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +0 -122
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +0 -36
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +0 -81
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +0 -247
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +0 -71
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +0 -351
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +0 -42
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +0 -124
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +0 -38
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +0 -203
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +0 -55
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +0 -79
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +0 -66
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +0 -628
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +0 -95
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +0 -78
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +0 -950
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +0 -72
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +0 -181
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +0 -1487
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +0 -540
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +0 -275
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +0 -860
- package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +0 -101
- package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +0 -360
- package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +0 -578
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +0 -451
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +0 -835
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +0 -17
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +0 -4
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +0 -1
- package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +0 -51
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +0 -1370
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +0 -279
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +0 -215
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +0 -855
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +0 -160
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +0 -14
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +0 -6
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +0 -72
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +0 -187
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +0 -218
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +0 -48
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +0 -67
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +0 -23
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +0 -19
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +0 -12
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +0 -10
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +0 -13
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +0 -11
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +0 -3
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +0 -9
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +0 -330
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +0 -93
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +0 -41
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +0 -7
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +0 -130
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +0 -28
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +0 -36
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +0 -55
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +0 -1251
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +0 -19
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
#ifndef HPatch_decompress_plugin_demo_h
|
|
29
29
|
#define HPatch_decompress_plugin_demo_h
|
|
30
30
|
//decompress plugin demo:
|
|
31
|
-
// zlibDecompressPlugin;
|
|
32
|
-
// ldefDecompressPlugin; // optimized deompress speed for deflate encoding
|
|
31
|
+
// zlibDecompressPlugin;
|
|
33
32
|
// bz2DecompressPlugin;
|
|
34
33
|
// lzmaDecompressPlugin;
|
|
35
34
|
// lzma2DecompressPlugin;
|
|
@@ -37,44 +36,19 @@
|
|
|
37
36
|
// zstdDecompressPlugin;
|
|
38
37
|
// brotliDecompressPlugin;
|
|
39
38
|
// lzhamDecompressPlugin;
|
|
40
|
-
// tuzDecompressPlugin;
|
|
41
39
|
|
|
42
|
-
// _bz2DecompressPlugin_unsz : support for bspatch_with_cache()
|
|
43
|
-
// _7zXZDecompressPlugin : support for vcpatch_with_cache(), diffData created by "xdelta3 -S lzma ..."
|
|
44
|
-
// _7zXZDecompressPlugin_a : support for vcpatch_with_cache(), diffData created by "hdiffz -VCD-compressLevel ..."
|
|
45
40
|
#include <stdlib.h> //malloc free
|
|
46
41
|
#include <stdio.h> //fprintf
|
|
47
42
|
#include "libHDiffPatch/HPatch/patch_types.h"
|
|
48
43
|
|
|
49
44
|
#ifndef kDecompressBufSize
|
|
50
|
-
# define kDecompressBufSize (1024*
|
|
45
|
+
# define kDecompressBufSize (1024*16)
|
|
51
46
|
#endif
|
|
52
47
|
#ifndef _IsNeedIncludeDefaultCompressHead
|
|
53
48
|
# define _IsNeedIncludeDefaultCompressHead 1
|
|
54
49
|
#endif
|
|
55
50
|
|
|
56
|
-
#define
|
|
57
|
-
#define _dec_memErr_rt() do { _dec_memErr(); return 0; } while(0)
|
|
58
|
-
#define _dec_openErr_rt() do { _hpatch_update_decError(decompressPlugin,hpatch_dec_open_error); return 0; } while(0)
|
|
59
|
-
#define _dec_close_check(value) { if (!(value)) { LOG_ERR("check "#value " ERROR!\n"); \
|
|
60
|
-
result=hpatch_FALSE; _hpatch_update_decError(decompressPlugin,hpatch_dec_close_error); } }
|
|
61
|
-
|
|
62
|
-
#define _dec_onDecErr_rt() do { if (!(self)->decError) (self)->decError=hpatch_dec_error; return 0; } while(0)
|
|
63
|
-
#define _dec_onDecErr_up() do { if ((self)->decError) _hpatch_update_decError(decompressPlugin,(self)->decError); } while(0)
|
|
64
|
-
|
|
65
|
-
static void* _dec_malloc(hpatch_size_t size) {
|
|
66
|
-
void* result=malloc(size);
|
|
67
|
-
if (!result) LOG_ERRNO(errno);
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
#define __dec_Alloc_fun(_type_TDecompress,p,size) { \
|
|
71
|
-
void* result=_dec_malloc(size); \
|
|
72
|
-
if (!result) \
|
|
73
|
-
((_type_TDecompress*)p)->decError=hpatch_dec_mem_error; \
|
|
74
|
-
return result; }
|
|
75
|
-
|
|
76
|
-
static void __dec_free(void* _, void* address){
|
|
77
|
-
if (address) free(address); }
|
|
51
|
+
#define _close_check(value) { if (!(value)) { fprintf(stderr,"check "#value " ERROR!\n"); result=hpatch_FALSE; } }
|
|
78
52
|
|
|
79
53
|
#ifdef _CompressPlugin_zlib
|
|
80
54
|
#if (_IsNeedIncludeDefaultCompressHead)
|
|
@@ -89,42 +63,42 @@ static void __dec_free(void* _, void* address){
|
|
|
89
63
|
size_t dec_buf_size;
|
|
90
64
|
z_stream d_stream;
|
|
91
65
|
signed char windowBits;
|
|
92
|
-
hpatch_dec_error_t decError;
|
|
93
66
|
} _zlib_TDecompress;
|
|
94
|
-
static void * __zlib_dec_Alloc(void* p,uInt items,uInt size)
|
|
95
|
-
__dec_Alloc_fun(_zlib_TDecompress,p,((items)*(size_t)(size)))
|
|
96
67
|
static hpatch_BOOL _zlib_is_can_open(const char* compressType){
|
|
97
68
|
return (0==strcmp(compressType,"zlib"))||(0==strcmp(compressType,"pzlib"));
|
|
98
69
|
}
|
|
99
70
|
|
|
100
|
-
static _zlib_TDecompress*
|
|
71
|
+
static _zlib_TDecompress* _zlib_decompress_open_by(hpatch_TDecompress* decompressPlugin,
|
|
101
72
|
const hpatch_TStreamInput* codeStream,
|
|
102
73
|
hpatch_StreamPos_t code_begin,
|
|
103
74
|
hpatch_StreamPos_t code_end,
|
|
104
75
|
int isSavedWindowBits,
|
|
105
|
-
|
|
76
|
+
unsigned char* _mem_buf,size_t _mem_buf_size){
|
|
77
|
+
_zlib_TDecompress* self=0;
|
|
106
78
|
int ret;
|
|
107
79
|
signed char kWindowBits=-MAX_WBITS;
|
|
108
|
-
assert(_self_and_buf_size>sizeof(_zlib_TDecompress));
|
|
109
80
|
if (isSavedWindowBits){//load kWindowBits
|
|
110
|
-
if (code_end-code_begin<1)
|
|
81
|
+
if (code_end-code_begin<1) return 0;
|
|
111
82
|
if (!codeStream->read(codeStream,code_begin,(unsigned char*)&kWindowBits,
|
|
112
83
|
(unsigned char*)&kWindowBits+1)) return 0;
|
|
113
84
|
++code_begin;
|
|
114
85
|
}
|
|
115
86
|
|
|
87
|
+
self=(_zlib_TDecompress*)_hpatch_align_upper(_mem_buf,sizeof(hpatch_StreamPos_t));
|
|
88
|
+
assert((_mem_buf+_mem_buf_size)>((unsigned char*)self+sizeof(_zlib_TDecompress)));
|
|
89
|
+
_mem_buf_size=(_mem_buf+_mem_buf_size)-((unsigned char*)self+sizeof(_zlib_TDecompress));
|
|
90
|
+
_mem_buf=(unsigned char*)self+sizeof(_zlib_TDecompress);
|
|
91
|
+
|
|
116
92
|
memset(self,0,sizeof(_zlib_TDecompress));
|
|
117
|
-
self->dec_buf=
|
|
118
|
-
self->dec_buf_size=
|
|
93
|
+
self->dec_buf=_mem_buf;
|
|
94
|
+
self->dec_buf_size=_mem_buf_size;
|
|
119
95
|
self->codeStream=codeStream;
|
|
120
96
|
self->code_begin=code_begin;
|
|
121
97
|
self->code_end=code_end;
|
|
122
98
|
self->windowBits=kWindowBits;
|
|
123
|
-
|
|
124
|
-
self->d_stream.zfree=__dec_free;
|
|
125
|
-
self->d_stream.opaque=self;
|
|
99
|
+
|
|
126
100
|
ret = inflateInit2(&self->d_stream,self->windowBits);
|
|
127
|
-
if (ret!=Z_OK)
|
|
101
|
+
if (ret!=Z_OK) return 0;
|
|
128
102
|
return self;
|
|
129
103
|
}
|
|
130
104
|
static hpatch_decompressHandle _zlib_decompress_open(hpatch_TDecompress* decompressPlugin,
|
|
@@ -133,10 +107,10 @@ static void __dec_free(void* _, void* address){
|
|
|
133
107
|
hpatch_StreamPos_t code_begin,
|
|
134
108
|
hpatch_StreamPos_t code_end){
|
|
135
109
|
_zlib_TDecompress* self=0;
|
|
136
|
-
unsigned char* _mem_buf=(unsigned char*)
|
|
137
|
-
if (!_mem_buf)
|
|
138
|
-
self=
|
|
139
|
-
|
|
110
|
+
unsigned char* _mem_buf=(unsigned char*)malloc(sizeof(_zlib_TDecompress)+kDecompressBufSize);
|
|
111
|
+
if (!_mem_buf) return 0;
|
|
112
|
+
self=_zlib_decompress_open_by(decompressPlugin,codeStream,code_begin,code_end,1,
|
|
113
|
+
_mem_buf,sizeof(_zlib_TDecompress)+kDecompressBufSize);
|
|
140
114
|
if (!self)
|
|
141
115
|
free(_mem_buf);
|
|
142
116
|
return self;
|
|
@@ -147,42 +121,24 @@ static void __dec_free(void* _, void* address){
|
|
|
147
121
|
hpatch_StreamPos_t code_begin,
|
|
148
122
|
hpatch_StreamPos_t code_end){
|
|
149
123
|
_zlib_TDecompress* self=0;
|
|
150
|
-
unsigned char* _mem_buf=(unsigned char*)
|
|
151
|
-
if (!_mem_buf)
|
|
152
|
-
self=
|
|
153
|
-
|
|
124
|
+
unsigned char* _mem_buf=(unsigned char*)malloc(sizeof(_zlib_TDecompress)+kDecompressBufSize);
|
|
125
|
+
if (!_mem_buf) return 0;
|
|
126
|
+
self=_zlib_decompress_open_by(decompressPlugin,codeStream,code_begin,code_end,0,
|
|
127
|
+
_mem_buf,sizeof(_zlib_TDecompress)+kDecompressBufSize);
|
|
154
128
|
if (!self)
|
|
155
129
|
free(_mem_buf);
|
|
156
130
|
return self;
|
|
157
131
|
}
|
|
158
|
-
|
|
159
|
-
static _zlib_TDecompress* _zlib_decompress_open_by(hpatch_TDecompress* decompressPlugin,
|
|
160
|
-
const hpatch_TStreamInput* codeStream,
|
|
161
|
-
hpatch_StreamPos_t code_begin,
|
|
162
|
-
hpatch_StreamPos_t code_end,
|
|
163
|
-
int isSavedWindowBits,
|
|
164
|
-
unsigned char* _mem_buf,size_t _mem_buf_size){
|
|
165
|
-
#define __MAX_TS(a,b) ((a)>=(b)?(a):(b))
|
|
166
|
-
const hpatch_size_t kZlibAlign=__MAX_TS(__MAX_TS(sizeof(hpatch_StreamPos_t),sizeof(void*)),sizeof(uLongf));
|
|
167
|
-
#undef __MAX_TS
|
|
168
|
-
unsigned char* _mem_buf_end=_mem_buf+_mem_buf_size;
|
|
169
|
-
unsigned char* self_at=(unsigned char*)_hpatch_align_upper(_mem_buf,kZlibAlign);
|
|
170
|
-
if (self_at>=_mem_buf_end) return 0;
|
|
171
|
-
return _zlib_decompress_open_at(decompressPlugin,codeStream,code_begin,code_end,isSavedWindowBits,
|
|
172
|
-
(_zlib_TDecompress*)self_at,_mem_buf_end-self_at);
|
|
173
|
-
}
|
|
174
132
|
static hpatch_BOOL _zlib_decompress_close_by(struct hpatch_TDecompress* decompressPlugin,
|
|
175
133
|
_zlib_TDecompress* self){
|
|
176
134
|
hpatch_BOOL result=hpatch_TRUE;
|
|
177
135
|
if (!self) return result;
|
|
178
|
-
_dec_onDecErr_up();
|
|
179
136
|
if (self->d_stream.state!=0){
|
|
180
|
-
|
|
137
|
+
_close_check(Z_OK==inflateEnd(&self->d_stream));
|
|
181
138
|
}
|
|
182
139
|
memset(self,0,sizeof(_zlib_TDecompress));
|
|
183
140
|
return result;
|
|
184
141
|
}
|
|
185
|
-
|
|
186
142
|
static hpatch_BOOL _zlib_decompress_close(struct hpatch_TDecompress* decompressPlugin,
|
|
187
143
|
hpatch_decompressHandle decompressHandle){
|
|
188
144
|
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
|
|
@@ -190,22 +146,23 @@ static void __dec_free(void* _, void* address){
|
|
|
190
146
|
if (self) free(self);
|
|
191
147
|
return result;
|
|
192
148
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
149
|
+
static hpatch_BOOL _zlib_reset_for_next_node(_zlib_TDecompress* self){
|
|
150
|
+
//backup
|
|
151
|
+
Bytef* next_out_back=self->d_stream.next_out;
|
|
152
|
+
Bytef* next_in_back=self->d_stream.next_in;
|
|
153
|
+
unsigned int avail_out_back=self->d_stream.avail_out;
|
|
154
|
+
unsigned int avail_in_back=self->d_stream.avail_in;
|
|
155
|
+
//reset
|
|
156
|
+
//if (Z_OK!=inflateEnd(&self->d_stream)) return hpatch_FALSE;
|
|
157
|
+
//if (Z_OK!=inflateInit2(&self->d_stream,self->windowBits)) return hpatch_FALSE;
|
|
158
|
+
if (Z_OK!=inflateReset(&self->d_stream)) return hpatch_FALSE;
|
|
159
|
+
//restore
|
|
160
|
+
self->d_stream.next_out=next_out_back;
|
|
161
|
+
self->d_stream.next_in=next_in_back;
|
|
162
|
+
self->d_stream.avail_out=avail_out_back;
|
|
163
|
+
self->d_stream.avail_in=avail_in_back;
|
|
164
|
+
return hpatch_TRUE;
|
|
165
|
+
}
|
|
209
166
|
static hpatch_BOOL __zlib_do_inflate(hpatch_decompressHandle decompressHandle){
|
|
210
167
|
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
|
|
211
168
|
uInt avail_out_back,avail_in_back;
|
|
@@ -224,20 +181,20 @@ static void __dec_free(void* _, void* address){
|
|
|
224
181
|
|
|
225
182
|
avail_out_back=self->d_stream.avail_out;
|
|
226
183
|
avail_in_back=self->d_stream.avail_in;
|
|
227
|
-
ret=inflate(&self->d_stream,
|
|
184
|
+
ret=inflate(&self->d_stream,Z_PARTIAL_FLUSH);
|
|
228
185
|
if (ret==Z_OK){
|
|
229
186
|
if ((self->d_stream.avail_in==avail_in_back)&&(self->d_stream.avail_out==avail_out_back))
|
|
230
|
-
|
|
187
|
+
return hpatch_FALSE;//error;
|
|
231
188
|
}else if (ret==Z_STREAM_END){
|
|
232
189
|
if (self->d_stream.avail_in+codeLen>0){ //next compress node!
|
|
233
|
-
if (!_zlib_reset_for_next_node(
|
|
234
|
-
|
|
190
|
+
if (!_zlib_reset_for_next_node(self))
|
|
191
|
+
return hpatch_FALSE;//error;
|
|
235
192
|
}else{//all end
|
|
236
193
|
if (self->d_stream.avail_out!=0)
|
|
237
|
-
|
|
194
|
+
return hpatch_FALSE;//error;
|
|
238
195
|
}
|
|
239
196
|
}else{
|
|
240
|
-
|
|
197
|
+
return hpatch_FALSE;//error;
|
|
241
198
|
}
|
|
242
199
|
return hpatch_TRUE;
|
|
243
200
|
}
|
|
@@ -257,16 +214,13 @@ static void __dec_free(void* _, void* address){
|
|
|
257
214
|
static hpatch_inline int _zlib_is_decompress_finish(const hpatch_TDecompress* decompressPlugin,
|
|
258
215
|
hpatch_decompressHandle decompressHandle){
|
|
259
216
|
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
|
|
260
|
-
unsigned char _empty=0;
|
|
261
217
|
while (self->code_begin!=self->code_end){ //for end tag code
|
|
218
|
+
unsigned char _empty;
|
|
262
219
|
self->d_stream.next_out = &_empty;
|
|
263
220
|
self->d_stream.avail_out=0;
|
|
264
|
-
if (!__zlib_do_inflate(self))
|
|
265
|
-
self->d_stream.next_out=0;
|
|
221
|
+
if (!__zlib_do_inflate(self))
|
|
266
222
|
return hpatch_FALSE;//error;
|
|
267
|
-
}
|
|
268
223
|
}
|
|
269
|
-
self->d_stream.next_out=0;
|
|
270
224
|
return (self->code_begin==self->code_end)
|
|
271
225
|
&(self->d_stream.avail_in==0)
|
|
272
226
|
&(self->d_stream.avail_out==0);
|
|
@@ -276,307 +230,7 @@ static void __dec_free(void* _, void* address){
|
|
|
276
230
|
static hpatch_TDecompress zlibDecompressPlugin_deflate={_zlib_is_can_open,_zlib_decompress_open_deflate,
|
|
277
231
|
_zlib_decompress_close,_zlib_decompress_part};
|
|
278
232
|
#endif//_CompressPlugin_zlib
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
#ifdef _CompressPlugin_ldef
|
|
282
|
-
#if (_IsNeedIncludeDefaultCompressHead)
|
|
283
|
-
# include "libdeflate.h" // https://github.com/sisong/libdeflate/tree/stream-mt based on https://github.com/ebiggers/libdeflate
|
|
284
|
-
# if (_CompressPlugin_ldef_is_use_zlib)
|
|
285
|
-
# include "zlib.h" // https://github.com/sisong/zlib/tree/bit_pos_padding based on https://github.com/madler/zlib
|
|
286
|
-
# endif
|
|
287
|
-
#endif
|
|
288
|
-
static const size_t _de_ldef_kDictSize = 1024*32;
|
|
289
|
-
static const size_t _de_ldef_kMaxBlockSize =1024*32*19;
|
|
290
|
-
// used _de_ldef_kMaxBlockSize*2 memory; optimized speed for
|
|
291
|
-
// libdefalte & zlib's deflate code ..., when theirs input deflate code compress block size<=_de_ldef_kMaxBlockSize/2;
|
|
292
|
-
// if (_de_ldef_kMaxBlockSize>=compress block size>_de_ldef_kMaxBlockSize/2) speed will little slower;
|
|
293
|
-
// if (compress block size>_de_ldef_kMaxBlockSize) && if (_CompressPlugin_ldef_is_use_zlib!=0),
|
|
294
|
-
// then swap to zlib decompressor & very slower (slower than zlib); && if (_CompressPlugin_ldef_is_use_zlib==0) will decompress fail.
|
|
295
|
-
|
|
296
|
-
typedef struct _ldef_TDecompress{
|
|
297
|
-
hpatch_StreamPos_t code_begin;
|
|
298
|
-
hpatch_StreamPos_t code_end;
|
|
299
|
-
const struct hpatch_TStreamInput* codeStream;
|
|
300
|
-
|
|
301
|
-
unsigned char* data_buf;
|
|
302
|
-
size_t data_buf_size;
|
|
303
|
-
unsigned char* code_buf;
|
|
304
|
-
size_t code_buf_size;
|
|
305
|
-
struct libdeflate_decompressor* d;
|
|
306
|
-
hpatch_dec_error_t decError;
|
|
307
|
-
|
|
308
|
-
size_t data_cur;
|
|
309
|
-
size_t out_cur;
|
|
310
|
-
size_t code_cur;
|
|
311
|
-
#if (_CompressPlugin_ldef_is_use_zlib)
|
|
312
|
-
hpatch_BOOL is_swap_to_zlib;
|
|
313
|
-
z_stream d_stream;
|
|
314
|
-
#endif
|
|
315
|
-
} _ldef_TDecompress;
|
|
316
|
-
|
|
317
|
-
#if (_CompressPlugin_ldef_is_use_zlib)
|
|
318
|
-
static hpatch_inline hpatch_BOOL _ldef_is_swap_to_zlib(_ldef_TDecompress* self){
|
|
319
|
-
return self->is_swap_to_zlib;
|
|
320
|
-
}
|
|
321
|
-
static hpatch_BOOL _ldef_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
322
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end);
|
|
323
|
-
static hpatch_BOOL _ldef_swap_from_zlib(_ldef_TDecompress* self){
|
|
324
|
-
const size_t out_part_len=self->d_stream.avail_out;
|
|
325
|
-
self->is_swap_to_zlib=hpatch_FALSE;
|
|
326
|
-
libdeflate_deflate_decompress_block_reset(self->d);
|
|
327
|
-
{
|
|
328
|
-
unsigned long shift_v;
|
|
329
|
-
unsigned int shift_bit;
|
|
330
|
-
zlib_inflate_shift_value(&self->d_stream,&shift_v,&shift_bit);
|
|
331
|
-
if (shift_bit>>3) _dec_onDecErr_rt();
|
|
332
|
-
libdeflate_deflate_decompress_set_state(self->d,(uint16_t)((shift_v<<3)|shift_bit));
|
|
333
|
-
}
|
|
334
|
-
assert(self->data_cur==_de_ldef_kDictSize);
|
|
335
|
-
self->code_cur=self->code_buf_size-self->d_stream.avail_in;
|
|
336
|
-
assert(self->d_stream.next_in==self->code_buf+self->code_cur);
|
|
337
|
-
{
|
|
338
|
-
uInt dict_size=0;
|
|
339
|
-
if (Z_OK!=inflateGetDictionary(&self->d_stream,0,&dict_size)) _dec_onDecErr_rt();
|
|
340
|
-
if (Z_OK!=inflateGetDictionary(&self->d_stream,self->data_buf+self->data_cur-dict_size,0)) _dec_onDecErr_rt();
|
|
341
|
-
}
|
|
342
|
-
if (out_part_len>0)
|
|
343
|
-
return _ldef_decompress_part(self,self->d_stream.next_out,self->d_stream.next_out+out_part_len);
|
|
344
|
-
else
|
|
345
|
-
return hpatch_TRUE;
|
|
346
|
-
}
|
|
347
|
-
static hpatch_BOOL _ldef_decompress_part_by_zlib(_ldef_TDecompress* self,
|
|
348
|
-
unsigned char* out_part_data,size_t out_part_len){
|
|
349
|
-
self->d_stream.next_out=out_part_data;
|
|
350
|
-
self->d_stream.avail_out=(uInt)out_part_len;
|
|
351
|
-
while (self->d_stream.avail_out){
|
|
352
|
-
uInt avail_out_back,avail_in_back;
|
|
353
|
-
int ret;
|
|
354
|
-
hpatch_StreamPos_t codeLen=(self->code_end-self->code_begin);
|
|
355
|
-
if ((self->d_stream.avail_in==0)&&(codeLen>0)) {
|
|
356
|
-
size_t readLen=self->code_buf_size;
|
|
357
|
-
if (readLen>codeLen) readLen=(size_t)codeLen;
|
|
358
|
-
self->d_stream.next_in=self->code_buf+self->code_buf_size-readLen;
|
|
359
|
-
if (!self->codeStream->read(self->codeStream,self->code_begin,self->d_stream.next_in,
|
|
360
|
-
self->d_stream.next_in+readLen)) return hpatch_FALSE;//error;
|
|
361
|
-
self->d_stream.avail_in=(uInt)readLen;
|
|
362
|
-
self->code_begin+=readLen;
|
|
363
|
-
codeLen-=readLen;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
avail_out_back=self->d_stream.avail_out;
|
|
367
|
-
avail_in_back=self->d_stream.avail_in;
|
|
368
|
-
ret=inflate(&self->d_stream,Z_BLOCK);
|
|
369
|
-
if (ret==Z_OK){
|
|
370
|
-
if ((self->d_stream.avail_in==avail_in_back)&&(self->d_stream.avail_out==avail_out_back))
|
|
371
|
-
_dec_onDecErr_rt();//error;
|
|
372
|
-
if (zlib_inflate_is_block_end(&self->d_stream)&&(!zlib_inflate_is_last_block_end(&self->d_stream)))
|
|
373
|
-
return _ldef_swap_from_zlib(self);
|
|
374
|
-
}else if (ret==Z_STREAM_END){
|
|
375
|
-
if (self->d_stream.avail_in+codeLen>0){ //next compress node!
|
|
376
|
-
zlib_inflate_set_shift_value(&self->d_stream,0,0);
|
|
377
|
-
return _ldef_swap_from_zlib(self);
|
|
378
|
-
}else{//all end
|
|
379
|
-
if (self->d_stream.avail_out!=0)
|
|
380
|
-
_dec_onDecErr_rt();//error;
|
|
381
|
-
}
|
|
382
|
-
}else{
|
|
383
|
-
_dec_onDecErr_rt();//error;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return hpatch_TRUE;
|
|
387
|
-
}
|
|
388
|
-
static hpatch_BOOL _ldef_swap_to_zlib(_ldef_TDecompress* self,uint16_t dec_state,
|
|
389
|
-
unsigned char* out_part_data,size_t out_part_len){
|
|
390
|
-
self->is_swap_to_zlib=hpatch_TRUE;
|
|
391
|
-
if (self->d_stream.state==0){
|
|
392
|
-
if (Z_OK!=inflateInit2(&self->d_stream,-15)){
|
|
393
|
-
if (!self->decError) self->decError=hpatch_dec_open_error;
|
|
394
|
-
return hpatch_FALSE;
|
|
395
|
-
}
|
|
396
|
-
}else{
|
|
397
|
-
if (Z_OK!=inflateReset(&self->d_stream)) _dec_onDecErr_rt();
|
|
398
|
-
}
|
|
399
|
-
zlib_inflate_set_shift_value(&self->d_stream,(uLong)(dec_state>>3),(uInt)(dec_state&((1<<3)-1)));
|
|
400
|
-
if (Z_OK!=inflateSetDictionary(&self->d_stream,self->data_buf+self->data_cur-_de_ldef_kDictSize,(uInt)_de_ldef_kDictSize)) _dec_onDecErr_rt();
|
|
401
|
-
self->d_stream.next_in=self->code_buf+self->code_cur;
|
|
402
|
-
self->d_stream.avail_in=(uInt)(self->code_buf_size-self->code_cur);
|
|
403
|
-
return _ldef_decompress_part_by_zlib(self,out_part_data,out_part_len);
|
|
404
|
-
}
|
|
405
|
-
#endif //_CompressPlugin_ldef_is_use_zlib
|
|
406
|
-
|
|
407
|
-
static hpatch_BOOL _ldef_is_can_open(const char* compressType){
|
|
408
|
-
return (0==strcmp(compressType,"zlib"))||(0==strcmp(compressType,"pzlib"));
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
static _ldef_TDecompress* _ldef_decompress_open_at(hpatch_TDecompress* decompressPlugin,
|
|
412
|
-
const hpatch_TStreamInput* codeStream,
|
|
413
|
-
hpatch_StreamPos_t code_begin,hpatch_StreamPos_t code_end,
|
|
414
|
-
int isSavedWindowBits,_ldef_TDecompress* self,
|
|
415
|
-
size_t data_buf_size,size_t code_buf_size){
|
|
416
|
-
if (isSavedWindowBits){//load kWindowBits
|
|
417
|
-
signed char kWindowBits=0;
|
|
418
|
-
if (code_end-code_begin<1) _dec_openErr_rt();
|
|
419
|
-
if (!codeStream->read(codeStream,code_begin,(unsigned char*)&kWindowBits,
|
|
420
|
-
(unsigned char*)&kWindowBits+1)) return 0;
|
|
421
|
-
++code_begin;
|
|
422
|
-
if (!((-15<=kWindowBits)&&(kWindowBits<0)))
|
|
423
|
-
_dec_openErr_rt(); //now, unsupported these window bits
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
memset(self,0,sizeof(_ldef_TDecompress));
|
|
427
|
-
self->d=libdeflate_alloc_decompressor();
|
|
428
|
-
if (!self->d) _dec_memErr_rt();
|
|
429
|
-
self->data_buf=((unsigned char*)self)+sizeof(_ldef_TDecompress);
|
|
430
|
-
self->data_buf_size=data_buf_size;
|
|
431
|
-
self->code_buf=self->data_buf+data_buf_size;
|
|
432
|
-
self->code_buf_size=code_buf_size;
|
|
433
|
-
self->codeStream=codeStream;
|
|
434
|
-
self->code_begin=code_begin;
|
|
435
|
-
self->code_end=code_end;
|
|
436
|
-
|
|
437
|
-
self->data_cur=_de_ldef_kDictSize; //empty
|
|
438
|
-
self->out_cur=_de_ldef_kDictSize;
|
|
439
|
-
self->code_cur=code_buf_size; //empty
|
|
440
|
-
return self;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
static hpatch_decompressHandle _ldef_decompress_open(hpatch_TDecompress* decompressPlugin,
|
|
444
|
-
hpatch_StreamPos_t dataSize,
|
|
445
|
-
const hpatch_TStreamInput* codeStream,
|
|
446
|
-
hpatch_StreamPos_t code_begin,
|
|
447
|
-
hpatch_StreamPos_t code_end){
|
|
448
|
-
_ldef_TDecompress* self=0;
|
|
449
|
-
const hpatch_StreamPos_t in_size=code_end-code_begin;
|
|
450
|
-
const size_t data_buf_size=_de_ldef_kDictSize+((_de_ldef_kMaxBlockSize<dataSize)?_de_ldef_kMaxBlockSize:(size_t)dataSize);
|
|
451
|
-
const size_t code_buf_size=(_de_ldef_kMaxBlockSize<in_size)?_de_ldef_kMaxBlockSize:(size_t)in_size;
|
|
452
|
-
size_t _mem_size=sizeof(_ldef_TDecompress)+data_buf_size+code_buf_size;
|
|
453
|
-
unsigned char* _mem_buf=(unsigned char*)_dec_malloc(_mem_size);
|
|
454
|
-
if (!_mem_buf) _dec_memErr_rt();
|
|
455
|
-
|
|
456
|
-
self=_ldef_decompress_open_at(decompressPlugin,codeStream,code_begin,code_end,1,
|
|
457
|
-
(_ldef_TDecompress*)_mem_buf,data_buf_size,code_buf_size);
|
|
458
|
-
if (!self)
|
|
459
|
-
free(_mem_buf);
|
|
460
|
-
return self;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
static hpatch_BOOL _ldef_decompress_close_by(struct hpatch_TDecompress* decompressPlugin,
|
|
464
|
-
_ldef_TDecompress* self){
|
|
465
|
-
hpatch_BOOL result=hpatch_TRUE;
|
|
466
|
-
if (!self) return result;
|
|
467
|
-
_dec_onDecErr_up();
|
|
468
|
-
#if (_CompressPlugin_ldef_is_use_zlib)
|
|
469
|
-
if (self->d_stream.state!=0){
|
|
470
|
-
_dec_close_check(Z_OK==inflateEnd(&self->d_stream));
|
|
471
|
-
}
|
|
472
|
-
#endif
|
|
473
|
-
if (self->d!=0)
|
|
474
|
-
libdeflate_free_decompressor(self->d);
|
|
475
|
-
memset(self,0,sizeof(_ldef_TDecompress));
|
|
476
|
-
return result;
|
|
477
|
-
}
|
|
478
233
|
|
|
479
|
-
static hpatch_BOOL _ldef_decompress_close(struct hpatch_TDecompress* decompressPlugin,
|
|
480
|
-
hpatch_decompressHandle decompressHandle){
|
|
481
|
-
_ldef_TDecompress* self=(_ldef_TDecompress*)decompressHandle;
|
|
482
|
-
hpatch_BOOL result=_ldef_decompress_close_by(decompressPlugin,self);
|
|
483
|
-
if (self) free(self);
|
|
484
|
-
return result;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
static hpatch_BOOL _ldef_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
488
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
489
|
-
_ldef_TDecompress* self=(_ldef_TDecompress*)decompressHandle;
|
|
490
|
-
size_t out_part_len=out_part_data_end-out_part_data;
|
|
491
|
-
#if (_CompressPlugin_ldef_is_use_zlib)
|
|
492
|
-
if (_ldef_is_swap_to_zlib(self)&&out_part_len)
|
|
493
|
-
return _ldef_decompress_part_by_zlib(self,out_part_data,out_part_len);
|
|
494
|
-
#endif
|
|
495
|
-
const size_t kDictSize=_de_ldef_kDictSize;
|
|
496
|
-
// [ ( dict ) | dataBuf ] [ codeBuf ]
|
|
497
|
-
// ^ ^ ^ ^ ^ ^ ^
|
|
498
|
-
// data_buf out_cur data_cur data_buf_size code_buf code_cur code_buf_size
|
|
499
|
-
while (out_part_len) {
|
|
500
|
-
{//write data out
|
|
501
|
-
size_t out_len=self->data_cur-self->out_cur;
|
|
502
|
-
if (out_len){ //have data
|
|
503
|
-
out_len=(out_len<out_part_len)?out_len:out_part_len;
|
|
504
|
-
memcpy(out_part_data,self->data_buf+self->out_cur,out_len);
|
|
505
|
-
self->out_cur+=out_len;
|
|
506
|
-
out_part_data+=out_len;
|
|
507
|
-
out_part_len-=out_len;
|
|
508
|
-
continue;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
size_t kLimitDataSize=_de_ldef_kMaxBlockSize/2+kDictSize;
|
|
513
|
-
size_t kLimitCodeSize=self->code_buf_size/2;
|
|
514
|
-
__datas_prepare:
|
|
515
|
-
{//read code in
|
|
516
|
-
if (self->code_cur>kLimitCodeSize){
|
|
517
|
-
const hpatch_StreamPos_t _codeSize=self->code_end-self->code_begin;
|
|
518
|
-
size_t read_len=(self->code_cur<_codeSize)?self->code_cur:(size_t)_codeSize;
|
|
519
|
-
if (read_len){
|
|
520
|
-
size_t code_len=self->code_buf_size-self->code_cur;
|
|
521
|
-
unsigned char* pcode=self->code_buf+self->code_cur;
|
|
522
|
-
unsigned char* pdst=pcode-read_len;
|
|
523
|
-
memmove(pdst,pcode,code_len);
|
|
524
|
-
pdst+=code_len;
|
|
525
|
-
if (!self->codeStream->read(self->codeStream,self->code_begin,pdst,pdst+read_len))
|
|
526
|
-
return 0; //read error
|
|
527
|
-
self->code_begin+=read_len;
|
|
528
|
-
self->code_cur-=read_len;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
{//move dict
|
|
533
|
-
if (self->data_cur>kLimitDataSize){
|
|
534
|
-
size_t move_offset=self->data_cur-kDictSize;
|
|
535
|
-
if (move_offset){
|
|
536
|
-
memmove(self->data_buf,self->data_buf+move_offset,kDictSize);
|
|
537
|
-
self->data_cur=kDictSize;
|
|
538
|
-
self->out_cur=kDictSize;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
{// decompress
|
|
543
|
-
int is_final_block_ret;
|
|
544
|
-
size_t actual_in_nbytes_ret;
|
|
545
|
-
size_t actual_out_nbytes_ret;
|
|
546
|
-
const uint16_t dec_state=libdeflate_deflate_decompress_get_state(self->d);
|
|
547
|
-
enum libdeflate_result ret=libdeflate_deflate_decompress_block(self->d,
|
|
548
|
-
self->code_buf+self->code_cur,self->code_buf_size-self->code_cur,
|
|
549
|
-
self->data_buf,self->data_cur,self->data_buf_size-self->data_cur,
|
|
550
|
-
&actual_in_nbytes_ret,&actual_out_nbytes_ret,
|
|
551
|
-
LIBDEFLATE_STOP_BY_ANY_BLOCK,&is_final_block_ret);
|
|
552
|
-
if (ret!=LIBDEFLATE_SUCCESS){
|
|
553
|
-
if ((self->code_begin==self->code_end)&&(ret!=LIBDEFLATE_INSUFFICIENT_SPACE))
|
|
554
|
-
_dec_onDecErr_rt();
|
|
555
|
-
if ((self->data_cur>kDictSize)||((self->code_cur>0)&&(self->code_begin<self->code_end))){
|
|
556
|
-
kLimitDataSize=kDictSize;
|
|
557
|
-
kLimitCodeSize=0;
|
|
558
|
-
libdeflate_deflate_decompress_set_state(self->d,dec_state);
|
|
559
|
-
goto __datas_prepare; //retry by libdefalte
|
|
560
|
-
}
|
|
561
|
-
#if (_CompressPlugin_ldef_is_use_zlib)
|
|
562
|
-
return _ldef_swap_to_zlib(self,dec_state,out_part_data,out_part_len); //retry by zlib
|
|
563
|
-
#else
|
|
564
|
-
_dec_onDecErr_rt();
|
|
565
|
-
#endif
|
|
566
|
-
}
|
|
567
|
-
self->code_cur+=actual_in_nbytes_ret;
|
|
568
|
-
self->data_cur+=actual_out_nbytes_ret;
|
|
569
|
-
if (is_final_block_ret)
|
|
570
|
-
libdeflate_deflate_decompress_block_reset(self->d);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
return hpatch_TRUE;
|
|
574
|
-
}
|
|
575
|
-
static hpatch_TDecompress ldefDecompressPlugin={_ldef_is_can_open,_ldef_decompress_open,
|
|
576
|
-
_ldef_decompress_close,_ldef_decompress_part};
|
|
577
|
-
#endif//_CompressPlugin_ldef
|
|
578
|
-
|
|
579
|
-
|
|
580
234
|
#ifdef _CompressPlugin_bz2
|
|
581
235
|
#if (_IsNeedIncludeDefaultCompressHead)
|
|
582
236
|
# include "bzlib.h" // http://www.bzip.org/ https://github.com/sisong/bzip2
|
|
@@ -587,7 +241,6 @@ static void __dec_free(void* _, void* address){
|
|
|
587
241
|
hpatch_StreamPos_t code_end;
|
|
588
242
|
|
|
589
243
|
bz_stream d_stream;
|
|
590
|
-
hpatch_dec_error_t decError;
|
|
591
244
|
unsigned char dec_buf[kDecompressBufSize];
|
|
592
245
|
} _bz2_TDecompress;
|
|
593
246
|
static hpatch_BOOL _bz2_is_can_open(const char* compressType){
|
|
@@ -600,15 +253,15 @@ static void __dec_free(void* _, void* address){
|
|
|
600
253
|
hpatch_StreamPos_t code_begin,
|
|
601
254
|
hpatch_StreamPos_t code_end){
|
|
602
255
|
int ret;
|
|
603
|
-
_bz2_TDecompress* self=(_bz2_TDecompress*)
|
|
604
|
-
if (!self)
|
|
256
|
+
_bz2_TDecompress* self=(_bz2_TDecompress*)malloc(sizeof(_bz2_TDecompress));
|
|
257
|
+
if (!self) return 0;
|
|
605
258
|
memset(self,0,sizeof(_bz2_TDecompress)-kDecompressBufSize);
|
|
606
259
|
self->codeStream=codeStream;
|
|
607
260
|
self->code_begin=code_begin;
|
|
608
261
|
self->code_end=code_end;
|
|
609
262
|
|
|
610
263
|
ret=BZ2_bzDecompressInit(&self->d_stream,0,0);
|
|
611
|
-
if (ret!=BZ_OK){ free(self);
|
|
264
|
+
if (ret!=BZ_OK){ free(self); return 0; }
|
|
612
265
|
return self;
|
|
613
266
|
}
|
|
614
267
|
static hpatch_BOOL _bz2_close(struct hpatch_TDecompress* decompressPlugin,
|
|
@@ -616,8 +269,7 @@ static void __dec_free(void* _, void* address){
|
|
|
616
269
|
hpatch_BOOL result=hpatch_TRUE;
|
|
617
270
|
_bz2_TDecompress* self=(_bz2_TDecompress*)decompressHandle;
|
|
618
271
|
if (!self) return result;
|
|
619
|
-
|
|
620
|
-
_dec_close_check(BZ_OK==BZ2_bzDecompressEnd(&self->d_stream));
|
|
272
|
+
_close_check(BZ_OK==BZ2_bzDecompressEnd(&self->d_stream));
|
|
621
273
|
free(self);
|
|
622
274
|
return result;
|
|
623
275
|
}
|
|
@@ -628,8 +280,8 @@ static void __dec_free(void* _, void* address){
|
|
|
628
280
|
unsigned int avail_out_back=self->d_stream.avail_out;
|
|
629
281
|
unsigned int avail_in_back=self->d_stream.avail_in;
|
|
630
282
|
//reset
|
|
631
|
-
if (BZ_OK!=BZ2_bzDecompressEnd(&self->d_stream))
|
|
632
|
-
if (BZ_OK!=BZ2_bzDecompressInit(&self->d_stream,0,0))
|
|
283
|
+
if (BZ_OK!=BZ2_bzDecompressEnd(&self->d_stream)) return hpatch_FALSE;
|
|
284
|
+
if (BZ_OK!=BZ2_bzDecompressInit(&self->d_stream,0,0)) return hpatch_FALSE;
|
|
633
285
|
//restore
|
|
634
286
|
self->d_stream.next_out=next_out_back;
|
|
635
287
|
self->d_stream.next_in=next_in_back;
|
|
@@ -637,10 +289,8 @@ static void __dec_free(void* _, void* address){
|
|
|
637
289
|
self->d_stream.avail_in=avail_in_back;
|
|
638
290
|
return hpatch_TRUE;
|
|
639
291
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end,
|
|
643
|
-
hpatch_BOOL isMustOutData){
|
|
292
|
+
static hpatch_BOOL _bz2_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
293
|
+
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
644
294
|
_bz2_TDecompress* self=(_bz2_TDecompress*)decompressHandle;
|
|
645
295
|
assert(out_part_data<=out_part_data_end);
|
|
646
296
|
|
|
@@ -666,43 +316,23 @@ static void __dec_free(void* _, void* address){
|
|
|
666
316
|
ret=BZ2_bzDecompress(&self->d_stream);
|
|
667
317
|
if (ret==BZ_OK){
|
|
668
318
|
if ((self->d_stream.avail_in==avail_in_back)&&(self->d_stream.avail_out==avail_out_back))
|
|
669
|
-
|
|
319
|
+
return hpatch_FALSE;//error;
|
|
670
320
|
}else if (ret==BZ_STREAM_END){
|
|
671
321
|
if (self->d_stream.avail_in+codeLen>0){ //next compress node!
|
|
672
322
|
if (!_bz2_reset_for_next_node(self))
|
|
673
323
|
return hpatch_FALSE;//error;
|
|
674
324
|
}else{//all end
|
|
675
|
-
if (self->d_stream.avail_out!=0)
|
|
676
|
-
|
|
677
|
-
memset(self->d_stream.next_out,0,self->d_stream.avail_out);
|
|
678
|
-
self->d_stream.next_out+=self->d_stream.avail_out;
|
|
679
|
-
self->d_stream.avail_out=0;
|
|
680
|
-
}else{
|
|
681
|
-
_dec_onDecErr_rt();//error;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
325
|
+
if (self->d_stream.avail_out!=0)
|
|
326
|
+
return hpatch_FALSE;//error;
|
|
684
327
|
}
|
|
685
328
|
}else{
|
|
686
|
-
|
|
329
|
+
return hpatch_FALSE;//error;
|
|
687
330
|
}
|
|
688
331
|
}
|
|
689
332
|
return hpatch_TRUE;
|
|
690
333
|
}
|
|
691
|
-
static hpatch_BOOL _bz2_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
692
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
693
|
-
return _bz2_decompress_part_(decompressHandle,out_part_data,out_part_data_end,hpatch_FALSE);
|
|
694
|
-
}
|
|
695
|
-
static hpatch_BOOL _bz2_decompress_part_unsz(hpatch_decompressHandle decompressHandle,
|
|
696
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
697
|
-
return _bz2_decompress_part_(decompressHandle,out_part_data,out_part_data_end,hpatch_TRUE);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
334
|
static hpatch_TDecompress bz2DecompressPlugin={_bz2_is_can_open,_bz2_open,
|
|
701
335
|
_bz2_close,_bz2_decompress_part};
|
|
702
|
-
|
|
703
|
-
//unkown uncompress data size
|
|
704
|
-
static hpatch_TDecompress _bz2DecompressPlugin_unsz={_bz2_is_can_open,_bz2_open,
|
|
705
|
-
_bz2_close,_bz2_decompress_part_unsz};
|
|
706
336
|
#endif//_CompressPlugin_bz2
|
|
707
337
|
|
|
708
338
|
|
|
@@ -713,11 +343,17 @@ static void __dec_free(void* _, void* address){
|
|
|
713
343
|
# include "Lzma2Dec.h"
|
|
714
344
|
# endif
|
|
715
345
|
#endif
|
|
346
|
+
static void * __lzma_dec_Alloc(ISzAllocPtr p, size_t size){
|
|
347
|
+
return malloc(size);
|
|
348
|
+
}
|
|
349
|
+
static void __lzma_dec_Free(ISzAllocPtr p, void *address){
|
|
350
|
+
if (address) free(address);
|
|
351
|
+
}
|
|
352
|
+
static ISzAlloc __lzma_dec_alloc={__lzma_dec_Alloc,__lzma_dec_Free};
|
|
716
353
|
#endif
|
|
717
354
|
|
|
718
355
|
#ifdef _CompressPlugin_lzma
|
|
719
356
|
typedef struct _lzma_TDecompress{
|
|
720
|
-
ISzAlloc memAllocBase;
|
|
721
357
|
const struct hpatch_TStreamInput* codeStream;
|
|
722
358
|
hpatch_StreamPos_t code_begin;
|
|
723
359
|
hpatch_StreamPos_t code_end;
|
|
@@ -725,12 +361,8 @@ static void __dec_free(void* _, void* address){
|
|
|
725
361
|
CLzmaDec decEnv;
|
|
726
362
|
SizeT decCopyPos;
|
|
727
363
|
SizeT decReadPos;
|
|
728
|
-
hpatch_dec_error_t decError;
|
|
729
364
|
unsigned char dec_buf[kDecompressBufSize];
|
|
730
365
|
} _lzma_TDecompress;
|
|
731
|
-
static void * __lzma1_dec_Alloc(ISzAllocPtr p, size_t size)
|
|
732
|
-
__dec_Alloc_fun(_lzma_TDecompress,p,size)
|
|
733
|
-
|
|
734
366
|
static hpatch_BOOL _lzma_is_can_open(const char* compressType){
|
|
735
367
|
return (0==strcmp(compressType,"lzma"));
|
|
736
368
|
}
|
|
@@ -744,19 +376,17 @@ static void __dec_free(void* _, void* address){
|
|
|
744
376
|
unsigned char propsSize=0;
|
|
745
377
|
unsigned char props[256];
|
|
746
378
|
//load propsSize
|
|
747
|
-
if (code_end-code_begin<1)
|
|
379
|
+
if (code_end-code_begin<1) return 0;
|
|
748
380
|
if (!codeStream->read(codeStream,code_begin,&propsSize,&propsSize+1)) return 0;
|
|
749
381
|
++code_begin;
|
|
750
|
-
if (propsSize>(code_end-code_begin))
|
|
382
|
+
if (propsSize>(code_end-code_begin)) return 0;
|
|
751
383
|
//load props
|
|
752
384
|
if (!codeStream->read(codeStream,code_begin,props,props+propsSize)) return 0;
|
|
753
385
|
code_begin+=propsSize;
|
|
754
386
|
|
|
755
|
-
self=(_lzma_TDecompress*)
|
|
756
|
-
if (!self)
|
|
387
|
+
self=(_lzma_TDecompress*)malloc(sizeof(_lzma_TDecompress));
|
|
388
|
+
if (!self) return 0;
|
|
757
389
|
memset(self,0,sizeof(_lzma_TDecompress)-kDecompressBufSize);
|
|
758
|
-
self->memAllocBase.Alloc=__lzma1_dec_Alloc;
|
|
759
|
-
*((void**)&self->memAllocBase.Free)=(void*)__dec_free;
|
|
760
390
|
self->codeStream=codeStream;
|
|
761
391
|
self->code_begin=code_begin;
|
|
762
392
|
self->code_end=code_end;
|
|
@@ -765,8 +395,8 @@ static void __dec_free(void* _, void* address){
|
|
|
765
395
|
self->decReadPos=kDecompressBufSize;
|
|
766
396
|
|
|
767
397
|
LzmaDec_Construct(&self->decEnv);
|
|
768
|
-
ret=LzmaDec_Allocate(&self->decEnv,props,propsSize,&
|
|
769
|
-
if (ret!=SZ_OK){
|
|
398
|
+
ret=LzmaDec_Allocate(&self->decEnv,props,propsSize,&__lzma_dec_alloc);
|
|
399
|
+
if (ret!=SZ_OK){ free(self); return 0; }
|
|
770
400
|
LzmaDec_Init(&self->decEnv);
|
|
771
401
|
return self;
|
|
772
402
|
}
|
|
@@ -774,8 +404,7 @@ static void __dec_free(void* _, void* address){
|
|
|
774
404
|
hpatch_decompressHandle decompressHandle){
|
|
775
405
|
_lzma_TDecompress* self=(_lzma_TDecompress*)decompressHandle;
|
|
776
406
|
if (!self) return hpatch_TRUE;
|
|
777
|
-
LzmaDec_Free(&self->decEnv,&
|
|
778
|
-
_dec_onDecErr_up();
|
|
407
|
+
LzmaDec_Free(&self->decEnv,&__lzma_dec_alloc);
|
|
779
408
|
free(self);
|
|
780
409
|
return hpatch_TRUE;
|
|
781
410
|
}
|
|
@@ -817,9 +446,9 @@ static void __dec_free(void* _, void* address){
|
|
|
817
446
|
self->dec_buf+self->decReadPos,&inSize,LZMA_FINISH_ANY,&status);
|
|
818
447
|
if(res==SZ_OK){
|
|
819
448
|
if ((inSize==0)&&(self->decEnv.dicPos==dicPos_back))
|
|
820
|
-
|
|
449
|
+
return hpatch_FALSE;//error;
|
|
821
450
|
}else{
|
|
822
|
-
|
|
451
|
+
return hpatch_FALSE;//error;
|
|
823
452
|
}
|
|
824
453
|
self->decReadPos+=inSize;
|
|
825
454
|
}
|
|
@@ -831,247 +460,79 @@ static void __dec_free(void* _, void* address){
|
|
|
831
460
|
#endif//_CompressPlugin_lzma
|
|
832
461
|
|
|
833
462
|
#ifdef _CompressPlugin_lzma2
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
hpatch_StreamPos_t code_end;
|
|
839
|
-
|
|
840
|
-
CLzma2Dec decEnv;
|
|
841
|
-
SizeT decCopyPos;
|
|
842
|
-
SizeT decReadPos;
|
|
843
|
-
hpatch_dec_error_t decError;
|
|
844
|
-
unsigned char dec_buf[kDecompressBufSize];
|
|
845
|
-
} _lzma2_TDecompress;
|
|
846
|
-
static void * __lzma2_dec_Alloc(ISzAllocPtr p, size_t size)
|
|
847
|
-
__dec_Alloc_fun(_lzma2_TDecompress,p,size)
|
|
463
|
+
typedef struct _lzma2_TDecompress{
|
|
464
|
+
const struct hpatch_TStreamInput* codeStream;
|
|
465
|
+
hpatch_StreamPos_t code_begin;
|
|
466
|
+
hpatch_StreamPos_t code_end;
|
|
848
467
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
*((void**)&self->memAllocBase.Free)=(void*)__dec_free;
|
|
870
|
-
self->codeStream=codeStream;
|
|
871
|
-
self->code_begin=code_begin;
|
|
872
|
-
self->code_end=code_end;
|
|
873
|
-
|
|
874
|
-
self->decCopyPos=0;
|
|
875
|
-
self->decReadPos=kDecompressBufSize;
|
|
876
|
-
|
|
877
|
-
Lzma2Dec_Construct(&self->decEnv);
|
|
878
|
-
ret=Lzma2Dec_Allocate(&self->decEnv,propsSize,&self->memAllocBase);
|
|
879
|
-
if (ret!=SZ_OK){ _dec_onDecErr_up(); free(self); _dec_openErr_rt(); }
|
|
880
|
-
Lzma2Dec_Init(&self->decEnv);
|
|
881
|
-
return self;
|
|
882
|
-
}
|
|
883
|
-
static hpatch_BOOL _lzma2_close(struct hpatch_TDecompress* decompressPlugin,
|
|
884
|
-
hpatch_decompressHandle decompressHandle){
|
|
885
|
-
_lzma2_TDecompress* self=(_lzma2_TDecompress*)decompressHandle;
|
|
886
|
-
if (!self) return hpatch_TRUE;
|
|
887
|
-
Lzma2Dec_Free(&self->decEnv,&self->memAllocBase);
|
|
888
|
-
_dec_onDecErr_up();
|
|
889
|
-
free(self);
|
|
890
|
-
return hpatch_TRUE;
|
|
891
|
-
}
|
|
892
|
-
static hpatch_BOOL _lzma2_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
893
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
894
|
-
_lzma2_TDecompress* self=(_lzma2_TDecompress*)decompressHandle;
|
|
895
|
-
unsigned char* out_cur=out_part_data;
|
|
896
|
-
assert(out_part_data<=out_part_data_end);
|
|
897
|
-
while (out_cur<out_part_data_end){
|
|
898
|
-
size_t copyLen=(self->decEnv.decoder.dicPos-self->decCopyPos);
|
|
899
|
-
if (copyLen>0){
|
|
900
|
-
if (copyLen>(size_t)(out_part_data_end-out_cur))
|
|
901
|
-
copyLen=(out_part_data_end-out_cur);
|
|
902
|
-
memcpy(out_cur,self->decEnv.decoder.dic+self->decCopyPos,copyLen);
|
|
903
|
-
out_cur+=copyLen;
|
|
904
|
-
self->decCopyPos+=copyLen;
|
|
905
|
-
if ((self->decEnv.decoder.dicPos==self->decEnv.decoder.dicBufSize)
|
|
906
|
-
&&(self->decEnv.decoder.dicPos==self->decCopyPos)){
|
|
907
|
-
self->decEnv.decoder.dicPos=0;
|
|
908
|
-
self->decCopyPos=0;
|
|
909
|
-
}
|
|
910
|
-
}else{
|
|
911
|
-
ELzmaStatus status;
|
|
912
|
-
SizeT inSize,dicPos_back;
|
|
913
|
-
SRes res;
|
|
914
|
-
hpatch_StreamPos_t codeLen=(self->code_end - self->code_begin);
|
|
915
|
-
if ((self->decReadPos==kDecompressBufSize)&&(codeLen>0)) {
|
|
916
|
-
size_t readLen=kDecompressBufSize;
|
|
917
|
-
if (readLen>codeLen) readLen=(size_t)codeLen;
|
|
918
|
-
self->decReadPos=kDecompressBufSize-readLen;
|
|
919
|
-
if (!self->codeStream->read(self->codeStream,self->code_begin,self->dec_buf+self->decReadPos,
|
|
920
|
-
self->dec_buf+self->decReadPos+readLen)) return hpatch_FALSE;//error;
|
|
921
|
-
self->code_begin+=readLen;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
inSize=kDecompressBufSize-self->decReadPos;
|
|
925
|
-
dicPos_back=self->decEnv.decoder.dicPos;
|
|
926
|
-
res=Lzma2Dec_DecodeToDic(&self->decEnv,self->decEnv.decoder.dicBufSize,
|
|
927
|
-
self->dec_buf+self->decReadPos,&inSize,LZMA_FINISH_ANY,&status);
|
|
928
|
-
if(res==SZ_OK){
|
|
929
|
-
if ((inSize==0)&&(self->decEnv.decoder.dicPos==dicPos_back))
|
|
930
|
-
_dec_onDecErr_rt();//error;
|
|
931
|
-
}else{
|
|
932
|
-
_dec_onDecErr_rt();//error;
|
|
933
|
-
}
|
|
934
|
-
self->decReadPos+=inSize;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
return hpatch_TRUE;
|
|
938
|
-
}
|
|
939
|
-
static hpatch_TDecompress lzma2DecompressPlugin={_lzma2_is_can_open,_lzma2_open,
|
|
940
|
-
_lzma2_close,_lzma2_decompress_part};
|
|
941
|
-
#endif//_CompressPlugin_lzma2
|
|
942
|
-
|
|
943
|
-
#ifdef _CompressPlugin_7zXZ
|
|
944
|
-
#if (_IsNeedIncludeDefaultCompressHead)
|
|
945
|
-
# include "Xz.h" // "lzma/C/Xz.h" https://github.com/sisong/lzma
|
|
946
|
-
# include "7zCrc.h" // CrcGenerateTable()
|
|
947
|
-
#endif
|
|
948
|
-
|
|
949
|
-
#ifndef _init_CompressPlugin_7zXZ_DEF
|
|
950
|
-
# define _init_CompressPlugin_7zXZ_DEF
|
|
951
|
-
static int _init_CompressPlugin_7zXZ(){
|
|
952
|
-
static hpatch_BOOL _isInit=hpatch_FALSE;
|
|
953
|
-
if (!_isInit){
|
|
954
|
-
CrcGenerateTable();
|
|
955
|
-
_isInit=hpatch_TRUE;
|
|
956
|
-
}
|
|
957
|
-
return 0;
|
|
958
|
-
}
|
|
959
|
-
#endif
|
|
468
|
+
CLzma2Dec decEnv;
|
|
469
|
+
SizeT decCopyPos;
|
|
470
|
+
SizeT decReadPos;
|
|
471
|
+
unsigned char dec_buf[kDecompressBufSize];
|
|
472
|
+
} _lzma2_TDecompress;
|
|
473
|
+
static hpatch_BOOL _lzma2_is_can_open(const char* compressType){
|
|
474
|
+
return (0==strcmp(compressType,"lzma2"));
|
|
475
|
+
}
|
|
476
|
+
static hpatch_decompressHandle _lzma2_open(hpatch_TDecompress* decompressPlugin,
|
|
477
|
+
hpatch_StreamPos_t dataSize,
|
|
478
|
+
const hpatch_TStreamInput* codeStream,
|
|
479
|
+
hpatch_StreamPos_t code_begin,
|
|
480
|
+
hpatch_StreamPos_t code_end){
|
|
481
|
+
_lzma2_TDecompress* self=0;
|
|
482
|
+
SRes ret;
|
|
483
|
+
unsigned char propsSize=0;
|
|
484
|
+
//load propsSize
|
|
485
|
+
if (code_end-code_begin<1) return 0;
|
|
486
|
+
if (!codeStream->read(codeStream,code_begin,&propsSize,&propsSize+1)) return 0;
|
|
487
|
+
++code_begin;
|
|
960
488
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
hpatch_BOOL isResetState;
|
|
968
|
-
|
|
969
|
-
CXzUnpacker decEnv;
|
|
970
|
-
SizeT decCopyPos;
|
|
971
|
-
SizeT decReadPos;
|
|
972
|
-
hpatch_dec_error_t decError;
|
|
973
|
-
unsigned char dec_buf[kDecompressBufSize];
|
|
974
|
-
} _7zXZ_TDecompress;
|
|
975
|
-
static void * __7zXZ_dec_Alloc(ISzAllocPtr p, size_t size)
|
|
976
|
-
__dec_Alloc_fun(_7zXZ_TDecompress,p,size)
|
|
489
|
+
self=(_lzma2_TDecompress*)malloc(sizeof(_lzma2_TDecompress));
|
|
490
|
+
if (!self) return 0;
|
|
491
|
+
memset(self,0,sizeof(_lzma2_TDecompress)-kDecompressBufSize);
|
|
492
|
+
self->codeStream=codeStream;
|
|
493
|
+
self->code_begin=code_begin;
|
|
494
|
+
self->code_end=code_end;
|
|
977
495
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
hpatch_StreamPos_t code_end){
|
|
1014
|
-
_7zXZ_TDecompress* self=0;
|
|
1015
|
-
|
|
1016
|
-
self=(_7zXZ_TDecompress*)_dec_malloc(sizeof(_7zXZ_TDecompress));
|
|
1017
|
-
if (!self) _dec_memErr_rt();
|
|
1018
|
-
_7zXZ_open_at(self,decompressPlugin,dataSize,codeStream,
|
|
1019
|
-
code_begin,code_end,hpatch_FALSE,hpatch_TRUE);
|
|
1020
|
-
return self;
|
|
1021
|
-
}
|
|
1022
|
-
static hpatch_decompressHandle _7zXZ_a_open(hpatch_TDecompress* decompressPlugin,
|
|
1023
|
-
hpatch_StreamPos_t dataSize,
|
|
1024
|
-
const hpatch_TStreamInput* codeStream,
|
|
1025
|
-
hpatch_StreamPos_t code_begin,
|
|
1026
|
-
hpatch_StreamPos_t code_end){
|
|
1027
|
-
_7zXZ_TDecompress* self=0;
|
|
1028
|
-
|
|
1029
|
-
self=(_7zXZ_TDecompress*)_dec_malloc(sizeof(_7zXZ_TDecompress));
|
|
1030
|
-
if (!self) _dec_memErr_rt();
|
|
1031
|
-
_7zXZ_open_at(self,decompressPlugin,dataSize,codeStream,
|
|
1032
|
-
code_begin,code_end,hpatch_TRUE,hpatch_TRUE);
|
|
1033
|
-
return self;
|
|
1034
|
-
}
|
|
1035
|
-
static hpatch_BOOL _7zXZ_close(struct hpatch_TDecompress* decompressPlugin,
|
|
1036
|
-
hpatch_decompressHandle decompressHandle){
|
|
1037
|
-
if (decompressHandle){
|
|
1038
|
-
_7zXZ_close_at(decompressHandle);
|
|
1039
|
-
free(decompressHandle);
|
|
1040
|
-
}
|
|
1041
|
-
return hpatch_TRUE;
|
|
1042
|
-
}
|
|
1043
|
-
static hpatch_BOOL _7zXZ_reset_code(hpatch_decompressHandle decompressHandle,
|
|
1044
|
-
hpatch_StreamPos_t dataSize,
|
|
1045
|
-
const struct hpatch_TStreamInput* codeStream,
|
|
1046
|
-
hpatch_StreamPos_t code_begin,
|
|
1047
|
-
hpatch_StreamPos_t code_end){
|
|
1048
|
-
_7zXZ_TDecompress* self=(_7zXZ_TDecompress*)decompressHandle;
|
|
1049
|
-
hpatch_BOOL isResetState=self->isResetState;
|
|
1050
|
-
if (isResetState){
|
|
1051
|
-
hpatch_TDecompress* decompressPlugin=self->decompressPlugin;
|
|
1052
|
-
_7zXZ_close_at(self);
|
|
1053
|
-
_7zXZ_open_at(self,decompressPlugin,dataSize,codeStream,
|
|
1054
|
-
code_begin,code_end,isResetState,hpatch_FALSE);
|
|
496
|
+
self->decCopyPos=0;
|
|
497
|
+
self->decReadPos=kDecompressBufSize;
|
|
498
|
+
|
|
499
|
+
Lzma2Dec_Construct(&self->decEnv);
|
|
500
|
+
ret=Lzma2Dec_Allocate(&self->decEnv,propsSize,&__lzma_dec_alloc);
|
|
501
|
+
if (ret!=SZ_OK){ free(self); return 0; }
|
|
502
|
+
Lzma2Dec_Init(&self->decEnv);
|
|
503
|
+
return self;
|
|
504
|
+
}
|
|
505
|
+
static hpatch_BOOL _lzma2_close(struct hpatch_TDecompress* decompressPlugin,
|
|
506
|
+
hpatch_decompressHandle decompressHandle){
|
|
507
|
+
_lzma2_TDecompress* self=(_lzma2_TDecompress*)decompressHandle;
|
|
508
|
+
if (!self) return hpatch_TRUE;
|
|
509
|
+
Lzma2Dec_Free(&self->decEnv,&__lzma_dec_alloc);
|
|
510
|
+
free(self);
|
|
511
|
+
return hpatch_TRUE;
|
|
512
|
+
}
|
|
513
|
+
static hpatch_BOOL _lzma2_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
514
|
+
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
515
|
+
_lzma2_TDecompress* self=(_lzma2_TDecompress*)decompressHandle;
|
|
516
|
+
unsigned char* out_cur=out_part_data;
|
|
517
|
+
assert(out_part_data<=out_part_data_end);
|
|
518
|
+
while (out_cur<out_part_data_end){
|
|
519
|
+
size_t copyLen=(self->decEnv.decoder.dicPos-self->decCopyPos);
|
|
520
|
+
if (copyLen>0){
|
|
521
|
+
if (copyLen>(size_t)(out_part_data_end-out_cur))
|
|
522
|
+
copyLen=(out_part_data_end-out_cur);
|
|
523
|
+
memcpy(out_cur,self->decEnv.decoder.dic+self->decCopyPos,copyLen);
|
|
524
|
+
out_cur+=copyLen;
|
|
525
|
+
self->decCopyPos+=copyLen;
|
|
526
|
+
if ((self->decEnv.decoder.dicPos==self->decEnv.decoder.dicBufSize)
|
|
527
|
+
&&(self->decEnv.decoder.dicPos==self->decCopyPos)){
|
|
528
|
+
self->decEnv.decoder.dicPos=0;
|
|
529
|
+
self->decCopyPos=0;
|
|
530
|
+
}
|
|
1055
531
|
}else{
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
self->code_end=code_end;
|
|
1059
|
-
self->decCopyPos=0;
|
|
1060
|
-
self->decReadPos=kDecompressBufSize;
|
|
1061
|
-
}
|
|
1062
|
-
return hpatch_TRUE;
|
|
1063
|
-
}
|
|
1064
|
-
static hpatch_BOOL _7zXZ_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
1065
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
1066
|
-
_7zXZ_TDecompress* self=(_7zXZ_TDecompress*)decompressHandle;
|
|
1067
|
-
unsigned char* out_cur=out_part_data;
|
|
1068
|
-
assert(out_part_data<=out_part_data_end);
|
|
1069
|
-
while (out_cur<out_part_data_end){
|
|
1070
|
-
ECoderStatus status;
|
|
1071
|
-
SizeT inSize;
|
|
1072
|
-
SizeT outSize=out_part_data_end-out_cur;
|
|
532
|
+
ELzmaStatus status;
|
|
533
|
+
SizeT inSize,dicPos_back;
|
|
1073
534
|
SRes res;
|
|
1074
|
-
hpatch_StreamPos_t codeLen=(self->code_end-self->code_begin);
|
|
535
|
+
hpatch_StreamPos_t codeLen=(self->code_end - self->code_begin);
|
|
1075
536
|
if ((self->decReadPos==kDecompressBufSize)&&(codeLen>0)) {
|
|
1076
537
|
size_t readLen=kDecompressBufSize;
|
|
1077
538
|
if (readLen>codeLen) readLen=(size_t)codeLen;
|
|
@@ -1079,28 +540,26 @@ static void __dec_free(void* _, void* address){
|
|
|
1079
540
|
if (!self->codeStream->read(self->codeStream,self->code_begin,self->dec_buf+self->decReadPos,
|
|
1080
541
|
self->dec_buf+self->decReadPos+readLen)) return hpatch_FALSE;//error;
|
|
1081
542
|
self->code_begin+=readLen;
|
|
1082
|
-
codeLen-=readLen;
|
|
1083
543
|
}
|
|
1084
544
|
|
|
1085
545
|
inSize=kDecompressBufSize-self->decReadPos;
|
|
1086
|
-
|
|
1087
|
-
|
|
546
|
+
dicPos_back=self->decEnv.decoder.dicPos;
|
|
547
|
+
res=Lzma2Dec_DecodeToDic(&self->decEnv,self->decEnv.decoder.dicBufSize,
|
|
548
|
+
self->dec_buf+self->decReadPos,&inSize,LZMA_FINISH_ANY,&status);
|
|
1088
549
|
if(res==SZ_OK){
|
|
1089
|
-
if ((inSize==0)&&(
|
|
1090
|
-
|
|
550
|
+
if ((inSize==0)&&(self->decEnv.decoder.dicPos==dicPos_back))
|
|
551
|
+
return hpatch_FALSE;//error;
|
|
1091
552
|
}else{
|
|
1092
|
-
|
|
553
|
+
return hpatch_FALSE;//error;
|
|
1093
554
|
}
|
|
1094
555
|
self->decReadPos+=inSize;
|
|
1095
|
-
out_cur+=outSize;
|
|
1096
556
|
}
|
|
1097
|
-
return hpatch_TRUE;
|
|
1098
557
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
#endif//
|
|
558
|
+
return hpatch_TRUE;
|
|
559
|
+
}
|
|
560
|
+
static hpatch_TDecompress lzma2DecompressPlugin={_lzma2_is_can_open,_lzma2_open,
|
|
561
|
+
_lzma2_close,_lzma2_decompress_part};
|
|
562
|
+
#endif//_CompressPlugin_lzma2
|
|
1104
563
|
|
|
1105
564
|
|
|
1106
565
|
#if (defined(_CompressPlugin_lz4) || defined(_CompressPlugin_lz4hc))
|
|
@@ -1117,15 +576,14 @@ static void __dec_free(void* _, void* address){
|
|
|
1117
576
|
int code_buf_size;
|
|
1118
577
|
int data_begin;
|
|
1119
578
|
int data_end;
|
|
1120
|
-
hpatch_dec_error_t decError;
|
|
1121
579
|
unsigned char buf[1];
|
|
1122
580
|
} _lz4_TDecompress;
|
|
1123
581
|
static hpatch_BOOL _lz4_is_can_open(const char* compressType){
|
|
1124
582
|
return (0==strcmp(compressType,"lz4"));
|
|
1125
583
|
}
|
|
1126
|
-
#define _lz4_read_len4(len,in_code,code_begin,code_end
|
|
584
|
+
#define _lz4_read_len4(len,in_code,code_begin,code_end) { \
|
|
1127
585
|
unsigned char _temp_buf4[4]; \
|
|
1128
|
-
if (4>code_end-code_begin)
|
|
586
|
+
if (4>code_end-code_begin) return hpatch_FALSE; \
|
|
1129
587
|
if (!in_code->read(in_code,code_begin,_temp_buf4,_temp_buf4+4)) \
|
|
1130
588
|
return hpatch_FALSE; \
|
|
1131
589
|
len=_temp_buf4[0]|(_temp_buf4[1]<<8)|(_temp_buf4[2]<<16)|(_temp_buf4[3]<<24); \
|
|
@@ -1142,12 +600,12 @@ static void __dec_free(void* _, void* address){
|
|
|
1142
600
|
int code_buf_size=0;
|
|
1143
601
|
assert(code_begin<code_end);
|
|
1144
602
|
{//read kLz4CompressBufSize
|
|
1145
|
-
_lz4_read_len4(kLz4CompressBufSize,codeStream,code_begin,code_end
|
|
1146
|
-
if ((kLz4CompressBufSize<0)||(kLz4CompressBufSize>=kMaxLz4CompressBufSize))
|
|
603
|
+
_lz4_read_len4(kLz4CompressBufSize,codeStream,code_begin,code_end);
|
|
604
|
+
if ((kLz4CompressBufSize<0)||(kLz4CompressBufSize>=kMaxLz4CompressBufSize)) return 0;
|
|
1147
605
|
code_buf_size=LZ4_compressBound(kLz4CompressBufSize);
|
|
1148
606
|
}
|
|
1149
|
-
self=(_lz4_TDecompress*)
|
|
1150
|
-
if (!self)
|
|
607
|
+
self=(_lz4_TDecompress*)malloc(sizeof(_lz4_TDecompress)+kLz4CompressBufSize+code_buf_size);
|
|
608
|
+
if (!self) return 0;
|
|
1151
609
|
memset(self,0,sizeof(_lz4_TDecompress));
|
|
1152
610
|
self->codeStream=codeStream;
|
|
1153
611
|
self->code_begin=code_begin;
|
|
@@ -1158,7 +616,7 @@ static void __dec_free(void* _, void* address){
|
|
|
1158
616
|
self->data_end=0;
|
|
1159
617
|
|
|
1160
618
|
self->s = LZ4_createStreamDecode();
|
|
1161
|
-
if (!self->s){ free(self);
|
|
619
|
+
if (!self->s){ free(self); return 0; }
|
|
1162
620
|
return self;
|
|
1163
621
|
}
|
|
1164
622
|
static hpatch_BOOL _lz4_close(struct hpatch_TDecompress* decompressPlugin,
|
|
@@ -1166,8 +624,7 @@ static void __dec_free(void* _, void* address){
|
|
|
1166
624
|
hpatch_BOOL result=hpatch_TRUE;
|
|
1167
625
|
_lz4_TDecompress* self=(_lz4_TDecompress*)decompressHandle;
|
|
1168
626
|
if (!self) return result;
|
|
1169
|
-
|
|
1170
|
-
_dec_close_check(0==LZ4_freeStreamDecode(self->s));
|
|
627
|
+
_close_check(0==LZ4_freeStreamDecode(self->s));
|
|
1171
628
|
free(self);
|
|
1172
629
|
return result;
|
|
1173
630
|
}
|
|
@@ -1187,16 +644,16 @@ static void __dec_free(void* _, void* address){
|
|
|
1187
644
|
self->data_begin+=dataLen;
|
|
1188
645
|
}else{
|
|
1189
646
|
int codeLen;
|
|
1190
|
-
_lz4_read_len4(codeLen,self->codeStream,self->code_begin,self->code_end
|
|
647
|
+
_lz4_read_len4(codeLen,self->codeStream,self->code_begin,self->code_end);
|
|
1191
648
|
if ((codeLen<=0)||(codeLen>self->code_buf_size)
|
|
1192
|
-
||((size_t)codeLen>(self->code_end-self->code_begin)))
|
|
649
|
+
||((size_t)codeLen>(self->code_end-self->code_begin))) return hpatch_FALSE;
|
|
1193
650
|
if (!self->codeStream->read(self->codeStream,self->code_begin,
|
|
1194
651
|
code_buf,code_buf+codeLen)) return hpatch_FALSE;
|
|
1195
652
|
self->code_begin+=codeLen;
|
|
1196
653
|
self->data_begin=0;
|
|
1197
654
|
self->data_end=LZ4_decompress_safe_continue(self->s,(const char*)code_buf,(char*)data_buf,
|
|
1198
655
|
codeLen,self->kLz4CompressBufSize);
|
|
1199
|
-
if (self->data_end<=0)
|
|
656
|
+
if (self->data_end<=0) return hpatch_FALSE;
|
|
1200
657
|
}
|
|
1201
658
|
}
|
|
1202
659
|
return hpatch_TRUE;
|
|
@@ -1207,8 +664,7 @@ static void __dec_free(void* _, void* address){
|
|
|
1207
664
|
|
|
1208
665
|
#ifdef _CompressPlugin_zstd
|
|
1209
666
|
#if (_IsNeedIncludeDefaultCompressHead)
|
|
1210
|
-
|
|
1211
|
-
# include "zstd.h" // "zstd/lib/zstd.h" https://github.com/sisong/zstd
|
|
667
|
+
# include "zstd.h" // "zstd/lib/zstd.h" https://github.com/facebook/zstd
|
|
1212
668
|
#endif
|
|
1213
669
|
typedef struct _zstd_TDecompress{
|
|
1214
670
|
const struct hpatch_TStreamInput* codeStream;
|
|
@@ -1219,13 +675,8 @@ static void __dec_free(void* _, void* address){
|
|
|
1219
675
|
ZSTD_outBuffer s_output;
|
|
1220
676
|
size_t data_begin;
|
|
1221
677
|
ZSTD_DStream* s;
|
|
1222
|
-
hpatch_dec_error_t decError;
|
|
1223
678
|
unsigned char buf[1];
|
|
1224
679
|
} _zstd_TDecompress;
|
|
1225
|
-
#ifdef ZSTD_STATIC_LINKING_ONLY
|
|
1226
|
-
static void* __ZSTD_alloc(void* opaque, size_t size)
|
|
1227
|
-
__dec_Alloc_fun(_zstd_TDecompress,opaque,size)
|
|
1228
|
-
#endif
|
|
1229
680
|
static hpatch_BOOL _zstd_is_can_open(const char* compressType){
|
|
1230
681
|
return (0==strcmp(compressType,"zstd"));
|
|
1231
682
|
}
|
|
@@ -1238,8 +689,9 @@ static void __dec_free(void* _, void* address){
|
|
|
1238
689
|
size_t ret;
|
|
1239
690
|
size_t _input_size=ZSTD_DStreamInSize();
|
|
1240
691
|
size_t _output_size=ZSTD_DStreamOutSize();
|
|
1241
|
-
|
|
1242
|
-
|
|
692
|
+
assert(code_begin<code_end);
|
|
693
|
+
self=(_zstd_TDecompress*)malloc(sizeof(_zstd_TDecompress)+_input_size+_output_size);
|
|
694
|
+
if (!self) return 0;
|
|
1243
695
|
memset(self,0,sizeof(_zstd_TDecompress));
|
|
1244
696
|
self->codeStream=codeStream;
|
|
1245
697
|
self->code_begin=code_begin;
|
|
@@ -1251,20 +703,11 @@ static void __dec_free(void* _, void* address){
|
|
|
1251
703
|
self->s_output.size=_output_size;
|
|
1252
704
|
self->s_output.pos=0;
|
|
1253
705
|
self->data_begin=0;
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
self->s=ZSTD_createDStream_advanced(customMem);
|
|
1258
|
-
}
|
|
1259
|
-
#else
|
|
1260
|
-
self->s=ZSTD_createDStream();
|
|
1261
|
-
#endif
|
|
1262
|
-
if (!self->s){ _dec_onDecErr_up(); free(self); _dec_openErr_rt(); }
|
|
706
|
+
|
|
707
|
+
self->s = ZSTD_createDStream();
|
|
708
|
+
if (!self->s){ free(self); return 0; }
|
|
1263
709
|
ret=ZSTD_initDStream(self->s);
|
|
1264
|
-
if (ZSTD_isError(ret)) { ZSTD_freeDStream(self->s);
|
|
1265
|
-
#define _ZSTD_WINDOWLOG_MAX 30
|
|
1266
|
-
ret=ZSTD_DCtx_setParameter(self->s,ZSTD_d_windowLogMax,_ZSTD_WINDOWLOG_MAX);
|
|
1267
|
-
//if (ZSTD_isError(ret)) { printf("WARNING: ZSTD_DCtx_setMaxWindowSize() error!"); }
|
|
710
|
+
if (ZSTD_isError(ret)) { ZSTD_freeDStream(self->s); free(self); return 0; }
|
|
1268
711
|
return self;
|
|
1269
712
|
}
|
|
1270
713
|
static hpatch_BOOL _zstd_close(struct hpatch_TDecompress* decompressPlugin,
|
|
@@ -1272,8 +715,7 @@ static void __dec_free(void* _, void* address){
|
|
|
1272
715
|
hpatch_BOOL result=hpatch_TRUE;
|
|
1273
716
|
_zstd_TDecompress* self=(_zstd_TDecompress*)decompressHandle;
|
|
1274
717
|
if (!self) return result;
|
|
1275
|
-
|
|
1276
|
-
_dec_close_check(0==ZSTD_freeDStream(self->s));
|
|
718
|
+
_close_check(0==ZSTD_freeDStream(self->s));
|
|
1277
719
|
free(self);
|
|
1278
720
|
return result;
|
|
1279
721
|
}
|
|
@@ -1305,8 +747,8 @@ static void __dec_free(void* _, void* address){
|
|
|
1305
747
|
self->s_output.pos=0;
|
|
1306
748
|
self->data_begin=0;
|
|
1307
749
|
ret=ZSTD_decompressStream(self->s,&self->s_output,&self->s_input);
|
|
1308
|
-
if (ZSTD_isError(ret))
|
|
1309
|
-
if (self->s_output.pos==self->data_begin)
|
|
750
|
+
if (ZSTD_isError(ret)) return hpatch_FALSE;
|
|
751
|
+
if (self->s_output.pos==self->data_begin) return hpatch_FALSE;
|
|
1310
752
|
}
|
|
1311
753
|
}
|
|
1312
754
|
return hpatch_TRUE;
|
|
@@ -1333,7 +775,6 @@ static void __dec_free(void* _, void* address){
|
|
|
1333
775
|
unsigned char* next_out;
|
|
1334
776
|
unsigned char* data_begin;
|
|
1335
777
|
BrotliDecoderState* s;
|
|
1336
|
-
hpatch_dec_error_t decError;
|
|
1337
778
|
unsigned char buf[1];
|
|
1338
779
|
} _brotli_TDecompress;
|
|
1339
780
|
static hpatch_BOOL _brotli_is_can_open(const char* compressType){
|
|
@@ -1347,8 +788,8 @@ static void __dec_free(void* _, void* address){
|
|
|
1347
788
|
const size_t kBufSize=kDecompressBufSize;
|
|
1348
789
|
_brotli_TDecompress* self=0;
|
|
1349
790
|
assert(code_begin<code_end);
|
|
1350
|
-
self=(_brotli_TDecompress*)
|
|
1351
|
-
if (!self)
|
|
791
|
+
self=(_brotli_TDecompress*)malloc(sizeof(_brotli_TDecompress)+kBufSize*2);
|
|
792
|
+
if (!self) return 0;
|
|
1352
793
|
memset(self,0,sizeof(_brotli_TDecompress));
|
|
1353
794
|
self->codeStream=codeStream;
|
|
1354
795
|
self->code_begin=code_begin;
|
|
@@ -1362,16 +803,15 @@ static void __dec_free(void* _, void* address){
|
|
|
1362
803
|
self->data_begin=self->output;
|
|
1363
804
|
|
|
1364
805
|
self->s = BrotliDecoderCreateInstance(0,0,0);
|
|
1365
|
-
if (!self->s){ free(self);
|
|
806
|
+
if (!self->s){ free(self); return 0; }
|
|
1366
807
|
if (!BrotliDecoderSetParameter(self->s, BROTLI_DECODER_PARAM_LARGE_WINDOW, 1u))
|
|
1367
|
-
{ BrotliDecoderDestroyInstance(self->s); free(self);
|
|
808
|
+
{ BrotliDecoderDestroyInstance(self->s); free(self); return 0; }
|
|
1368
809
|
return self;
|
|
1369
810
|
}
|
|
1370
811
|
static hpatch_BOOL _brotli_close(struct hpatch_TDecompress* decompressPlugin,
|
|
1371
812
|
hpatch_decompressHandle decompressHandle){
|
|
1372
813
|
_brotli_TDecompress* self=(_brotli_TDecompress*)decompressHandle;
|
|
1373
814
|
if (!self) return hpatch_TRUE;
|
|
1374
|
-
_dec_onDecErr_up();
|
|
1375
815
|
BrotliDecoderDestroyInstance(self->s);
|
|
1376
816
|
free(self);
|
|
1377
817
|
return hpatch_TRUE;
|
|
@@ -1409,13 +849,13 @@ static void __dec_free(void* _, void* address){
|
|
|
1409
849
|
switch (ret){
|
|
1410
850
|
case BROTLI_DECODER_RESULT_SUCCESS:
|
|
1411
851
|
case BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: {
|
|
1412
|
-
if (self->next_out==self->data_begin)
|
|
852
|
+
if (self->next_out==self->data_begin) return hpatch_FALSE;
|
|
1413
853
|
} break;
|
|
1414
854
|
case BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: {
|
|
1415
|
-
if (self->code_end==self->code_begin)
|
|
855
|
+
if (self->code_end==self->code_begin) return hpatch_FALSE;
|
|
1416
856
|
} break;
|
|
1417
857
|
default:
|
|
1418
|
-
|
|
858
|
+
return hpatch_FALSE;
|
|
1419
859
|
}
|
|
1420
860
|
}
|
|
1421
861
|
}
|
|
@@ -1443,7 +883,6 @@ static void __dec_free(void* _, void* address){
|
|
|
1443
883
|
unsigned char* next_out;
|
|
1444
884
|
unsigned char* data_begin;
|
|
1445
885
|
lzham_decompress_state_ptr s;
|
|
1446
|
-
hpatch_dec_error_t decError;
|
|
1447
886
|
unsigned char buf[1];
|
|
1448
887
|
} _lzham_TDecompress;
|
|
1449
888
|
static hpatch_BOOL _lzham_is_can_open(const char* compressType){
|
|
@@ -1460,14 +899,14 @@ static void __dec_free(void* _, void* address){
|
|
|
1460
899
|
_lzham_TDecompress* self=0;
|
|
1461
900
|
assert(code_begin<code_end);
|
|
1462
901
|
{//load head
|
|
1463
|
-
if (code_end-code_begin<1)
|
|
902
|
+
if (code_end-code_begin<1) return 0;
|
|
1464
903
|
if (!codeStream->read(codeStream,code_begin,&dict_bits,(&dict_bits)+1))
|
|
1465
904
|
return 0;
|
|
1466
905
|
++code_begin;
|
|
1467
906
|
}
|
|
1468
907
|
|
|
1469
|
-
self=(_lzham_TDecompress*)
|
|
1470
|
-
if (!self)
|
|
908
|
+
self=(_lzham_TDecompress*)malloc(sizeof(_lzham_TDecompress)+kBufSize*2);
|
|
909
|
+
if (!self) return 0;
|
|
1471
910
|
memset(self,0,sizeof(_lzham_TDecompress));
|
|
1472
911
|
self->codeStream=codeStream;
|
|
1473
912
|
self->code_begin=code_begin;
|
|
@@ -1485,7 +924,7 @@ static void __dec_free(void* _, void* address){
|
|
|
1485
924
|
params.m_dict_size_log2 = dict_bits;
|
|
1486
925
|
|
|
1487
926
|
self->s = lzham_decompress_init(¶ms);
|
|
1488
|
-
if (!self->s){ free(self);
|
|
927
|
+
if (!self->s){ free(self); return 0; }
|
|
1489
928
|
|
|
1490
929
|
return self;
|
|
1491
930
|
}
|
|
@@ -1493,7 +932,6 @@ static void __dec_free(void* _, void* address){
|
|
|
1493
932
|
hpatch_decompressHandle decompressHandle){
|
|
1494
933
|
_lzham_TDecompress* self=(_lzham_TDecompress*)decompressHandle;
|
|
1495
934
|
if (!self) return hpatch_TRUE;
|
|
1496
|
-
_dec_onDecErr_up();
|
|
1497
935
|
lzham_decompress_deinit(self->s);
|
|
1498
936
|
free(self);
|
|
1499
937
|
return hpatch_TRUE;
|
|
@@ -1538,13 +976,13 @@ static void __dec_free(void* _, void* address){
|
|
|
1538
976
|
case LZHAM_DECOMP_STATUS_SUCCESS:
|
|
1539
977
|
case LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT:
|
|
1540
978
|
case LZHAM_DECOMP_STATUS_NOT_FINISHED: {
|
|
1541
|
-
if (self->next_out==self->data_begin)
|
|
979
|
+
if (self->next_out==self->data_begin) return hpatch_FALSE;
|
|
1542
980
|
} break;
|
|
1543
981
|
case LZHAM_DECOMP_STATUS_NEEDS_MORE_INPUT: {
|
|
1544
|
-
if (self->code_end==self->code_begin)
|
|
982
|
+
if (self->code_end==self->code_begin) return hpatch_FALSE;
|
|
1545
983
|
} break;
|
|
1546
984
|
default:
|
|
1547
|
-
|
|
985
|
+
return hpatch_FALSE;
|
|
1548
986
|
}
|
|
1549
987
|
}
|
|
1550
988
|
}
|
|
@@ -1554,84 +992,4 @@ static void __dec_free(void* _, void* address){
|
|
|
1554
992
|
_lzham_close,_lzham_decompress_part};
|
|
1555
993
|
#endif//_CompressPlugin_lzham
|
|
1556
994
|
|
|
1557
|
-
|
|
1558
|
-
#ifdef _CompressPlugin_tuz
|
|
1559
|
-
#if (_IsNeedIncludeDefaultCompressHead)
|
|
1560
|
-
# include "tuz_dec.h" // "tinyuz/decompress/tuz_dec.h" https://github.com/sisong/tinyuz
|
|
1561
|
-
#endif
|
|
1562
|
-
typedef struct _tuz_TDecompress{
|
|
1563
|
-
const struct hpatch_TStreamInput* codeStream;
|
|
1564
|
-
hpatch_StreamPos_t code_begin;
|
|
1565
|
-
hpatch_StreamPos_t code_end;
|
|
1566
|
-
tuz_byte* dec_mem;
|
|
1567
|
-
tuz_TStream s;
|
|
1568
|
-
hpatch_dec_error_t decError;
|
|
1569
|
-
} _tuz_TDecompress;
|
|
1570
|
-
|
|
1571
|
-
static tuz_BOOL _tuz_TDecompress_read_code(tuz_TInputStreamHandle listener,
|
|
1572
|
-
tuz_byte* out_code,tuz_size_t* code_size){
|
|
1573
|
-
_tuz_TDecompress* self=(_tuz_TDecompress*)listener;
|
|
1574
|
-
tuz_size_t r_size=*code_size;
|
|
1575
|
-
hpatch_StreamPos_t s_size=self->code_end-self->code_begin;
|
|
1576
|
-
if (r_size>s_size){
|
|
1577
|
-
r_size=(tuz_size_t)s_size;
|
|
1578
|
-
*code_size=r_size;
|
|
1579
|
-
}
|
|
1580
|
-
if (!self->codeStream->read(self->codeStream,self->code_begin,
|
|
1581
|
-
out_code,out_code+r_size)) return tuz_FALSE;
|
|
1582
|
-
self->code_begin+=r_size;
|
|
1583
|
-
return tuz_TRUE;
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
static hpatch_BOOL _tuz_is_can_open(const char* compressType){
|
|
1587
|
-
return (0==strcmp(compressType,"tuz"));
|
|
1588
|
-
}
|
|
1589
|
-
static hpatch_decompressHandle _tuz_open(hpatch_TDecompress* decompressPlugin,
|
|
1590
|
-
hpatch_StreamPos_t dataSize,
|
|
1591
|
-
const hpatch_TStreamInput* codeStream,
|
|
1592
|
-
hpatch_StreamPos_t code_begin,
|
|
1593
|
-
hpatch_StreamPos_t code_end){
|
|
1594
|
-
tuz_size_t dictSize;
|
|
1595
|
-
_tuz_TDecompress* self=0;
|
|
1596
|
-
self=(_tuz_TDecompress*)_dec_malloc(sizeof(_tuz_TDecompress));
|
|
1597
|
-
if (!self) _dec_memErr_rt();
|
|
1598
|
-
self->dec_mem=0;
|
|
1599
|
-
self->codeStream=codeStream;
|
|
1600
|
-
self->code_begin=code_begin;
|
|
1601
|
-
self->code_end=code_end;
|
|
1602
|
-
self->decError=hpatch_dec_ok;
|
|
1603
|
-
dictSize=tuz_TStream_read_dict_size(self,_tuz_TDecompress_read_code);
|
|
1604
|
-
if (((tuz_size_t)(dictSize-1))>=tuz_kMaxOfDictSize) { free(self); _dec_openErr_rt(); }
|
|
1605
|
-
self->dec_mem=(tuz_byte*)_dec_malloc(dictSize+kDecompressBufSize);
|
|
1606
|
-
if (self->dec_mem==0){ free(self); _dec_memErr_rt(); }
|
|
1607
|
-
if (tuz_OK!=tuz_TStream_open(&self->s,self,_tuz_TDecompress_read_code,
|
|
1608
|
-
self->dec_mem,dictSize,kDecompressBufSize)){
|
|
1609
|
-
free(self->dec_mem); free(self); _dec_openErr_rt(); }
|
|
1610
|
-
return self;
|
|
1611
|
-
}
|
|
1612
|
-
static hpatch_BOOL _tuz_close(struct hpatch_TDecompress* decompressPlugin,
|
|
1613
|
-
hpatch_decompressHandle decompressHandle){
|
|
1614
|
-
_tuz_TDecompress* self=(_tuz_TDecompress*)decompressHandle;
|
|
1615
|
-
if (!self) return hpatch_TRUE;
|
|
1616
|
-
_dec_onDecErr_up();
|
|
1617
|
-
if (self->dec_mem) free(self->dec_mem);
|
|
1618
|
-
free(self);
|
|
1619
|
-
return hpatch_TRUE;
|
|
1620
|
-
}
|
|
1621
|
-
static hpatch_BOOL _tuz_decompress_part(hpatch_decompressHandle decompressHandle,
|
|
1622
|
-
unsigned char* out_part_data,unsigned char* out_part_data_end){
|
|
1623
|
-
tuz_TResult ret;
|
|
1624
|
-
_tuz_TDecompress* self=(_tuz_TDecompress*)decompressHandle;
|
|
1625
|
-
size_t out_size=out_part_data_end-out_part_data;
|
|
1626
|
-
tuz_size_t data_size=(tuz_size_t)out_size;
|
|
1627
|
-
assert(data_size==out_size);
|
|
1628
|
-
ret=tuz_TStream_decompress_partial(&self->s,out_part_data,&data_size);
|
|
1629
|
-
if (!((ret<=tuz_STREAM_END)&&(data_size==out_size)))
|
|
1630
|
-
_dec_onDecErr_rt();
|
|
1631
|
-
return hpatch_TRUE;
|
|
1632
|
-
}
|
|
1633
|
-
static hpatch_TDecompress tuzDecompressPlugin={_tuz_is_can_open,_tuz_open,
|
|
1634
|
-
_tuz_close,_tuz_decompress_part};
|
|
1635
|
-
#endif//_CompressPlugin_tuz
|
|
1636
|
-
|
|
1637
995
|
#endif
|