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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
/*
|
|
5
5
|
The MIT License (MIT)
|
|
6
|
-
Copyright (c) 2012-
|
|
6
|
+
Copyright (c) 2012-2019 HouSisong
|
|
7
7
|
|
|
8
8
|
Permission is hereby granted, free of charge, to any person
|
|
9
9
|
obtaining a copy of this software and associated documentation
|
|
@@ -34,27 +34,22 @@
|
|
|
34
34
|
#include <string.h>
|
|
35
35
|
#include <stdlib.h>
|
|
36
36
|
#include <stdio.h>
|
|
37
|
+
#include <algorithm> //find search
|
|
37
38
|
#include "libHDiffPatch/HDiff/diff.h"
|
|
38
|
-
#include "libHDiffPatch/HDiff/match_block.h"
|
|
39
39
|
#include "libHDiffPatch/HPatch/patch.h"
|
|
40
40
|
#include "_clock_for_demo.h"
|
|
41
41
|
#include "_atosize.h"
|
|
42
42
|
#include "file_for_patch.h"
|
|
43
43
|
#include "libHDiffPatch/HDiff/private_diff/mem_buf.h"
|
|
44
|
-
#include "hdiffz_import_patch.h"
|
|
45
44
|
|
|
46
45
|
#include "_dir_ignore.h"
|
|
46
|
+
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
47
47
|
#include "dirDiffPatch/dir_diff/dir_diff.h"
|
|
48
|
+
#endif
|
|
48
49
|
|
|
49
50
|
#ifndef _IS_NEED_MAIN
|
|
50
51
|
# define _IS_NEED_MAIN 1
|
|
51
52
|
#endif
|
|
52
|
-
#ifndef _IS_NEED_BSDIFF
|
|
53
|
-
# define _IS_NEED_BSDIFF 1
|
|
54
|
-
#endif
|
|
55
|
-
#ifndef _IS_NEED_VCDIFF
|
|
56
|
-
# define _IS_NEED_VCDIFF 1
|
|
57
|
-
#endif
|
|
58
53
|
|
|
59
54
|
#ifndef _IS_NEED_DEFAULT_CompressPlugin
|
|
60
55
|
# define _IS_NEED_DEFAULT_CompressPlugin 1
|
|
@@ -65,44 +60,18 @@
|
|
|
65
60
|
#endif
|
|
66
61
|
#if (_IS_NEED_DEFAULT_CompressPlugin)
|
|
67
62
|
//===== select needs decompress plugins or change to your plugin=====
|
|
68
|
-
# define _CompressPlugin_zlib //
|
|
69
|
-
# define _CompressPlugin_ldef // faster or better compress than zlib / (now used ldef+zlib decompressor)
|
|
63
|
+
# define _CompressPlugin_zlib // memroy requires less
|
|
70
64
|
# define _CompressPlugin_bz2
|
|
71
65
|
# define _CompressPlugin_lzma // better compresser
|
|
72
66
|
# define _CompressPlugin_lzma2 // better compresser
|
|
73
|
-
# define _CompressPlugin_zstd // better compresser / faster decompressor
|
|
74
|
-
#if (_IS_NEED_VCDIFF)
|
|
75
|
-
# define _CompressPlugin_7zXZ //only for VCDIFF, used lzma2
|
|
76
|
-
#endif
|
|
77
|
-
|
|
78
67
|
#endif
|
|
79
68
|
#if (_IS_NEED_ALL_CompressPlugin)
|
|
80
69
|
//===== select needs decompress plugins or change to your plugin=====
|
|
81
|
-
# define _CompressPlugin_lz4 // faster compresser / faster
|
|
82
|
-
# define _CompressPlugin_lz4hc //
|
|
83
|
-
# define
|
|
70
|
+
# define _CompressPlugin_lz4 // faster compresser / faster decompresser
|
|
71
|
+
# define _CompressPlugin_lz4hc // faster decompresser
|
|
72
|
+
# define _CompressPlugin_zstd // better compresser / faster decompresser
|
|
73
|
+
# define _CompressPlugin_brotli// better compresser / faster decompresser
|
|
84
74
|
# define _CompressPlugin_lzham // better compresser / decompress faster than lzma2
|
|
85
|
-
# define _CompressPlugin_tuz // slower compresser / decompress requires tiny code(.text) & ram
|
|
86
|
-
#endif
|
|
87
|
-
#ifdef _CompressPlugin_ldef
|
|
88
|
-
# ifndef _CompressPlugin_ldef_is_use_zlib
|
|
89
|
-
# define _CompressPlugin_ldef_is_use_zlib 1 //now ldef need zlib decompressor for any all of deflate code
|
|
90
|
-
# endif
|
|
91
|
-
# ifndef _IS_NEED_decompressor_ldef_replace_zlib
|
|
92
|
-
# define _IS_NEED_decompressor_ldef_replace_zlib 0
|
|
93
|
-
# endif
|
|
94
|
-
#endif
|
|
95
|
-
|
|
96
|
-
#if (_IS_NEED_BSDIFF)
|
|
97
|
-
# include "bsdiff_wrapper/bsdiff_wrapper.h"
|
|
98
|
-
# include "bsdiff_wrapper/bspatch_wrapper.h"
|
|
99
|
-
# ifndef _CompressPlugin_bz2
|
|
100
|
-
# define _CompressPlugin_bz2 //bsdiff need bz2
|
|
101
|
-
# endif
|
|
102
|
-
#endif
|
|
103
|
-
#if (_IS_NEED_VCDIFF)
|
|
104
|
-
# include "vcdiff_wrapper/vcdiff_wrapper.h"
|
|
105
|
-
# include "vcdiff_wrapper/vcpatch_wrapper.h"
|
|
106
75
|
#endif
|
|
107
76
|
|
|
108
77
|
#include "compress_plugin_demo.h"
|
|
@@ -120,11 +89,8 @@
|
|
|
120
89
|
#endif
|
|
121
90
|
#if (_IS_NEED_DEFAULT_ChecksumPlugin)
|
|
122
91
|
//===== select needs checksum plugins or change to your plugin=====
|
|
123
|
-
# define _ChecksumPlugin_crc32 //
|
|
92
|
+
# define _ChecksumPlugin_crc32 // = 32 bit effective //need zlib
|
|
124
93
|
# define _ChecksumPlugin_fadler64 // ? 63 bit effective
|
|
125
|
-
# define _ChecksumPlugin_md5 // 128 bit
|
|
126
|
-
# define _ChecksumPlugin_xxh3 // 64 bit fast
|
|
127
|
-
# define _ChecksumPlugin_xxh128 // 128 bit fast
|
|
128
94
|
#endif
|
|
129
95
|
#if (_IS_NEED_ALL_ChecksumPlugin)
|
|
130
96
|
//===== select needs checksum plugins or change to your plugin=====
|
|
@@ -132,28 +98,22 @@
|
|
|
132
98
|
# define _ChecksumPlugin_adler64 // ? 30 bit effective
|
|
133
99
|
# define _ChecksumPlugin_fadler32 // ~ 32 bit effective
|
|
134
100
|
# define _ChecksumPlugin_fadler128// ? 81 bit effective
|
|
135
|
-
# define
|
|
101
|
+
# define _ChecksumPlugin_md5 // ? 128 bit effective
|
|
136
102
|
#endif
|
|
137
103
|
|
|
104
|
+
|
|
138
105
|
#include "checksum_plugin_demo.h"
|
|
139
106
|
#endif
|
|
140
107
|
|
|
141
108
|
static void printVersion(){
|
|
142
|
-
printf("HDiffPatch::hdiffz v" HDIFFPATCH_VERSION_STRING "\n");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
static void printHelpInfo(){
|
|
146
|
-
printf(" -h (or -?)\n"
|
|
147
|
-
" print usage info.\n");
|
|
109
|
+
printf("HDiffPatch::hdiffz v" HDIFFPATCH_VERSION_STRING "\n\n");
|
|
148
110
|
}
|
|
149
111
|
|
|
150
112
|
static void printUsage(){
|
|
151
113
|
printVersion();
|
|
152
|
-
printf("\n");
|
|
153
114
|
printf("diff usage: hdiffz [options] oldPath newPath outDiffFile\n"
|
|
154
115
|
"test usage: hdiffz -t oldPath newPath testDiffFile\n"
|
|
155
116
|
"resave usage: hdiffz [-c-...] diffFile outDiffFile\n"
|
|
156
|
-
"print info: hdiffz -info diffFile\n"
|
|
157
117
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
158
118
|
"get manifest: hdiffz [-g#...] [-C-checksumType] inputPath -M#outManifestTxtFile\n"
|
|
159
119
|
"manifest diff: hdiffz [options] -M-old#oldManifestFile -M-new#newManifestFile\n"
|
|
@@ -161,7 +121,7 @@ static void printUsage(){
|
|
|
161
121
|
" oldPath newPath inputPath can be file or directory(folder),\n"
|
|
162
122
|
#endif
|
|
163
123
|
" oldPath can empty, and input parameter \"\"\n"
|
|
164
|
-
"options:\n"
|
|
124
|
+
"memory options:\n"
|
|
165
125
|
" -m[-matchScore]\n"
|
|
166
126
|
" DEFAULT; all file load into Memory; best diffFileSize;\n"
|
|
167
127
|
" requires (newFileSize+ oldFileSize*5(or *9 when oldFileSize>=2GB))+O(1)\n"
|
|
@@ -169,81 +129,32 @@ static void printUsage(){
|
|
|
169
129
|
" matchScore>=0, DEFAULT -m-6, recommended bin: 0--4 text: 4--9 etc...\n"
|
|
170
130
|
" -s[-matchBlockSize]\n"
|
|
171
131
|
" all file load as Stream; fast;\n"
|
|
172
|
-
" requires O(oldFileSize*16/matchBlockSize+matchBlockSize*5"
|
|
173
|
-
#if (_IS_USED_MULTITHREAD)
|
|
174
|
-
"*parallelThreadNumber"
|
|
175
|
-
#endif
|
|
176
|
-
")bytes of memory;\n"
|
|
132
|
+
" requires O(oldFileSize*16/matchBlockSize+matchBlockSize*5)bytes of memory;\n"
|
|
177
133
|
" matchBlockSize>=4, DEFAULT -s-64, recommended 16,32,48,1k,64k,1m etc...\n"
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
" set block match befor slow byte-by-byte match, DEFAULT -block-1k;\n"
|
|
181
|
-
" if set -block-0, means don't use block match;\n"
|
|
182
|
-
" fastMatchBlockSize>=4, recommended 128,4k,64k, etc...\n"
|
|
183
|
-
" if newData similar to oldData then diff speed++ & diff memory--,\n"
|
|
184
|
-
" but small possibility outDiffFile's size+\n"
|
|
185
|
-
" -cache \n"
|
|
186
|
-
" must run with -m;\n"
|
|
187
|
-
" set is use a big cache for slow match, DEFAULT false;\n"
|
|
188
|
-
" if newData not similar to oldData then diff speed++,\n"
|
|
189
|
-
" big cache max used O(oldFileSize) memory, and build slow(diff speed--)\n"
|
|
134
|
+
"special options:\n"
|
|
135
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
190
136
|
" -SD[-stepSize]\n"
|
|
191
|
-
" create single compressed diffData
|
|
192
|
-
"
|
|
193
|
-
" and supports multi-thread patching!\n"
|
|
137
|
+
" create single compressed stream diffData! \n"
|
|
138
|
+
" now only for test, must run with -m, and not supprot directory(folder).\n"
|
|
194
139
|
" stepSize>=" _HDIFFPATCH_EXPAND_AND_QUOTE(hpatch_kStreamCacheSize) ", DEFAULT -SD-256k, recommended 64k,2m etc...\n"
|
|
195
|
-
#if (_IS_NEED_BSDIFF)
|
|
196
|
-
" -BSD\n"
|
|
197
|
-
" create diffFile compatible with bsdiff4, unsupport input directory(folder).\n"
|
|
198
|
-
" also support run with -SD (not used stepSize), then create single compressed\n"
|
|
199
|
-
" diffFile compatible with endsley/bsdiff (https://github.com/mendsley/bsdiff).\n"
|
|
200
|
-
#endif
|
|
201
|
-
#if (_IS_NEED_VCDIFF)
|
|
202
|
-
# ifdef _CompressPlugin_7zXZ
|
|
203
|
-
" -VCD[-compressLevel[-dictSize]]\n"
|
|
204
|
-
" create diffFile compatible with VCDIFF, unsupport input directory(folder).\n"
|
|
205
|
-
" DEFAULT no compress, out format same as $open-vcdiff ... or $xdelta3 -S -e -n ...\n"
|
|
206
|
-
" if set compressLevel, out format same as $xdelta3 -S lzma -e -n ...\n"
|
|
207
|
-
" compress by 7zXZ(xz), compressLevel in {0..9}, DEFAULT level 7;\n"
|
|
208
|
-
" dictSize can like 4096 or 4k or 4m or 16m etc..., DEFAULT 8m\n"
|
|
209
|
-
# if (_IS_USED_MULTITHREAD)
|
|
210
|
-
" support compress by multi-thread parallel.\n"
|
|
211
|
-
# endif
|
|
212
|
-
# else
|
|
213
|
-
" -VCD\n"
|
|
214
|
-
" create diffFile compatible with VCDIFF, unsupport input directory(folder).\n"
|
|
215
|
-
" out format same as $open-vcdiff ... or $xdelta3 -S -e -n ...\n"
|
|
216
|
-
# endif
|
|
217
|
-
" NOTE: out diffFile used large source window size!\n"
|
|
218
140
|
#endif
|
|
219
141
|
#if (_IS_USED_MULTITHREAD)
|
|
220
142
|
" -p-parallelThreadNumber\n"
|
|
221
143
|
" if parallelThreadNumber>1 then open multi-thread Parallel mode;\n"
|
|
222
144
|
" DEFAULT -p-4; requires more memory!\n"
|
|
223
|
-
" -p-search-searchThreadNumber\n"
|
|
224
|
-
" DEFAULT searchThreadNumber same as parallelThreadNumber;\n"
|
|
225
|
-
" old file on HDD hard drives WARNING: multi-thread search need frequent random\n"
|
|
226
|
-
" disk reads when -s-matchBlockSize or -block-fastMatchBlockSize(run with -m),\n"
|
|
227
|
-
" causes slowdown; at this time, need to close(searchThreadNumber<=1) multi-thread\n"
|
|
228
|
-
" search mode or reduce the number of searchThreadNumber!\n"
|
|
229
145
|
#endif
|
|
230
146
|
" -c-compressType[-compressLevel]\n"
|
|
231
|
-
" set outDiffFile Compress type, DEFAULT uncompress;\n"
|
|
147
|
+
" set outDiffFile Compress type & level, DEFAULT uncompress;\n"
|
|
232
148
|
" for resave diffFile,recompress diffFile to outDiffFile by new set;\n"
|
|
233
|
-
" support compress type & level
|
|
149
|
+
" support compress type & level:\n"
|
|
150
|
+
" (re. https://github.com/sisong/lzbench/blob/master/lzbench171_sorted.md )\n"
|
|
234
151
|
#ifdef _CompressPlugin_zlib
|
|
235
|
-
" -c-zlib[-{1..9}
|
|
236
|
-
" dictBits can 9--15, DEFAULT 15.\n"
|
|
237
|
-
# if (_IS_USED_MULTITHREAD)
|
|
238
|
-
" support run by multi-thread parallel, fast!\n"
|
|
239
|
-
# endif
|
|
240
|
-
#endif
|
|
241
|
-
#ifdef _CompressPlugin_ldef
|
|
242
|
-
" -c-ldef[-{1..12}] DEFAULT level 12\n"
|
|
243
|
-
" compatible with -c-zlib, faster or better compress than zlib;\n"
|
|
244
|
-
" used libdeflate compressor, & dictBits always 15.\n"
|
|
152
|
+
" -c-zlib[-{1..9}] DEFAULT level 9\n"
|
|
245
153
|
# if (_IS_USED_MULTITHREAD)
|
|
154
|
+
" -c-pzlib[-{1..9}] DEFAULT level 6\n"
|
|
246
155
|
" support run by multi-thread parallel, fast!\n"
|
|
156
|
+
" WARNING: code not compatible with it compressed by -c-zlib!\n"
|
|
157
|
+
" and code size may be larger than if it compressed by -c-zlib. \n"
|
|
247
158
|
# endif
|
|
248
159
|
#endif
|
|
249
160
|
#ifdef _CompressPlugin_bz2
|
|
@@ -251,7 +162,8 @@ static void printUsage(){
|
|
|
251
162
|
# if (_IS_USED_MULTITHREAD)
|
|
252
163
|
" -c-pbzip2[-{1..9}] (or -pbz2) DEFAULT level 8\n"
|
|
253
164
|
" support run by multi-thread parallel, fast!\n"
|
|
254
|
-
"
|
|
165
|
+
" WARNING: code not compatible with it compressed by -c-bzip2!\n"
|
|
166
|
+
" and code size may be larger than if it compressed by -c-bzip2.\n"
|
|
255
167
|
# endif
|
|
256
168
|
#endif
|
|
257
169
|
#ifdef _CompressPlugin_lzma
|
|
@@ -267,7 +179,7 @@ static void printUsage(){
|
|
|
267
179
|
# if (_IS_USED_MULTITHREAD)
|
|
268
180
|
" support run by multi-thread parallel, fast!\n"
|
|
269
181
|
# endif
|
|
270
|
-
"
|
|
182
|
+
" WARNING: code not compatible with it compressed by -c-lzma!\n"
|
|
271
183
|
#endif
|
|
272
184
|
#ifdef _CompressPlugin_lz4
|
|
273
185
|
" -c-lz4[-{1..50}] DEFAULT level 50 (as lz4 acceleration 1)\n"
|
|
@@ -277,26 +189,22 @@ static void printUsage(){
|
|
|
277
189
|
#endif
|
|
278
190
|
#ifdef _CompressPlugin_zstd
|
|
279
191
|
" -c-zstd[-{0..22}[-dictBits]] DEFAULT level 20\n"
|
|
280
|
-
" dictBits can 10--
|
|
192
|
+
" dictBits can 10--31, DEFAULT 24.\n"
|
|
281
193
|
# if (_IS_USED_MULTITHREAD)
|
|
282
194
|
" support run by multi-thread parallel, fast!\n"
|
|
283
195
|
# endif
|
|
284
196
|
#endif
|
|
285
197
|
#ifdef _CompressPlugin_brotli
|
|
286
198
|
" -c-brotli[-{0..11}[-dictBits]] DEFAULT level 9\n"
|
|
287
|
-
" dictBits can 10--30, DEFAULT
|
|
199
|
+
" dictBits can 10--30, DEFAULT 24.\n"
|
|
288
200
|
#endif
|
|
289
201
|
#ifdef _CompressPlugin_lzham
|
|
290
202
|
" -c-lzham[-{0..5}[-dictBits]] DEFAULT level 4\n"
|
|
291
|
-
" dictBits can 15--29, DEFAULT
|
|
203
|
+
" dictBits can 15--29, DEFAULT 24.\n"
|
|
292
204
|
# if (_IS_USED_MULTITHREAD)
|
|
293
205
|
" support run by multi-thread parallel, fast!\n"
|
|
294
206
|
# endif
|
|
295
207
|
#endif
|
|
296
|
-
#ifdef _CompressPlugin_tuz
|
|
297
|
-
" -c-tuz[-dictSize] (or -tinyuz)\n"
|
|
298
|
-
" 1<=dictSize<=" _HDIFFPATCH_EXPAND_AND_QUOTE(tuz_kMaxOfDictSize) ", can like 510,1k,4k,64k,1m,16m ..., DEFAULT 8m\n"
|
|
299
|
-
#endif
|
|
300
208
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
301
209
|
" -C-checksumType\n"
|
|
302
210
|
" set outDiffFile Checksum type for directory diff, DEFAULT "
|
|
@@ -336,19 +244,10 @@ static void printUsage(){
|
|
|
336
244
|
#endif
|
|
337
245
|
#ifdef _ChecksumPlugin_md5
|
|
338
246
|
" -C-md5\n"
|
|
339
|
-
#endif
|
|
340
|
-
#ifdef _ChecksumPlugin_blake3
|
|
341
|
-
" -C-blake3\n"
|
|
342
|
-
#endif
|
|
343
|
-
#ifdef _ChecksumPlugin_xxh3
|
|
344
|
-
" -C-xxh3 (need v4.12 patcher)\n"
|
|
345
|
-
#endif
|
|
346
|
-
#ifdef _ChecksumPlugin_xxh128
|
|
347
|
-
" -C-xxh128 recommended (need v4.12 patcher)\n"
|
|
348
247
|
#endif
|
|
349
248
|
" -n-maxOpenFileNumber\n"
|
|
350
249
|
" limit Number of open files at same time when stream directory diff;\n"
|
|
351
|
-
" maxOpenFileNumber>=
|
|
250
|
+
" maxOpenFileNumber>=8, DEFAULT -n-48, the best limit value by different\n"
|
|
352
251
|
" operating system.\n"
|
|
353
252
|
" -g#ignorePath[#ignorePath#...]\n"
|
|
354
253
|
" set iGnore path list when Directory Diff; ignore path list such as:\n"
|
|
@@ -374,22 +273,15 @@ static void printUsage(){
|
|
|
374
273
|
" -D force run Directory diff between two files; DEFAULT (no -D) run \n"
|
|
375
274
|
" directory diff need oldPath or newPath is directory.\n"
|
|
376
275
|
#endif //_IS_NEED_DIR_DIFF_PATCH
|
|
377
|
-
" -neq\n"
|
|
378
|
-
" open check: if newPath & oldPath's all datas are equal, then return error; \n"
|
|
379
|
-
" DEFAULT not check equal.\n"
|
|
380
276
|
" -d Diff only, do't run patch check, DEFAULT run patch check.\n"
|
|
381
277
|
" -t Test only, run patch check, patch(oldPath,testDiffFile)==newPath ? \n"
|
|
382
278
|
" -f Force overwrite, ignore write path already exists;\n"
|
|
383
279
|
" DEFAULT (no -f) not overwrite and then return error;\n"
|
|
384
280
|
" if used -f and write path is exist directory, will always return error.\n"
|
|
385
|
-
"
|
|
386
|
-
"
|
|
387
|
-
" -info\n"
|
|
388
|
-
" print infos of diffFile.\n"
|
|
389
|
-
" -v print Version info.\n"
|
|
281
|
+
" -h or -?\n"
|
|
282
|
+
" output Help info (this usage).\n"
|
|
283
|
+
" -v output Version info.\n\n"
|
|
390
284
|
);
|
|
391
|
-
printHelpInfo();
|
|
392
|
-
printf("\n");
|
|
393
285
|
}
|
|
394
286
|
|
|
395
287
|
typedef enum THDiffResult {
|
|
@@ -398,63 +290,47 @@ typedef enum THDiffResult {
|
|
|
398
290
|
HDIFF_OPENREAD_ERROR,
|
|
399
291
|
HDIFF_OPENWRITE_ERROR,
|
|
400
292
|
HDIFF_FILECLOSE_ERROR,
|
|
401
|
-
HDIFF_MEM_ERROR,
|
|
293
|
+
HDIFF_MEM_ERROR,
|
|
402
294
|
HDIFF_DIFF_ERROR,
|
|
403
295
|
HDIFF_PATCH_ERROR,
|
|
404
296
|
HDIFF_RESAVE_FILEREAD_ERROR,
|
|
405
|
-
//HDIFF_RESAVE_OPENWRITE_ERROR = HDIFF_OPENWRITE_ERROR
|
|
406
297
|
HDIFF_RESAVE_DIFFINFO_ERROR,
|
|
407
|
-
HDIFF_RESAVE_COMPRESSTYPE_ERROR,
|
|
298
|
+
HDIFF_RESAVE_COMPRESSTYPE_ERROR,
|
|
408
299
|
HDIFF_RESAVE_ERROR,
|
|
409
300
|
HDIFF_RESAVE_CHECKSUMTYPE_ERROR,
|
|
410
301
|
|
|
411
302
|
HDIFF_PATHTYPE_ERROR, //adding begin v3.0
|
|
412
303
|
HDIFF_TEMPPATH_ERROR,
|
|
413
|
-
HDIFF_DELETEPATH_ERROR,
|
|
304
|
+
HDIFF_DELETEPATH_ERROR,
|
|
414
305
|
HDIFF_RENAMEPATH_ERROR,
|
|
415
|
-
HDIFF_OLD_NEW_SAME_ERROR,//adding begin v4.7.0 ; note: now not included dir_diff(), dir_diff thow an error & return DIRDIFF_DIFF_ERROR
|
|
416
306
|
|
|
417
307
|
DIRDIFF_DIFF_ERROR=101,
|
|
418
308
|
DIRDIFF_PATCH_ERROR,
|
|
419
309
|
MANIFEST_CREATE_ERROR,
|
|
420
310
|
MANIFEST_TEST_ERROR,
|
|
421
311
|
} THDiffResult;
|
|
422
|
-
#define HDIFF_RESAVE_OPENWRITE_ERROR HDIFF_OPENWRITE_ERROR
|
|
423
312
|
|
|
424
313
|
int hdiff_cmd_line(int argc,const char * argv[]);
|
|
425
314
|
|
|
426
|
-
struct TDiffSets:public THDiffSets{
|
|
427
|
-
hpatch_BOOL isDoDiff;
|
|
428
|
-
hpatch_BOOL isDoPatchCheck;
|
|
429
|
-
#if (_IS_NEED_BSDIFF)
|
|
430
|
-
hpatch_BOOL isBsDiff;
|
|
431
|
-
#endif
|
|
432
|
-
#if (_IS_NEED_VCDIFF)
|
|
433
|
-
hpatch_BOOL isVcDiff;
|
|
434
|
-
#endif
|
|
435
|
-
};
|
|
436
|
-
|
|
437
315
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
438
316
|
int hdiff_dir(const char* oldPath,const char* newPath,const char* outDiffFileName,
|
|
439
|
-
const hdiff_TCompress* compressPlugin,hpatch_TChecksum* checksumPlugin,
|
|
440
317
|
hpatch_BOOL oldIsDir, hpatch_BOOL newIsDir,
|
|
441
|
-
|
|
318
|
+
hpatch_BOOL isDiff,hpatch_BOOL isLoadAll,size_t matchValue,hpatch_BOOL isPatchCheck,
|
|
319
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
|
|
320
|
+
hpatch_TChecksum* checksumPlugin,size_t kMaxOpenFileNumber,
|
|
442
321
|
const std::vector<std::string>& ignorePathListBase,const std::vector<std::string>& ignoreOldPathList,
|
|
443
322
|
const std::vector<std::string>& ignoreNewPathList,
|
|
444
323
|
const std::string& oldManifestFileName,const std::string& newManifestFileName);
|
|
445
324
|
int create_manifest(const char* inputPath,const char* outManifestFileName,
|
|
446
325
|
hpatch_TChecksum* checksumPlugin,const std::vector<std::string>& ignorePathList);
|
|
447
326
|
#endif
|
|
448
|
-
int hdiff(const char* oldFileName,const char* newFileName,const char* outDiffFileName,
|
|
449
|
-
|
|
327
|
+
int hdiff(const char* oldFileName,const char* newFileName,const char* outDiffFileName,hpatch_BOOL isDiff,
|
|
328
|
+
hpatch_BOOL isLoadAll,size_t matchValue,hpatch_BOOL isPatchCheck,
|
|
329
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
|
|
330
|
+
hpatch_BOOL isSingleStreamDiff,size_t singleStreamStepSize);
|
|
450
331
|
int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
451
332
|
const hdiff_TCompress* compressPlugin);
|
|
452
333
|
|
|
453
|
-
#define _checkPatchMode(_argc,_argv) \
|
|
454
|
-
if (isSwapToPatchMode(_argc,_argv)){ \
|
|
455
|
-
printf("hdiffz swap to hpatchz mode.\n\n"); \
|
|
456
|
-
return hpatch_cmd_line(_argc,_argv); \
|
|
457
|
-
}
|
|
458
334
|
|
|
459
335
|
#if (_IS_NEED_MAIN)
|
|
460
336
|
# if (_IS_USED_WIN32_UTF8_WAPI)
|
|
@@ -464,12 +340,10 @@ int wmain(int argc,wchar_t* argv_w[]){
|
|
|
464
340
|
if (!_wFileNames_to_utf8((const wchar_t**)argv_w,argc,argv_utf8,_mem.size()))
|
|
465
341
|
return HDIFF_OPTIONS_ERROR;
|
|
466
342
|
SetDefaultStringLocale();
|
|
467
|
-
_checkPatchMode(argc,(const char**)argv_utf8);
|
|
468
343
|
return hdiff_cmd_line(argc,(const char**)argv_utf8);
|
|
469
344
|
}
|
|
470
345
|
# else
|
|
471
346
|
int main(int argc,char* argv[]){
|
|
472
|
-
_checkPatchMode(argc,(const char**)argv);
|
|
473
347
|
return hdiff_cmd_line(argc,(const char**)argv);
|
|
474
348
|
}
|
|
475
349
|
# endif
|
|
@@ -486,128 +360,74 @@ static hpatch_BOOL _getIsCompressedDiffFile(const char* diffFileName){
|
|
|
486
360
|
return result;
|
|
487
361
|
}
|
|
488
362
|
|
|
489
|
-
static
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
hpatch_BOOL result=getSingleCompressedDiffInfo(&diffInfo,&diffData.base,0);
|
|
495
|
-
if (!hpatch_TFileStreamInput_close(&diffData)) return hpatch_FALSE;
|
|
496
|
-
return result;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
#if (_IS_NEED_BSDIFF)
|
|
500
|
-
static hpatch_BOOL _getIsBsDiffFile(const char* diffFileName) {
|
|
501
|
-
hpatch_TFileStreamInput diffData;
|
|
502
|
-
hpatch_TFileStreamInput_init(&diffData);
|
|
503
|
-
if (!hpatch_TFileStreamInput_open(&diffData, diffFileName)) return hpatch_FALSE;
|
|
504
|
-
hpatch_BOOL result=getIsBsDiff(&diffData.base,0);
|
|
505
|
-
if (!hpatch_TFileStreamInput_close(&diffData)) return hpatch_FALSE;
|
|
506
|
-
return result;
|
|
507
|
-
}
|
|
508
|
-
#endif
|
|
509
|
-
#if (_IS_NEED_VCDIFF)
|
|
510
|
-
static hpatch_BOOL _getIsVcDiffFile(const char* diffFileName) {
|
|
511
|
-
hpatch_TFileStreamInput diffData;
|
|
512
|
-
hpatch_TFileStreamInput_init(&diffData);
|
|
513
|
-
if (!hpatch_TFileStreamInput_open(&diffData, diffFileName)) return hpatch_FALSE;
|
|
514
|
-
hpatch_BOOL result=getIsVcDiff(&diffData.base);
|
|
515
|
-
if (!hpatch_TFileStreamInput_close(&diffData)) return hpatch_FALSE;
|
|
516
|
-
return result;
|
|
363
|
+
static void _trySetDecompress(hpatch_TDecompress** out_decompressPlugin,const char* compressType,
|
|
364
|
+
hpatch_TDecompress* testDecompressPlugin){
|
|
365
|
+
if ((*out_decompressPlugin)!=0) return;
|
|
366
|
+
if (testDecompressPlugin->is_can_open(compressType))
|
|
367
|
+
*out_decompressPlugin=testDecompressPlugin;
|
|
517
368
|
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
#
|
|
522
|
-
|
|
523
|
-
static hpatch_TDecompress* __find_decompressPlugin(const char* compressType){
|
|
524
|
-
#if ((defined(_CompressPlugin_ldef))&&_IS_NEED_decompressor_ldef_replace_zlib)
|
|
525
|
-
_try_rt_dec(ldefDecompressPlugin);
|
|
526
|
-
#else
|
|
527
|
-
# ifdef _CompressPlugin_zlib
|
|
528
|
-
_try_rt_dec(zlibDecompressPlugin);
|
|
529
|
-
# endif
|
|
369
|
+
static hpatch_BOOL findDecompress(hpatch_TDecompress** out_decompressPlugin,const char* compressType){
|
|
370
|
+
*out_decompressPlugin=0;
|
|
371
|
+
if (strlen(compressType)==0) return hpatch_TRUE;
|
|
372
|
+
#ifdef _CompressPlugin_zlib
|
|
373
|
+
_trySetDecompress(out_decompressPlugin,compressType,&zlibDecompressPlugin);
|
|
530
374
|
#endif
|
|
531
375
|
#ifdef _CompressPlugin_bz2
|
|
532
|
-
|
|
376
|
+
_trySetDecompress(out_decompressPlugin,compressType,&bz2DecompressPlugin);
|
|
533
377
|
#endif
|
|
534
378
|
#ifdef _CompressPlugin_lzma
|
|
535
|
-
|
|
379
|
+
_trySetDecompress(out_decompressPlugin,compressType,&lzmaDecompressPlugin);
|
|
536
380
|
#endif
|
|
537
381
|
#ifdef _CompressPlugin_lzma2
|
|
538
|
-
|
|
382
|
+
_trySetDecompress(out_decompressPlugin,compressType,&lzma2DecompressPlugin);
|
|
539
383
|
#endif
|
|
540
384
|
#if (defined(_CompressPlugin_lz4) || (defined(_CompressPlugin_lz4hc)))
|
|
541
|
-
|
|
385
|
+
_trySetDecompress(out_decompressPlugin,compressType,&lz4DecompressPlugin);
|
|
542
386
|
#endif
|
|
543
387
|
#ifdef _CompressPlugin_zstd
|
|
544
|
-
|
|
388
|
+
_trySetDecompress(out_decompressPlugin,compressType,&zstdDecompressPlugin);
|
|
545
389
|
#endif
|
|
546
390
|
#ifdef _CompressPlugin_brotli
|
|
547
|
-
|
|
391
|
+
_trySetDecompress(out_decompressPlugin,compressType,&brotliDecompressPlugin);
|
|
548
392
|
#endif
|
|
549
393
|
#ifdef _CompressPlugin_lzham
|
|
550
|
-
|
|
551
|
-
#endif
|
|
552
|
-
#ifdef _CompressPlugin_tuz
|
|
553
|
-
_try_rt_dec(tuzDecompressPlugin);
|
|
394
|
+
_trySetDecompress(out_decompressPlugin,compressType,&lzhamDecompressPlugin);
|
|
554
395
|
#endif
|
|
555
|
-
return 0;
|
|
556
|
-
}
|
|
557
|
-
static hpatch_BOOL findDecompress(hpatch_TDecompress* out_decompressPlugin,const char* compressType){
|
|
558
|
-
memset(out_decompressPlugin,0,sizeof(hpatch_TDecompress));
|
|
559
|
-
if (strlen(compressType)==0) return hpatch_TRUE;
|
|
560
|
-
hpatch_TDecompress* decompressPlugin=__find_decompressPlugin(compressType);
|
|
561
|
-
if (decompressPlugin==0) return hpatch_FALSE;
|
|
562
|
-
*out_decompressPlugin=*decompressPlugin;
|
|
563
|
-
return hpatch_TRUE;
|
|
396
|
+
return 0!=*out_decompressPlugin;
|
|
564
397
|
}
|
|
565
398
|
|
|
566
399
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
567
|
-
static
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (0
|
|
571
|
-
|
|
572
|
-
return hpatch_TRUE;
|
|
400
|
+
static void _trySetChecksum(hpatch_TChecksum** out_checksumPlugin,const char* checksumType,
|
|
401
|
+
hpatch_TChecksum* testChecksumPlugin){
|
|
402
|
+
if ((*out_checksumPlugin)!=0) return;
|
|
403
|
+
if (0==strcmp(checksumType,testChecksumPlugin->checksumType()))
|
|
404
|
+
*out_checksumPlugin=testChecksumPlugin;
|
|
573
405
|
}
|
|
574
|
-
#define __setChecksum(_checksumPlugin) \
|
|
575
|
-
if (_trySetChecksum(out_checksumPlugin,checksumType,_checksumPlugin)) return hpatch_TRUE;
|
|
576
|
-
|
|
577
406
|
static hpatch_BOOL findChecksum(hpatch_TChecksum** out_checksumPlugin,const char* checksumType){
|
|
578
407
|
*out_checksumPlugin=0;
|
|
579
408
|
if (strlen(checksumType)==0) return hpatch_TRUE;
|
|
580
|
-
#ifdef _ChecksumPlugin_fadler64
|
|
581
|
-
__setChecksum(&fadler64ChecksumPlugin);
|
|
582
|
-
#endif
|
|
583
|
-
#ifdef _ChecksumPlugin_xxh128
|
|
584
|
-
__setChecksum(&xxh128ChecksumPlugin);
|
|
585
|
-
#endif
|
|
586
|
-
#ifdef _ChecksumPlugin_xxh3
|
|
587
|
-
__setChecksum(&xxh3ChecksumPlugin);
|
|
588
|
-
#endif
|
|
589
|
-
#ifdef _ChecksumPlugin_md5
|
|
590
|
-
__setChecksum(&md5ChecksumPlugin);
|
|
591
|
-
#endif
|
|
592
409
|
#ifdef _ChecksumPlugin_crc32
|
|
593
|
-
|
|
410
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&crc32ChecksumPlugin);
|
|
594
411
|
#endif
|
|
595
412
|
#ifdef _ChecksumPlugin_adler32
|
|
596
|
-
|
|
413
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&adler32ChecksumPlugin);
|
|
597
414
|
#endif
|
|
598
415
|
#ifdef _ChecksumPlugin_adler64
|
|
599
|
-
|
|
416
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&adler64ChecksumPlugin);
|
|
600
417
|
#endif
|
|
601
418
|
#ifdef _ChecksumPlugin_fadler32
|
|
602
|
-
|
|
419
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&fadler32ChecksumPlugin);
|
|
420
|
+
#endif
|
|
421
|
+
#ifdef _ChecksumPlugin_fadler64
|
|
422
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&fadler64ChecksumPlugin);
|
|
603
423
|
#endif
|
|
604
424
|
#ifdef _ChecksumPlugin_fadler128
|
|
605
|
-
|
|
425
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&fadler128ChecksumPlugin);
|
|
606
426
|
#endif
|
|
607
|
-
#ifdef
|
|
608
|
-
|
|
427
|
+
#ifdef _ChecksumPlugin_md5
|
|
428
|
+
_trySetChecksum(out_checksumPlugin,checksumType,&md5ChecksumPlugin);
|
|
609
429
|
#endif
|
|
610
|
-
return
|
|
430
|
+
return (0!=*out_checksumPlugin);
|
|
611
431
|
}
|
|
612
432
|
|
|
613
433
|
static hpatch_BOOL _getOptChecksum(hpatch_TChecksum** out_checksumPlugin,
|
|
@@ -615,6 +435,8 @@ static hpatch_BOOL _getOptChecksum(hpatch_TChecksum** out_checksumPlugin,
|
|
|
615
435
|
assert(0==*out_checksumPlugin);
|
|
616
436
|
if (0==strcmp(checksumType,kNoChecksum))
|
|
617
437
|
return hpatch_TRUE;
|
|
438
|
+
else if (strlen(checksumType)==0)
|
|
439
|
+
return hpatch_FALSE;
|
|
618
440
|
else
|
|
619
441
|
return findChecksum(out_checksumPlugin,checksumType);
|
|
620
442
|
}
|
|
@@ -626,7 +448,7 @@ static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,cons
|
|
|
626
448
|
const char* cmpType,const char* cmpType2=0,
|
|
627
449
|
size_t* compressLevel=0,size_t levelMin=0,size_t levelMax=0,size_t levelDefault=0,
|
|
628
450
|
size_t* dictSize=0,size_t dictSizeMin=0,size_t dictSizeMax=0,size_t dictSizeDefault=0){
|
|
629
|
-
|
|
451
|
+
if (*isMatchedType) return true; //ok
|
|
630
452
|
const size_t ctypeLen=strlen(cmpType);
|
|
631
453
|
const size_t ctype2Len=(cmpType2!=0)?strlen(cmpType2):0;
|
|
632
454
|
if ( ((ctypeLen==(size_t)(ptypeEnd-ptype))&&(0==strncmp(ptype,cmpType,ctypeLen)))
|
|
@@ -638,7 +460,7 @@ static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,cons
|
|
|
638
460
|
if ((compressLevel)&&(ptypeEnd[0]=='-')){
|
|
639
461
|
const char* plevel=ptypeEnd+1;
|
|
640
462
|
const char* plevelEnd=findUntilEnd(plevel,'-');
|
|
641
|
-
if (!
|
|
463
|
+
if (!a_to_size(plevel,plevelEnd-plevel,compressLevel)) return false; //error
|
|
642
464
|
if (*compressLevel<levelMin) *compressLevel=levelMin;
|
|
643
465
|
else if (*compressLevel>levelMax) *compressLevel=levelMax;
|
|
644
466
|
if ((dictSize)&&(plevelEnd[0]=='-')){
|
|
@@ -649,7 +471,7 @@ static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,cons
|
|
|
649
471
|
else if (*dictSize>dictSizeMax) *dictSize=dictSizeMax;
|
|
650
472
|
}else{
|
|
651
473
|
if (plevelEnd[0]!='\0') return false; //error
|
|
652
|
-
if (dictSize) *dictSize=
|
|
474
|
+
if (dictSize) *dictSize=dictSizeDefault;
|
|
653
475
|
}
|
|
654
476
|
}else{
|
|
655
477
|
if (ptypeEnd[0]!='\0') return false; //error
|
|
@@ -660,179 +482,164 @@ static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,cons
|
|
|
660
482
|
}
|
|
661
483
|
|
|
662
484
|
#define _options_check(value,errorInfo){ \
|
|
663
|
-
if (!(value)) {
|
|
664
|
-
|
|
665
|
-
#define __getCompressSet(_tryGet_code,_errTag) \
|
|
666
|
-
if (isMatchedType==0){ \
|
|
667
|
-
_options_check(_tryGet_code,_errTag); \
|
|
668
|
-
if (isMatchedType)
|
|
485
|
+
if (!(value)) { fprintf(stderr,"options " errorInfo " ERROR!\n\n"); printUsage(); return HDIFF_OPTIONS_ERROR; } }
|
|
669
486
|
|
|
670
487
|
static int _checkSetCompress(hdiff_TCompress** out_compressPlugin,
|
|
488
|
+
hpatch_TDecompress** out_decompressPlugin,
|
|
671
489
|
const char* ptype,const char* ptypeEnd){
|
|
672
490
|
const char* isMatchedType=0;
|
|
673
491
|
size_t compressLevel=0;
|
|
674
|
-
#if (defined _CompressPlugin_lzma)||(defined _CompressPlugin_lzma2)
|
|
492
|
+
#if (defined _CompressPlugin_lzma)||(defined _CompressPlugin_lzma2)
|
|
675
493
|
size_t dictSize=0;
|
|
676
|
-
const size_t defaultDictSize=(1<<20)*8;
|
|
494
|
+
const size_t defaultDictSize=(1<<20)*8;
|
|
677
495
|
#endif
|
|
678
|
-
#if (defined
|
|
679
|
-
||(defined _CompressPlugin_brotli)||(defined _CompressPlugin_lzham)
|
|
496
|
+
#if (defined _CompressPlugin_zstd)||(defined _CompressPlugin_brotli)||(defined _CompressPlugin_lzham)
|
|
680
497
|
size_t dictBits=0;
|
|
681
|
-
const size_t defaultDictBits=20+
|
|
682
|
-
const size_t defaultDictBits_zlib=15; //32k
|
|
498
|
+
const size_t defaultDictBits=20+4;
|
|
683
499
|
#endif
|
|
684
500
|
#ifdef _CompressPlugin_zlib
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
#
|
|
501
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"zlib",0,
|
|
502
|
+
&compressLevel,1,9,9),"-c-zlib-?");
|
|
503
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"zlib"))){
|
|
504
|
+
static TCompressPlugin_zlib _zlibCompressPlugin=zlibCompressPlugin;
|
|
505
|
+
_zlibCompressPlugin.compress_level=(int)compressLevel;
|
|
506
|
+
*out_compressPlugin=&_zlibCompressPlugin.base;
|
|
507
|
+
*out_decompressPlugin=&zlibDecompressPlugin; }
|
|
508
|
+
# if (_IS_USED_MULTITHREAD)
|
|
509
|
+
//pzlib
|
|
510
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"pzlib",0,
|
|
511
|
+
&compressLevel,1,9,6),"-c-pzlib-?");
|
|
512
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"pzlib"))){
|
|
693
513
|
static TCompressPlugin_pzlib _pzlibCompressPlugin=pzlibCompressPlugin;
|
|
694
514
|
_pzlibCompressPlugin.base.compress_level=(int)compressLevel;
|
|
695
|
-
_pzlibCompressPlugin.base.
|
|
696
|
-
*
|
|
697
|
-
# endif // _IS_USED_MULTITHREAD
|
|
698
|
-
#endif
|
|
699
|
-
#ifdef _CompressPlugin_ldef
|
|
700
|
-
__getCompressSet(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"ldef","pldef",
|
|
701
|
-
&compressLevel,1,12,12, &dictBits,15,15,defaultDictBits_zlib),"-c-ldef-?"){
|
|
702
|
-
# if (!_IS_USED_MULTITHREAD)
|
|
703
|
-
static TCompressPlugin_ldef _ldefCompressPlugin=ldefCompressPlugin;
|
|
704
|
-
_ldefCompressPlugin.compress_level=(int)compressLevel;
|
|
705
|
-
*out_compressPlugin=&_ldefCompressPlugin.base; }}
|
|
706
|
-
# else
|
|
707
|
-
static TCompressPlugin_pldef _pldefCompressPlugin=pldefCompressPlugin;
|
|
708
|
-
_pldefCompressPlugin.base.compress_level=(int)compressLevel;
|
|
709
|
-
*out_compressPlugin=&_pldefCompressPlugin.base.base; }}
|
|
515
|
+
*out_compressPlugin=&_pzlibCompressPlugin.base.base;
|
|
516
|
+
*out_decompressPlugin=&zlibDecompressPlugin; }
|
|
710
517
|
# endif // _IS_USED_MULTITHREAD
|
|
711
518
|
#endif
|
|
712
519
|
#ifdef _CompressPlugin_bz2
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
520
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"bzip2","bz2",
|
|
521
|
+
&compressLevel,1,9,9),"-c-bzip2-?");
|
|
522
|
+
if ((isMatchedType)&&((0==strcmp(isMatchedType,"bzip2"))||(0==strcmp(isMatchedType,"bz2")))){
|
|
523
|
+
static TCompressPlugin_bz2 _bz2CompressPlugin=bz2CompressPlugin;
|
|
524
|
+
_bz2CompressPlugin.compress_level=(int)compressLevel;
|
|
525
|
+
*out_compressPlugin=&_bz2CompressPlugin.base;
|
|
526
|
+
*out_decompressPlugin=&bz2DecompressPlugin; }
|
|
718
527
|
# if (_IS_USED_MULTITHREAD)
|
|
719
528
|
//pbzip2
|
|
720
|
-
|
|
721
|
-
|
|
529
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"pbzip2","pbz2",
|
|
530
|
+
&compressLevel,1,9,8),"-c-pbzip2-?");
|
|
531
|
+
if ((isMatchedType)&&((0==strcmp(isMatchedType,"pbzip2"))||(0==strcmp(isMatchedType,"pbz2")))){
|
|
722
532
|
static TCompressPlugin_pbz2 _pbz2CompressPlugin=pbz2CompressPlugin;
|
|
723
533
|
_pbz2CompressPlugin.base.compress_level=(int)compressLevel;
|
|
724
|
-
*out_compressPlugin=&_pbz2CompressPlugin.base.base;
|
|
534
|
+
*out_compressPlugin=&_pbz2CompressPlugin.base.base;
|
|
535
|
+
*out_decompressPlugin=&bz2DecompressPlugin; }
|
|
725
536
|
# endif // _IS_USED_MULTITHREAD
|
|
726
537
|
#endif
|
|
727
538
|
#ifdef _CompressPlugin_lzma
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
539
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lzma",0,
|
|
540
|
+
&compressLevel,0,9,7, &dictSize,1<<12,
|
|
541
|
+
(sizeof(size_t)<=4)?(1<<27):((size_t)3<<29),defaultDictSize),"-c-lzma-?");
|
|
542
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"lzma"))){
|
|
543
|
+
static TCompressPlugin_lzma _lzmaCompressPlugin=lzmaCompressPlugin;
|
|
544
|
+
_lzmaCompressPlugin.compress_level=(int)compressLevel;
|
|
545
|
+
_lzmaCompressPlugin.dict_size=(int)dictSize;
|
|
546
|
+
*out_compressPlugin=&_lzmaCompressPlugin.base;
|
|
547
|
+
*out_decompressPlugin=&lzmaDecompressPlugin; }
|
|
735
548
|
#endif
|
|
736
549
|
#ifdef _CompressPlugin_lzma2
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
550
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lzma2",0,
|
|
551
|
+
&compressLevel,0,9,7, &dictSize,1<<12,
|
|
552
|
+
(sizeof(size_t)<=4)?(1<<27):((size_t)3<<29),defaultDictSize),"-c-lzma2-?");
|
|
553
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"lzma2"))){
|
|
554
|
+
static TCompressPlugin_lzma2 _lzma2CompressPlugin=lzma2CompressPlugin;
|
|
555
|
+
_lzma2CompressPlugin.compress_level=(int)compressLevel;
|
|
556
|
+
_lzma2CompressPlugin.dict_size=(int)dictSize;
|
|
557
|
+
*out_compressPlugin=&_lzma2CompressPlugin.base;
|
|
558
|
+
*out_decompressPlugin=&lzma2DecompressPlugin; }
|
|
744
559
|
#endif
|
|
745
560
|
#ifdef _CompressPlugin_lz4
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
561
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lz4",0,
|
|
562
|
+
&compressLevel,1,50,50),"-c-lz4-?");
|
|
563
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"lz4"))){
|
|
564
|
+
static TCompressPlugin_lz4 _lz4CompressPlugin=lz4CompressPlugin;
|
|
565
|
+
_lz4CompressPlugin.compress_level=(int)compressLevel;
|
|
566
|
+
*out_compressPlugin=&_lz4CompressPlugin.base;
|
|
567
|
+
*out_decompressPlugin=&lz4DecompressPlugin; }
|
|
751
568
|
#endif
|
|
752
569
|
#ifdef _CompressPlugin_lz4hc
|
|
753
|
-
|
|
754
|
-
|
|
570
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lz4hc",0,
|
|
571
|
+
&compressLevel,3,12,11),"-c-lz4hc-?");
|
|
572
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"lz4hc"))){
|
|
755
573
|
static TCompressPlugin_lz4hc _lz4hcCompressPlugin=lz4hcCompressPlugin;
|
|
756
574
|
_lz4hcCompressPlugin.compress_level=(int)compressLevel;
|
|
757
|
-
*out_compressPlugin=&_lz4hcCompressPlugin.base;
|
|
575
|
+
*out_compressPlugin=&_lz4hcCompressPlugin.base;
|
|
576
|
+
*out_decompressPlugin=&lz4DecompressPlugin; }
|
|
758
577
|
#endif
|
|
759
578
|
#ifdef _CompressPlugin_zstd
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
579
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"zstd",0,
|
|
580
|
+
&compressLevel,0,22,20, &dictBits,10,
|
|
581
|
+
(sizeof(size_t)<=4)?30:31,defaultDictBits),"-c-zstd-?");
|
|
582
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"zstd"))){
|
|
583
|
+
static TCompressPlugin_zstd _zstdCompressPlugin=zstdCompressPlugin;
|
|
584
|
+
_zstdCompressPlugin.compress_level=(int)compressLevel;
|
|
585
|
+
_zstdCompressPlugin.dict_bits = (int)dictBits;
|
|
586
|
+
*out_compressPlugin=&_zstdCompressPlugin.base;
|
|
587
|
+
*out_decompressPlugin=&zstdDecompressPlugin; }
|
|
767
588
|
#endif
|
|
768
589
|
#ifdef _CompressPlugin_brotli
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
590
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"brotli",0,
|
|
591
|
+
&compressLevel,0,11,9, &dictBits,10,
|
|
592
|
+
30,defaultDictBits),"-c-brotli-?");
|
|
593
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"brotli"))){
|
|
594
|
+
static TCompressPlugin_brotli _brotliCompressPlugin=brotliCompressPlugin;
|
|
595
|
+
_brotliCompressPlugin.compress_level=(int)compressLevel;
|
|
596
|
+
_brotliCompressPlugin.dict_bits = (int)dictBits;
|
|
597
|
+
*out_compressPlugin=&_brotliCompressPlugin.base;
|
|
598
|
+
*out_decompressPlugin=&brotliDecompressPlugin; }
|
|
776
599
|
#endif
|
|
777
600
|
#ifdef _CompressPlugin_lzham
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
&dictSize,1,tuz_kMaxOfDictSize,defaultDictSize),"-c-tuz-?"){
|
|
790
|
-
static TCompressPlugin_tuz _tuzCompressPlugin=tuzCompressPlugin;
|
|
791
|
-
_tuzCompressPlugin.props.dictSize=(tuz_size_t)dictSize;
|
|
792
|
-
*out_compressPlugin=&_tuzCompressPlugin.base; }}
|
|
793
|
-
#endif
|
|
794
|
-
|
|
795
|
-
_options_check((*out_compressPlugin!=0),"-c-?");
|
|
601
|
+
_options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lzham",0,
|
|
602
|
+
&compressLevel,0,5,4, &dictBits,15,
|
|
603
|
+
(sizeof(size_t)<=4)?26:29,defaultDictBits),"-c-lzham-?");
|
|
604
|
+
if ((isMatchedType)&&(0==strcmp(isMatchedType,"lzham"))){
|
|
605
|
+
static TCompressPlugin_lzham _lzhamCompressPlugin=lzhamCompressPlugin;
|
|
606
|
+
_lzhamCompressPlugin.compress_level=(int)compressLevel;
|
|
607
|
+
_lzhamCompressPlugin.dict_bits = (int)dictBits;
|
|
608
|
+
*out_compressPlugin=&_lzhamCompressPlugin.base;
|
|
609
|
+
*out_decompressPlugin=&lzhamDecompressPlugin; }
|
|
610
|
+
#endif
|
|
611
|
+
_options_check((*out_compressPlugin!=0)&&(*out_decompressPlugin!=0),"-c-?");
|
|
796
612
|
return HDIFF_SUCCESS;
|
|
797
613
|
}
|
|
798
614
|
|
|
799
615
|
#define _return_check(value,exitCode,errorInfo){ \
|
|
800
|
-
if (!(value)) {
|
|
616
|
+
if (!(value)) { fprintf(stderr,errorInfo " ERROR!\n"); return exitCode; } }
|
|
801
617
|
|
|
802
618
|
#define _kNULL_VALUE ((hpatch_BOOL)(-1))
|
|
803
619
|
#define _kNULL_SIZE (~(size_t)0)
|
|
804
620
|
|
|
805
|
-
#define _THREAD_NUMBER_NULL
|
|
621
|
+
#define _THREAD_NUMBER_NULL 0
|
|
622
|
+
#define _THREAD_NUMBER_MIN 1
|
|
806
623
|
#define _THREAD_NUMBER_DEFUALT kDefaultCompressThreadNumber
|
|
807
624
|
#define _THREAD_NUMBER_MAX (1<<8)
|
|
808
625
|
|
|
809
626
|
int hdiff_cmd_line(int argc, const char * argv[]){
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
diffSets.isBsDiff = _kNULL_VALUE;
|
|
814
|
-
#endif
|
|
815
|
-
#if (_IS_NEED_VCDIFF)
|
|
816
|
-
diffSets.isVcDiff = _kNULL_VALUE;
|
|
817
|
-
#endif
|
|
818
|
-
diffSets.isDoDiff =_kNULL_VALUE;
|
|
819
|
-
diffSets.isDoPatchCheck=_kNULL_VALUE;
|
|
820
|
-
diffSets.isDiffInMem =_kNULL_VALUE;
|
|
821
|
-
diffSets.isSingleCompressedDiff =_kNULL_VALUE;
|
|
822
|
-
diffSets.isUseBigCacheMatch =_kNULL_VALUE;
|
|
823
|
-
diffSets.isCheckNotEqual =_kNULL_VALUE;
|
|
824
|
-
diffSets.matchBlockSize=_kNULL_SIZE;
|
|
825
|
-
diffSets.threadNum=_THREAD_NUMBER_NULL;
|
|
826
|
-
diffSets.threadNumSearch_s=_THREAD_NUMBER_NULL;
|
|
827
|
-
hpatch_BOOL isPrintFileInfo=_kNULL_VALUE;
|
|
627
|
+
hpatch_BOOL isLoadAll=_kNULL_VALUE;
|
|
628
|
+
hpatch_BOOL isPatchCheck=_kNULL_VALUE;
|
|
629
|
+
hpatch_BOOL isDiff=_kNULL_VALUE;
|
|
828
630
|
hpatch_BOOL isForceOverwrite=_kNULL_VALUE;
|
|
829
631
|
hpatch_BOOL isOutputHelp=_kNULL_VALUE;
|
|
830
632
|
hpatch_BOOL isOutputVersion=_kNULL_VALUE;
|
|
831
633
|
hpatch_BOOL isOldPathInputEmpty=_kNULL_VALUE;
|
|
634
|
+
size_t matchValue=0;
|
|
635
|
+
size_t threadNum = _THREAD_NUMBER_NULL;
|
|
832
636
|
hdiff_TCompress* compressPlugin=0;
|
|
637
|
+
hpatch_TDecompress* decompressPlugin=0;
|
|
638
|
+
hpatch_BOOL isSingleStreamDiff=_kNULL_VALUE;
|
|
639
|
+
size_t singleStreamStepSize=_kNULL_SIZE;
|
|
833
640
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
834
641
|
hpatch_BOOL isForceRunDirDiff=_kNULL_VALUE;
|
|
835
|
-
size_t kMaxOpenFileNumber=_kNULL_SIZE; //only used in dir diff
|
|
642
|
+
size_t kMaxOpenFileNumber=_kNULL_SIZE; //only used in stream dir diff
|
|
836
643
|
hpatch_BOOL isSetChecksum=_kNULL_VALUE;
|
|
837
644
|
hpatch_TChecksum* checksumPlugin=0;
|
|
838
645
|
std::string manifestOut;
|
|
@@ -843,10 +650,6 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
843
650
|
std::vector<std::string> ignoreNewPathList;
|
|
844
651
|
#endif
|
|
845
652
|
std::vector<const char *> arg_values;
|
|
846
|
-
if (argc<=1){
|
|
847
|
-
printUsage();
|
|
848
|
-
return HDIFF_OPTIONS_ERROR;
|
|
849
|
-
}
|
|
850
653
|
for (int i=1; i<argc; ++i) {
|
|
851
654
|
const char* op=argv[i];
|
|
852
655
|
_options_check(op!=0,"?");
|
|
@@ -866,84 +669,42 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
866
669
|
}
|
|
867
670
|
switch (op[1]) {
|
|
868
671
|
case 'm':{ //diff in memory
|
|
869
|
-
_options_check((
|
|
870
|
-
|
|
672
|
+
_options_check((isLoadAll==_kNULL_VALUE)&&((op[2]=='-')||(op[2]=='\0')),"-m");
|
|
673
|
+
isLoadAll=hpatch_TRUE;
|
|
871
674
|
if (op[2]=='-'){
|
|
872
675
|
const char* pnum=op+3;
|
|
873
|
-
_options_check(kmg_to_size(pnum,strlen(pnum),&
|
|
874
|
-
_options_check((0<=(int)
|
|
676
|
+
_options_check(kmg_to_size(pnum,strlen(pnum),&matchValue),"-m-?");
|
|
677
|
+
_options_check((0<=(int)matchValue)&&(matchValue==(size_t)(int)matchValue),"-m-?");
|
|
875
678
|
}else{
|
|
876
|
-
|
|
679
|
+
matchValue=kMinSingleMatchScore_default;
|
|
877
680
|
}
|
|
878
681
|
} break;
|
|
879
682
|
case 's':{
|
|
880
|
-
|
|
881
|
-
_options_check((
|
|
882
|
-
|
|
683
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
684
|
+
_options_check((isSingleStreamDiff!=hpatch_TRUE),"-SD");
|
|
685
|
+
#endif
|
|
686
|
+
isLoadAll=hpatch_FALSE; //diff by stream
|
|
883
687
|
if (op[2]=='-'){
|
|
884
688
|
const char* pnum=op+3;
|
|
885
|
-
_options_check(kmg_to_size(pnum,strlen(pnum),&
|
|
886
|
-
_options_check((kMatchBlockSize_min<=diffSets.matchBlockSize)
|
|
887
|
-
&&(diffSets.matchBlockSize!=_kNULL_SIZE),"-s-?");
|
|
689
|
+
_options_check(kmg_to_size(pnum,strlen(pnum),&matchValue),"-s-?");
|
|
888
690
|
}else{
|
|
889
|
-
|
|
691
|
+
matchValue=kMatchBlockSize_default;
|
|
890
692
|
}
|
|
891
693
|
} break;
|
|
694
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
892
695
|
case 'S':{
|
|
893
|
-
_options_check((
|
|
696
|
+
_options_check((isSingleStreamDiff==_kNULL_VALUE)&&(isLoadAll!=hpatch_FALSE)
|
|
894
697
|
&&(op[2]=='D')&&((op[3]=='\0')||(op[3]=='-')),"-SD");
|
|
895
|
-
|
|
698
|
+
isSingleStreamDiff=hpatch_TRUE;
|
|
896
699
|
if (op[3]=='-'){
|
|
897
700
|
const char* pnum=op+4;
|
|
898
|
-
_options_check(kmg_to_size(pnum,strlen(pnum),&
|
|
899
|
-
_options_check((
|
|
701
|
+
_options_check(kmg_to_size(pnum,strlen(pnum),&singleStreamStepSize),"-SD-?");
|
|
702
|
+
_options_check((singleStreamStepSize>=hpatch_kStreamCacheSize),"-SD-?");
|
|
900
703
|
}else{
|
|
901
|
-
|
|
704
|
+
singleStreamStepSize=kDefaultStepMemSize;
|
|
902
705
|
}
|
|
903
706
|
} break;
|
|
904
|
-
#if (_IS_NEED_BSDIFF)
|
|
905
|
-
case 'B':{
|
|
906
|
-
_options_check((diffSets.isBsDiff==_kNULL_VALUE)
|
|
907
|
-
&&(op[2]=='S')&&(op[3]=='D')&&(op[4]=='\0'),"-BSD");
|
|
908
|
-
diffSets.isBsDiff=hpatch_TRUE;
|
|
909
|
-
} break;
|
|
910
707
|
#endif
|
|
911
|
-
#if (_IS_NEED_VCDIFF)
|
|
912
|
-
# ifdef _CompressPlugin_7zXZ
|
|
913
|
-
case 'V':{
|
|
914
|
-
_options_check((diffSets.isVcDiff==_kNULL_VALUE)&&(op[2]=='C')&&(op[3]=='D')
|
|
915
|
-
&&((op[4]=='\0')||(op[4]=='-')),"-VCD");
|
|
916
|
-
_options_check((compressPlugin==0),"-VCD compress support 7zXZ, unsupport -c-*");
|
|
917
|
-
if (op[4]=='-'){
|
|
918
|
-
size_t compressLevel;
|
|
919
|
-
size_t dictSize;
|
|
920
|
-
const char* isMatchedType=0;
|
|
921
|
-
_options_check(_tryGetCompressSet(&isMatchedType,op+1,op+4,"VCD",0,
|
|
922
|
-
&compressLevel,0,9,7, &dictSize,1<<12,
|
|
923
|
-
vcdiff_kMaxTargetWindowsSize,(1<<20)*8),"-VCD-?");
|
|
924
|
-
|
|
925
|
-
_init_CompressPlugin_7zXZ();
|
|
926
|
-
static TCompressPlugin_7zXZ xzCompressPlugin=_7zXZCompressPlugin;
|
|
927
|
-
xzCompressPlugin.compress_level=(int)compressLevel;
|
|
928
|
-
xzCompressPlugin.dict_size=(UInt32)dictSize;
|
|
929
|
-
compressPlugin=&xzCompressPlugin.base;
|
|
930
|
-
}
|
|
931
|
-
diffSets.isVcDiff=hpatch_TRUE;
|
|
932
|
-
} break;
|
|
933
|
-
# else
|
|
934
|
-
case 'V':{
|
|
935
|
-
_options_check((diffSets.isVcDiff==_kNULL_VALUE)&&(op[2]=='C')&&(op[3]=='D')
|
|
936
|
-
&&(op[4]=='\0'),"-VCD");
|
|
937
|
-
_options_check((compressPlugin==0),"-VCD unsupport -c-*");
|
|
938
|
-
diffSets.isVcDiff=hpatch_TRUE;
|
|
939
|
-
} break;
|
|
940
|
-
# endif
|
|
941
|
-
#endif
|
|
942
|
-
case 'i':{
|
|
943
|
-
_options_check((isPrintFileInfo==_kNULL_VALUE)&&(op[2]=='n')&&(op[3]=='f')
|
|
944
|
-
&&(op[4]=='o')&&(op[5]=='\0'),"-info");
|
|
945
|
-
isPrintFileInfo=hpatch_TRUE;
|
|
946
|
-
} break;
|
|
947
708
|
case '?':
|
|
948
709
|
case 'h':{
|
|
949
710
|
_options_check((isOutputHelp==_kNULL_VALUE)&&(op[2]=='\0'),"-h");
|
|
@@ -954,63 +715,32 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
954
715
|
isOutputVersion=hpatch_TRUE;
|
|
955
716
|
} break;
|
|
956
717
|
case 't':{
|
|
957
|
-
_options_check((
|
|
958
|
-
|
|
959
|
-
diffSets.isDoPatchCheck=hpatch_TRUE; //only test diffFile
|
|
960
|
-
} break;
|
|
961
|
-
case 'd':{
|
|
962
|
-
_options_check((diffSets.isDoDiff==_kNULL_VALUE)&&(diffSets.isDoPatchCheck==_kNULL_VALUE)&&(op[2]=='\0'),"-t -d?");
|
|
963
|
-
diffSets.isDoDiff=hpatch_TRUE; //only diff
|
|
964
|
-
diffSets.isDoPatchCheck=hpatch_FALSE;
|
|
718
|
+
_options_check((isPatchCheck==_kNULL_VALUE)&&(op[2]=='\0'),"-t");
|
|
719
|
+
isPatchCheck=hpatch_TRUE; //test diffFile
|
|
965
720
|
} break;
|
|
966
721
|
case 'f':{
|
|
967
722
|
_options_check((isForceOverwrite==_kNULL_VALUE)&&(op[2]=='\0'),"-f");
|
|
968
723
|
isForceOverwrite=hpatch_TRUE;
|
|
969
724
|
} break;
|
|
725
|
+
case 'd':{
|
|
726
|
+
_options_check((isDiff==_kNULL_VALUE)&&(op[2]=='\0'),"-d");
|
|
727
|
+
isDiff=hpatch_TRUE; //diff only
|
|
728
|
+
} break;
|
|
970
729
|
#if (_IS_USED_MULTITHREAD)
|
|
971
730
|
case 'p':{
|
|
972
|
-
_options_check((op[2]=='-'),"-p
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
const char* pnum=op+10;
|
|
977
|
-
_options_check(a_to_size(pnum,strlen(pnum),&diffSets.threadNumSearch_s),"-p-search-?");
|
|
978
|
-
}else{
|
|
979
|
-
_options_check(diffSets.threadNum==_THREAD_NUMBER_NULL,"-p-?");
|
|
980
|
-
const char* pnum=op+3;
|
|
981
|
-
_options_check(a_to_size(pnum,strlen(pnum),&diffSets.threadNum),"-p-?");
|
|
982
|
-
}
|
|
731
|
+
_options_check((threadNum==_THREAD_NUMBER_NULL)&&(op[2]=='-'),"-p-?");
|
|
732
|
+
const char* pnum=op+3;
|
|
733
|
+
_options_check(a_to_size(pnum,strlen(pnum),&threadNum),"-p-?");
|
|
734
|
+
_options_check(threadNum>=_THREAD_NUMBER_MIN,"-p-?");
|
|
983
735
|
} break;
|
|
984
736
|
#endif
|
|
985
|
-
case 'b':{
|
|
986
|
-
_options_check((diffSets.matchBlockSize==_kNULL_SIZE)&&
|
|
987
|
-
(op[2]=='l')&&(op[3]=='o')&&(op[4]=='c')&&(op[5]=='k')&&
|
|
988
|
-
((op[6]=='\0')||(op[6]=='-')),"-block?");
|
|
989
|
-
if (op[6]=='-'){
|
|
990
|
-
const char* pnum=op+7;
|
|
991
|
-
_options_check(kmg_to_size(pnum,strlen(pnum),&diffSets.matchBlockSize),"-block-?");
|
|
992
|
-
if (diffSets.matchBlockSize!=0)
|
|
993
|
-
_options_check((kMatchBlockSize_min<=diffSets.matchBlockSize)
|
|
994
|
-
&&(diffSets.matchBlockSize!=_kNULL_SIZE),"-block-?");
|
|
995
|
-
}else{
|
|
996
|
-
diffSets.matchBlockSize=kDefaultFastMatchBlockSize;
|
|
997
|
-
}
|
|
998
|
-
} break;
|
|
999
737
|
case 'c':{
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
return result;
|
|
1007
|
-
}else if (op[2]=='a'){
|
|
1008
|
-
_options_check((diffSets.isUseBigCacheMatch==_kNULL_VALUE)&&
|
|
1009
|
-
(op[3]=='c')&&(op[4]=='h')&&(op[5]=='e')&&(op[6]=='\0'),"-cache?");
|
|
1010
|
-
diffSets.isUseBigCacheMatch=hpatch_TRUE; //use big cache for match
|
|
1011
|
-
}else{
|
|
1012
|
-
_options_check(false,"-c?");
|
|
1013
|
-
}
|
|
738
|
+
_options_check((compressPlugin==0)&&(op[2]=='-'),"-c");
|
|
739
|
+
const char* ptype=op+3;
|
|
740
|
+
const char* ptypeEnd=findUntilEnd(ptype,'-');
|
|
741
|
+
int result=_checkSetCompress(&compressPlugin,&decompressPlugin,ptype,ptypeEnd);
|
|
742
|
+
if (HDIFF_SUCCESS!=result)
|
|
743
|
+
return result;
|
|
1014
744
|
} break;
|
|
1015
745
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1016
746
|
case 'C':{
|
|
@@ -1019,6 +749,11 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1019
749
|
isSetChecksum=hpatch_TRUE;
|
|
1020
750
|
_options_check(_getOptChecksum(&checksumPlugin,ptype,"no"),"-C-?");
|
|
1021
751
|
} break;
|
|
752
|
+
case 'n':{
|
|
753
|
+
_options_check((kMaxOpenFileNumber==_kNULL_SIZE)&&(op[2]=='-'),"-n-?")
|
|
754
|
+
const char* pnum=op+3;
|
|
755
|
+
_options_check(kmg_to_size(pnum,strlen(pnum),&kMaxOpenFileNumber),"-n-?");
|
|
756
|
+
} break;
|
|
1022
757
|
case 'g':{
|
|
1023
758
|
if (op[2]=='#'){ //-g#
|
|
1024
759
|
const char* plist=op+3;
|
|
@@ -1061,35 +796,18 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1061
796
|
isForceRunDirDiff=hpatch_TRUE; //force run DirDiff
|
|
1062
797
|
} break;
|
|
1063
798
|
#endif
|
|
1064
|
-
case 'n':{
|
|
1065
|
-
_options_check((op[2]!='\0'), "-n?");
|
|
1066
|
-
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1067
|
-
if (op[2]=='-'){
|
|
1068
|
-
_options_check((kMaxOpenFileNumber == _kNULL_SIZE), "-n-")
|
|
1069
|
-
const char* pnum = op + 3;
|
|
1070
|
-
_options_check(kmg_to_size(pnum, strlen(pnum), &kMaxOpenFileNumber), "-n-?");
|
|
1071
|
-
_options_check((kMaxOpenFileNumber != _kNULL_SIZE), "-n-?");
|
|
1072
|
-
}else
|
|
1073
|
-
#endif
|
|
1074
|
-
{
|
|
1075
|
-
_options_check((diffSets.isCheckNotEqual==_kNULL_VALUE)&&(op[2]=='e')&&(op[3]=='q')&&(op[4]=='\0'),"-neq");
|
|
1076
|
-
diffSets.isCheckNotEqual=hpatch_TRUE;
|
|
1077
|
-
}
|
|
1078
|
-
} break;
|
|
1079
799
|
default: {
|
|
1080
800
|
_options_check(hpatch_FALSE,"-?");
|
|
1081
801
|
} break;
|
|
1082
802
|
}//switch
|
|
1083
803
|
}
|
|
1084
|
-
|
|
804
|
+
|
|
1085
805
|
if (isOutputHelp==_kNULL_VALUE)
|
|
1086
806
|
isOutputHelp=hpatch_FALSE;
|
|
1087
807
|
if (isOutputVersion==_kNULL_VALUE)
|
|
1088
808
|
isOutputVersion=hpatch_FALSE;
|
|
1089
809
|
if (isForceOverwrite==_kNULL_VALUE)
|
|
1090
810
|
isForceOverwrite=hpatch_FALSE;
|
|
1091
|
-
if (isPrintFileInfo==_kNULL_VALUE)
|
|
1092
|
-
isPrintFileInfo=hpatch_FALSE;
|
|
1093
811
|
if (isOutputHelp||isOutputVersion){
|
|
1094
812
|
if (isOutputHelp)
|
|
1095
813
|
printUsage();//with version
|
|
@@ -1098,83 +816,51 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1098
816
|
if (arg_values.empty())
|
|
1099
817
|
return 0; //ok
|
|
1100
818
|
}
|
|
1101
|
-
if (
|
|
1102
|
-
|
|
1103
|
-
}
|
|
1104
|
-
if (diffSets.isCheckNotEqual==_kNULL_VALUE)
|
|
1105
|
-
diffSets.isCheckNotEqual=hpatch_FALSE;
|
|
1106
|
-
if (diffSets.isSingleCompressedDiff==_kNULL_VALUE)
|
|
1107
|
-
diffSets.isSingleCompressedDiff=hpatch_FALSE;
|
|
1108
|
-
#if (_IS_NEED_BSDIFF)
|
|
1109
|
-
if (diffSets.isBsDiff==_kNULL_VALUE)
|
|
1110
|
-
diffSets.isBsDiff=hpatch_FALSE;
|
|
1111
|
-
if (diffSets.isBsDiff){
|
|
1112
|
-
if (compressPlugin!=0){
|
|
1113
|
-
_options_check(0==strcmp(compressPlugin->compressType(),"bz2"),"bsdiff must run with -c-bz2");
|
|
1114
|
-
}else{
|
|
1115
|
-
static TCompressPlugin_bz2 _bz2CompressPlugin=bz2CompressPlugin;
|
|
1116
|
-
compressPlugin=&_bz2CompressPlugin.base;
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
#endif
|
|
1120
|
-
#if (_IS_NEED_VCDIFF)
|
|
1121
|
-
if (diffSets.isVcDiff==_kNULL_VALUE)
|
|
1122
|
-
diffSets.isVcDiff=hpatch_FALSE;
|
|
1123
|
-
if (diffSets.isVcDiff){
|
|
1124
|
-
_options_check(!diffSets.isSingleCompressedDiff,"-SD -VCD can only set one");
|
|
1125
|
-
#if (_IS_NEED_BSDIFF)
|
|
1126
|
-
_options_check(!diffSets.isBsDiff,"-BSD -VCD can only set one");
|
|
1127
|
-
#endif
|
|
1128
|
-
}
|
|
1129
|
-
#endif
|
|
819
|
+
if (isSingleStreamDiff==_kNULL_VALUE)
|
|
820
|
+
isSingleStreamDiff=hpatch_FALSE;
|
|
1130
821
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1131
|
-
if (isSetChecksum==_kNULL_VALUE)
|
|
1132
|
-
isSetChecksum=hpatch_FALSE;
|
|
1133
822
|
if (kMaxOpenFileNumber==_kNULL_SIZE)
|
|
1134
823
|
kMaxOpenFileNumber=kMaxOpenFileNumber_default_diff;
|
|
1135
824
|
if (kMaxOpenFileNumber<kMaxOpenFileNumber_default_min)
|
|
1136
825
|
kMaxOpenFileNumber=kMaxOpenFileNumber_default_min;
|
|
1137
826
|
#endif
|
|
1138
|
-
if (
|
|
1139
|
-
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1142
|
-
else if (diffSets.threadNum>_THREAD_NUMBER_MAX)
|
|
1143
|
-
diffSets.threadNum=_THREAD_NUMBER_MAX;
|
|
1144
|
-
else if (diffSets.threadNum<1)
|
|
1145
|
-
diffSets.threadNum=1;
|
|
1146
|
-
if (diffSets.threadNumSearch_s==_THREAD_NUMBER_NULL)
|
|
1147
|
-
diffSets.threadNumSearch_s=diffSets.threadNum;
|
|
1148
|
-
else if (diffSets.threadNumSearch_s>_THREAD_NUMBER_MAX)
|
|
1149
|
-
diffSets.threadNumSearch_s=_THREAD_NUMBER_MAX;
|
|
1150
|
-
else if (diffSets.threadNumSearch_s<1)
|
|
1151
|
-
diffSets.threadNumSearch_s=1;
|
|
827
|
+
if (threadNum==_THREAD_NUMBER_NULL)
|
|
828
|
+
threadNum=_THREAD_NUMBER_DEFUALT;
|
|
829
|
+
else if (threadNum>_THREAD_NUMBER_MAX)
|
|
830
|
+
threadNum=_THREAD_NUMBER_MAX;
|
|
1152
831
|
if (compressPlugin!=0){
|
|
1153
|
-
compressPlugin->setParallelThreadNumber(compressPlugin,(int)
|
|
832
|
+
compressPlugin->setParallelThreadNumber(compressPlugin,(int)threadNum);
|
|
1154
833
|
}
|
|
1155
834
|
|
|
1156
835
|
if (isOldPathInputEmpty==_kNULL_VALUE)
|
|
1157
836
|
isOldPathInputEmpty=hpatch_FALSE;
|
|
1158
837
|
_options_check((arg_values.size()==1)||(arg_values.size()==2)||(arg_values.size()==3),"input count");
|
|
1159
838
|
if (arg_values.size()==3){ //diff
|
|
1160
|
-
if (
|
|
1161
|
-
|
|
1162
|
-
|
|
839
|
+
if (isLoadAll==_kNULL_VALUE){
|
|
840
|
+
isLoadAll=hpatch_TRUE;
|
|
841
|
+
matchValue=kMinSingleMatchScore_default;
|
|
1163
842
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1166
|
-
if (
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
843
|
+
if ((isDiff==hpatch_TRUE)&&(isPatchCheck==_kNULL_VALUE))
|
|
844
|
+
isPatchCheck=hpatch_FALSE;
|
|
845
|
+
if ((isDiff==_kNULL_VALUE)&&(isPatchCheck==hpatch_TRUE))
|
|
846
|
+
isDiff=hpatch_FALSE;
|
|
847
|
+
if (isDiff==_kNULL_VALUE)
|
|
848
|
+
isDiff=hpatch_TRUE;
|
|
849
|
+
if (isPatchCheck==_kNULL_VALUE){
|
|
850
|
+
#if (defined(_IS_NEED_PATCH_CHECK) && (_IS_NEED_PATCH_CHECK==0))
|
|
851
|
+
isPatchCheck=hpatch_FALSE;
|
|
852
|
+
#else
|
|
853
|
+
isPatchCheck=hpatch_TRUE;
|
|
854
|
+
#endif
|
|
1173
855
|
}
|
|
856
|
+
assert(isPatchCheck||isDiff);
|
|
1174
857
|
|
|
1175
858
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1176
859
|
if (isForceRunDirDiff==_kNULL_VALUE)
|
|
1177
860
|
isForceRunDirDiff=hpatch_FALSE;
|
|
861
|
+
if (isSetChecksum==_kNULL_VALUE)
|
|
862
|
+
isSetChecksum=hpatch_FALSE;
|
|
863
|
+
|
|
1178
864
|
if ((!manifestOld.empty())||(!manifestNew.empty())){
|
|
1179
865
|
isForceRunDirDiff=hpatch_TRUE;
|
|
1180
866
|
_options_check(manifestOut.empty()&&(!manifestNew.empty()),"-M?");
|
|
@@ -1200,16 +886,15 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1200
886
|
hpatch_TPathType outDiffFileType;
|
|
1201
887
|
_return_check(hpatch_getPathStat(outDiffFileName,&outDiffFileType,0),
|
|
1202
888
|
HDIFF_PATHTYPE_ERROR,"get outDiffFile type");
|
|
1203
|
-
_return_check((outDiffFileType==kPathType_notExist)||(!
|
|
889
|
+
_return_check((outDiffFileType==kPathType_notExist)||(!isDiff),
|
|
1204
890
|
HDIFF_PATHTYPE_ERROR,"diff outDiffFile already exists, overwrite");
|
|
1205
891
|
}
|
|
1206
892
|
hpatch_TPathType oldType;
|
|
1207
893
|
hpatch_TPathType newType;
|
|
1208
894
|
if (isOldPathInputEmpty){
|
|
1209
895
|
oldType=kPathType_file; //as empty file
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
diffSets.isUseBigCacheMatch=hpatch_FALSE;
|
|
896
|
+
isLoadAll=hpatch_FALSE; //not need -m, set as -s
|
|
897
|
+
matchValue=hpatch_kStreamCacheSize; //not used
|
|
1213
898
|
}else{
|
|
1214
899
|
_return_check(hpatch_getPathStat(oldPath,&oldType,0),HDIFF_PATHTYPE_ERROR,"get oldPath type");
|
|
1215
900
|
_return_check((oldType!=kPathType_notExist),HDIFF_PATHTYPE_ERROR,"oldPath not exist");
|
|
@@ -1218,19 +903,18 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1218
903
|
_return_check((newType!=kPathType_notExist),HDIFF_PATHTYPE_ERROR,"newPath not exist");
|
|
1219
904
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1220
905
|
hpatch_BOOL isUseDirDiff=isForceRunDirDiff||(kPathType_dir==oldType)||(kPathType_dir==newType);
|
|
1221
|
-
if (!diffSets.isDoDiff){
|
|
1222
|
-
TDirDiffInfo dirinfo;
|
|
1223
|
-
_return_check(getDirDiffInfoByFile(&dirinfo,outDiffFileName,0,0),DIRDIFF_PATCH_ERROR,"get dir diff info");
|
|
1224
|
-
isUseDirDiff=dirinfo.isDirDiff;
|
|
1225
|
-
}
|
|
1226
906
|
if (isUseDirDiff){
|
|
1227
907
|
#ifdef _ChecksumPlugin_fadler64
|
|
1228
|
-
if (isSetChecksum==hpatch_FALSE)
|
|
908
|
+
if (isSetChecksum==hpatch_FALSE){
|
|
1229
909
|
checksumPlugin=&fadler64ChecksumPlugin; //DEFAULT
|
|
910
|
+
isSetChecksum=hpatch_TRUE;
|
|
911
|
+
}
|
|
1230
912
|
#else
|
|
1231
913
|
# ifdef _ChecksumPlugin_crc32
|
|
1232
|
-
if (isSetChecksum==hpatch_FALSE)
|
|
914
|
+
if (isSetChecksum==hpatch_FALSE){
|
|
1233
915
|
checksumPlugin=&crc32ChecksumPlugin; //DEFAULT
|
|
916
|
+
isSetChecksum=hpatch_TRUE;
|
|
917
|
+
}
|
|
1234
918
|
# endif
|
|
1235
919
|
#endif
|
|
1236
920
|
}else
|
|
@@ -1239,41 +923,37 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1239
923
|
}
|
|
1240
924
|
#endif //_IS_NEED_DIR_DIFF_PATCH
|
|
1241
925
|
|
|
1242
|
-
if (!diffSets.isDoDiff)
|
|
1243
|
-
diffSets.isDiffInMem=hpatch_FALSE; //all check diffFile (-t) run with stream;
|
|
1244
|
-
|
|
1245
926
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1246
927
|
if (isUseDirDiff){
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
#if (_IS_NEED_VCDIFF)
|
|
1251
|
-
_options_check(!diffSets.isVcDiff,"VCDIFF unsupport dir diff");
|
|
1252
|
-
#endif
|
|
1253
|
-
return hdiff_dir(oldPath,newPath,outDiffFileName,compressPlugin,
|
|
1254
|
-
checksumPlugin,(kPathType_dir==oldType),(kPathType_dir==newType),
|
|
1255
|
-
diffSets,kMaxOpenFileNumber,
|
|
928
|
+
return hdiff_dir(oldPath,newPath,outDiffFileName, (kPathType_dir==oldType),
|
|
929
|
+
(kPathType_dir==newType), isDiff,isLoadAll,matchValue,isPatchCheck,
|
|
930
|
+
compressPlugin,decompressPlugin,checksumPlugin,kMaxOpenFileNumber,
|
|
1256
931
|
ignorePathList,ignoreOldPathList,ignoreNewPathList,
|
|
1257
932
|
manifestOld,manifestNew);
|
|
1258
933
|
}else
|
|
1259
934
|
#endif
|
|
1260
935
|
{
|
|
1261
|
-
return hdiff(oldPath,newPath,outDiffFileName,
|
|
1262
|
-
compressPlugin,
|
|
936
|
+
return hdiff(oldPath,newPath,outDiffFileName,isDiff,isLoadAll,matchValue,isPatchCheck,
|
|
937
|
+
compressPlugin,decompressPlugin,isSingleStreamDiff,singleStreamStepSize);
|
|
1263
938
|
}
|
|
1264
939
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1265
940
|
}else if (!manifestOut.empty()){ //() //create manifest
|
|
1266
941
|
_options_check(arg_values.size()==1,"create manifest file used one inputPath");
|
|
1267
942
|
_options_check(ignoreOldPathList.empty(),"-g-old unsupport run with create manifest file mode");
|
|
1268
943
|
_options_check(ignoreNewPathList.empty(),"-g-new unsupport run with create manifest file mode");
|
|
1269
|
-
|
|
944
|
+
if (isSetChecksum==_kNULL_VALUE)
|
|
945
|
+
isSetChecksum=hpatch_FALSE;
|
|
1270
946
|
#ifdef _ChecksumPlugin_fadler64
|
|
1271
|
-
if (isSetChecksum==hpatch_FALSE)
|
|
947
|
+
if (isSetChecksum==hpatch_FALSE){
|
|
1272
948
|
checksumPlugin=&fadler64ChecksumPlugin; //DEFAULT
|
|
949
|
+
isSetChecksum=hpatch_TRUE;
|
|
950
|
+
}
|
|
1273
951
|
#else
|
|
1274
952
|
# ifdef _ChecksumPlugin_crc32
|
|
1275
|
-
if (isSetChecksum==hpatch_FALSE)
|
|
953
|
+
if (isSetChecksum==hpatch_FALSE){
|
|
1276
954
|
checksumPlugin=&crc32ChecksumPlugin; //DEFAULT
|
|
955
|
+
isSetChecksum=hpatch_TRUE;
|
|
956
|
+
}
|
|
1277
957
|
# endif
|
|
1278
958
|
#endif
|
|
1279
959
|
|
|
@@ -1290,15 +970,10 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1290
970
|
#endif
|
|
1291
971
|
}else{// (arg_values.size()==2) //resave
|
|
1292
972
|
_options_check(!isOldPathInputEmpty,"can't resave, must input a diffFile");
|
|
1293
|
-
_options_check((
|
|
1294
|
-
_options_check((
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
#endif
|
|
1298
|
-
#if (_IS_NEED_VCDIFF)
|
|
1299
|
-
_options_check((diffSets.isVcDiff==hpatch_FALSE),"-VCD unsupport run with resave mode");
|
|
1300
|
-
#endif
|
|
1301
|
-
|
|
973
|
+
_options_check((isLoadAll==_kNULL_VALUE),"-m or -s unsupport run with resave mode");
|
|
974
|
+
_options_check((isDiff==_kNULL_VALUE),"-d unsupport run with resave mode");
|
|
975
|
+
_options_check((isPatchCheck==_kNULL_VALUE),"-t unsupport run with resave mode");
|
|
976
|
+
|
|
1302
977
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1303
978
|
_options_check((isForceRunDirDiff==_kNULL_VALUE),"-D unsupport run with resave mode");
|
|
1304
979
|
_options_check((checksumPlugin==0),"-C unsupport run with resave mode");
|
|
@@ -1306,15 +981,8 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1306
981
|
const char* diffFileName =arg_values[0];
|
|
1307
982
|
const char* outDiffFileName=arg_values[1];
|
|
1308
983
|
hpatch_BOOL isDiffFile=_getIsCompressedDiffFile(diffFileName);
|
|
1309
|
-
isDiffFile=isDiffFile || _getIsSingleStreamDiffFile(diffFileName);
|
|
1310
984
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1311
985
|
isDiffFile=isDiffFile || getIsDirDiffFile(diffFileName);
|
|
1312
|
-
#endif
|
|
1313
|
-
#if (_IS_NEED_BSDIFF)
|
|
1314
|
-
isDiffFile=isDiffFile || _getIsBsDiffFile(diffFileName);
|
|
1315
|
-
#endif
|
|
1316
|
-
#if (_IS_NEED_VCDIFF)
|
|
1317
|
-
isDiffFile=isDiffFile || _getIsVcDiffFile(diffFileName);
|
|
1318
986
|
#endif
|
|
1319
987
|
_return_check(isDiffFile,HDIFF_RESAVE_DIFFINFO_ERROR,"can't resave, input file is not diffFile");
|
|
1320
988
|
if (!isForceOverwrite){
|
|
@@ -1356,61 +1024,123 @@ int hdiff_cmd_line(int argc, const char * argv[]){
|
|
|
1356
1024
|
}
|
|
1357
1025
|
}
|
|
1358
1026
|
|
|
1359
|
-
#if (
|
|
1360
|
-
static hpatch_BOOL
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
decompressPlugin=&_7zXZDecompressPlugin_a;
|
|
1372
|
-
else
|
|
1373
|
-
decompressPlugin=&_7zXZDecompressPlugin;
|
|
1374
|
-
} break;
|
|
1375
|
-
#endif
|
|
1376
|
-
default: return hpatch_FALSE; //unsupport
|
|
1027
|
+
#define _check_readFile(value) { if (!(value)) { hpatch_TFileStreamInput_close(&file); return hpatch_FALSE; } }
|
|
1028
|
+
static hpatch_BOOL readFileAll(hdiff_private::TAutoMem& out_mem,const char* fileName){
|
|
1029
|
+
size_t dataSize;
|
|
1030
|
+
hpatch_TFileStreamInput file;
|
|
1031
|
+
hpatch_TFileStreamInput_init(&file);
|
|
1032
|
+
_check_readFile(hpatch_TFileStreamInput_open(&file,fileName));
|
|
1033
|
+
dataSize=(size_t)file.base.streamSize;
|
|
1034
|
+
_check_readFile(dataSize==file.base.streamSize);
|
|
1035
|
+
try {
|
|
1036
|
+
out_mem.realloc(dataSize);
|
|
1037
|
+
} catch (...) {
|
|
1038
|
+
_check_readFile(false);
|
|
1377
1039
|
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
out_decompressPlugin->decError=hpatch_dec_ok;
|
|
1381
|
-
}
|
|
1382
|
-
return hpatch_TRUE;
|
|
1040
|
+
_check_readFile(file.base.read(&file.base,0,out_mem.data(),out_mem.data_end()));
|
|
1041
|
+
return hpatch_TFileStreamInput_close(&file);
|
|
1383
1042
|
}
|
|
1384
1043
|
|
|
1385
|
-
#
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
_vcdiffCompressPlugin.compress_open=_7zXZ_compress_open; \
|
|
1394
|
-
_vcdiffCompressPlugin.compress_encode=_7zXZ_compress_encode; \
|
|
1395
|
-
_vcdiffCompressPlugin.compress_close=_7zXZ_compress_close; \
|
|
1396
|
-
vcdiffCompressPlugin=&_vcdiffCompressPlugin; }
|
|
1397
|
-
#else
|
|
1398
|
-
#define _CompressPluginForVcDiff(vcdiffCompressPlugin,compressPlugin) \
|
|
1399
|
-
vcdiffCompressPlugin=0; \
|
|
1400
|
-
if (compressPlugin){ \
|
|
1401
|
-
check(hpatch_FALSE,HDIFF_OPTIONS_ERROR,"-VCD unsupport compress"); }
|
|
1402
|
-
#endif
|
|
1403
|
-
|
|
1404
|
-
#endif //_IS_NEED_VCDIFF
|
|
1044
|
+
#define _check_writeFile(value) { if (!(value)) { hpatch_TFileStreamOutput_close(&file); return hpatch_FALSE; } }
|
|
1045
|
+
static hpatch_BOOL writeFileAll(const TByte* pdata,size_t dataSize,const char* outFileName){
|
|
1046
|
+
hpatch_TFileStreamOutput file;
|
|
1047
|
+
hpatch_TFileStreamOutput_init(&file);
|
|
1048
|
+
_check_writeFile(hpatch_TFileStreamOutput_open(&file,outFileName,dataSize));
|
|
1049
|
+
_check_writeFile(file.base.write(&file.base,0,pdata,pdata+dataSize));
|
|
1050
|
+
return hpatch_TFileStreamOutput_close(&file);
|
|
1051
|
+
}
|
|
1405
1052
|
|
|
1406
|
-
#define
|
|
1053
|
+
#define _check_on_error(errorType) { \
|
|
1407
1054
|
if (result==HDIFF_SUCCESS) result=errorType; if (!_isInClear){ goto clear; } }
|
|
1408
|
-
#define check(value,errorType,errorInfo) {
|
|
1409
|
-
|
|
1410
|
-
_check_on_error(errorType); } }
|
|
1055
|
+
#define check(value,errorType,errorInfo) { \
|
|
1056
|
+
std::string erri=std::string()+errorInfo+" ERROR!\n"; \
|
|
1057
|
+
if (!(value)){ hpatch_printStdErrPath_utf8(erri.c_str()); _check_on_error(errorType); } }
|
|
1058
|
+
|
|
1059
|
+
static int hdiff_mem(const char* oldFileName,const char* newFileName,const char* outDiffFileName,
|
|
1060
|
+
hpatch_BOOL isDiff,size_t matchScore,hpatch_BOOL isPatchCheck,
|
|
1061
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
|
|
1062
|
+
hpatch_BOOL isSingleStreamDiff,size_t singleStreamStepSize){
|
|
1063
|
+
double diff_time0=clock_s();
|
|
1064
|
+
int result=HDIFF_SUCCESS;
|
|
1065
|
+
int _isInClear=hpatch_FALSE;
|
|
1066
|
+
hdiff_private::TAutoMem oldMem(0);
|
|
1067
|
+
hdiff_private::TAutoMem newMem(0);
|
|
1068
|
+
check(readFileAll(oldMem,oldFileName),HDIFF_OPENREAD_ERROR,"open oldFile");
|
|
1069
|
+
check(readFileAll(newMem,newFileName),HDIFF_OPENREAD_ERROR,"open newFile");
|
|
1070
|
+
printf("oldDataSize : %" PRIu64 "\nnewDataSize : %" PRIu64 "\n",
|
|
1071
|
+
(hpatch_StreamPos_t)oldMem.size(),(hpatch_StreamPos_t)newMem.size());
|
|
1072
|
+
if (isDiff){
|
|
1073
|
+
std::vector<TByte> outDiffData;
|
|
1074
|
+
try {
|
|
1075
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
1076
|
+
if (isSingleStreamDiff){
|
|
1077
|
+
printf("create single compressed stream diffData!\n");
|
|
1078
|
+
create_single_compressed_diff(newMem.data(),newMem.data_end(),oldMem.data(),oldMem.data_end(),
|
|
1079
|
+
outDiffData,0,compressPlugin,(int)matchScore,singleStreamStepSize);
|
|
1080
|
+
}else
|
|
1081
|
+
#endif
|
|
1082
|
+
create_compressed_diff(newMem.data(),newMem.data_end(),oldMem.data(),oldMem.data_end(),
|
|
1083
|
+
outDiffData,compressPlugin,(int)matchScore);
|
|
1084
|
+
}catch(const std::exception& e){
|
|
1085
|
+
check(false,HDIFF_DIFF_ERROR,"diff run an error: "+e.what());
|
|
1086
|
+
}
|
|
1087
|
+
printf("diffDataSize: %" PRIu64 "\n",(hpatch_StreamPos_t)outDiffData.size());
|
|
1088
|
+
check(writeFileAll(outDiffData.data(),outDiffData.size(),outDiffFileName),
|
|
1089
|
+
HDIFF_OPENWRITE_ERROR,"open write diffFile");
|
|
1090
|
+
printf("diff time: %.3f s\n",(clock_s()-diff_time0));
|
|
1091
|
+
printf(" out diff file ok!\n");
|
|
1092
|
+
outDiffData.clear();
|
|
1093
|
+
}
|
|
1094
|
+
if (isPatchCheck){
|
|
1095
|
+
isSingleStreamDiff=hpatch_FALSE;
|
|
1096
|
+
hdiff_private::TAutoMem diffMem(0);
|
|
1097
|
+
double patch_time0=clock_s();
|
|
1098
|
+
printf("\nload diffFile for test by patch:\n");
|
|
1099
|
+
check(readFileAll(diffMem,outDiffFileName),
|
|
1100
|
+
HDIFF_OPENREAD_ERROR,"open diffFile for test");
|
|
1101
|
+
printf("diffDataSize: %" PRIu64 "\n",(hpatch_StreamPos_t)diffMem.size());
|
|
1102
|
+
|
|
1103
|
+
bool diffrt;
|
|
1104
|
+
{
|
|
1105
|
+
hpatch_TDecompress* saved_decompressPlugin=0;
|
|
1106
|
+
{
|
|
1107
|
+
hpatch_compressedDiffInfo diffinfo;
|
|
1108
|
+
if (!getCompressedDiffInfo_mem(&diffinfo,diffMem.data(),diffMem.data_end())){
|
|
1109
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
1110
|
+
hpatch_singleCompressedDiffInfo sdiffInfo;
|
|
1111
|
+
if (getSingleCompressedDiffInfo_mem(&sdiffInfo,diffMem.data(),diffMem.data_end())){
|
|
1112
|
+
memcpy(diffinfo.compressType,sdiffInfo.compressType,strlen(sdiffInfo.compressType)+1);
|
|
1113
|
+
isSingleStreamDiff=hpatch_TRUE;
|
|
1114
|
+
if (!isDiff)
|
|
1115
|
+
printf("test single compressed stream diffData!\n");
|
|
1116
|
+
}else
|
|
1117
|
+
#endif
|
|
1118
|
+
check(hpatch_FALSE,HDIFF_PATCH_ERROR,"get diff info");
|
|
1119
|
+
}
|
|
1120
|
+
check(findDecompress(&saved_decompressPlugin,diffinfo.compressType),
|
|
1121
|
+
HDIFF_PATCH_ERROR,"diff data saved compress type");
|
|
1122
|
+
}
|
|
1123
|
+
#if (_IS_NEED_SINGLE_STREAM_DIFF)
|
|
1124
|
+
if (isSingleStreamDiff){
|
|
1125
|
+
diffrt=check_single_compressed_diff(newMem.data(),newMem.data_end(),oldMem.data(),oldMem.data_end(),
|
|
1126
|
+
diffMem.data(),diffMem.data_end(),saved_decompressPlugin);
|
|
1127
|
+
}else
|
|
1128
|
+
#endif
|
|
1129
|
+
diffrt=check_compressed_diff(newMem.data(),newMem.data_end(),oldMem.data(),oldMem.data_end(),
|
|
1130
|
+
diffMem.data(),diffMem.data_end(),saved_decompressPlugin);
|
|
1131
|
+
}
|
|
1132
|
+
check(diffrt,HDIFF_PATCH_ERROR,"patch check diff data");
|
|
1133
|
+
printf("patch time: %.3f s\n",(clock_s()-patch_time0));
|
|
1134
|
+
printf(" patch check diff data ok!\n");
|
|
1135
|
+
}
|
|
1136
|
+
clear:
|
|
1137
|
+
_isInClear=hpatch_TRUE;
|
|
1138
|
+
return result;
|
|
1139
|
+
}
|
|
1411
1140
|
|
|
1412
|
-
static int
|
|
1413
|
-
|
|
1141
|
+
static int hdiff_stream(const char* oldFileName,const char* newFileName,const char* outDiffFileName,
|
|
1142
|
+
hpatch_BOOL isDiff,size_t matchBlockSize,hpatch_BOOL isPatchCheck,
|
|
1143
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin){
|
|
1414
1144
|
double diff_time0=clock_s();
|
|
1415
1145
|
int result=HDIFF_SUCCESS;
|
|
1416
1146
|
int _isInClear=hpatch_FALSE;
|
|
@@ -1423,155 +1153,48 @@ static int hdiff_by_stream(const char* oldFileName,const char* newFileName,const
|
|
|
1423
1153
|
hpatch_TFileStreamOutput_init(&diffData_out);
|
|
1424
1154
|
hpatch_TFileStreamInput_init(&diffData_in);
|
|
1425
1155
|
|
|
1426
|
-
if (
|
|
1427
|
-
check(hpatch_TFileStreamInput_open(&oldData,oldFileName),HDIFF_OPENREAD_ERROR,"open oldFile");
|
|
1428
|
-
}else{
|
|
1156
|
+
if (0==strcmp(oldFileName,"")){ // isOldPathInputEmpty
|
|
1429
1157
|
mem_as_hStreamInput(&oldData.base,0,0);
|
|
1158
|
+
}else{
|
|
1159
|
+
check(hpatch_TFileStreamInput_open(&oldData,oldFileName),HDIFF_OPENREAD_ERROR,"open oldFile");
|
|
1430
1160
|
}
|
|
1431
1161
|
check(hpatch_TFileStreamInput_open(&newData,newFileName),HDIFF_OPENREAD_ERROR,"open newFile");
|
|
1432
1162
|
printf("oldDataSize : %" PRIu64 "\nnewDataSize : %" PRIu64 "\n",
|
|
1433
1163
|
oldData.base.streamSize,newData.base.streamSize);
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1436
|
-
_out_diff_info(" load datas of oldFile & newFile for equal check ...\n");
|
|
1437
|
-
check(!hdiff_streamDataIsEqual(&oldData.base,&newData.base),HDIFF_OLD_NEW_SAME_ERROR,"oldFile & newFile's datas can't be equal");
|
|
1438
|
-
}
|
|
1439
|
-
const hdiff_TMTSets_s mtsets={diffSets.threadNum,diffSets.threadNumSearch_s,false,false};
|
|
1440
|
-
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,hpatch_kNullStreamPos),
|
|
1164
|
+
if (isDiff){
|
|
1165
|
+
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),
|
|
1441
1166
|
HDIFF_OPENWRITE_ERROR,"open out diffFile");
|
|
1442
1167
|
hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
|
|
1443
1168
|
try{
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
if (diffSets.isDiffInMem)
|
|
1447
|
-
create_bsdiff_block(&newData.base,&oldData.base,&diffData_out.base,compressPlugin,
|
|
1448
|
-
diffSets.isSingleCompressedDiff,(int)diffSets.matchScore,diffSets.isUseBigCacheMatch,
|
|
1449
|
-
diffSets.matchBlockSize,diffSets.threadNum,diffSets.threadNumSearch_s);
|
|
1450
|
-
else
|
|
1451
|
-
create_bsdiff_stream(&newData.base,&oldData.base,&diffData_out.base,
|
|
1452
|
-
compressPlugin,diffSets.isSingleCompressedDiff,
|
|
1453
|
-
diffSets.matchBlockSize,&mtsets);
|
|
1454
|
-
}else
|
|
1455
|
-
#endif
|
|
1456
|
-
#if (_IS_NEED_VCDIFF)
|
|
1457
|
-
if (diffSets.isVcDiff){
|
|
1458
|
-
vcdiff_TCompress* vcdiffCompressPlugin;
|
|
1459
|
-
_CompressPluginForVcDiff(vcdiffCompressPlugin,compressPlugin);
|
|
1460
|
-
if (diffSets.isDiffInMem)
|
|
1461
|
-
create_vcdiff_block(&newData.base,&oldData.base,&diffData_out.base,vcdiffCompressPlugin,
|
|
1462
|
-
(int)diffSets.matchScore,diffSets.isUseBigCacheMatch,
|
|
1463
|
-
diffSets.matchBlockSize,diffSets.threadNum,diffSets.threadNumSearch_s);
|
|
1464
|
-
else
|
|
1465
|
-
create_vcdiff_stream(&newData.base,&oldData.base,&diffData_out.base,
|
|
1466
|
-
vcdiffCompressPlugin,diffSets.matchBlockSize,&mtsets);
|
|
1467
|
-
}else
|
|
1468
|
-
#endif
|
|
1469
|
-
if (diffSets.isSingleCompressedDiff)
|
|
1470
|
-
if (diffSets.isDiffInMem)
|
|
1471
|
-
create_single_compressed_diff_block(&newData.base,&oldData.base,&diffData_out.base,compressPlugin,
|
|
1472
|
-
(int)diffSets.matchScore,diffSets.patchStepMemSize,diffSets.isUseBigCacheMatch,
|
|
1473
|
-
diffSets.matchBlockSize,diffSets.threadNum,diffSets.threadNumSearch_s);
|
|
1474
|
-
else
|
|
1475
|
-
create_single_compressed_diff_stream(&newData.base,&oldData.base, &diffData_out.base,
|
|
1476
|
-
compressPlugin,diffSets.matchBlockSize,
|
|
1477
|
-
diffSets.patchStepMemSize,&mtsets);
|
|
1478
|
-
else{
|
|
1479
|
-
if (diffSets.isDiffInMem)
|
|
1480
|
-
create_compressed_diff_block(&newData.base,&oldData.base,&diffData_out.base,compressPlugin,
|
|
1481
|
-
(int)diffSets.matchScore,diffSets.isUseBigCacheMatch,
|
|
1482
|
-
diffSets.matchBlockSize,diffSets.threadNum,diffSets.threadNumSearch_s);
|
|
1483
|
-
else
|
|
1484
|
-
create_compressed_diff_stream(&newData.base,&oldData.base, &diffData_out.base,
|
|
1485
|
-
compressPlugin,diffSets.matchBlockSize,&mtsets);
|
|
1486
|
-
}
|
|
1169
|
+
create_compressed_diff_stream(&newData.base,&oldData.base, &diffData_out.base,
|
|
1170
|
+
compressPlugin,matchBlockSize);
|
|
1487
1171
|
diffData_out.base.streamSize=diffData_out.out_length;
|
|
1488
1172
|
}catch(const std::exception& e){
|
|
1489
|
-
check(!newData.fileError,HDIFF_OPENREAD_ERROR,"read newFile");
|
|
1490
|
-
check(!oldData.fileError,HDIFF_OPENREAD_ERROR,"read oldFile");
|
|
1491
|
-
check(!diffData_out.fileError,HDIFF_OPENWRITE_ERROR,"write diffFile");
|
|
1492
1173
|
check(false,HDIFF_DIFF_ERROR,"stream diff run an error: "+e.what());
|
|
1493
1174
|
}
|
|
1494
|
-
const hpatch_StreamPos_t outDiffDataSize=diffData_out.base.streamSize;
|
|
1495
1175
|
check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
|
|
1496
|
-
printf("diffDataSize: %" PRIu64 "\n"
|
|
1497
|
-
|
|
1498
|
-
|
|
1176
|
+
printf("diffDataSize: %" PRIu64 "\n",diffData_out.base.streamSize);
|
|
1177
|
+
printf("diff time: %.3f s\n",(clock_s()-diff_time0));
|
|
1178
|
+
printf(" out diff file ok!\n");
|
|
1499
1179
|
}
|
|
1500
|
-
if (
|
|
1180
|
+
if (isPatchCheck){
|
|
1501
1181
|
double patch_time0=clock_s();
|
|
1502
|
-
printf("\nload diffFile for patch check:\n");
|
|
1182
|
+
printf("\nload diffFile for test by patch check:\n");
|
|
1503
1183
|
check(hpatch_TFileStreamInput_open(&diffData_in,outDiffFileName),HDIFF_OPENREAD_ERROR,"open check diffFile");
|
|
1504
1184
|
printf("diffDataSize: %" PRIu64 "\n",diffData_in.base.streamSize);
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
#if (_IS_NEED_BSDIFF)
|
|
1508
|
-
hpatch_BOOL isBsDiff=hpatch_FALSE;
|
|
1509
|
-
hpatch_BOOL isSingleCompressedBsDiff=hpatch_FALSE;
|
|
1510
|
-
#endif
|
|
1511
|
-
#if (_IS_NEED_VCDIFF)
|
|
1512
|
-
hpatch_BOOL isVcDiff=hpatch_FALSE;
|
|
1513
|
-
#endif
|
|
1514
|
-
hpatch_TDecompress _decompressPlugin={0};
|
|
1515
|
-
hpatch_TDecompress* saved_decompressPlugin=&_decompressPlugin;
|
|
1185
|
+
|
|
1186
|
+
hpatch_TDecompress* saved_decompressPlugin=0;
|
|
1516
1187
|
{
|
|
1517
|
-
hpatch_compressedDiffInfo
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
#endif
|
|
1522
|
-
const char* compressType="";
|
|
1523
|
-
if (getCompressedDiffInfo(&diffInfo,&diffData_in.base)){
|
|
1524
|
-
if (!diffSets.isDoDiff)
|
|
1525
|
-
printf("test compressed diffData!\n");
|
|
1526
|
-
compressType=diffInfo.compressType;
|
|
1527
|
-
}else if (getSingleCompressedDiffInfo(&sdiffInfo,&diffData_in.base,0)){
|
|
1528
|
-
compressType=sdiffInfo.compressType;
|
|
1529
|
-
isSingleCompressedDiff=hpatch_TRUE;
|
|
1530
|
-
if (!diffSets.isDoDiff)
|
|
1531
|
-
printf("test single compressed diffData!\n");
|
|
1532
|
-
#if (_IS_NEED_BSDIFF)
|
|
1533
|
-
}else if (getIsBsDiff(&diffData_in.base,&isSingleCompressedBsDiff)){
|
|
1534
|
-
*saved_decompressPlugin=_bz2DecompressPlugin_unsz;
|
|
1535
|
-
isBsDiff=hpatch_TRUE;
|
|
1536
|
-
if (!diffSets.isDoDiff)
|
|
1537
|
-
printf(isSingleCompressedBsDiff?"test endsley/bsdiff's diffData!\n":"test bsdiff4's diffData!\n");
|
|
1538
|
-
#endif
|
|
1539
|
-
#if (_IS_NEED_VCDIFF)
|
|
1540
|
-
}else if (getVcDiffInfo(&vcdiffInfo,&diffData_in.base,hpatch_FALSE)){
|
|
1541
|
-
check(getVcDiffDecompressPlugin(saved_decompressPlugin,&vcdiffInfo),
|
|
1542
|
-
HDIFF_PATCH_ERROR,"VCDIFF unsported compressorID");
|
|
1543
|
-
isVcDiff=hpatch_TRUE;
|
|
1544
|
-
if (!diffSets.isDoDiff)
|
|
1545
|
-
printf("test VCDIFF's diffData!\n");
|
|
1546
|
-
#endif
|
|
1547
|
-
}else{
|
|
1548
|
-
check(hpatch_FALSE,HDIFF_PATCH_ERROR,"get diff info");
|
|
1549
|
-
}
|
|
1550
|
-
if (saved_decompressPlugin->open==0){
|
|
1551
|
-
check(findDecompress(saved_decompressPlugin,compressType),
|
|
1552
|
-
HDIFF_PATCH_ERROR,"diff data saved compress type");
|
|
1553
|
-
}
|
|
1554
|
-
if (saved_decompressPlugin->open==0) saved_decompressPlugin=0;
|
|
1555
|
-
else saved_decompressPlugin->decError=hpatch_dec_ok;
|
|
1188
|
+
hpatch_compressedDiffInfo diffinfo;
|
|
1189
|
+
check(getCompressedDiffInfo(&diffinfo,&diffData_in.base),HDIFF_PATCH_ERROR,"get diff info");
|
|
1190
|
+
check(findDecompress(&saved_decompressPlugin,diffinfo.compressType),
|
|
1191
|
+
HDIFF_PATCH_ERROR,"diff data saved compress type");
|
|
1556
1192
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
#endif
|
|
1563
|
-
#if (_IS_NEED_VCDIFF)
|
|
1564
|
-
if (isVcDiff)
|
|
1565
|
-
diffrt=check_vcdiff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
|
|
1566
|
-
else
|
|
1567
|
-
#endif
|
|
1568
|
-
if (isSingleCompressedDiff)
|
|
1569
|
-
diffrt=check_single_compressed_diff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
|
|
1570
|
-
else
|
|
1571
|
-
diffrt=check_compressed_diff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
|
|
1572
|
-
check(diffrt,HDIFF_PATCH_ERROR,"patch check diff data");
|
|
1573
|
-
printf("patch time: %.3f s\n"
|
|
1574
|
-
" patch check diff data ok!\n",(clock_s()-patch_time0));
|
|
1193
|
+
check(check_compressed_diff_stream(&newData.base,&oldData.base,
|
|
1194
|
+
&diffData_in.base,saved_decompressPlugin),
|
|
1195
|
+
HDIFF_PATCH_ERROR,"patch check diff data");
|
|
1196
|
+
printf("patch time: %.3f s\n",(clock_s()-patch_time0));
|
|
1197
|
+
printf(" patch check diff data ok!\n");
|
|
1575
1198
|
}
|
|
1576
1199
|
clear:
|
|
1577
1200
|
_isInClear=hpatch_TRUE;
|
|
@@ -1582,38 +1205,32 @@ clear:
|
|
|
1582
1205
|
return result;
|
|
1583
1206
|
}
|
|
1584
1207
|
|
|
1585
|
-
int hdiff(const char* oldFileName,const char* newFileName,const char* outDiffFileName,
|
|
1586
|
-
|
|
1208
|
+
int hdiff(const char* oldFileName,const char* newFileName,const char* outDiffFileName,hpatch_BOOL isDiff,
|
|
1209
|
+
hpatch_BOOL isLoadAll,size_t matchValue,hpatch_BOOL isPatchCheck,
|
|
1210
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
|
|
1211
|
+
hpatch_BOOL isSingleStreamDiff,size_t singleStreamStepSize){
|
|
1587
1212
|
double time0=clock_s();
|
|
1588
1213
|
std::string fnameInfo=std::string("old : \"")+oldFileName+"\"\n"
|
|
1589
1214
|
+"new : \""+newFileName+"\"\n"
|
|
1590
|
-
+(
|
|
1215
|
+
+(isDiff?"out : \"":"test: \"")+outDiffFileName+"\"\n";
|
|
1591
1216
|
hpatch_printPath_utf8(fnameInfo.c_str());
|
|
1592
1217
|
|
|
1593
|
-
if (
|
|
1594
|
-
const char*
|
|
1595
|
-
if (compressPlugin)
|
|
1596
|
-
|
|
1597
|
-
printf("hdiffz run with compress plugin: \"%s\"\n",compressTypeTxt);
|
|
1598
|
-
if (diffSets.isSingleCompressedDiff){
|
|
1599
|
-
#if (_IS_NEED_BSDIFF)
|
|
1600
|
-
if (!diffSets.isBsDiff)
|
|
1601
|
-
#endif
|
|
1602
|
-
printf("create single compressed diffData!\n");
|
|
1603
|
-
}
|
|
1604
|
-
#if (_IS_NEED_BSDIFF)
|
|
1605
|
-
if (diffSets.isBsDiff)
|
|
1606
|
-
printf(diffSets.isSingleCompressedDiff?"create endsley/bsdiff diffData!\n":"create bsdiff4 diffData!\n");
|
|
1607
|
-
#endif
|
|
1608
|
-
#if (_IS_NEED_VCDIFF)
|
|
1609
|
-
if (diffSets.isVcDiff)
|
|
1610
|
-
printf("create VCDIFF diffData!\n");
|
|
1611
|
-
#endif
|
|
1218
|
+
if (isDiff) {
|
|
1219
|
+
const char* compressType="";
|
|
1220
|
+
if (compressPlugin) compressType=compressPlugin->compressType();
|
|
1221
|
+
printf("hdiffz run with compress plugin: \"%s\"\n",compressType);
|
|
1612
1222
|
}
|
|
1613
1223
|
|
|
1614
|
-
int exitCode
|
|
1615
|
-
|
|
1616
|
-
|
|
1224
|
+
int exitCode;
|
|
1225
|
+
if (isLoadAll){
|
|
1226
|
+
exitCode=hdiff_mem(oldFileName,newFileName,outDiffFileName,isDiff,matchValue,isPatchCheck,
|
|
1227
|
+
compressPlugin,decompressPlugin,isSingleStreamDiff,singleStreamStepSize);
|
|
1228
|
+
}else{
|
|
1229
|
+
assert(!isSingleStreamDiff); //now not support
|
|
1230
|
+
exitCode=hdiff_stream(oldFileName,newFileName,outDiffFileName,
|
|
1231
|
+
isDiff,matchValue,isPatchCheck,compressPlugin,decompressPlugin);
|
|
1232
|
+
}
|
|
1233
|
+
if (isDiff && isPatchCheck)
|
|
1617
1234
|
printf("\nall time: %.3f s\n",(clock_s()-time0));
|
|
1618
1235
|
return exitCode;
|
|
1619
1236
|
}
|
|
@@ -1627,10 +1244,7 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
|
1627
1244
|
|
|
1628
1245
|
int result=HDIFF_SUCCESS;
|
|
1629
1246
|
hpatch_BOOL _isInClear=hpatch_FALSE;
|
|
1630
|
-
hpatch_BOOL isDirDiff=
|
|
1631
|
-
hpatch_BOOL isSingleDiff=hpatch_FALSE;
|
|
1632
|
-
hpatch_compressedDiffInfo diffInfo;
|
|
1633
|
-
hpatch_singleCompressedDiffInfo singleDiffInfo;
|
|
1247
|
+
hpatch_BOOL isDirDiff=false;
|
|
1634
1248
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1635
1249
|
std::string dirCompressType;
|
|
1636
1250
|
TDirDiffInfo dirDiffInfo;
|
|
@@ -1641,31 +1255,26 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
|
1641
1255
|
hpatch_TFileStreamInput_init(&diffData_in);
|
|
1642
1256
|
hpatch_TFileStreamOutput_init(&diffData_out);
|
|
1643
1257
|
|
|
1644
|
-
hpatch_TDecompress
|
|
1645
|
-
hpatch_TDecompress* decompressPlugin=&_decompressPlugin;
|
|
1258
|
+
hpatch_TDecompress* decompressPlugin=0;
|
|
1646
1259
|
check(hpatch_TFileStreamInput_open(&diffData_in,diffFileName),HDIFF_OPENREAD_ERROR,"open diffFile");
|
|
1647
1260
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1648
|
-
check(getDirDiffInfo(&
|
|
1261
|
+
check(getDirDiffInfo(&diffData_in.base,&dirDiffInfo),HDIFF_OPENREAD_ERROR,"read diffFile");
|
|
1649
1262
|
isDirDiff=dirDiffInfo.isDirDiff;
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
diffInfo
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
}
|
|
1666
|
-
{//decompressPlugin
|
|
1667
|
-
findDecompress(decompressPlugin,diffInfo.compressType);
|
|
1668
|
-
if (decompressPlugin->open==0){
|
|
1263
|
+
#endif
|
|
1264
|
+
{ //decompressPlugin
|
|
1265
|
+
hpatch_compressedDiffInfo diffInfo;
|
|
1266
|
+
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1267
|
+
if (isDirDiff){
|
|
1268
|
+
diffInfo=dirDiffInfo.hdiffInfo;
|
|
1269
|
+
diffInfo.compressedCount+=dirDiffInfo.dirDataIsCompressed?1:0;
|
|
1270
|
+
}else
|
|
1271
|
+
#endif
|
|
1272
|
+
if (!getCompressedDiffInfo(&diffInfo,&diffData_in.base)){
|
|
1273
|
+
check(!diffData_in.fileError,HDIFF_RESAVE_FILEREAD_ERROR,"read diffFile");
|
|
1274
|
+
check(hpatch_FALSE,HDIFF_RESAVE_DIFFINFO_ERROR,"is hdiff file? get diff info");
|
|
1275
|
+
}
|
|
1276
|
+
findDecompress(&decompressPlugin,diffInfo.compressType);
|
|
1277
|
+
if (decompressPlugin==0){
|
|
1669
1278
|
if (diffInfo.compressedCount>0){
|
|
1670
1279
|
check(false,HDIFF_RESAVE_COMPRESSTYPE_ERROR,
|
|
1671
1280
|
"can no decompress \""+diffInfo.compressType+" data");
|
|
@@ -1675,15 +1284,14 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
|
1675
1284
|
decompressPlugin=0;
|
|
1676
1285
|
}
|
|
1677
1286
|
}else{
|
|
1678
|
-
|
|
1679
|
-
printf("resave diffFile with decompress plugin: \"%s\" (need decompress %d)\n",diffInfo.compressType,diffInfo.compressedCount);
|
|
1287
|
+
printf("resave %s with decompress plugin: \"%s\" (need decompress %d)\n",(isDirDiff?"dirDiffFile":"diffFile"),diffInfo.compressType,diffInfo.compressedCount);
|
|
1680
1288
|
}
|
|
1681
1289
|
}
|
|
1682
1290
|
{
|
|
1683
|
-
const char*
|
|
1684
|
-
if (compressPlugin)
|
|
1685
|
-
|
|
1686
|
-
|
|
1291
|
+
const char* compressType="";
|
|
1292
|
+
if (compressPlugin) compressType=compressPlugin->compressType();
|
|
1293
|
+
printf("resave %s with compress plugin: \"%s\"\n",
|
|
1294
|
+
(isDirDiff?"dirDiffFile":"diffFile"),compressType);
|
|
1687
1295
|
}
|
|
1688
1296
|
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1689
1297
|
if (isDirDiff){ //checksumPlugin
|
|
@@ -1694,12 +1302,10 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
|
1694
1302
|
"found checksum plugin not same as dirDiffFile used: \""+dirDiffInfo.checksumType+"\"\n");
|
|
1695
1303
|
}
|
|
1696
1304
|
printf("resave dirDiffFile with checksum plugin: \"%s\"\n",dirDiffInfo.checksumType);
|
|
1697
|
-
}else{
|
|
1698
|
-
_options_check(checksumPlugin==0,"-C now only support dir diff");
|
|
1699
1305
|
}
|
|
1700
1306
|
#endif
|
|
1701
|
-
|
|
1702
|
-
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName
|
|
1307
|
+
|
|
1308
|
+
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),HDIFF_OPENWRITE_ERROR,
|
|
1703
1309
|
"open out diffFile");
|
|
1704
1310
|
hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
|
|
1705
1311
|
printf("inDiffSize : %" PRIu64 "\n",diffData_in.base.streamSize);
|
|
@@ -1710,16 +1316,15 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
|
|
|
1710
1316
|
&diffData_out.base,compressPlugin,checksumPlugin);
|
|
1711
1317
|
}else
|
|
1712
1318
|
#endif
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1319
|
+
{
|
|
1320
|
+
#if (_IS_NEED_DIR_DIFF_PATCH)
|
|
1321
|
+
_options_check(checksumPlugin==0,"-C now only support dir diff, unsupport diff");
|
|
1322
|
+
#endif
|
|
1717
1323
|
resave_compressed_diff(&diffData_in.base,decompressPlugin,
|
|
1718
1324
|
&diffData_out.base,compressPlugin);
|
|
1325
|
+
}
|
|
1719
1326
|
diffData_out.base.streamSize=diffData_out.out_length;
|
|
1720
1327
|
}catch(const std::exception& e){
|
|
1721
|
-
check(!diffData_in.fileError,HDIFF_RESAVE_FILEREAD_ERROR,"read diffFile");
|
|
1722
|
-
check(!diffData_out.fileError,HDIFF_RESAVE_OPENWRITE_ERROR,"write diffFile");
|
|
1723
1328
|
check(false,HDIFF_RESAVE_ERROR,"resave diff run an error: "+e.what());
|
|
1724
1329
|
}
|
|
1725
1330
|
printf("outDiffSize: %" PRIu64 "\n",diffData_out.base.streamSize);
|
|
@@ -1759,13 +1364,14 @@ struct DirDiffListener:public IDirDiffListener{
|
|
|
1759
1364
|
virtual void diffRefInfo(size_t oldPathCount,size_t newPathCount,size_t sameFilePairCount,
|
|
1760
1365
|
hpatch_StreamPos_t sameFileSize,size_t refOldFileCount,size_t refNewFileCount,
|
|
1761
1366
|
hpatch_StreamPos_t refOldFileSize,hpatch_StreamPos_t refNewFileSize){
|
|
1762
|
-
printf("
|
|
1763
|
-
printf("
|
|
1367
|
+
printf("\n");
|
|
1368
|
+
printf("DirDiff old path count: %" PRIu64 "\n",(hpatch_StreamPos_t)oldPathCount);
|
|
1369
|
+
printf(" new path count: %" PRIu64 " (fileCount:%" PRIu64 ")\n",
|
|
1764
1370
|
(hpatch_StreamPos_t)newPathCount,(hpatch_StreamPos_t)(sameFilePairCount+refNewFileCount));
|
|
1765
|
-
printf("
|
|
1371
|
+
printf(" same file count: %" PRIu64 " (dataSize: %" PRIu64 ")\n",
|
|
1766
1372
|
(hpatch_StreamPos_t)sameFilePairCount,sameFileSize);
|
|
1767
|
-
printf("
|
|
1768
|
-
printf("
|
|
1373
|
+
printf(" ref old file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refOldFileCount);
|
|
1374
|
+
printf(" diff new file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refNewFileCount);
|
|
1769
1375
|
printf("\nrun hdiffz:\n");
|
|
1770
1376
|
printf(" oldRefSize : %" PRIu64 "\n",refOldFileSize);
|
|
1771
1377
|
printf(" newRefSize : %" PRIu64 " (all newSize: %" PRIu64 ")\n",refNewFileSize,refNewFileSize+sameFileSize);
|
|
@@ -1790,9 +1396,10 @@ static void check_manifest(TManifest& out_manifest,const std::string& rootPath,c
|
|
|
1790
1396
|
}
|
|
1791
1397
|
|
|
1792
1398
|
int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileName,
|
|
1793
|
-
const hdiff_TCompress* compressPlugin,hpatch_TChecksum* checksumPlugin,
|
|
1794
1399
|
hpatch_BOOL oldIsDir, hpatch_BOOL newIsDir,
|
|
1795
|
-
|
|
1400
|
+
hpatch_BOOL isDiff,hpatch_BOOL isLoadAll,size_t matchValue,hpatch_BOOL isPatchCheck,
|
|
1401
|
+
const hdiff_TCompress* compressPlugin,hpatch_TDecompress* decompressPlugin,
|
|
1402
|
+
hpatch_TChecksum* checksumPlugin,size_t kMaxOpenFileNumber,
|
|
1796
1403
|
const std::vector<std::string>& ignorePathListBase,const std::vector<std::string>& ignoreOldPathList,
|
|
1797
1404
|
const std::vector<std::string>& ignoreNewPathList,
|
|
1798
1405
|
const std::string& oldManifestFileName,const std::string& newManifestFileName){
|
|
@@ -1804,18 +1411,17 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
|
|
|
1804
1411
|
std::string fnameInfo=std::string("")
|
|
1805
1412
|
+(oldIsDir?"oldDir : \"":"oldFile: \"")+oldPath+"\"\n"
|
|
1806
1413
|
+(newIsDir?"newDir : \"":"newFile: \"")+newPath+"\"\n"
|
|
1807
|
-
+(
|
|
1414
|
+
+(isDiff? "outDiff: \"":" test : \"")+outDiffFileName+"\"\n";
|
|
1808
1415
|
hpatch_printPath_utf8(fnameInfo.c_str());
|
|
1809
1416
|
|
|
1810
1417
|
bool isManifest= (!newManifestFileName.empty());
|
|
1811
|
-
if (
|
|
1418
|
+
if (isDiff) {
|
|
1812
1419
|
const char* checksumType="";
|
|
1813
|
-
const char*
|
|
1420
|
+
const char* compressType="";
|
|
1814
1421
|
if (checksumPlugin)
|
|
1815
1422
|
checksumType=checksumPlugin->checksumType();
|
|
1816
|
-
if (compressPlugin)
|
|
1817
|
-
|
|
1818
|
-
printf("hdiffz run %sdir diff with compress plugin: \"%s\"\n",isManifest?"manifest ":"",compressTypeTxt);
|
|
1423
|
+
if (compressPlugin) compressType=compressPlugin->compressType();
|
|
1424
|
+
printf("hdiffz run %sdir diff with compress plugin: \"%s\"\n",isManifest?"manifest ":"",compressType);
|
|
1819
1425
|
printf("hdiffz run %sdir diff with checksum plugin: \"%s\"\n",isManifest?"manifest ":"",checksumType);
|
|
1820
1426
|
}
|
|
1821
1427
|
printf("\n");
|
|
@@ -1830,7 +1436,6 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
|
|
|
1830
1436
|
TManifest oldManifest;
|
|
1831
1437
|
TManifest newManifest;
|
|
1832
1438
|
if (isManifest){
|
|
1833
|
-
_out_diff_info(" check old & new's datas by manifest ...\n");
|
|
1834
1439
|
double check_time0=clock_s();
|
|
1835
1440
|
try {
|
|
1836
1441
|
if (!oldPath.empty())// isOldPathInputEmpty
|
|
@@ -1840,7 +1445,7 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
|
|
|
1840
1445
|
check(false,MANIFEST_TEST_ERROR,"check by manifest found an error: "+e.what());
|
|
1841
1446
|
}
|
|
1842
1447
|
printf("check manifest time: %.3f s\n",(clock_s()-check_time0));
|
|
1843
|
-
printf(" check datas by manifest ok!\n\n");
|
|
1448
|
+
printf(" check path datas by manifest ok!\n\n");
|
|
1844
1449
|
}else{
|
|
1845
1450
|
DirPathIgnoreListener oldDirPathIgnore(ignorePathListBase,ignoreOldPathList);
|
|
1846
1451
|
DirPathIgnoreListener newDirPathIgnore(ignorePathListBase,ignoreNewPathList);
|
|
@@ -1848,15 +1453,15 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
|
|
|
1848
1453
|
get_manifest(&newDirPathIgnore,newPath,newManifest);
|
|
1849
1454
|
}
|
|
1850
1455
|
|
|
1851
|
-
if (
|
|
1456
|
+
if (isDiff){
|
|
1852
1457
|
double diff_time0=clock_s();
|
|
1853
1458
|
try {
|
|
1854
|
-
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName
|
|
1459
|
+
check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),
|
|
1855
1460
|
HDIFF_OPENWRITE_ERROR,"open out diffFile");
|
|
1856
1461
|
hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
|
|
1857
1462
|
DirDiffListener listener;
|
|
1858
|
-
dir_diff(&listener,oldManifest,newManifest,&diffData_out.base,
|
|
1859
|
-
compressPlugin,checksumPlugin,
|
|
1463
|
+
dir_diff(&listener,oldManifest,newManifest,&diffData_out.base,isLoadAll!=0,matchValue,
|
|
1464
|
+
compressPlugin,checksumPlugin,kMaxOpenFileNumber);
|
|
1860
1465
|
diffData_out.base.streamSize=diffData_out.out_length;
|
|
1861
1466
|
}catch(const std::exception& e){
|
|
1862
1467
|
check(false,DIRDIFF_DIFF_ERROR,"dir diff run an error: "+e.what());
|
|
@@ -1866,26 +1471,20 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
|
|
|
1866
1471
|
check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
|
|
1867
1472
|
printf(" out dirDiffFile ok!\n");
|
|
1868
1473
|
}
|
|
1869
|
-
if (
|
|
1474
|
+
if (isPatchCheck){
|
|
1870
1475
|
double patch_time0=clock_s();
|
|
1871
1476
|
printf("\nload %sdirDiffFile for test by patch check:\n",isManifest?"manifest ":"");
|
|
1872
1477
|
check(hpatch_TFileStreamInput_open(&diffData_in,outDiffFileName),
|
|
1873
1478
|
HDIFF_OPENREAD_ERROR,"open check diffFile");
|
|
1874
1479
|
printf("diffDataSize : %" PRIu64 "\n",diffData_in.base.streamSize);
|
|
1875
|
-
hpatch_TDecompress
|
|
1876
|
-
hpatch_TDecompress* saved_decompressPlugin=&_decompressPlugin;
|
|
1480
|
+
hpatch_TDecompress* saved_decompressPlugin=0;
|
|
1877
1481
|
hpatch_TChecksum* saved_checksumPlugin=0;
|
|
1878
1482
|
{
|
|
1879
1483
|
TDirDiffInfo dirinfo;
|
|
1880
|
-
check(getDirDiffInfo(&
|
|
1484
|
+
check(getDirDiffInfo(&diffData_in.base,&dirinfo),DIRDIFF_PATCH_ERROR,"get dir diff info");
|
|
1881
1485
|
check(dirinfo.isDirDiff,DIRDIFF_PATCH_ERROR,"dir diffFile data");
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
if (saved_decompressPlugin->open==0) saved_decompressPlugin=0;
|
|
1885
|
-
else saved_decompressPlugin->decError=hpatch_dec_ok;
|
|
1886
|
-
check(findChecksum(&saved_checksumPlugin,dirinfo.checksumType),
|
|
1887
|
-
DIRDIFF_PATCH_ERROR,"diff data saved checksum type");
|
|
1888
|
-
|
|
1486
|
+
findDecompress(&saved_decompressPlugin,dirinfo.hdiffInfo.compressType);
|
|
1487
|
+
findChecksum(&saved_checksumPlugin,dirinfo.checksumType);
|
|
1889
1488
|
}
|
|
1890
1489
|
//check(check_dirOldDataChecksum(oldPath.c_str(),&diffData_in.base,
|
|
1891
1490
|
// saved_decompressPlugin,saved_checksumPlugin),
|
|
@@ -1936,7 +1535,7 @@ int create_manifest(const char* _inputPath,const char* outManifestFileName,
|
|
|
1936
1535
|
{//create
|
|
1937
1536
|
try {
|
|
1938
1537
|
std::vector<std::string> emptyPathList;
|
|
1939
|
-
check(hpatch_TFileStreamOutput_open(&manifestData_out,outManifestFileName
|
|
1538
|
+
check(hpatch_TFileStreamOutput_open(&manifestData_out,outManifestFileName,~(hpatch_StreamPos_t)0),
|
|
1940
1539
|
HDIFF_OPENWRITE_ERROR,"open out manifestFile");
|
|
1941
1540
|
//hpatch_TFileStreamOutput_setRandomOut(&manifestData_out,hpatch_TRUE);
|
|
1942
1541
|
DirPathIgnoreListener dirPathIgnore(ignorePathList,emptyPathList);
|