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
|
@@ -31,12 +31,16 @@
|
|
|
31
31
|
#endif
|
|
32
32
|
#include "patch_private.h"
|
|
33
33
|
|
|
34
|
+
#ifndef _IS_NEED_MIN_CODE_SIZE
|
|
35
|
+
# define _IS_NEED_MIN_CODE_SIZE 0 //default used fast code
|
|
36
|
+
#endif
|
|
37
|
+
|
|
34
38
|
#ifndef _IS_RUN_MEM_SAFE_CHECK
|
|
35
39
|
# define _IS_RUN_MEM_SAFE_CHECK 1
|
|
36
40
|
#endif
|
|
37
41
|
|
|
38
42
|
#if (_IS_RUN_MEM_SAFE_CHECK)
|
|
39
|
-
//
|
|
43
|
+
//__RUN_MEM_SAFE_CHECK用来启动内存访问越界检查,用以防御可能被意外或故意损坏的数据.
|
|
40
44
|
# define __RUN_MEM_SAFE_CHECK
|
|
41
45
|
#endif
|
|
42
46
|
|
|
@@ -47,13 +51,13 @@
|
|
|
47
51
|
#endif
|
|
48
52
|
|
|
49
53
|
#define _hpatch_FALSE hpatch_FALSE
|
|
50
|
-
//hpatch_uint
|
|
51
|
-
//#define _hpatch_FALSE (1/
|
|
54
|
+
//hpatch_uint __debug_check_false_x=0; //for debug
|
|
55
|
+
//#define _hpatch_FALSE (1/__debug_check_false_x)
|
|
52
56
|
|
|
53
57
|
typedef unsigned char TByte;
|
|
54
58
|
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
//变长正整数编码方案(x bit额外类型标志位,x<=7),从高位开始输出1--n byte:
|
|
57
61
|
// x0* 7-x bit
|
|
58
62
|
// x1* 0* 7+7-x bit
|
|
59
63
|
// x1* 1* 0* 7+7+7-x bit
|
|
@@ -62,7 +66,7 @@ typedef unsigned char TByte;
|
|
|
62
66
|
// ......
|
|
63
67
|
hpatch_BOOL hpatch_packUIntWithTag(TByte** out_code,TByte* out_code_end,
|
|
64
68
|
hpatch_StreamPos_t uValue,hpatch_uint highTag,
|
|
65
|
-
const hpatch_uint kTagBit){
|
|
69
|
+
const hpatch_uint kTagBit){//写入整数并前进指针.
|
|
66
70
|
TByte* pcode=*out_code;
|
|
67
71
|
const hpatch_StreamPos_t kMaxValueWithTag=((hpatch_StreamPos_t)1<<(7-kTagBit))-1;
|
|
68
72
|
TByte codeBuf[hpatch_kMaxPackedUIntBytes];
|
|
@@ -84,7 +88,7 @@ hpatch_BOOL hpatch_packUIntWithTag(TByte** out_code,TByte* out_code_end,
|
|
|
84
88
|
++pcode;
|
|
85
89
|
while (codeBuf!=codeEnd) {
|
|
86
90
|
--codeEnd;
|
|
87
|
-
*pcode=(*codeEnd) | (
|
|
91
|
+
*pcode=(*codeEnd) | (((codeBuf!=codeEnd)?1:0)<<7);
|
|
88
92
|
++pcode;
|
|
89
93
|
}
|
|
90
94
|
*out_code=pcode;
|
|
@@ -103,7 +107,7 @@ hpatch_uint hpatch_packUIntWithTag_size(hpatch_StreamPos_t uValue,const hpatch_u
|
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
hpatch_BOOL hpatch_unpackUIntWithTag(const TByte** src_code,const TByte* src_code_end,
|
|
106
|
-
hpatch_StreamPos_t* result,const hpatch_uint kTagBit){
|
|
110
|
+
hpatch_StreamPos_t* result,const hpatch_uint kTagBit){//读出整数并前进指针.
|
|
107
111
|
#ifdef __RUN_MEM_SAFE_CHECK
|
|
108
112
|
//const hpatch_uint kPackMaxTagBit=7;
|
|
109
113
|
#endif
|
|
@@ -144,12 +148,11 @@ hpatch_BOOL hpatch_unpackUIntWithTag(const TByte** src_code,const TByte* src_cod
|
|
|
144
148
|
memcpy(out_data,src+readFromPos,readLen);
|
|
145
149
|
return hpatch_TRUE;
|
|
146
150
|
}
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
void mem_as_hStreamInput(hpatch_TStreamInput* out_stream,
|
|
152
|
+
const unsigned char* mem,const unsigned char* mem_end){
|
|
149
153
|
out_stream->streamImport=(void*)mem;
|
|
150
154
|
out_stream->streamSize=mem_end-mem;
|
|
151
155
|
out_stream->read=_read_mem_stream;
|
|
152
|
-
return out_stream;
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
static hpatch_BOOL _write_mem_stream(const hpatch_TStreamOutput* stream,hpatch_StreamPos_t writeToPos,
|
|
@@ -165,13 +168,12 @@ const hpatch_TStreamInput* mem_as_hStreamInput(hpatch_TStreamInput* out_stream,
|
|
|
165
168
|
}
|
|
166
169
|
typedef hpatch_BOOL (*_read_mem_stream_t)(const hpatch_TStreamOutput* stream,hpatch_StreamPos_t readFromPos,
|
|
167
170
|
unsigned char* out_data,unsigned char* out_data_end);
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
void mem_as_hStreamOutput(hpatch_TStreamOutput* out_stream,
|
|
172
|
+
unsigned char* mem,unsigned char* mem_end){
|
|
170
173
|
out_stream->streamImport=mem;
|
|
171
174
|
out_stream->streamSize=mem_end-mem;
|
|
172
175
|
out_stream->read_writed=(_read_mem_stream_t)_read_mem_stream;
|
|
173
176
|
out_stream->write=_write_mem_stream;
|
|
174
|
-
return out_stream;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
hpatch_BOOL hpatch_deccompress_mem(hpatch_TDecompress* decompressPlugin,
|
|
@@ -323,9 +325,30 @@ hpatch_BOOL patch(TByte* out_newData,TByte* out_newData_end,
|
|
|
323
325
|
return _hpatch_FALSE;
|
|
324
326
|
}
|
|
325
327
|
|
|
328
|
+
#if (_IS_NEED_MIN_CODE_SIZE)
|
|
326
329
|
hpatch_inline static void addData(TByte* dst,const TByte* src,hpatch_size_t length){
|
|
327
330
|
while (length--) { *dst++ += *src++; }
|
|
328
331
|
}
|
|
332
|
+
#else
|
|
333
|
+
static void addData(TByte* dst,const TByte* src,hpatch_size_t length){
|
|
334
|
+
hpatch_size_t length_fast,i;
|
|
335
|
+
|
|
336
|
+
length_fast=length&(~(hpatch_size_t)7);
|
|
337
|
+
for (i=0;i<length_fast;i+=8){
|
|
338
|
+
dst[i ]+=src[i ];
|
|
339
|
+
dst[i+1]+=src[i+1];
|
|
340
|
+
dst[i+2]+=src[i+2];
|
|
341
|
+
dst[i+3]+=src[i+3];
|
|
342
|
+
dst[i+4]+=src[i+4];
|
|
343
|
+
dst[i+5]+=src[i+5];
|
|
344
|
+
dst[i+6]+=src[i+6];
|
|
345
|
+
dst[i+7]+=src[i+7];
|
|
346
|
+
}
|
|
347
|
+
for (;i<length;++i)
|
|
348
|
+
dst[i]+=src[i];
|
|
349
|
+
}
|
|
350
|
+
#endif
|
|
351
|
+
|
|
329
352
|
|
|
330
353
|
static hpatch_BOOL _bytesRle_load(TByte* out_data,TByte* out_dataEnd,
|
|
331
354
|
const TByte* rle_code,const TByte* rle_code_end){
|
|
@@ -437,13 +460,13 @@ void TStreamOutputClip_init(TStreamOutputClip* self,const hpatch_TStreamOutput*
|
|
|
437
460
|
struct __private_hpatch_check_kMaxCompressTypeLength {
|
|
438
461
|
char _[(hpatch_kStreamCacheSize>=(hpatch_kMaxPluginTypeLength+1))?1:-1];};
|
|
439
462
|
|
|
440
|
-
hpatch_BOOL
|
|
441
|
-
|
|
463
|
+
hpatch_BOOL _TStreamCacheClip_readType_end(TStreamCacheClip* sclip,TByte endTag,
|
|
464
|
+
char out_type[hpatch_kMaxPluginTypeLength+1]){
|
|
442
465
|
const TByte* type_begin;
|
|
443
466
|
hpatch_size_t i;
|
|
444
|
-
hpatch_size_t readLen=
|
|
445
|
-
if (readLen>
|
|
446
|
-
readLen=(hpatch_size_t)
|
|
467
|
+
hpatch_size_t readLen=hpatch_kMaxPluginTypeLength+1;
|
|
468
|
+
if (readLen>_TStreamCacheClip_streamSize(sclip))
|
|
469
|
+
readLen=(hpatch_size_t)_TStreamCacheClip_streamSize(sclip);
|
|
447
470
|
type_begin=_TStreamCacheClip_accessData(sclip,readLen);
|
|
448
471
|
if (type_begin==0) return _hpatch_FALSE;//not found
|
|
449
472
|
for (i=0; i<readLen; ++i) {
|
|
@@ -499,7 +522,7 @@ struct __private_hpatch_check_hpatch_kMaxPackedUIntBytes {
|
|
|
499
522
|
hpatch_BOOL _TStreamCacheClip_unpackUIntWithTag(TStreamCacheClip* sclip,hpatch_StreamPos_t* result,const hpatch_uint kTagBit){
|
|
500
523
|
TByte* curCode,*codeBegin;
|
|
501
524
|
hpatch_size_t readSize=hpatch_kMaxPackedUIntBytes;
|
|
502
|
-
const hpatch_StreamPos_t dataSize=
|
|
525
|
+
const hpatch_StreamPos_t dataSize=_TStreamCacheClip_streamSize(sclip);
|
|
503
526
|
if (readSize>dataSize)
|
|
504
527
|
readSize=(hpatch_size_t)dataSize;
|
|
505
528
|
codeBegin=_TStreamCacheClip_accessData(sclip,readSize);
|
|
@@ -510,6 +533,28 @@ hpatch_BOOL _TStreamCacheClip_unpackUIntWithTag(TStreamCacheClip* sclip,hpatch_S
|
|
|
510
533
|
return hpatch_TRUE;
|
|
511
534
|
}
|
|
512
535
|
|
|
536
|
+
hpatch_BOOL _TStreamCacheClip_readUInt(TStreamCacheClip* sclip,hpatch_StreamPos_t* result,hpatch_size_t uintSize){
|
|
537
|
+
// assert(uintSize<=sizeof(hpatch_StreamPos_t));
|
|
538
|
+
const TByte* buf=_TStreamCacheClip_readData(sclip,uintSize);
|
|
539
|
+
hpatch_StreamPos_t v=0;
|
|
540
|
+
if (buf!=0){
|
|
541
|
+
switch (uintSize) {
|
|
542
|
+
case 8: v|=((hpatch_StreamPos_t)buf[7])<<(7*8);
|
|
543
|
+
case 7: v|=((hpatch_StreamPos_t)buf[6])<<(6*8);
|
|
544
|
+
case 6: v|=((hpatch_StreamPos_t)buf[5])<<(5*8);
|
|
545
|
+
case 5: v|=((hpatch_StreamPos_t)buf[4])<<(4*8);
|
|
546
|
+
case 4: v|=((hpatch_StreamPos_t)buf[3])<<(3*8);
|
|
547
|
+
case 3: v|=((hpatch_StreamPos_t)buf[2])<<(2*8);
|
|
548
|
+
case 2: v|=((hpatch_StreamPos_t)buf[1])<<(1*8);
|
|
549
|
+
case 1: v|=((hpatch_StreamPos_t)buf[0]);
|
|
550
|
+
case 0: { *result=v; return hpatch_TRUE; }
|
|
551
|
+
default: return _hpatch_FALSE;
|
|
552
|
+
}
|
|
553
|
+
}else{
|
|
554
|
+
return _hpatch_FALSE;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
513
558
|
hpatch_BOOL _TStreamCacheClip_readDataTo(TStreamCacheClip* sclip,TByte* out_buf,TByte* bufEnd){
|
|
514
559
|
hpatch_size_t readLen=_TStreamCacheClip_cachedSize(sclip);
|
|
515
560
|
hpatch_size_t outLen=bufEnd-out_buf;
|
|
@@ -517,31 +562,16 @@ hpatch_BOOL _TStreamCacheClip_readDataTo(TStreamCacheClip* sclip,TByte* out_buf,
|
|
|
517
562
|
readLen=outLen;
|
|
518
563
|
memcpy(out_buf,&sclip->cacheBuf[sclip->cacheBegin],readLen);
|
|
519
564
|
sclip->cacheBegin+=readLen;
|
|
565
|
+
out_buf+=readLen;
|
|
520
566
|
outLen-=readLen;
|
|
521
567
|
if (outLen){
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
#ifdef __RUN_MEM_SAFE_CHECK
|
|
526
|
-
if (outLen>_TStreamCacheClip_cachedSize(sclip)) return _hpatch_FALSE;
|
|
527
|
-
#endif
|
|
528
|
-
return _TStreamCacheClip_readDataTo(sclip, out_buf, bufEnd);
|
|
529
|
-
}else{
|
|
530
|
-
if (!sclip->srcStream->read(sclip->srcStream,sclip->streamPos,
|
|
531
|
-
out_buf,bufEnd)) return _hpatch_FALSE;
|
|
532
|
-
sclip->streamPos+=outLen;
|
|
533
|
-
}
|
|
568
|
+
if (!sclip->srcStream->read(sclip->srcStream,sclip->streamPos,
|
|
569
|
+
out_buf,bufEnd)) return _hpatch_FALSE;
|
|
570
|
+
sclip->streamPos+=outLen;
|
|
534
571
|
}
|
|
535
572
|
return hpatch_TRUE;
|
|
536
573
|
}
|
|
537
574
|
|
|
538
|
-
hpatch_BOOL _TStreamCacheClip_addDataTo(TStreamCacheClip* self,unsigned char* dst,hpatch_size_t addLen){
|
|
539
|
-
const unsigned char* src=_TStreamCacheClip_readData(self,addLen);
|
|
540
|
-
if (src==0) return _hpatch_FALSE;
|
|
541
|
-
addData(dst,src,addLen);
|
|
542
|
-
return hpatch_TRUE;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
575
|
static hpatch_BOOL _decompress_read(const hpatch_TStreamInput* stream,
|
|
546
576
|
const hpatch_StreamPos_t readFromPos,
|
|
547
577
|
TByte* out_data,TByte* out_data_end){
|
|
@@ -571,15 +601,9 @@ hpatch_BOOL getStreamClip(TStreamCacheClip* out_clip,_TDecompressInputStream* ou
|
|
|
571
601
|
out_stream->IInputStream.streamSize=dataSize;
|
|
572
602
|
out_stream->IInputStream.read=_decompress_read;
|
|
573
603
|
out_stream->decompressPlugin=decompressPlugin;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
if (!out_stream->decompressHandle) return _hpatch_FALSE;
|
|
578
|
-
}else{
|
|
579
|
-
if (decompressPlugin->reset_code==0) return _hpatch_FALSE;
|
|
580
|
-
if (!decompressPlugin->reset_code(out_stream->decompressHandle,dataSize,stream,curStreamPos,
|
|
581
|
-
curStreamPos+compressedSize)) return _hpatch_FALSE;
|
|
582
|
-
}
|
|
604
|
+
out_stream->decompressHandle=decompressPlugin->open(decompressPlugin,dataSize,stream,
|
|
605
|
+
curStreamPos,curStreamPos+compressedSize);
|
|
606
|
+
if (!out_stream->decompressHandle) return _hpatch_FALSE;
|
|
583
607
|
_TStreamCacheClip_init(out_clip,&out_stream->IInputStream,0,
|
|
584
608
|
out_stream->IInputStream.streamSize,aCache,cacheSize);
|
|
585
609
|
}
|
|
@@ -591,29 +615,50 @@ hpatch_BOOL getStreamClip(TStreamCacheClip* out_clip,_TDecompressInputStream* ou
|
|
|
591
615
|
|
|
592
616
|
///////
|
|
593
617
|
|
|
594
|
-
|
|
618
|
+
// Stream Clip cache
|
|
619
|
+
typedef struct {
|
|
620
|
+
hpatch_StreamPos_t writeToPos;
|
|
621
|
+
const hpatch_TStreamOutput* dstStream;
|
|
622
|
+
unsigned char* cacheBuf;
|
|
623
|
+
hpatch_size_t cacheCur;
|
|
624
|
+
hpatch_size_t cacheEnd;
|
|
625
|
+
} TOutStreamCache;
|
|
626
|
+
|
|
627
|
+
static hpatch_inline void TOutStreamCache_init(TOutStreamCache* self,const hpatch_TStreamOutput* dstStream,
|
|
628
|
+
TByte* aCache,hpatch_size_t aCacheSize){
|
|
629
|
+
self->writeToPos=0;
|
|
630
|
+
self->dstStream=dstStream;
|
|
631
|
+
self->cacheBuf=aCache;
|
|
632
|
+
self->cacheCur=0;
|
|
633
|
+
self->cacheEnd=aCacheSize;
|
|
634
|
+
}
|
|
635
|
+
static hpatch_inline hpatch_BOOL TOutStreamCache_isFinish(const TOutStreamCache* self){
|
|
636
|
+
return self->writeToPos==self->dstStream->streamSize;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
static hpatch_inline hpatch_BOOL _TOutStreamCache_write(TOutStreamCache* self,const TByte* data,hpatch_size_t dataSize){
|
|
595
640
|
if (!self->dstStream->write(self->dstStream,self->writeToPos,data,data+dataSize))
|
|
596
641
|
return _hpatch_FALSE;
|
|
597
642
|
self->writeToPos+=dataSize;
|
|
598
643
|
return hpatch_TRUE;
|
|
599
644
|
}
|
|
600
645
|
|
|
601
|
-
hpatch_BOOL
|
|
646
|
+
static hpatch_BOOL TOutStreamCache_flush(TOutStreamCache* self){
|
|
602
647
|
hpatch_size_t curSize=self->cacheCur;
|
|
603
648
|
if (curSize>0){
|
|
604
|
-
if (!
|
|
649
|
+
if (!_TOutStreamCache_write(self,self->cacheBuf,curSize))
|
|
605
650
|
return _hpatch_FALSE;
|
|
606
651
|
self->cacheCur=0;
|
|
607
652
|
}
|
|
608
653
|
return hpatch_TRUE;
|
|
609
654
|
}
|
|
610
655
|
|
|
611
|
-
hpatch_BOOL
|
|
656
|
+
static hpatch_BOOL TOutStreamCache_write(TOutStreamCache* self,const TByte* data,hpatch_size_t dataSize){
|
|
612
657
|
while (dataSize>0) {
|
|
613
658
|
hpatch_size_t copyLen;
|
|
614
659
|
hpatch_size_t curSize=self->cacheCur;
|
|
615
660
|
if ((dataSize>=self->cacheEnd)&&(curSize==0)){
|
|
616
|
-
return
|
|
661
|
+
return _TOutStreamCache_write(self,data,dataSize);
|
|
617
662
|
}
|
|
618
663
|
copyLen=self->cacheEnd-curSize;
|
|
619
664
|
copyLen=(copyLen<=dataSize)?copyLen:dataSize;
|
|
@@ -622,137 +667,28 @@ hpatch_BOOL _TOutStreamCache_write(_TOutStreamCache* self,const TByte* data,hpat
|
|
|
622
667
|
data+=copyLen;
|
|
623
668
|
dataSize-=copyLen;
|
|
624
669
|
if (self->cacheCur==self->cacheEnd){
|
|
625
|
-
if (!
|
|
626
|
-
return _hpatch_FALSE;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
return hpatch_TRUE;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
hpatch_BOOL _TOutStreamCache_fill(_TOutStreamCache* self,hpatch_byte fillValue,hpatch_StreamPos_t fillLength){
|
|
633
|
-
assert(self->cacheBuf);
|
|
634
|
-
if (self->cacheBuf==0) return _hpatch_FALSE;
|
|
635
|
-
while (fillLength>0){
|
|
636
|
-
hpatch_size_t curSize=self->cacheCur;
|
|
637
|
-
hpatch_size_t runStep=self->cacheEnd-curSize;
|
|
638
|
-
runStep=(runStep<=fillLength)?runStep:(hpatch_size_t)fillLength;
|
|
639
|
-
memset(self->cacheBuf+curSize,fillValue,runStep);
|
|
640
|
-
self->cacheCur=curSize+runStep;
|
|
641
|
-
fillLength-=runStep;
|
|
642
|
-
if (self->cacheCur==self->cacheEnd){
|
|
643
|
-
if (!_TOutStreamCache_flush(self))
|
|
644
|
-
return _hpatch_FALSE;
|
|
670
|
+
if (!TOutStreamCache_flush(self)) return _hpatch_FALSE;
|
|
645
671
|
}
|
|
646
672
|
}
|
|
647
673
|
return hpatch_TRUE;
|
|
648
674
|
}
|
|
649
675
|
|
|
650
|
-
hpatch_BOOL _TOutStreamCache_copyFromStream(_TOutStreamCache* self,const hpatch_TStreamInput* src,
|
|
651
|
-
hpatch_StreamPos_t srcPos,hpatch_StreamPos_t copyLength){
|
|
652
|
-
assert(self->cacheBuf);
|
|
653
|
-
if (self->cacheBuf==0) return _hpatch_FALSE;
|
|
654
|
-
while (copyLength>0){
|
|
655
|
-
hpatch_size_t curSize=self->cacheCur;
|
|
656
|
-
hpatch_size_t runStep=self->cacheEnd-curSize;
|
|
657
|
-
hpatch_byte* buf=self->cacheBuf+curSize;
|
|
658
|
-
runStep=(runStep<=copyLength)?runStep:(hpatch_size_t)copyLength;
|
|
659
|
-
if (!src->read(src,srcPos,buf,buf+runStep))
|
|
660
|
-
return _hpatch_FALSE;
|
|
661
|
-
srcPos+=runStep;
|
|
662
|
-
self->cacheCur=curSize+runStep;
|
|
663
|
-
copyLength-=runStep;
|
|
664
|
-
if (self->cacheCur==self->cacheEnd){
|
|
665
|
-
if (!_TOutStreamCache_flush(self))
|
|
666
|
-
return _hpatch_FALSE;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return hpatch_TRUE;
|
|
670
|
-
}
|
|
671
676
|
|
|
672
|
-
hpatch_BOOL
|
|
677
|
+
static hpatch_BOOL _patch_copy_diff_by_outCache(TOutStreamCache* outCache,TStreamCacheClip* diff,hpatch_StreamPos_t copyLength){
|
|
673
678
|
while (copyLength>0){
|
|
674
679
|
const TByte* data;
|
|
675
|
-
hpatch_size_t
|
|
676
|
-
|
|
677
|
-
|
|
680
|
+
hpatch_size_t decodeStep=diff->cacheEnd;
|
|
681
|
+
if (decodeStep>copyLength)
|
|
682
|
+
decodeStep=(hpatch_size_t)copyLength;
|
|
683
|
+
data=_TStreamCacheClip_readData(diff,decodeStep);
|
|
684
|
+
if (data==0) return _hpatch_FALSE;
|
|
685
|
+
if (!TOutStreamCache_write(outCache,data,decodeStep))
|
|
678
686
|
return _hpatch_FALSE;
|
|
679
|
-
|
|
680
|
-
return _hpatch_FALSE;
|
|
681
|
-
copyLength-=runStep;
|
|
687
|
+
copyLength-=decodeStep;
|
|
682
688
|
}
|
|
683
689
|
return hpatch_TRUE;
|
|
684
690
|
}
|
|
685
691
|
|
|
686
|
-
hpatch_BOOL _TOutStreamCache_copyFromSelf(_TOutStreamCache* self,hpatch_StreamPos_t aheadLength,hpatch_StreamPos_t copyLength){
|
|
687
|
-
// [ writed ]
|
|
688
|
-
// [ cached buf | empty buf ]
|
|
689
|
-
const hpatch_TStreamInput* src=(const hpatch_TStreamInput*)self->dstStream;
|
|
690
|
-
hpatch_StreamPos_t srcPos=self->writeToPos+self->cacheCur-aheadLength;
|
|
691
|
-
if (src->read==0) //can't read
|
|
692
|
-
return _hpatch_FALSE;
|
|
693
|
-
if ((aheadLength<1)|(aheadLength>self->writeToPos+self->cacheCur))
|
|
694
|
-
return _hpatch_FALSE;
|
|
695
|
-
|
|
696
|
-
if (srcPos+copyLength<=self->writeToPos){//copy from stream
|
|
697
|
-
// [ copyLength ]
|
|
698
|
-
__copy_in_stream:
|
|
699
|
-
return _TOutStreamCache_copyFromStream(self,src,srcPos,copyLength);
|
|
700
|
-
}else if (srcPos>=self->writeToPos){ //copy in mem
|
|
701
|
-
// [ copyLength ]
|
|
702
|
-
__copy_in_mem:
|
|
703
|
-
while (copyLength>0){
|
|
704
|
-
hpatch_byte* dstBuf=self->cacheBuf+self->cacheCur;
|
|
705
|
-
hpatch_byte* srcBuf=dstBuf-(hpatch_size_t)aheadLength;
|
|
706
|
-
hpatch_size_t runLen=(self->cacheCur+copyLength<=self->cacheEnd)?(hpatch_size_t)copyLength:(self->cacheEnd-self->cacheCur);
|
|
707
|
-
hpatch_size_t i;
|
|
708
|
-
for (i=0;i<runLen;i++)
|
|
709
|
-
dstBuf[i]=srcBuf[i];
|
|
710
|
-
copyLength-=runLen;
|
|
711
|
-
self->cacheCur+=runLen;
|
|
712
|
-
if (self->cacheCur==self->cacheEnd){
|
|
713
|
-
if (!_TOutStreamCache_flush(self))
|
|
714
|
-
return _hpatch_FALSE;
|
|
715
|
-
runLen=(hpatch_size_t)((aheadLength<=copyLength)?aheadLength:copyLength);
|
|
716
|
-
memmove(self->cacheBuf,self->cacheBuf+self->cacheEnd-(hpatch_size_t)aheadLength,runLen);
|
|
717
|
-
self->cacheCur=runLen;
|
|
718
|
-
copyLength-=runLen;
|
|
719
|
-
}else{
|
|
720
|
-
assert(copyLength==0);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
return hpatch_TRUE;
|
|
724
|
-
}else if (self->writeToPos+self->cacheCur<=srcPos+self->cacheEnd){
|
|
725
|
-
// small data in stream,can as copy in mem
|
|
726
|
-
hpatch_byte* dstBuf=self->cacheBuf+self->cacheCur;
|
|
727
|
-
hpatch_size_t runLen=(hpatch_size_t)(self->writeToPos-srcPos);
|
|
728
|
-
if (!src->read(src,srcPos,dstBuf,dstBuf+runLen))
|
|
729
|
-
return _hpatch_FALSE;
|
|
730
|
-
//srcPos+=runLen; //not used
|
|
731
|
-
copyLength-=runLen;
|
|
732
|
-
self->cacheCur+=runLen;
|
|
733
|
-
if (self->cacheCur==self->cacheEnd){
|
|
734
|
-
while (hpatch_TRUE){
|
|
735
|
-
if (self->cacheCur==self->cacheEnd){
|
|
736
|
-
if (!_TOutStreamCache_flush(self))
|
|
737
|
-
return _hpatch_FALSE;
|
|
738
|
-
}
|
|
739
|
-
if (copyLength>0){
|
|
740
|
-
runLen=(self->cacheEnd<=copyLength)?self->cacheEnd:(hpatch_size_t)copyLength;
|
|
741
|
-
//srcPos+=runLen; //not used
|
|
742
|
-
copyLength-=runLen;
|
|
743
|
-
self->cacheCur=runLen;
|
|
744
|
-
}else{
|
|
745
|
-
return hpatch_TRUE;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
}else{
|
|
749
|
-
goto __copy_in_mem;
|
|
750
|
-
}
|
|
751
|
-
}else{
|
|
752
|
-
goto __copy_in_stream;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
692
|
|
|
757
693
|
typedef struct _TBytesRle_load_stream{
|
|
758
694
|
hpatch_StreamPos_t memCopyLength;
|
|
@@ -771,9 +707,29 @@ static void _TBytesRle_load_stream_init(_TBytesRle_load_stream* loader){
|
|
|
771
707
|
_TStreamCacheClip_init(&loader->rleCodeClip,0,0,0,0,0);
|
|
772
708
|
}
|
|
773
709
|
|
|
710
|
+
#if (_IS_NEED_MIN_CODE_SIZE)
|
|
774
711
|
hpatch_inline static void memSet_add(TByte* dst,const TByte src,hpatch_size_t length){
|
|
775
|
-
while (length--) {
|
|
712
|
+
while (length--) { *dst++ += src; }
|
|
776
713
|
}
|
|
714
|
+
#else
|
|
715
|
+
static void memSet_add(TByte* dst,const TByte src,hpatch_size_t length){
|
|
716
|
+
hpatch_size_t length_fast,i;
|
|
717
|
+
|
|
718
|
+
length_fast=length&(~(hpatch_size_t)7);
|
|
719
|
+
for (i=0;i<length_fast;i+=8){
|
|
720
|
+
dst[i ]+=src;
|
|
721
|
+
dst[i+1]+=src;
|
|
722
|
+
dst[i+2]+=src;
|
|
723
|
+
dst[i+3]+=src;
|
|
724
|
+
dst[i+4]+=src;
|
|
725
|
+
dst[i+5]+=src;
|
|
726
|
+
dst[i+6]+=src;
|
|
727
|
+
dst[i+7]+=src;
|
|
728
|
+
}
|
|
729
|
+
for (;i<length;++i)
|
|
730
|
+
dst[i]+=src;
|
|
731
|
+
}
|
|
732
|
+
#endif
|
|
777
733
|
|
|
778
734
|
static hpatch_BOOL _TBytesRle_load_stream_mem_add(_TBytesRle_load_stream* loader,
|
|
779
735
|
hpatch_size_t* _decodeSize,TByte** _out_data){
|
|
@@ -872,7 +828,7 @@ static hpatch_BOOL _TBytesRle_load_stream_decode_add(_TBytesRle_load_stream* loa
|
|
|
872
828
|
#define _TBytesRle_load_stream_decode_skip(loader,decodeSize) \
|
|
873
829
|
_TBytesRle_load_stream_decode_add(loader,0,decodeSize)
|
|
874
830
|
|
|
875
|
-
static hpatch_BOOL _patch_add_old_with_rle(
|
|
831
|
+
static hpatch_BOOL _patch_add_old_with_rle(TOutStreamCache* outCache,_TBytesRle_load_stream* rle_loader,
|
|
876
832
|
const hpatch_TStreamInput* old,hpatch_StreamPos_t oldPos,
|
|
877
833
|
hpatch_StreamPos_t addLength,TByte* aCache,hpatch_size_t aCacheSize){
|
|
878
834
|
while (addLength>0){
|
|
@@ -881,7 +837,7 @@ static hpatch_BOOL _patch_add_old_with_rle(_TOutStreamCache* outCache,_TBytesRl
|
|
|
881
837
|
decodeStep=(hpatch_size_t)addLength;
|
|
882
838
|
if (!old->read(old,oldPos,aCache,aCache+decodeStep)) return _hpatch_FALSE;
|
|
883
839
|
if (!_TBytesRle_load_stream_decode_add(rle_loader,aCache,decodeStep)) return _hpatch_FALSE;
|
|
884
|
-
if (!
|
|
840
|
+
if (!TOutStreamCache_write(outCache,aCache,decodeStep)) return _hpatch_FALSE;
|
|
885
841
|
oldPos+=decodeStep;
|
|
886
842
|
addLength-=decodeStep;
|
|
887
843
|
}
|
|
@@ -981,48 +937,51 @@ static hpatch_BOOL _rle_decode_skip(struct _TBytesRle_load_stream* rle_loader,hp
|
|
|
981
937
|
return hpatch_TRUE;
|
|
982
938
|
}
|
|
983
939
|
|
|
984
|
-
static hpatch_BOOL patchByClip(
|
|
940
|
+
static hpatch_BOOL patchByClip(const hpatch_TStreamOutput* out_newData,
|
|
985
941
|
const hpatch_TStreamInput* oldData,
|
|
986
942
|
hpatch_TCovers* covers,
|
|
987
943
|
TStreamCacheClip* code_newDataDiffClip,
|
|
988
944
|
struct _TBytesRle_load_stream* rle_loader,
|
|
989
945
|
TByte* temp_cache,hpatch_size_t cache_size){
|
|
990
|
-
const hpatch_StreamPos_t newDataSize=
|
|
946
|
+
const hpatch_StreamPos_t newDataSize=out_newData->streamSize;
|
|
991
947
|
const hpatch_StreamPos_t oldDataSize=oldData->streamSize;
|
|
992
948
|
hpatch_StreamPos_t coverCount=covers->leave_cover_count(covers);
|
|
949
|
+
TOutStreamCache outCache;
|
|
993
950
|
hpatch_StreamPos_t newPosBack=0;
|
|
994
951
|
assert(cache_size>=hpatch_kMaxPackedUIntBytes);
|
|
952
|
+
TOutStreamCache_init(&outCache,out_newData,temp_cache+cache_size,cache_size);
|
|
995
953
|
|
|
996
954
|
while (coverCount--){
|
|
997
955
|
hpatch_TCover cover;
|
|
998
956
|
if(!covers->read_cover(covers,&cover)) return _hpatch_FALSE;
|
|
999
957
|
#ifdef __RUN_MEM_SAFE_CHECK
|
|
1000
|
-
if (cover.newPos
|
|
958
|
+
if (cover.newPos>newDataSize) return _hpatch_FALSE;
|
|
1001
959
|
if (cover.length>(hpatch_StreamPos_t)(newDataSize-cover.newPos)) return _hpatch_FALSE;
|
|
1002
960
|
if (cover.oldPos>oldDataSize) return _hpatch_FALSE;
|
|
1003
961
|
if (cover.length>(hpatch_StreamPos_t)(oldDataSize-cover.oldPos)) return _hpatch_FALSE;
|
|
962
|
+
if (cover.newPos<newPosBack) return _hpatch_FALSE;
|
|
1004
963
|
#endif
|
|
1005
964
|
if (newPosBack<cover.newPos){
|
|
1006
965
|
hpatch_StreamPos_t copyLength=cover.newPos-newPosBack;
|
|
1007
|
-
if (!
|
|
966
|
+
if (!_patch_copy_diff_by_outCache(&outCache,code_newDataDiffClip,copyLength)) return _hpatch_FALSE;
|
|
1008
967
|
if (!_rle_decode_skip(rle_loader,copyLength)) return _hpatch_FALSE;
|
|
1009
968
|
}
|
|
1010
|
-
if (!_patch_add_old_with_rle(outCache,rle_loader,oldData,cover.oldPos,cover.length,
|
|
969
|
+
if (!_patch_add_old_with_rle(&outCache,rle_loader,oldData,cover.oldPos,cover.length,
|
|
1011
970
|
temp_cache,cache_size)) return _hpatch_FALSE;
|
|
1012
971
|
newPosBack=cover.newPos+cover.length;
|
|
1013
972
|
}
|
|
1014
973
|
|
|
1015
974
|
if (newPosBack<newDataSize){
|
|
1016
975
|
hpatch_StreamPos_t copyLength=newDataSize-newPosBack;
|
|
1017
|
-
if (!
|
|
976
|
+
if (!_patch_copy_diff_by_outCache(&outCache,code_newDataDiffClip,copyLength)) return _hpatch_FALSE;
|
|
1018
977
|
if (!_rle_decode_skip(rle_loader,copyLength)) return _hpatch_FALSE;
|
|
1019
978
|
newPosBack=newDataSize;
|
|
1020
979
|
}
|
|
1021
|
-
if (!
|
|
980
|
+
if (!TOutStreamCache_flush(&outCache))
|
|
1022
981
|
return _hpatch_FALSE;
|
|
1023
982
|
if ( _TBytesRle_load_stream_isFinish(rle_loader)
|
|
1024
983
|
&& covers->is_finish(covers)
|
|
1025
|
-
&&
|
|
984
|
+
&& TOutStreamCache_isFinish(&outCache)
|
|
1026
985
|
&& _TStreamCacheClip_isFinish(code_newDataDiffClip)
|
|
1027
986
|
&& (newPosBack==newDataSize) )
|
|
1028
987
|
return hpatch_TRUE;
|
|
@@ -1104,14 +1063,12 @@ static hpatch_BOOL _packedCovers_open(_TPackedCovers** out_self,
|
|
|
1104
1063
|
diffPos0=out_diffHead->headEndPos;
|
|
1105
1064
|
_TStreamCacheClip_init(&self->code_lengthsClip,serializedDiff,diffPos0,
|
|
1106
1065
|
diffPos0+out_diffHead->lengthSize,temp_cache,cacheSize);
|
|
1107
|
-
temp_cache+=cacheSize;
|
|
1108
1066
|
diffPos0+=out_diffHead->lengthSize;
|
|
1109
1067
|
_TStreamCacheClip_init(&self->code_inc_newPosClip,serializedDiff,diffPos0,
|
|
1110
|
-
diffPos0+out_diffHead->inc_newPosSize,temp_cache,cacheSize);
|
|
1111
|
-
temp_cache+=cacheSize;
|
|
1068
|
+
diffPos0+out_diffHead->inc_newPosSize,temp_cache+cacheSize*1,cacheSize);
|
|
1112
1069
|
diffPos0+=out_diffHead->inc_newPosSize;
|
|
1113
1070
|
_TStreamCacheClip_init(&self->code_inc_oldPosClip,serializedDiff,diffPos0,
|
|
1114
|
-
diffPos0+out_diffHead->inc_oldPosSize,temp_cache,cacheSize);
|
|
1071
|
+
diffPos0+out_diffHead->inc_oldPosSize,temp_cache+cacheSize*2,cacheSize);
|
|
1115
1072
|
}
|
|
1116
1073
|
|
|
1117
1074
|
_covers_init(&self->base,out_diffHead->coverCount,&self->code_inc_oldPosClip,
|
|
@@ -1153,8 +1110,7 @@ static hpatch_BOOL _patch_stream_with_cache(const hpatch_TStreamOutput* out_newD
|
|
|
1153
1110
|
//newDataDiff
|
|
1154
1111
|
diffPos0=diffHead.coverEndPos;
|
|
1155
1112
|
_TStreamCacheClip_init(&code_newDataDiffClip,serializedDiff,diffPos0,
|
|
1156
|
-
diffPos0+diffHead.newDataDiffSize,temp_cache,cacheSize);
|
|
1157
|
-
temp_cache+=cacheSize;
|
|
1113
|
+
diffPos0+diffHead.newDataDiffSize,temp_cache+cacheSize*0,cacheSize);
|
|
1158
1114
|
diffPos0+=diffHead.newDataDiffSize;
|
|
1159
1115
|
|
|
1160
1116
|
{//rle
|
|
@@ -1165,7 +1121,7 @@ static hpatch_BOOL _patch_stream_with_cache(const hpatch_TStreamOutput* out_newD
|
|
|
1165
1121
|
if (cacheSize<hpatch_kMaxPackedUIntBytes) return _hpatch_FALSE;
|
|
1166
1122
|
#endif
|
|
1167
1123
|
_TStreamCacheClip_init(rleHeadClip,serializedDiff,diffPos0,diffPos_end,
|
|
1168
|
-
temp_cache,hpatch_kMaxPackedUIntBytes);
|
|
1124
|
+
temp_cache+cacheSize*1,hpatch_kMaxPackedUIntBytes);
|
|
1169
1125
|
_clip_unpackUIntTo(&rleCtrlSize,rleHeadClip);
|
|
1170
1126
|
rlePos0=(hpatch_StreamPos_t)(_TStreamCacheClip_readPosOfSrcStream(rleHeadClip));
|
|
1171
1127
|
#ifdef __RUN_MEM_SAFE_CHECK
|
|
@@ -1173,19 +1129,13 @@ static hpatch_BOOL _patch_stream_with_cache(const hpatch_TStreamOutput* out_newD
|
|
|
1173
1129
|
#endif
|
|
1174
1130
|
_TBytesRle_load_stream_init(&rle_loader);
|
|
1175
1131
|
_TStreamCacheClip_init(&rle_loader.ctrlClip,serializedDiff,rlePos0,rlePos0+rleCtrlSize,
|
|
1176
|
-
temp_cache,cacheSize);
|
|
1177
|
-
temp_cache+=cacheSize;
|
|
1132
|
+
temp_cache+cacheSize*1,cacheSize);
|
|
1178
1133
|
_TStreamCacheClip_init(&rle_loader.rleCodeClip,serializedDiff,rlePos0+rleCtrlSize,diffPos_end,
|
|
1179
|
-
temp_cache,cacheSize);
|
|
1180
|
-
temp_cache+=cacheSize;
|
|
1181
|
-
}
|
|
1182
|
-
{
|
|
1183
|
-
_TOutStreamCache outCache;
|
|
1184
|
-
_TOutStreamCache_init(&outCache,out_newData,temp_cache,cacheSize);
|
|
1185
|
-
temp_cache+=cacheSize;
|
|
1186
|
-
return patchByClip(&outCache,oldData,pcovers,&code_newDataDiffClip,
|
|
1187
|
-
&rle_loader,temp_cache,cacheSize);
|
|
1134
|
+
temp_cache+cacheSize*2,cacheSize);
|
|
1188
1135
|
}
|
|
1136
|
+
|
|
1137
|
+
return patchByClip(out_newData,oldData,pcovers,&code_newDataDiffClip,
|
|
1138
|
+
&rle_loader,temp_cache+cacheSize*3,cacheSize);
|
|
1189
1139
|
}
|
|
1190
1140
|
|
|
1191
1141
|
|
|
@@ -1200,7 +1150,7 @@ hpatch_BOOL read_diffz_head(hpatch_compressedDiffInfo* out_diffInfo,_THDiffzHead
|
|
|
1200
1150
|
const char* kVersionType="HDIFF13";
|
|
1201
1151
|
char* tempType=out_diffInfo->compressType;
|
|
1202
1152
|
if (!_TStreamCacheClip_readType_end(diffHeadClip,'&',tempType)) return _hpatch_FALSE;
|
|
1203
|
-
if (0!=strcmp(tempType,kVersionType)) return
|
|
1153
|
+
if (0!=strcmp(tempType,kVersionType)) return _hpatch_FALSE;
|
|
1204
1154
|
}
|
|
1205
1155
|
{//read compressType
|
|
1206
1156
|
if (!_TStreamCacheClip_readType_end(diffHeadClip,'\0',
|
|
@@ -1247,6 +1197,7 @@ hpatch_BOOL getCompressedDiffInfo(hpatch_compressedDiffInfo* out_diffInfo,
|
|
|
1247
1197
|
|
|
1248
1198
|
static
|
|
1249
1199
|
hpatch_BOOL _patch_decompress_cache(const hpatch_TStreamOutput* out_newData,
|
|
1200
|
+
hpatch_TStreamInput* once_in_newData,
|
|
1250
1201
|
const hpatch_TStreamInput* oldData,
|
|
1251
1202
|
const hpatch_TStreamInput* compressedDiff,
|
|
1252
1203
|
hpatch_TDecompress* decompressPlugin,
|
|
@@ -1258,7 +1209,7 @@ hpatch_BOOL _patch_decompress_cache(const hpatch_TStreamOutput* out_newData,
|
|
|
1258
1209
|
_THDiffzHead head;
|
|
1259
1210
|
hpatch_compressedDiffInfo diffInfo;
|
|
1260
1211
|
_TDecompressInputStream decompressers[4];
|
|
1261
|
-
|
|
1212
|
+
hpatch_uint i;
|
|
1262
1213
|
hpatch_StreamPos_t coverCount;
|
|
1263
1214
|
hpatch_BOOL result=hpatch_TRUE;
|
|
1264
1215
|
hpatch_StreamPos_t diffPos0=0;
|
|
@@ -1295,35 +1246,29 @@ hpatch_BOOL _patch_decompress_cache(const hpatch_TStreamOutput* out_newData,
|
|
|
1295
1246
|
}
|
|
1296
1247
|
if (!getStreamClip(&rle_loader.ctrlClip,&decompressers[1],
|
|
1297
1248
|
head.rle_ctrlBuf_size,head.compress_rle_ctrlBuf_size,compressedDiff,&diffPos0,
|
|
1298
|
-
decompressPlugin,temp_cache,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1299
|
-
temp_cache+=cacheSize;
|
|
1249
|
+
decompressPlugin,temp_cache+cacheSize*0,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1300
1250
|
if (!getStreamClip(&rle_loader.rleCodeClip,&decompressers[2],
|
|
1301
1251
|
head.rle_codeBuf_size,head.compress_rle_codeBuf_size,compressedDiff,&diffPos0,
|
|
1302
|
-
decompressPlugin,temp_cache,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1303
|
-
temp_cache+=cacheSize;
|
|
1252
|
+
decompressPlugin,temp_cache+cacheSize*1,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1304
1253
|
if (!getStreamClip(&code_newDataDiffClip,&decompressers[3],
|
|
1305
1254
|
head.newDataDiff_size,head.compress_newDataDiff_size,compressedDiff,&diffPos0,
|
|
1306
|
-
decompressPlugin,temp_cache,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1307
|
-
temp_cache+=cacheSize;
|
|
1255
|
+
decompressPlugin,temp_cache+cacheSize*2,cacheSize)) _clear_return(_hpatch_FALSE);
|
|
1308
1256
|
#ifdef __RUN_MEM_SAFE_CHECK
|
|
1309
1257
|
if (diffPos0!=diffPos_end) _clear_return(_hpatch_FALSE);
|
|
1310
1258
|
#endif
|
|
1311
1259
|
|
|
1312
1260
|
coverCount=head.coverCount;
|
|
1313
1261
|
{
|
|
1314
|
-
_TCovers
|
|
1315
|
-
hpatch_TCovers*
|
|
1316
|
-
_TOutStreamCache outCache;
|
|
1317
|
-
_TOutStreamCache_init(&outCache,out_newData,temp_cache,cacheSize);
|
|
1318
|
-
temp_cache+=cacheSize;
|
|
1262
|
+
_TCovers covers;
|
|
1263
|
+
hpatch_TCovers* pcovers=0;
|
|
1319
1264
|
if (cached_covers){
|
|
1320
1265
|
pcovers=cached_covers;
|
|
1321
1266
|
}else{
|
|
1322
1267
|
_covers_init(&covers,coverCount,&coverClip,&coverClip,&coverClip,hpatch_TRUE);
|
|
1323
1268
|
pcovers=&covers.ICovers; //not need close before return
|
|
1324
1269
|
}
|
|
1325
|
-
result=patchByClip(
|
|
1326
|
-
temp_cache,cacheSize);
|
|
1270
|
+
result=patchByClip(out_newData,oldData,pcovers,&code_newDataDiffClip,&rle_loader,
|
|
1271
|
+
temp_cache+cacheSize*3,cacheSize);
|
|
1327
1272
|
//if ((pcovers!=cached_covers)&&(!pcovers->close(pcovers))) result=_hpatch_FALSE;
|
|
1328
1273
|
}
|
|
1329
1274
|
clear:
|
|
@@ -1408,7 +1353,7 @@ typedef struct hpatch_TCCover32{
|
|
|
1408
1353
|
hpatch_uint32_t oldPos;
|
|
1409
1354
|
hpatch_uint32_t newPos;
|
|
1410
1355
|
hpatch_uint32_t length;
|
|
1411
|
-
hpatch_uint32_t cachePos; //
|
|
1356
|
+
hpatch_uint32_t cachePos; //todo:放到临时内存中,用完释放?逻辑会比较复杂;
|
|
1412
1357
|
} hpatch_TCCover32;
|
|
1413
1358
|
|
|
1414
1359
|
typedef struct hpatch_TCCover64{
|
|
@@ -1464,22 +1409,6 @@ static hpatch_BOOL _arrayCovers_read_cover(struct hpatch_TCovers* covers,hpatch_
|
|
|
1464
1409
|
}
|
|
1465
1410
|
}
|
|
1466
1411
|
|
|
1467
|
-
static hpatch_force_inline void _arrayCovers_push_cover(_TArrayCovers* self,const hpatch_TCover* cover){
|
|
1468
|
-
hpatch_size_t i=self->coverCount;
|
|
1469
|
-
if (self->is32){
|
|
1470
|
-
hpatch_TCCover32* pCover=((hpatch_TCCover32*)self->pCCovers)+i;
|
|
1471
|
-
pCover->oldPos=(hpatch_uint32_t)cover->oldPos;
|
|
1472
|
-
pCover->newPos=(hpatch_uint32_t)cover->newPos;
|
|
1473
|
-
pCover->length=(hpatch_uint32_t)cover->length;
|
|
1474
|
-
}else{
|
|
1475
|
-
hpatch_TCCover64* pCover=((hpatch_TCCover64*)self->pCCovers)+i;
|
|
1476
|
-
pCover->oldPos=cover->oldPos;
|
|
1477
|
-
pCover->newPos=cover->newPos;
|
|
1478
|
-
pCover->length=cover->length;
|
|
1479
|
-
}
|
|
1480
|
-
self->coverCount=i+1;
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
1412
|
static hpatch_BOOL _arrayCovers_load(_TArrayCovers** out_self,hpatch_TCovers* src_covers,
|
|
1484
1413
|
hpatch_BOOL isUsedCover32,hpatch_BOOL* out_isReadError,
|
|
1485
1414
|
TByte** ptemp_cache,TByte* temp_cache_end){
|
|
@@ -1534,45 +1463,37 @@ static hpatch_BOOL _arrayCovers_load(_TArrayCovers** out_self,hpatch_TCovers* sr
|
|
|
1534
1463
|
_uint_t y=((const _uint_t*)_y)[item]; \
|
|
1535
1464
|
return (x<y)?(-1):((x>y)?1:0); \
|
|
1536
1465
|
}
|
|
1537
|
-
|
|
1538
|
-
# define __CALL_BACK_C __cdecl
|
|
1539
|
-
#else
|
|
1540
|
-
# define __CALL_BACK_C
|
|
1541
|
-
#endif
|
|
1542
|
-
static hpatch_int __CALL_BACK_C _arrayCovers_comp_by_old_32(const void* _x, const void *_y){
|
|
1466
|
+
static hpatch_int _arrayCovers_comp_by_old_32(const void* _x, const void *_y){
|
|
1543
1467
|
_arrayCovers_comp(hpatch_uint32_t,_x,_y,0);
|
|
1544
1468
|
}
|
|
1545
|
-
static hpatch_int
|
|
1469
|
+
static hpatch_int _arrayCovers_comp_by_old(const void* _x, const void *_y){
|
|
1546
1470
|
_arrayCovers_comp(hpatch_StreamPos_t,_x,_y,0);
|
|
1547
1471
|
}
|
|
1548
|
-
static hpatch_int
|
|
1472
|
+
static hpatch_int _arrayCovers_comp_by_new_32(const void* _x, const void *_y){
|
|
1549
1473
|
_arrayCovers_comp(hpatch_uint32_t,_x,_y,1);
|
|
1550
1474
|
}
|
|
1551
|
-
static hpatch_int
|
|
1475
|
+
static hpatch_int _arrayCovers_comp_by_new(const void* _x, const void *_y){
|
|
1552
1476
|
_arrayCovers_comp(hpatch_StreamPos_t,_x,_y,1);
|
|
1553
1477
|
}
|
|
1554
|
-
static hpatch_int
|
|
1478
|
+
static hpatch_int _arrayCovers_comp_by_len_32(const void* _x, const void *_y){
|
|
1555
1479
|
_arrayCovers_comp(hpatch_uint32_t,_x,_y,2);
|
|
1556
1480
|
}
|
|
1557
|
-
static hpatch_int
|
|
1481
|
+
static hpatch_int _arrayCovers_comp_by_len(const void* _x, const void *_y){
|
|
1558
1482
|
_arrayCovers_comp(hpatch_StreamPos_t,_x,_y,2);
|
|
1559
1483
|
}
|
|
1560
1484
|
|
|
1561
|
-
hpatch_force_inline
|
|
1562
1485
|
static void _arrayCovers_sort_by_old(_TArrayCovers* self){
|
|
1563
1486
|
if (self->is32)
|
|
1564
1487
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover32),_arrayCovers_comp_by_old_32);
|
|
1565
1488
|
else
|
|
1566
1489
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover64),_arrayCovers_comp_by_old);
|
|
1567
1490
|
}
|
|
1568
|
-
hpatch_force_inline
|
|
1569
1491
|
static void _arrayCovers_sort_by_new(_TArrayCovers* self){
|
|
1570
1492
|
if (self->is32)
|
|
1571
1493
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover32),_arrayCovers_comp_by_new_32);
|
|
1572
1494
|
else
|
|
1573
1495
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover64),_arrayCovers_comp_by_new);
|
|
1574
1496
|
}
|
|
1575
|
-
hpatch_force_inline
|
|
1576
1497
|
static void _arrayCovers_sort_by_len(_TArrayCovers* self){
|
|
1577
1498
|
if (self->is32)
|
|
1578
1499
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover32),_arrayCovers_comp_by_len_32);
|
|
@@ -1580,27 +1501,22 @@ static void _arrayCovers_sort_by_len(_TArrayCovers* self){
|
|
|
1580
1501
|
qsort(self->pCCovers,self->coverCount,sizeof(hpatch_TCCover64),_arrayCovers_comp_by_len);
|
|
1581
1502
|
}
|
|
1582
1503
|
|
|
1583
|
-
static
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
hpatch_size_t i;
|
|
1587
|
-
for (i=0; i<coverCount;++i) {
|
|
1588
|
-
hpatch_StreamPos_t mlen=_arrayCovers_get_len(src_covers,i);
|
|
1589
|
-
sumLen+=(mlen<=maxCachedLen)?mlen:0;
|
|
1590
|
-
}
|
|
1591
|
-
return sumLen;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
static hpatch_size_t _getMaxCachedLen(_TArrayCovers* arrayCovers,hpatch_size_t cacheSize){
|
|
1595
|
-
const hpatch_size_t kMaxCachedLen =(~((hpatch_size_t)0))/2;//max allowed length for a single cached data item;
|
|
1504
|
+
static hpatch_size_t _getMaxCachedLen(const _TArrayCovers* src_covers,
|
|
1505
|
+
TByte* temp_cache,TByte* temp_cache_end,TByte* cache_buf_end){
|
|
1506
|
+
const hpatch_size_t kMaxCachedLen =~((hpatch_size_t)0);//允许缓存的最长单个数据长度;
|
|
1596
1507
|
hpatch_StreamPos_t mlen=0;
|
|
1597
1508
|
hpatch_StreamPos_t sum=0;
|
|
1598
|
-
const hpatch_size_t coverCount=
|
|
1509
|
+
const hpatch_size_t coverCount=src_covers->coverCount;
|
|
1599
1510
|
hpatch_size_t i;
|
|
1600
|
-
|
|
1511
|
+
_TArrayCovers cur_covers=*src_covers;
|
|
1512
|
+
hpatch_size_t cacheSize=temp_cache_end-temp_cache;
|
|
1513
|
+
hpatch_StreamPos_t memSize=arrayCovers_memSize(src_covers->coverCount,src_covers->is32);
|
|
1514
|
+
_cache_alloc(cur_covers.pCCovers,void,memSize,temp_cache,temp_cache_end); //fail return 0
|
|
1515
|
+
memcpy(cur_covers.pCCovers,src_covers->pCCovers,(hpatch_size_t)memSize);
|
|
1516
|
+
_arrayCovers_sort_by_len(&cur_covers);
|
|
1601
1517
|
|
|
1602
1518
|
for (i=0; i<coverCount;++i) {
|
|
1603
|
-
mlen=_arrayCovers_get_len(
|
|
1519
|
+
mlen=_arrayCovers_get_len(&cur_covers,i);
|
|
1604
1520
|
sum+=mlen;
|
|
1605
1521
|
if (sum<=cacheSize){
|
|
1606
1522
|
continue;
|
|
@@ -1611,15 +1527,14 @@ static hpatch_size_t _getMaxCachedLen(_TArrayCovers* arrayCovers,hpatch_size_t c
|
|
|
1611
1527
|
}
|
|
1612
1528
|
if (mlen>kMaxCachedLen)
|
|
1613
1529
|
mlen=kMaxCachedLen;
|
|
1614
|
-
_arrayCovers_sort_by_new(arrayCovers);
|
|
1615
1530
|
return (hpatch_size_t)mlen;
|
|
1616
1531
|
}
|
|
1617
1532
|
|
|
1618
1533
|
static hpatch_size_t _set_cache_pos(_TArrayCovers* covers,hpatch_size_t maxCachedLen,
|
|
1619
|
-
hpatch_StreamPos_t* poldPosBegin,hpatch_StreamPos_t* poldPosEnd
|
|
1620
|
-
hpatch_size_t kMinCacheCoverCount){
|
|
1534
|
+
hpatch_StreamPos_t* poldPosBegin,hpatch_StreamPos_t* poldPosEnd){
|
|
1621
1535
|
const hpatch_size_t coverCount=covers->coverCount;
|
|
1622
|
-
|
|
1536
|
+
const hpatch_size_t kMinCacheCoverCount=coverCount/8+1; //控制最小缓存数量,否则缓存的意义太小;
|
|
1537
|
+
hpatch_StreamPos_t oldPosBegin=~(hpatch_StreamPos_t)0;
|
|
1623
1538
|
hpatch_StreamPos_t oldPosEnd=0;
|
|
1624
1539
|
hpatch_size_t cacheCoverCount=0;
|
|
1625
1540
|
hpatch_size_t sum=0;//result
|
|
@@ -1644,17 +1559,17 @@ static hpatch_size_t _set_cache_pos(_TArrayCovers* covers,hpatch_size_t maxCache
|
|
|
1644
1559
|
return sum;
|
|
1645
1560
|
}
|
|
1646
1561
|
|
|
1647
|
-
|
|
1648
|
-
// 1.
|
|
1649
|
-
// 2.
|
|
1650
|
-
// 3.
|
|
1562
|
+
//一个比较简单的缓存策略:
|
|
1563
|
+
// 1. 根据缓冲区大小限制,选择出最短的一批覆盖线来缓存;
|
|
1564
|
+
// 2. 顺序访问一次oldData文件,填充这些缓存;
|
|
1565
|
+
// 3. 顺序访问时跳过中间过大的对缓存无用的区域;
|
|
1651
1566
|
|
|
1652
1567
|
static hpatch_BOOL _cache_old_load(const hpatch_TStreamInput*oldData,
|
|
1653
1568
|
hpatch_StreamPos_t oldPos,hpatch_StreamPos_t oldPosAllEnd,
|
|
1654
1569
|
_TArrayCovers* arrayCovers,hpatch_size_t maxCachedLen,hpatch_size_t sumCacheLen,
|
|
1655
1570
|
TByte* old_cache,TByte* old_cache_end,TByte* cache_buf_end){
|
|
1656
|
-
const hpatch_size_t kMinSpaceLen =(1<<
|
|
1657
|
-
const hpatch_size_t kAccessPageSize=
|
|
1571
|
+
const hpatch_size_t kMinSpaceLen =(1<<(20+2));//跳过seekTime*speed长度的空间(SSD可以更小)时间上划得来,否则就顺序访问;
|
|
1572
|
+
const hpatch_size_t kAccessPageSize=(1<<(10+2));//页面对齐访问;
|
|
1658
1573
|
hpatch_BOOL result=hpatch_TRUE;
|
|
1659
1574
|
hpatch_size_t cur_i=0,i;
|
|
1660
1575
|
const hpatch_size_t coverCount=arrayCovers->coverCount;
|
|
@@ -1682,7 +1597,7 @@ static hpatch_BOOL _cache_old_load(const hpatch_TStreamInput*oldData,
|
|
|
1682
1597
|
for (i=cur_i;i<coverCount;++i){
|
|
1683
1598
|
hpatch_StreamPos_t ioldPos,ioldPosEnd;
|
|
1684
1599
|
hpatch_StreamPos_t ilen=_arrayCovers_get_len(arrayCovers,i);
|
|
1685
|
-
if (ilen>maxCachedLen){
|
|
1600
|
+
if (ilen>maxCachedLen){//覆盖线比较长不需要缓存,下一个覆盖线;
|
|
1686
1601
|
if (i==cur_i)
|
|
1687
1602
|
++cur_i;
|
|
1688
1603
|
continue;
|
|
@@ -1692,7 +1607,7 @@ static hpatch_BOOL _cache_old_load(const hpatch_TStreamInput*oldData,
|
|
|
1692
1607
|
if (ioldPosEnd>oldPos){
|
|
1693
1608
|
// [oldPos oldPosEnd]
|
|
1694
1609
|
// ioldPosEnd]----or----]
|
|
1695
|
-
if (ioldPos<oldPosEnd){
|
|
1610
|
+
if (ioldPos<oldPosEnd){//有交集,需要cache
|
|
1696
1611
|
// [----or----[ioldPos ioldPosEnd]----or----]
|
|
1697
1612
|
hpatch_StreamPos_t from;
|
|
1698
1613
|
hpatch_size_t copyLen;
|
|
@@ -1713,14 +1628,14 @@ static hpatch_BOOL _cache_old_load(const hpatch_TStreamInput*oldData,
|
|
|
1713
1628
|
sumCacheLen-=copyLen;
|
|
1714
1629
|
if ((i==cur_i)&(oldPosEnd>=ioldPosEnd))
|
|
1715
1630
|
++cur_i;
|
|
1716
|
-
}else{
|
|
1631
|
+
}else{//后面覆盖线暂时都不会与当前数据有交集了,下一块数据;
|
|
1717
1632
|
// [oldPos oldPosEnd]
|
|
1718
1633
|
// [ioldPos ioldPosEnd]
|
|
1719
1634
|
if ((i==cur_i)&&(ioldPos-oldPosEnd>=kMinSpaceLen))
|
|
1720
1635
|
oldPosEnd=_hpatch_align_type_lower(hpatch_StreamPos_t,ioldPos,kAccessPageSize);
|
|
1721
1636
|
break;
|
|
1722
1637
|
}
|
|
1723
|
-
}else{
|
|
1638
|
+
}else{//当前覆盖线已经落后于当前数据,下一个覆盖线;
|
|
1724
1639
|
// [oldPos oldPosEnd]
|
|
1725
1640
|
// [ioldPos ioldPosEnd]
|
|
1726
1641
|
if (i==cur_i)
|
|
@@ -1743,27 +1658,18 @@ typedef struct _cache_old_TStreamInput{
|
|
|
1743
1658
|
const TByte* caches;
|
|
1744
1659
|
const TByte* cachesEnd;
|
|
1745
1660
|
const hpatch_TStreamInput* oldData;
|
|
1746
|
-
void* _cacheImport;
|
|
1747
|
-
hpatch_BOOL (*_doUpdateCacheCovers)(void* _cacheImport);
|
|
1748
1661
|
} _cache_old_TStreamInput;
|
|
1749
1662
|
|
|
1750
1663
|
static hpatch_BOOL _cache_old_StreamInput_read(const hpatch_TStreamInput* stream,
|
|
1751
1664
|
hpatch_StreamPos_t readFromPos,
|
|
1752
1665
|
unsigned char* out_data,unsigned char* out_data_end){
|
|
1753
1666
|
_cache_old_TStreamInput* self=(_cache_old_TStreamInput*)stream->streamImport;
|
|
1754
|
-
hpatch_size_t readLen;
|
|
1755
1667
|
hpatch_StreamPos_t dataLen=(hpatch_size_t)(self->readFromPosEnd-self->readFromPos);
|
|
1668
|
+
hpatch_size_t readLen;
|
|
1756
1669
|
if (dataLen==0){//next cover
|
|
1757
1670
|
hpatch_StreamPos_t oldPos;
|
|
1758
1671
|
hpatch_size_t i=self->arrayCovers.cur_index++;
|
|
1759
|
-
if (i>=self->arrayCovers.coverCount)
|
|
1760
|
-
if ((self->_doUpdateCacheCovers)&&(self->_doUpdateCacheCovers(self->_cacheImport))){
|
|
1761
|
-
i=self->arrayCovers.cur_index++;
|
|
1762
|
-
if (i>=self->arrayCovers.coverCount)
|
|
1763
|
-
return _hpatch_FALSE;//update error;
|
|
1764
|
-
}else
|
|
1765
|
-
return _hpatch_FALSE;//error;
|
|
1766
|
-
}
|
|
1672
|
+
if (i>=self->arrayCovers.coverCount) return _hpatch_FALSE;//error;
|
|
1767
1673
|
oldPos=_arrayCovers_get_oldPos(&self->arrayCovers,i);
|
|
1768
1674
|
dataLen=_arrayCovers_get_len(&self->arrayCovers,i);
|
|
1769
1675
|
self->isInHitCache=(dataLen<=self->maxCachedLen);
|
|
@@ -1771,7 +1677,7 @@ static hpatch_BOOL _cache_old_StreamInput_read(const hpatch_TStreamInput* stream
|
|
|
1771
1677
|
self->readFromPosEnd=oldPos+dataLen;
|
|
1772
1678
|
}
|
|
1773
1679
|
readLen=out_data_end-out_data;
|
|
1774
|
-
if ((readLen>dataLen)
|
|
1680
|
+
if ((readLen>dataLen)||(self->readFromPos!=readFromPos)) return _hpatch_FALSE; //error
|
|
1775
1681
|
self->readFromPos=readFromPos+readLen;
|
|
1776
1682
|
if (self->isInHitCache){
|
|
1777
1683
|
assert(readLen<=(hpatch_size_t)(self->cachesEnd-self->caches));
|
|
@@ -1792,16 +1698,15 @@ static hpatch_BOOL _cache_old(hpatch_TStreamInput** out_cachedOld,const hpatch_T
|
|
|
1792
1698
|
hpatch_StreamPos_t oldPosEnd;
|
|
1793
1699
|
hpatch_size_t sumCacheLen;
|
|
1794
1700
|
hpatch_size_t maxCachedLen;
|
|
1795
|
-
const hpatch_size_t kMinCacheCoverCount=arrayCovers->coverCount/8+1; //control min cache count, otherwise caching becomes ineffective;
|
|
1796
1701
|
*out_isReadError=hpatch_FALSE;
|
|
1797
1702
|
_cache_alloc(*out_cachedOld,hpatch_TStreamInput,sizeof(hpatch_TStreamInput),
|
|
1798
1703
|
temp_cache,temp_cache_end);
|
|
1799
1704
|
_cache_alloc(self,_cache_old_TStreamInput,sizeof(_cache_old_TStreamInput),
|
|
1800
1705
|
temp_cache,temp_cache_end);
|
|
1801
1706
|
|
|
1802
|
-
maxCachedLen=_getMaxCachedLen(arrayCovers,temp_cache_end
|
|
1707
|
+
maxCachedLen=_getMaxCachedLen(arrayCovers,temp_cache,temp_cache_end,cache_buf_end);
|
|
1803
1708
|
if (maxCachedLen==0) return hpatch_FALSE;
|
|
1804
|
-
sumCacheLen=_set_cache_pos(arrayCovers,maxCachedLen,&oldPosBegin,&oldPosEnd
|
|
1709
|
+
sumCacheLen=_set_cache_pos(arrayCovers,maxCachedLen,&oldPosBegin,&oldPosEnd);
|
|
1805
1710
|
if (sumCacheLen==0) return hpatch_FALSE;
|
|
1806
1711
|
temp_cache_end=temp_cache+sumCacheLen;
|
|
1807
1712
|
|
|
@@ -1829,14 +1734,26 @@ static hpatch_BOOL _cache_old(hpatch_TStreamInput** out_cachedOld,const hpatch_T
|
|
|
1829
1734
|
|
|
1830
1735
|
#endif //_IS_NEED_CACHE_OLD_BY_COVERS
|
|
1831
1736
|
|
|
1832
|
-
|
|
1833
|
-
hpatch_BOOL
|
|
1834
|
-
|
|
1737
|
+
|
|
1738
|
+
static hpatch_BOOL _patch_cache(hpatch_TCovers** out_covers,
|
|
1739
|
+
const hpatch_TStreamInput** poldData,hpatch_StreamPos_t newDataSize,
|
|
1740
|
+
const hpatch_TStreamInput* diffData,hpatch_BOOL isCompressedDiff,
|
|
1741
|
+
hpatch_TDecompress* decompressPlugin,size_t kCacheCount,
|
|
1742
|
+
TByte** ptemp_cache,TByte** ptemp_cache_end,hpatch_BOOL* out_isReadError){
|
|
1835
1743
|
const hpatch_TStreamInput* oldData=*poldData;
|
|
1744
|
+
const hpatch_size_t kMinCacheSize=hpatch_kStreamCacheSize*kCacheCount;
|
|
1745
|
+
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
1746
|
+
const hpatch_size_t kBestACacheSize=hpatch_kFileIOBufBetterSize; //内存足够时比较好的hpatch_kStreamCacheSize值;
|
|
1747
|
+
const hpatch_size_t _minActiveSize=(1<<20)*8;
|
|
1748
|
+
const hpatch_StreamPos_t _betterActiveSize=kBestACacheSize*kCacheCount*2+oldData->streamSize/8;
|
|
1749
|
+
const hpatch_size_t kActiveCacheOldMemorySize = //尝试激活CacheOld功能的内存下限;
|
|
1750
|
+
(_betterActiveSize>_minActiveSize)?_minActiveSize:(hpatch_size_t)_betterActiveSize;
|
|
1751
|
+
#endif //_IS_NEED_CACHE_OLD_BY_COVERS
|
|
1836
1752
|
TByte* temp_cache=*ptemp_cache;
|
|
1837
1753
|
TByte* temp_cache_end=*ptemp_cache_end;
|
|
1838
1754
|
*out_isReadError=hpatch_FALSE;
|
|
1839
|
-
if (
|
|
1755
|
+
if ((hpatch_size_t)(temp_cache_end-temp_cache)>=oldData->streamSize+kMinCacheSize
|
|
1756
|
+
+sizeof(hpatch_TStreamInput)+sizeof(hpatch_StreamPos_t)){//load all oldData
|
|
1840
1757
|
hpatch_TStreamInput* replace_oldData=0;
|
|
1841
1758
|
_cache_alloc(replace_oldData,hpatch_TStreamInput,sizeof(hpatch_TStreamInput),
|
|
1842
1759
|
temp_cache,temp_cache_end);
|
|
@@ -1847,36 +1764,14 @@ hpatch_BOOL _patch_cache_all_old(const hpatch_TStreamInput** poldData,size_t kMi
|
|
|
1847
1764
|
temp_cache_end-=oldData->streamSize;
|
|
1848
1765
|
// [ patch cache | oldData cache ]
|
|
1849
1766
|
// [ (cacheSize-oldData->streamSize) | (oldData->streamSize) ]
|
|
1767
|
+
*out_covers=0;
|
|
1850
1768
|
*poldData=replace_oldData;
|
|
1851
1769
|
*ptemp_cache=temp_cache;
|
|
1852
1770
|
*ptemp_cache_end=temp_cache_end;
|
|
1853
1771
|
return hpatch_TRUE;
|
|
1854
1772
|
}
|
|
1855
|
-
return hpatch_FALSE;
|
|
1856
|
-
}
|
|
1857
|
-
#endif //_IS_NEED_CACHE_OLD_ALL
|
|
1858
|
-
|
|
1859
|
-
static hpatch_BOOL _patch_cache(hpatch_TCovers** out_covers,
|
|
1860
|
-
const hpatch_TStreamInput** poldData,hpatch_StreamPos_t newDataSize,
|
|
1861
|
-
const hpatch_TStreamInput* diffData,hpatch_BOOL isCompressedDiff,
|
|
1862
|
-
hpatch_TDecompress* decompressPlugin,size_t kCacheCount,
|
|
1863
|
-
TByte** ptemp_cache,TByte** ptemp_cache_end,hpatch_BOOL* out_isReadError){
|
|
1864
|
-
const hpatch_TStreamInput* oldData=*poldData;
|
|
1865
1773
|
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
1866
|
-
|
|
1867
|
-
const hpatch_size_t _minActiveSize=(1<<20)*3+kBestACacheSize*kCacheCount*2;
|
|
1868
|
-
const hpatch_StreamPos_t _betterActiveSize=oldData->streamSize/16+kBestACacheSize*kCacheCount*2;
|
|
1869
|
-
const hpatch_size_t kActiveCacheOldMemorySize = //min memory threshold for attempting to activate CacheOld functionality;
|
|
1870
|
-
(_minActiveSize>_betterActiveSize)?_minActiveSize:(hpatch_size_t)_betterActiveSize;
|
|
1871
|
-
#endif //_IS_NEED_CACHE_OLD_BY_COVERS
|
|
1872
|
-
TByte* temp_cache=*ptemp_cache;
|
|
1873
|
-
TByte* temp_cache_end=*ptemp_cache_end;
|
|
1874
|
-
*out_covers=0;
|
|
1875
|
-
if (_patch_cache_all_old(poldData,kCacheCount*hpatch_kStreamCacheSize,ptemp_cache,ptemp_cache_end,out_isReadError))
|
|
1876
|
-
return hpatch_TRUE;//cache all oldData
|
|
1877
|
-
if (*out_isReadError) return hpatch_FALSE;
|
|
1878
|
-
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
1879
|
-
if ((hpatch_size_t)(temp_cache_end-temp_cache)>=kActiveCacheOldMemorySize) {// try cache part of oldData
|
|
1774
|
+
else if ((hpatch_size_t)(temp_cache_end-temp_cache)>=kActiveCacheOldMemorySize) {
|
|
1880
1775
|
hpatch_BOOL isUsedCover32;
|
|
1881
1776
|
TByte* temp_cache_end_back=temp_cache_end;
|
|
1882
1777
|
_TArrayCovers* arrayCovers=0;
|
|
@@ -1894,7 +1789,7 @@ static hpatch_BOOL _patch_cache(hpatch_TCovers** out_covers,
|
|
|
1894
1789
|
// [ ... | compressedCovers cache ]
|
|
1895
1790
|
// [ (cacheSize-kBestACacheSize) | (kBestACacheSize) ]
|
|
1896
1791
|
*out_covers=&compressedCovers->base.ICovers;
|
|
1897
|
-
isUsedCover32=(diffInfo.oldDataSize|diffInfo.newDataSize)<((
|
|
1792
|
+
isUsedCover32=(diffInfo.oldDataSize|diffInfo.newDataSize)<((hpatch_StreamPos_t)1<<32);
|
|
1898
1793
|
}else{
|
|
1899
1794
|
_TPackedCovers* packedCovers=0;
|
|
1900
1795
|
_THDiffHead diffHead;
|
|
@@ -1906,7 +1801,7 @@ static hpatch_BOOL _patch_cache(hpatch_TCovers** out_covers,
|
|
|
1906
1801
|
// [ ... | packedCovers cache ]
|
|
1907
1802
|
// [ (cacheSize-kBestACacheSize*3) | (kBestACacheSize*3) ]
|
|
1908
1803
|
*out_covers=&packedCovers->base.ICovers;
|
|
1909
|
-
isUsedCover32=(oldDataSize|newDataSize)<((
|
|
1804
|
+
isUsedCover32=(oldDataSize|newDataSize)<((hpatch_StreamPos_t)1<<32);
|
|
1910
1805
|
}
|
|
1911
1806
|
|
|
1912
1807
|
if (!_arrayCovers_load(&arrayCovers,*out_covers,isUsedCover32,
|
|
@@ -1990,7 +1885,7 @@ hpatch_BOOL patch_decompress_with_cache(const hpatch_TStreamOutput* out_newData,
|
|
|
1990
1885
|
_patch_cache(&covers,&oldData,out_newData->streamSize,compressedDiff,hpatch_TRUE,
|
|
1991
1886
|
decompressPlugin,_kCacheDecCount,&temp_cache,&temp_cache_end,&isReadError);
|
|
1992
1887
|
if (isReadError) return _hpatch_FALSE;
|
|
1993
|
-
result=_patch_decompress_cache(out_newData,oldData,compressedDiff,decompressPlugin,
|
|
1888
|
+
result=_patch_decompress_cache(out_newData,0,oldData,compressedDiff,decompressPlugin,
|
|
1994
1889
|
covers,temp_cache,temp_cache_end);
|
|
1995
1890
|
if ((covers!=0)&&(!covers->close(covers))) result=_hpatch_FALSE;
|
|
1996
1891
|
return result;
|
|
@@ -2001,7 +1896,7 @@ hpatch_BOOL patch_decompress(const hpatch_TStreamOutput* out_newData,
|
|
|
2001
1896
|
const hpatch_TStreamInput* compressedDiff,
|
|
2002
1897
|
hpatch_TDecompress* decompressPlugin){
|
|
2003
1898
|
TByte temp_cache[hpatch_kStreamCacheSize*_kCacheDecCount];
|
|
2004
|
-
return _patch_decompress_cache(out_newData,oldData,compressedDiff,decompressPlugin,
|
|
1899
|
+
return _patch_decompress_cache(out_newData,0,oldData,compressedDiff,decompressPlugin,
|
|
2005
1900
|
0,temp_cache,temp_cache+sizeof(temp_cache)/sizeof(TByte));
|
|
2006
1901
|
}
|
|
2007
1902
|
|
|
@@ -2040,74 +1935,32 @@ hpatch_BOOL hpatch_coverList_open_compressedDiff(hpatch_TCoverList* out_coverLis
|
|
|
2040
1935
|
|
|
2041
1936
|
//
|
|
2042
1937
|
|
|
2043
|
-
#
|
|
2044
|
-
# include "hpatch_mt/hpatch_mt.h"
|
|
2045
|
-
#endif
|
|
1938
|
+
#define _kCacheSgCount 3
|
|
2046
1939
|
|
|
2047
|
-
hpatch_BOOL
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
unsigned char* temp_cache,unsigned char* temp_cache_end,
|
|
2056
|
-
sspatch_coversListener_t* coversListener,
|
|
2057
|
-
size_t maxThreadNum,hpatchMTSets_t hpatchMTSets){
|
|
2058
|
-
#if (_HPATCH_IS_USED_MULTITHREAD)
|
|
2059
|
-
struct hpatch_mt_manager_t* hpatch_mt_manager=0;
|
|
2060
|
-
hpatchMTSets_t mtsets=hpatch_getMTSets(out_newData->streamSize,oldData->streamSize,singleCompressedDiff->streamSize-diffData_pos,
|
|
2061
|
-
decompressPlugin,_kCacheSgCount,stepMemSize,
|
|
2062
|
-
temp_cache_end-temp_cache,maxThreadNum,hpatchMTSets);
|
|
2063
|
-
#endif
|
|
1940
|
+
hpatch_BOOL patch_single_compressed_diff(const hpatch_TStreamOutput* out_newData,
|
|
1941
|
+
const hpatch_TStreamInput* oldData,
|
|
1942
|
+
const hpatch_TStreamInput* singleCompressedDiff,
|
|
1943
|
+
hpatch_StreamPos_t diffData_pos,
|
|
1944
|
+
hpatch_StreamPos_t uncompressedSize,
|
|
1945
|
+
hpatch_TDecompress* decompressPlugin,
|
|
1946
|
+
hpatch_StreamPos_t coverCount,hpatch_size_t stepMemSize,
|
|
1947
|
+
unsigned char* temp_cache,unsigned char* temp_cache_end){
|
|
2064
1948
|
hpatch_BOOL result;
|
|
2065
|
-
hpatch_BOOL isNeedOutCache=hpatch_TRUE;
|
|
2066
1949
|
hpatch_TUncompresser_t uncompressedStream;
|
|
2067
|
-
hpatch_StreamPos_t diffData_posEnd;
|
|
2068
1950
|
memset(&uncompressedStream,0,sizeof(uncompressedStream));
|
|
2069
|
-
if (compressedSize==0){
|
|
2070
|
-
decompressPlugin=0;
|
|
2071
|
-
}else{
|
|
2072
|
-
if (decompressPlugin==0) return _hpatch_FALSE;
|
|
2073
|
-
}
|
|
2074
|
-
diffData_posEnd=(decompressPlugin?compressedSize:uncompressedSize)+diffData_pos;
|
|
2075
|
-
if (diffData_posEnd>singleCompressedDiff->streamSize) return _hpatch_FALSE;
|
|
2076
|
-
#if (_HPATCH_IS_USED_MULTITHREAD)
|
|
2077
|
-
mtsets.decompressDiff_isMT=decompressPlugin? mtsets.decompressDiff_isMT:0;
|
|
2078
|
-
if (_hpatchMTSets_threadNum(mtsets)>1){
|
|
2079
|
-
isNeedOutCache=!mtsets.writeNew_isMT;
|
|
2080
|
-
hpatch_mt_manager=hpatch_mt_manager_open(&out_newData,&oldData,&singleCompressedDiff,
|
|
2081
|
-
&diffData_pos,&diffData_posEnd,uncompressedSize,&decompressPlugin,
|
|
2082
|
-
stepMemSize,&temp_cache,&temp_cache_end,&coversListener,hpatch_TRUE,
|
|
2083
|
-
_kCacheSgCount-(isNeedOutCache?0:1),mtsets);
|
|
2084
|
-
if (!hpatch_mt_manager) return _hpatch_FALSE;
|
|
2085
|
-
}
|
|
2086
|
-
#endif
|
|
2087
1951
|
if (decompressPlugin){
|
|
2088
1952
|
if (!compressed_stream_as_uncompressed(&uncompressedStream,uncompressedSize,decompressPlugin,singleCompressedDiff,
|
|
2089
|
-
diffData_pos,
|
|
1953
|
+
diffData_pos,singleCompressedDiff->streamSize)) return _hpatch_FALSE;
|
|
2090
1954
|
singleCompressedDiff=&uncompressedStream.base;
|
|
2091
1955
|
diffData_pos=0;
|
|
2092
|
-
diffData_posEnd=singleCompressedDiff->streamSize;
|
|
2093
1956
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
coverCount,stepMemSize,temp_cache,temp_cache_end,coversListener,isNeedOutCache);
|
|
2097
|
-
|
|
1957
|
+
result=patch_single_stream_diff(out_newData,oldData,singleCompressedDiff,diffData_pos,
|
|
1958
|
+
coverCount,stepMemSize,temp_cache,temp_cache_end);
|
|
2098
1959
|
if (decompressPlugin)
|
|
2099
1960
|
close_compressed_stream_as_uncompressed(&uncompressedStream);
|
|
2100
|
-
#if (_HPATCH_IS_USED_MULTITHREAD)
|
|
2101
|
-
if (hpatch_mt_manager){
|
|
2102
|
-
if (!hpatch_mt_manager_close(hpatch_mt_manager,!result))
|
|
2103
|
-
result=_hpatch_FALSE;
|
|
2104
|
-
hpatch_mt_manager=0;
|
|
2105
|
-
}
|
|
2106
|
-
#endif
|
|
2107
1961
|
return result;
|
|
2108
1962
|
}
|
|
2109
1963
|
|
|
2110
|
-
static const size_t _kStepMemSizeSafeLimit =(1<<20)*16;
|
|
2111
1964
|
hpatch_BOOL getSingleCompressedDiffInfo(hpatch_singleCompressedDiffInfo* out_diffInfo,
|
|
2112
1965
|
const hpatch_TStreamInput* singleCompressedDiff,
|
|
2113
1966
|
hpatch_StreamPos_t diffInfo_pos){
|
|
@@ -2133,11 +1986,7 @@ hpatch_BOOL getSingleCompressedDiffInfo(hpatch_singleCompressedDiffInfo* out_dif
|
|
|
2133
1986
|
_clip_unpackUIntTo(&out_diffInfo->uncompressedSize,diffHeadClip);
|
|
2134
1987
|
_clip_unpackUIntTo(&out_diffInfo->compressedSize,diffHeadClip);
|
|
2135
1988
|
out_diffInfo->diffDataPos=_TStreamCacheClip_readPosOfSrcStream(diffHeadClip)-diffInfo_pos;
|
|
2136
|
-
if (out_diffInfo->
|
|
2137
|
-
return _hpatch_FALSE;
|
|
2138
|
-
if (out_diffInfo->stepMemSize>(out_diffInfo->newDataSize>=_kStepMemSizeSafeLimit?out_diffInfo->newDataSize:_kStepMemSizeSafeLimit))
|
|
2139
|
-
return _hpatch_FALSE;
|
|
2140
|
-
if (out_diffInfo->stepMemSize>out_diffInfo->uncompressedSize)
|
|
1989
|
+
if (out_diffInfo->stepMemSize>(size_t)((~(size_t)0)-hpatch_kStreamCacheSize*_kCacheSgCount))
|
|
2141
1990
|
return _hpatch_FALSE;
|
|
2142
1991
|
return hpatch_TRUE;
|
|
2143
1992
|
}
|
|
@@ -2241,7 +2090,7 @@ static hpatch_BOOL _rle0_decoder_add(rle0_decoder_t* self,TByte* out_data,hpatch
|
|
|
2241
2090
|
}
|
|
2242
2091
|
|
|
2243
2092
|
|
|
2244
|
-
static hpatch_BOOL _patch_add_old_with_rle0(
|
|
2093
|
+
static hpatch_BOOL _patch_add_old_with_rle0(TOutStreamCache* outCache,rle0_decoder_t* rle0_decoder,
|
|
2245
2094
|
const hpatch_TStreamInput* old,hpatch_StreamPos_t oldPos,
|
|
2246
2095
|
hpatch_StreamPos_t addLength,TByte* aCache,hpatch_size_t aCacheSize){
|
|
2247
2096
|
while (addLength>0){
|
|
@@ -2250,286 +2099,87 @@ static hpatch_BOOL _patch_add_old_with_rle0(_TOutStreamCache* outCache,rle0_dec
|
|
|
2250
2099
|
decodeStep=(hpatch_size_t)addLength;
|
|
2251
2100
|
if (!old->read(old,oldPos,aCache,aCache+decodeStep)) return _hpatch_FALSE;
|
|
2252
2101
|
if (!_rle0_decoder_add(rle0_decoder,aCache,decodeStep)) return _hpatch_FALSE;
|
|
2253
|
-
if (!
|
|
2102
|
+
if (!TOutStreamCache_write(outCache,aCache,decodeStep)) return _hpatch_FALSE;
|
|
2254
2103
|
oldPos+=decodeStep;
|
|
2255
2104
|
addLength-=decodeStep;
|
|
2256
2105
|
}
|
|
2257
2106
|
return hpatch_TRUE;
|
|
2258
2107
|
}
|
|
2259
2108
|
|
|
2260
|
-
hpatch_BOOL sspatch_covers_nextCover(sspatch_covers_t* self){
|
|
2261
|
-
hpatch_BOOL inc_oldPos_sign=(*(self->covers_cache))>>(8-1);
|
|
2262
|
-
self->lastOldEnd=self->cover.oldPos+self->cover.length;
|
|
2263
|
-
self->lastNewEnd=self->cover.newPos+self->cover.length;
|
|
2264
|
-
if (!hpatch_unpackUIntWithTag(&self->covers_cache,self->covers_cacheEnd,&self->cover.oldPos,1)) return _hpatch_FALSE;
|
|
2265
|
-
if (inc_oldPos_sign==0)
|
|
2266
|
-
self->cover.oldPos+=self->lastOldEnd;
|
|
2267
|
-
else
|
|
2268
|
-
self->cover.oldPos=self->lastOldEnd-self->cover.oldPos;
|
|
2269
|
-
if (!hpatch_unpackUInt(&self->covers_cache,self->covers_cacheEnd,&self->cover.newPos)) return _hpatch_FALSE;
|
|
2270
|
-
self->cover.newPos+=self->lastNewEnd;
|
|
2271
|
-
if (!hpatch_unpackUInt(&self->covers_cache,self->covers_cacheEnd,&self->cover.length)) return _hpatch_FALSE;
|
|
2272
|
-
return hpatch_TRUE;
|
|
2273
|
-
}
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
2277
|
-
|
|
2278
|
-
#define _kMaxCachedLen_min (32*1024) // 1M is big value, 256k is middle value, 32k is small value
|
|
2279
|
-
#define _kMaxCachedLen_max (32*_kMaxCachedLen_min)
|
|
2280
|
-
#define _kMemForReadOldSize (hpatch_kFileIOBufBetterSize*2)
|
|
2281
|
-
|
|
2282
|
-
typedef struct{
|
|
2283
|
-
_cache_old_TStreamInput cache_old;
|
|
2284
|
-
hpatch_TStreamInput base;
|
|
2285
|
-
sspatch_covers_t covers;
|
|
2286
|
-
hpatch_BOOL isHaveACover;
|
|
2287
|
-
hpatch_size_t sumCacheLen;
|
|
2288
|
-
hpatch_byte* cache_buf_end;
|
|
2289
|
-
const hpatch_byte* covers_cache;
|
|
2290
|
-
const hpatch_byte* covers_cacheEnd;
|
|
2291
|
-
} _step_cache_old_t;
|
|
2292
|
-
|
|
2293
|
-
static hpatch_force_inline hpatch_size_t _step_cache_old_sumBufSize(const _step_cache_old_t* self){
|
|
2294
|
-
return self->cache_old.cachesEnd-(const hpatch_byte*)self->cache_old.arrayCovers.pCCovers; }
|
|
2295
|
-
static hpatch_force_inline hpatch_size_t _step_cache_old_coverBufSize(const _step_cache_old_t* self){
|
|
2296
|
-
return (hpatch_size_t)arrayCovers_memSize(self->cache_old.arrayCovers.coverCount,self->cache_old.arrayCovers.is32); }
|
|
2297
|
-
static hpatch_force_inline hpatch_StreamPos_t _step_cache_old_incCoverBufSize(const _step_cache_old_t* self){
|
|
2298
|
-
return arrayCovers_memSize(self->cache_old.arrayCovers.coverCount+1,self->cache_old.arrayCovers.is32); }
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
static hpatch_BOOL _step_cache_old_addCover(_step_cache_old_t* self,const hpatch_TCover* cover){
|
|
2302
|
-
const hpatch_StreamPos_t _incCoverBufSize=_step_cache_old_incCoverBufSize(self);
|
|
2303
|
-
while (hpatch_TRUE){
|
|
2304
|
-
const hpatch_size_t _addCachedLen=(cover->length<=self->cache_old.maxCachedLen)?(hpatch_size_t)cover->length:0;
|
|
2305
|
-
if (_incCoverBufSize+self->sumCacheLen+_addCachedLen<=_step_cache_old_sumBufSize(self)){
|
|
2306
|
-
self->sumCacheLen+=_addCachedLen;
|
|
2307
|
-
_arrayCovers_push_cover(&self->cache_old.arrayCovers,cover);
|
|
2308
|
-
return hpatch_TRUE;
|
|
2309
|
-
}else{
|
|
2310
|
-
assert(self->cache_old.maxCachedLen>=_kMaxCachedLen_min);
|
|
2311
|
-
if (self->cache_old.maxCachedLen==_kMaxCachedLen_min) return hpatch_FALSE;
|
|
2312
|
-
self->cache_old.maxCachedLen/=2;
|
|
2313
|
-
self->sumCacheLen=(hpatch_size_t)_getCacheSumLen(&self->cache_old.arrayCovers,self->cache_old.maxCachedLen);
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
static hpatch_BOOL _patch_step_cache_old_update(void* _self){
|
|
2319
|
-
_step_cache_old_t* self=(_step_cache_old_t*)_self;
|
|
2320
|
-
hpatch_StreamPos_t oldPosBegin;
|
|
2321
|
-
hpatch_StreamPos_t oldPosEnd;
|
|
2322
|
-
const hpatch_size_t kMinCacheCoverCount=0; //no limit
|
|
2323
|
-
assert(self->cache_old.arrayCovers.coverCount<=self->cache_old.arrayCovers.cur_index);
|
|
2324
|
-
assert(self->cache_old.caches==self->cache_old.cachesEnd);
|
|
2325
|
-
self->sumCacheLen=0;
|
|
2326
|
-
self->cache_old.arrayCovers.coverCount=0;
|
|
2327
|
-
self->cache_old.arrayCovers.cur_index=0;
|
|
2328
|
-
self->cache_old.cachesEnd=self->cache_buf_end-_kMemForReadOldSize; //limit covers + cached data 's size
|
|
2329
|
-
self->cache_old.maxCachedLen=_kMaxCachedLen_max;
|
|
2330
|
-
while ((self->cache_old.maxCachedLen>=_step_cache_old_sumBufSize(self))&(self->cache_old.maxCachedLen>_kMaxCachedLen_min))
|
|
2331
|
-
self->cache_old.maxCachedLen/=2;
|
|
2332
|
-
|
|
2333
|
-
//read some cover from self->covers to self->cache_old.arrayCovers
|
|
2334
|
-
if (self->isHaveACover){
|
|
2335
|
-
self->isHaveACover=hpatch_FALSE;
|
|
2336
|
-
assert(self->covers.cover.length>0);
|
|
2337
|
-
if (!_step_cache_old_addCover(self,&self->covers.cover)) assert(hpatch_FALSE);
|
|
2338
|
-
}
|
|
2339
|
-
while (sspatch_covers_isHaveNextCover(&self->covers)){
|
|
2340
|
-
if (!sspatch_covers_nextCover(&self->covers))
|
|
2341
|
-
return hpatch_FALSE;
|
|
2342
|
-
if (self->covers.cover.length>0){
|
|
2343
|
-
if (_step_cache_old_addCover(self,&self->covers.cover)){
|
|
2344
|
-
//ok
|
|
2345
|
-
}else{
|
|
2346
|
-
self->isHaveACover=hpatch_TRUE;
|
|
2347
|
-
break; //arrayCovers full
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
self->cache_old.maxCachedLen=_getMaxCachedLen(&self->cache_old.arrayCovers,_step_cache_old_sumBufSize(self)-_step_cache_old_coverBufSize(self));
|
|
2353
|
-
assert(self->cache_old.maxCachedLen>0);
|
|
2354
|
-
self->sumCacheLen=_set_cache_pos(&self->cache_old.arrayCovers,self->cache_old.maxCachedLen,&oldPosBegin,&oldPosEnd,kMinCacheCoverCount);
|
|
2355
|
-
self->cache_old.caches=((hpatch_byte*)self->cache_old.arrayCovers.pCCovers)+_step_cache_old_coverBufSize(self);
|
|
2356
|
-
self->cache_old.cachesEnd=self->cache_old.caches+self->sumCacheLen;
|
|
2357
|
-
if (self->sumCacheLen>0){
|
|
2358
|
-
if (!_cache_old_load(self->cache_old.oldData,oldPosBegin,oldPosEnd,&self->cache_old.arrayCovers,
|
|
2359
|
-
self->cache_old.maxCachedLen,self->sumCacheLen, (hpatch_byte*)self->cache_old.caches,
|
|
2360
|
-
(hpatch_byte*)self->cache_old.cachesEnd,self->cache_buf_end))
|
|
2361
|
-
return _hpatch_FALSE;
|
|
2362
|
-
}
|
|
2363
|
-
return hpatch_TRUE;
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
static hpatch_inline
|
|
2367
|
-
void _patch_step_cache_old_init(_step_cache_old_t* self,hpatch_size_t canUsedMemSize,
|
|
2368
|
-
const hpatch_TStreamInput* oldData,hpatch_BOOL isUsedCover32){
|
|
2369
|
-
memset(self,0,sizeof(*self));
|
|
2370
|
-
assert(canUsedMemSize>=_kMemForReadOldSize*2);
|
|
2371
|
-
self->base.streamImport=&self->cache_old;
|
|
2372
|
-
self->base.streamSize=oldData->streamSize;
|
|
2373
|
-
self->base.read=_cache_old_StreamInput_read;
|
|
2374
|
-
//todo: _cache_old_StreamInput_read call back
|
|
2375
|
-
self->cache_old.oldData=oldData;
|
|
2376
|
-
self->cache_old._cacheImport=self;
|
|
2377
|
-
self->cache_old._doUpdateCacheCovers=_patch_step_cache_old_update;
|
|
2378
|
-
self->cache_buf_end=((hpatch_byte*)self) + canUsedMemSize;
|
|
2379
|
-
|
|
2380
|
-
self->cache_old.arrayCovers.is32=isUsedCover32;
|
|
2381
|
-
self->cache_old.arrayCovers.pCCovers=(void*)_hpatch_align_upper((self+1),sizeof(hpatch_StreamPos_t));
|
|
2382
|
-
self->cache_old.arrayCovers.ICovers.leave_cover_count=_arrayCovers_leaveCoverCount;
|
|
2383
|
-
self->cache_old.arrayCovers.ICovers.read_cover=_arrayCovers_read_cover;
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
hpatch_BOOL _patch_step_cache_old_onStepCovers(const hpatch_TStreamInput* _self,const unsigned char* covers_cache,const unsigned char* covers_cacheEnd){
|
|
2388
|
-
_step_cache_old_t* self=(_step_cache_old_t*)_self->streamImport;
|
|
2389
|
-
assert(!sspatch_covers_isHaveNextCover(&self->covers));
|
|
2390
|
-
assert(!self->isHaveACover);
|
|
2391
|
-
self->covers_cache=covers_cache;
|
|
2392
|
-
self->covers_cacheEnd=covers_cacheEnd;
|
|
2393
|
-
sspatch_covers_setCoversCache(&self->covers,covers_cache,covers_cacheEnd);
|
|
2394
|
-
return covers_cache?_patch_step_cache_old_update(self):hpatch_TRUE;
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
hpatch_size_t _patch_step_cache_old_canUsedSize(hpatch_size_t stepCoversMemSize,hpatch_size_t kMinTempCacheSize,hpatch_size_t tempCacheSize){
|
|
2399
|
-
const hpatch_size_t kActiveCacheOldMemorySize=(1<<20)*3+_kMemForReadOldSize*2;
|
|
2400
|
-
hpatch_size_t cacheStepSize,multiple;
|
|
2401
|
-
if (tempCacheSize<kActiveCacheOldMemorySize+stepCoversMemSize+kMinTempCacheSize)
|
|
2402
|
-
return 0;
|
|
2403
|
-
cacheStepSize=tempCacheSize-(stepCoversMemSize+kMinTempCacheSize+sizeof(hpatch_StreamPos_t));
|
|
2404
|
-
multiple=cacheStepSize/((kActiveCacheOldMemorySize+kMinTempCacheSize+_kMemForReadOldSize)/4);
|
|
2405
|
-
cacheStepSize-=(hpatch_size_t)((hpatch_StreamPos_t)(kMinTempCacheSize+_kMemForReadOldSize)*((multiple>4)?(hpatch_size_t)(multiple-4):0)/8);
|
|
2406
|
-
return cacheStepSize;
|
|
2407
|
-
}
|
|
2408
|
-
|
|
2409
|
-
hpatch_BOOL _patch_step_cache_old(const hpatch_TStreamInput** poldData,hpatch_StreamPos_t newDataSize,size_t stepCoversMemSize,
|
|
2410
|
-
size_t kMinTempCacheSize,hpatch_byte** ptemp_cache,hpatch_byte** ptemp_cache_end){
|
|
2411
|
-
const hpatch_TStreamInput* oldData=*poldData;
|
|
2412
|
-
_step_cache_old_t* self;
|
|
2413
|
-
const hpatch_BOOL isUsedCover32=(oldData->streamSize|newDataSize)<((hpatch_uint64_t)1<<32);
|
|
2414
|
-
hpatch_byte* temp_cache=*ptemp_cache;
|
|
2415
|
-
hpatch_byte* const temp_cache_end=*ptemp_cache_end;
|
|
2416
|
-
|
|
2417
|
-
hpatch_size_t canUsedMemSize=_patch_step_cache_old_canUsedSize(stepCoversMemSize,kMinTempCacheSize,temp_cache_end-temp_cache);
|
|
2418
|
-
if (canUsedMemSize==0)
|
|
2419
|
-
return hpatch_FALSE; //not enough memory for cache part of oldData
|
|
2420
|
-
_cache_alloc(self,_step_cache_old_t,canUsedMemSize,temp_cache,temp_cache_end);
|
|
2421
|
-
_patch_step_cache_old_init(self,canUsedMemSize,oldData,isUsedCover32);
|
|
2422
|
-
|
|
2423
|
-
*poldData=&self->base;
|
|
2424
|
-
*ptemp_cache=temp_cache;
|
|
2425
|
-
return hpatch_TRUE;
|
|
2426
|
-
}
|
|
2427
|
-
|
|
2428
|
-
#endif // _IS_NEED_CACHE_OLD_BY_COVERS
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
2109
|
hpatch_BOOL patch_single_stream_diff(const hpatch_TStreamOutput* out_newData,
|
|
2432
2110
|
const hpatch_TStreamInput* oldData,
|
|
2433
2111
|
const hpatch_TStreamInput* uncompressedDiffData,
|
|
2434
2112
|
hpatch_StreamPos_t diffData_pos,
|
|
2435
|
-
hpatch_StreamPos_t diffData_posEnd,
|
|
2436
2113
|
hpatch_StreamPos_t coverCount,hpatch_size_t stepMemSize,
|
|
2437
|
-
unsigned char* temp_cache,unsigned char* temp_cache_end
|
|
2438
|
-
|
|
2439
|
-
|
|
2114
|
+
unsigned char* temp_cache,unsigned char* temp_cache_end){
|
|
2115
|
+
unsigned char* step_cache=temp_cache;
|
|
2116
|
+
hpatch_StreamPos_t lastOldEnd=0;
|
|
2117
|
+
hpatch_StreamPos_t lastNewEnd=0;
|
|
2440
2118
|
hpatch_size_t cache_size;
|
|
2441
2119
|
TStreamCacheClip inClip;
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
assert(diffData_posEnd<=uncompressedDiffData->streamSize);
|
|
2451
|
-
sspatch_covers_init(&covers);
|
|
2452
|
-
if (coversListener) assert(coversListener->onStepCovers);
|
|
2453
|
-
{//cache
|
|
2454
|
-
hpatch_BOOL isCachedAllOld;
|
|
2455
|
-
hpatch_BOOL isReadError=hpatch_FALSE;
|
|
2456
|
-
if ((size_t)(temp_cache_end-temp_cache)<stepMemSize+hpatch_kStreamCacheSize*kCacheCount) return _hpatch_FALSE;
|
|
2457
|
-
temp_cache+=stepMemSize;
|
|
2458
|
-
isCachedAllOld=_patch_cache_all_old(&oldData,kCacheCount*hpatch_kStreamCacheSize,&temp_cache,&temp_cache_end,&isReadError);
|
|
2459
|
-
if (isReadError) return _hpatch_FALSE;
|
|
2460
|
-
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
2461
|
-
if (!isCachedAllOld)
|
|
2462
|
-
isCachedOldByStep=_patch_step_cache_old(&oldData,out_newData->streamSize,stepMemSize,
|
|
2463
|
-
kCacheCount*hpatch_kFileIOBufBetterSize,&temp_cache,&temp_cache_end);
|
|
2464
|
-
#endif
|
|
2465
|
-
cache_size=(temp_cache_end-temp_cache)/kCacheCount;
|
|
2466
|
-
_TStreamCacheClip_init(&inClip,uncompressedDiffData,diffData_pos,diffData_posEnd,
|
|
2467
|
-
temp_cache,cache_size);
|
|
2468
|
-
temp_cache+=cache_size;
|
|
2469
|
-
_TOutStreamCache_init(&outCache,out_newData,isNeedOutCache?(temp_cache+cache_size):0,isNeedOutCache?cache_size:0);
|
|
2470
|
-
}
|
|
2120
|
+
TOutStreamCache outCache;
|
|
2121
|
+
if ((size_t)(temp_cache_end-temp_cache)<stepMemSize+hpatch_kStreamCacheSize*_kCacheSgCount) return _hpatch_FALSE;
|
|
2122
|
+
temp_cache+=stepMemSize;
|
|
2123
|
+
cache_size=(temp_cache_end-temp_cache)/_kCacheSgCount;
|
|
2124
|
+
_TStreamCacheClip_init(&inClip,uncompressedDiffData,diffData_pos,uncompressedDiffData->streamSize,
|
|
2125
|
+
temp_cache,cache_size);
|
|
2126
|
+
temp_cache+=cache_size;
|
|
2127
|
+
TOutStreamCache_init(&outCache,out_newData,temp_cache+cache_size,cache_size);
|
|
2471
2128
|
while (coverCount) {//step loop
|
|
2129
|
+
const unsigned char* covers_cache = step_cache;
|
|
2130
|
+
const unsigned char* covers_cache_end;
|
|
2472
2131
|
rle0_decoder_t rle0_decoder;
|
|
2473
2132
|
{//read step info
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
if ((bufCover_size>stepMemSize)|(bufRle_size>stepMemSize)|
|
|
2483
|
-
(bufCover_size+bufRle_size>stepMemSize)) return _hpatch_FALSE;
|
|
2484
|
-
#endif
|
|
2485
|
-
covers_cacheEnd=step_cache+(size_t)bufCover_size;
|
|
2486
|
-
bufRle_cache_end=covers_cacheEnd+(size_t)bufRle_size;
|
|
2487
|
-
}
|
|
2488
|
-
if (coversListener&&coversListener->onStepCoversReset)
|
|
2489
|
-
coversListener->onStepCoversReset(coversListener,coverCount);
|
|
2490
|
-
if (!_TStreamCacheClip_readDataTo(&inClip,step_cache,bufRle_cache_end))
|
|
2491
|
-
return _hpatch_FALSE;
|
|
2492
|
-
if (coversListener)
|
|
2493
|
-
coversListener->onStepCovers(coversListener,step_cache,covers_cacheEnd);
|
|
2494
|
-
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
|
|
2495
|
-
if (isCachedOldByStep)
|
|
2496
|
-
_patch_step_cache_old_onStepCovers(oldData,step_cache,covers_cacheEnd);
|
|
2497
|
-
#endif
|
|
2498
|
-
sspatch_covers_setCoversCache(&covers,step_cache,covers_cacheEnd);
|
|
2499
|
-
_rle0_decoder_init(&rle0_decoder,covers_cacheEnd,bufRle_cache_end);
|
|
2133
|
+
hpatch_StreamPos_t bufCover_size;
|
|
2134
|
+
hpatch_StreamPos_t bufRle_size;
|
|
2135
|
+
_clip_unpackUIntTo(&bufCover_size,&inClip);
|
|
2136
|
+
_clip_unpackUIntTo(&bufRle_size,&inClip);
|
|
2137
|
+
if (bufCover_size+bufRle_size>stepMemSize) return _hpatch_FALSE;
|
|
2138
|
+
if (!_TStreamCacheClip_readDataTo(&inClip,step_cache,step_cache+bufCover_size+bufRle_size)) return _hpatch_FALSE;
|
|
2139
|
+
covers_cache_end=covers_cache+bufCover_size;
|
|
2140
|
+
_rle0_decoder_init(&rle0_decoder,covers_cache_end,covers_cache_end+bufRle_size);
|
|
2500
2141
|
}
|
|
2501
|
-
while (
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2142
|
+
while (covers_cache!=covers_cache_end) {// cover loop
|
|
2143
|
+
hpatch_StreamPos_t oldPos;
|
|
2144
|
+
hpatch_StreamPos_t newPos;
|
|
2145
|
+
hpatch_StreamPos_t coverLen;
|
|
2146
|
+
{//read cover
|
|
2147
|
+
hpatch_BOOL inc_oldPos_sign;
|
|
2148
|
+
if (covers_cache==covers_cache_end) return _hpatch_FALSE;
|
|
2149
|
+
inc_oldPos_sign=(*covers_cache)>>7;
|
|
2150
|
+
if (!hpatch_unpackUIntWithTag(&covers_cache,covers_cache_end,&oldPos,1)) return _hpatch_FALSE;
|
|
2151
|
+
if (inc_oldPos_sign==0)
|
|
2152
|
+
oldPos+=lastOldEnd;
|
|
2153
|
+
else
|
|
2154
|
+
oldPos=lastOldEnd-oldPos;
|
|
2155
|
+
if (!hpatch_unpackUInt(&covers_cache,covers_cache_end,&newPos)) return _hpatch_FALSE;
|
|
2156
|
+
newPos+=lastNewEnd;
|
|
2157
|
+
if (!hpatch_unpackUInt(&covers_cache,covers_cache_end,&coverLen)) return _hpatch_FALSE;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
if (newPos>lastNewEnd){
|
|
2161
|
+
if (!_patch_copy_diff_by_outCache(&outCache,&inClip,newPos-lastNewEnd)) return _hpatch_FALSE;
|
|
2507
2162
|
}
|
|
2508
2163
|
|
|
2509
2164
|
--coverCount;
|
|
2510
|
-
if (
|
|
2165
|
+
if (coverLen){
|
|
2511
2166
|
#ifdef __RUN_MEM_SAFE_CHECK
|
|
2512
|
-
if (
|
|
2513
|
-
|
|
2167
|
+
if (oldPos>oldData->streamSize) return _hpatch_FALSE;
|
|
2168
|
+
if (coverLen>(hpatch_StreamPos_t)(oldData->streamSize-oldPos)) return _hpatch_FALSE;
|
|
2514
2169
|
#endif
|
|
2515
|
-
if (!_patch_add_old_with_rle0(&outCache,&rle0_decoder,oldData,
|
|
2170
|
+
if (!_patch_add_old_with_rle0(&outCache,&rle0_decoder,oldData,oldPos,coverLen,
|
|
2516
2171
|
temp_cache,cache_size)) return _hpatch_FALSE;
|
|
2172
|
+
lastOldEnd=oldPos+coverLen;
|
|
2173
|
+
lastNewEnd=newPos+coverLen;
|
|
2517
2174
|
}else{
|
|
2518
|
-
|
|
2519
|
-
if (coverCount!=0) return _hpatch_FALSE;
|
|
2520
|
-
#endif
|
|
2175
|
+
if (coverCount!=0) return _hpatch_FALSE;
|
|
2521
2176
|
}
|
|
2522
2177
|
}
|
|
2523
2178
|
}
|
|
2524
|
-
if (coversListener){
|
|
2525
|
-
if (coversListener->onStepCoversReset)
|
|
2526
|
-
coversListener->onStepCoversReset(coversListener,0);
|
|
2527
|
-
coversListener->onStepCovers(coversListener,0,0);
|
|
2528
|
-
}
|
|
2529
2179
|
|
|
2530
|
-
if (!
|
|
2180
|
+
if (!TOutStreamCache_flush(&outCache))
|
|
2531
2181
|
return _hpatch_FALSE;
|
|
2532
|
-
if (_TStreamCacheClip_isFinish(&inClip)&
|
|
2182
|
+
if (_TStreamCacheClip_isFinish(&inClip)&TOutStreamCache_isFinish(&outCache)&(coverCount==0))
|
|
2533
2183
|
return hpatch_TRUE;
|
|
2534
2184
|
else
|
|
2535
2185
|
return _hpatch_FALSE;
|
|
@@ -2599,14 +2249,12 @@ void TDiffToSingleStream_init(TDiffToSingleStream* self,const hpatch_TStreamInpu
|
|
|
2599
2249
|
self->isInSingleStream=hpatch_FALSE;
|
|
2600
2250
|
}
|
|
2601
2251
|
|
|
2602
|
-
hpatch_BOOL
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
size_t maxThreadNum,hpatchMTSets_t hpatchMTSets){
|
|
2609
|
-
hpatch_BOOL result=hpatch_TRUE;
|
|
2252
|
+
hpatch_BOOL patch_single_stream_by(sspatch_listener_t* listener,
|
|
2253
|
+
const hpatch_TStreamOutput* __out_newData,
|
|
2254
|
+
const hpatch_TStreamInput* oldData,
|
|
2255
|
+
const hpatch_TStreamInput* singleCompressedDiff,
|
|
2256
|
+
hpatch_StreamPos_t diffInfo_pos){
|
|
2257
|
+
hpatch_BOOL result;
|
|
2610
2258
|
hpatch_TDecompress* decompressPlugin=0;
|
|
2611
2259
|
unsigned char* temp_cache=0;
|
|
2612
2260
|
unsigned char* temp_cacheEnd=0;
|
|
@@ -2625,19 +2273,20 @@ hpatch_BOOL _patch_single_stream_mt(sspatch_listener_t* listener,
|
|
|
2625
2273
|
out_newData->streamSize=diffInfo.newDataSize;
|
|
2626
2274
|
if (diffInfo.oldDataSize!=oldData->streamSize)
|
|
2627
2275
|
return _hpatch_FALSE;
|
|
2628
|
-
if (
|
|
2276
|
+
if ((diffInfo.compressedSize?diffInfo.compressedSize:diffInfo.uncompressedSize)
|
|
2277
|
+
!=(singleCompressedDiff->streamSize-diffInfo.diffDataPos))
|
|
2629
2278
|
return _hpatch_FALSE;
|
|
2630
2279
|
|
|
2280
|
+
if (!listener->onDiffInfo(listener,&diffInfo,&decompressPlugin,&temp_cache,&temp_cacheEnd))
|
|
2281
|
+
return _hpatch_FALSE;
|
|
2631
2282
|
if ((temp_cache==0)||(temp_cache>=temp_cacheEnd))
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
diffInfo.
|
|
2636
|
-
diffInfo.coverCount,
|
|
2637
|
-
temp_cache,temp_cacheEnd
|
|
2638
|
-
}
|
|
2283
|
+
return _hpatch_FALSE;
|
|
2284
|
+
result=(diffInfo.compressType[0]=='\0')?(decompressPlugin==0):(decompressPlugin!=0);
|
|
2285
|
+
result=result&&patch_single_compressed_diff(out_newData,oldData,singleCompressedDiff,
|
|
2286
|
+
diffInfo.diffDataPos,diffInfo.uncompressedSize,
|
|
2287
|
+
decompressPlugin,diffInfo.coverCount,
|
|
2288
|
+
(size_t)diffInfo.stepMemSize,temp_cache,temp_cacheEnd);
|
|
2639
2289
|
if (listener->onPatchFinish)
|
|
2640
2290
|
listener->onPatchFinish(listener,temp_cache,temp_cacheEnd);
|
|
2641
2291
|
return result;
|
|
2642
2292
|
}
|
|
2643
|
-
|