react-native-update 10.34.1 → 10.34.3
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/.gitmodules +6 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +291 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +48 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +473 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +552 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +547 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +127 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +59 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/_dir_ignore.h +191 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +112 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +389 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +73 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +266 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +58 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +190 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.bat +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.sh +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +1 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +49 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +31 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +38 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +26 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +155 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +364 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +348 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +228 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +215 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +256 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +7 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +271 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +228 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +296 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +242 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +287 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +39 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +447 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +703 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +463 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +286 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lz4.xcodeproj/project.pbxproj +268 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +585 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +301 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +591 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +308 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +524 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +33 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +33 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +774 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +799 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +201 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +59 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +1526 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +1637 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +846 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +79 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +339 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +190 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +339 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.h +87 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +43 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +836 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +246 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_private.h +47 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +112 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +69 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +65 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +346 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +149 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +176 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +84 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +146 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +61 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +152 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +76 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +735 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +240 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +1971 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +31 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +42 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +307 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +1786 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +1746 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +201 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +74 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +187 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +478 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +222 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +383 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +73 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +184 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +88 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/config.h +89 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +325 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.cpp +10 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +97 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +14 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +108 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +186 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +780 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +579 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +415 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +144 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +164 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +148 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +769 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +97 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +954 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +299 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +168 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +44 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +72 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +130 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +125 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +428 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +133 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/checksum_plugin.h +52 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +243 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +51 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +153 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +54 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +158 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +49 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +294 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +59 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +217 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +349 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +110 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +2643 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +253 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +245 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +361 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +366 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +91 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +31 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +106 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +170 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +250 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +67 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +497 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +106 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +254 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +39 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +37 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +62 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +44 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +156 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +440 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +88 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +332 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +48 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +198 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +697 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +74 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +262 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +174 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +174 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +252 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +67 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +680 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +137 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +83 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +125 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +56 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +55 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +147 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +38 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +354 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +76 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +521 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +69 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +122 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +66 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +36 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +81 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +247 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +71 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +351 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +42 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +124 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +38 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +203 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +55 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +79 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +66 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +301 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +291 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +630 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +889 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +628 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +95 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +78 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +950 -0
- package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +72 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm/7zCrcOpt.asm +100 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +181 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +1487 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +341 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +258 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +742 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +540 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +1339 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +275 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +860 -0
- package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +523 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7z.h +204 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +89 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +1786 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.c +36 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +35 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zBuf2.c +52 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +464 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +199 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +673 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +443 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +92 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +199 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +597 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.rc +55 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +101 -0
- package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +360 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +429 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +60 -0
- package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +1002 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +605 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +76 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +290 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +332 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +506 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +709 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +105 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +187 -0
- package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +14 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +246 -0
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +970 -0
- package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +686 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +169 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +99 -0
- package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +20 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +1746 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +160 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +1422 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +114 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +578 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +34 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +493 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +121 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +1095 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +81 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +807 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +58 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +111 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +53 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +103 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +1363 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +237 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +3150 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +85 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +42 -0
- package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +138 -0
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +604 -0
- package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +144 -0
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +1124 -0
- package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +202 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +169 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +1131 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +181 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +312 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +337 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +127 -0
- package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +50 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +492 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +86 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +451 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +268 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +15 -0
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +835 -0
- package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +17 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +812 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +260 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +249 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +889 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.c +4 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +13 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +44 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +32 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +313 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +192 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +13 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +30 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +21 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.def +4 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +206 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +15 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +4 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +13 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +59 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/resource.rc +3 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.c +4 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +13 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +657 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsp +231 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +44 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +40 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/resource.rc +5 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/setup.ico +0 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +92 -0
- package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +542 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +140 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +26 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +261 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +2876 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +1384 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +64 -0
- package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +385 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +10 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +10 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +1 -0
- package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +1 -0
- package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +51 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +240 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +1370 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +73 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +721 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +95 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +795 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +178 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +156 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +1764 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +454 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +207 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +346 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +26 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +3088 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +21 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +86 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +175 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +754 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Icons/7z.ico +0 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +608 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +353 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +1452 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +168 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +279 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +121 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +817 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp +715 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +137 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +371 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +159 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +358 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +182 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +548 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +200 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +923 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +205 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +577 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +201 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +182 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +121 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +45 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +393 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +221 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +765 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +349 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +855 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +160 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +37 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +22 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +111 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +133 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +51 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +33 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +117 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +80 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +106 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +151 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +78 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +290 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +146 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +101 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +57 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +41 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +47 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +24 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +127 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +24 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +37 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +17 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +106 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +59 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +58 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +91 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +378 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +153 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +34 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyRegister.cpp +15 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +113 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +45 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +87 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +49 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +151 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +86 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +243 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +35 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +8 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +8 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +315 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +130 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +277 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +122 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +241 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +41 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +119 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +243 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +480 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +76 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +54 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +20 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +210 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersion.h +2 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +2 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +178 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +13 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/SubBuild.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/resource.rc +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1799 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3077 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +641 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +398 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +5026 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +121 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +407 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +575 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +107 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +44 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +296 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +322 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +1337 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +3702 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +469 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +745 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +1931 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +221 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +66 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +1069 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +302 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +74 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +30 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +46 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +946 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +426 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +58 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +1417 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +42 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +1635 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +235 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +998 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +68 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +187 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/resource.rc +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1272 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1483 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +351 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +199 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +59 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +421 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/resource2.h +2 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +12 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +13 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +9 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +55 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +252 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +46 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +6 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +21 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +231 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +63 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +330 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +77 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +93 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +41 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +76 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +215 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +54 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +30 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +150 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +18 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +297 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +185 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +693 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +14 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +63 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +57 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +75 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +1842 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +1079 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +38 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +8 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.cpp +3 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +724 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +292 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +325 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +340 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +121 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +67 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +8 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +98 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +46 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +248 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +87 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +762 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +110 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +154 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +38 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +123 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +863 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +384 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +789 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +231 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Init.cpp +7 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +39 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +86 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +130 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +269 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +43 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +66 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +77 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +52 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +446 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +213 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.cpp +10 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +87 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +162 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +156 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +35 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +165 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +50 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +34 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +28 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +42 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +43 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +27 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +202 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +53 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +178 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +103 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +17 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +133 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +16 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +1362 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +172 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +1449 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +347 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +954 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +467 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +697 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.cpp +12 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +66 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +911 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +142 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +187 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +31 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +39 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +36 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +55 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +127 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +40 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +58 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +393 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +173 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +274 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +47 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +474 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +96 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +103 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +17 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +186 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +150 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +839 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +129 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +11 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +87 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +386 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +421 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +189 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +1251 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +19 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +46 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +467 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +146 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +179 -0
- package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +363 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CRC.cs +55 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CommandLineParser.cs +274 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/InBuffer.cs +72 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/OutBuffer.cs +47 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/IMatchFinder.cs +24 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzBinTree.cs +367 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzInWindow.cs +132 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzOutWindow.cs +110 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaBase.cs +76 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaDecoder.cs +398 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaEncoder.cs +1480 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs +364 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln +20 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaBench.cs +340 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs +29 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs +70 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs +42 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoder.cs +234 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs +117 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs +157 -0
- package/harmony/pushy/src/main/cpp/lzma/CS/7zip/ICoder.cs +157 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/7zC.txt +187 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/7zFormat.txt +469 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +177 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/installer.txt +166 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +651 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +437 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-specification.txt +1176 -0
- package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +345 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/CRC.java +52 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/BinTree.java +382 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/InWindow.java +131 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/OutWindow.java +85 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Base.java +88 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Decoder.java +329 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Encoder.java +1416 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java +55 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java +99 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Decoder.java +88 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Encoder.java +151 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/ICodeProgress.java +6 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaAlone.java +253 -0
- package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaBench.java +392 -0
- 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/installer/config.txt +5 -0
- package/harmony/pushy/src/main/cpp/lzma/bin/installer/cr.bat +5 -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
|
@@ -0,0 +1,1746 @@
|
|
|
1
|
+
//diff.cpp
|
|
2
|
+
//
|
|
3
|
+
/*
|
|
4
|
+
The MIT License (MIT)
|
|
5
|
+
Copyright (c) 2012-2018 HouSisong
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person
|
|
8
|
+
obtaining a copy of this software and associated documentation
|
|
9
|
+
files (the "Software"), to deal in the Software without
|
|
10
|
+
restriction, including without limitation the rights to use,
|
|
11
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the
|
|
13
|
+
Software is furnished to do so, subject to the following
|
|
14
|
+
conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be
|
|
17
|
+
included in all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
21
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
23
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
24
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
25
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
26
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
#include "diff.h"
|
|
30
|
+
#include <string.h> //strlen memcmp
|
|
31
|
+
#include <stdio.h> //fprintf
|
|
32
|
+
#include <algorithm> //std::max std::sort
|
|
33
|
+
#include <vector>
|
|
34
|
+
#include "private_diff/suffix_string.h"
|
|
35
|
+
#include "private_diff/bytes_rle.h"
|
|
36
|
+
#include "private_diff/compress_detect.h"
|
|
37
|
+
#include "private_diff/pack_uint.h"
|
|
38
|
+
#include "private_diff/mem_buf.h"
|
|
39
|
+
#include "../HPatch/patch.h"
|
|
40
|
+
#include "../HPatch/patch_private.h"
|
|
41
|
+
#include "private_diff/limit_mem_diff/covers.h"
|
|
42
|
+
#include "private_diff/limit_mem_diff/digest_matcher.h"
|
|
43
|
+
#include "private_diff/limit_mem_diff/stream_serialize.h"
|
|
44
|
+
#include "../../libParallel/parallel_import.h"
|
|
45
|
+
#if (_IS_USED_MULTITHREAD)
|
|
46
|
+
#include <thread> //if used vc++, need >= vc2012
|
|
47
|
+
#include <atomic>
|
|
48
|
+
#endif
|
|
49
|
+
using namespace hdiff_private;
|
|
50
|
+
#if (_IS_OUT_DIFF_INFO)
|
|
51
|
+
int _hdiff_is_out_diff_info=1;
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
static const char* kHDiffVersionType ="HDIFF13";
|
|
55
|
+
static const char* kHDiffSFVersionType="HDIFFSF20";
|
|
56
|
+
|
|
57
|
+
#define checki(value,info) { if (!(value)) { throw std::runtime_error(info); } }
|
|
58
|
+
#define check(value) checki(value,"check "#value" error!")
|
|
59
|
+
|
|
60
|
+
#if (_SSTRING_FAST_MATCH>0)
|
|
61
|
+
static const int kMinMatchLen = (_SSTRING_FAST_MATCH>kCoverMinMatchLen)?_SSTRING_FAST_MATCH:kCoverMinMatchLen;
|
|
62
|
+
#else
|
|
63
|
+
static const int kMinMatchLen = kCoverMinMatchLen; //min length for match search.
|
|
64
|
+
#endif
|
|
65
|
+
static const int kMinMatchScore = 2; //min match benefit threshold for cover search.
|
|
66
|
+
static const hpatch_uint64_t kDefaultLimitCoverLen=((hpatch_uint64_t)1<<30); //<=2GB-1
|
|
67
|
+
|
|
68
|
+
namespace{
|
|
69
|
+
|
|
70
|
+
typedef unsigned char TByte;
|
|
71
|
+
typedef size_t TUInt;
|
|
72
|
+
typedef ptrdiff_t TInt;
|
|
73
|
+
static const int kMaxLinkSpaceLength=(1<<9)-1; //max allowed distance for merging across cover lines.
|
|
74
|
+
|
|
75
|
+
//cover line.
|
|
76
|
+
struct TOldCover {
|
|
77
|
+
TInt oldPos;
|
|
78
|
+
TInt newPos;
|
|
79
|
+
TInt length;
|
|
80
|
+
inline TOldCover():oldPos(0),newPos(0),length(0) { }
|
|
81
|
+
inline TOldCover(TInt _oldPos,TInt _newPos,TInt _length)
|
|
82
|
+
:oldPos(_oldPos),newPos(_newPos),length(_length) { }
|
|
83
|
+
inline TOldCover(const TOldCover& cover)
|
|
84
|
+
:oldPos(cover.oldPos),newPos(cover.newPos),length(cover.length) { }
|
|
85
|
+
|
|
86
|
+
inline bool isCanLink(const TOldCover& next)const{//whether the cover lines can be linked.
|
|
87
|
+
return isCollinear(next)&&(linkSpaceLength(next)<=kMaxLinkSpaceLength);
|
|
88
|
+
}
|
|
89
|
+
inline bool isCollinear(const TOldCover& next)const{//whether the cover lines are collinear.
|
|
90
|
+
return cover_is_collinear(*this,next);
|
|
91
|
+
}
|
|
92
|
+
inline TInt linkSpaceLength(const TOldCover& next)const{//the space between cover lines.
|
|
93
|
+
return next.oldPos-(oldPos+length);
|
|
94
|
+
}
|
|
95
|
+
inline void Link(const TOldCover& next){// link&merge two collinear cover lines.
|
|
96
|
+
assert(isCollinear(next));
|
|
97
|
+
assert(oldPos<=next.oldPos);
|
|
98
|
+
length = (next.oldPos-oldPos)+next.length;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
struct TDiffData{
|
|
104
|
+
const TByte* newData;
|
|
105
|
+
const TByte* newData_end;
|
|
106
|
+
const TByte* oldData;
|
|
107
|
+
const TByte* oldData_end;
|
|
108
|
+
inline TDiffData():newData(0),newData_end(0),oldData(0),oldData_end(0){}
|
|
109
|
+
inline TDiffData(const TByte* _newData,const TByte* _newData_end,
|
|
110
|
+
const TByte* _oldData,const TByte* _oldData_end)
|
|
111
|
+
:newData(_newData),newData_end(_newData_end),oldData(_oldData),oldData_end(_oldData_end){}
|
|
112
|
+
inline TDiffData(const TDiffData& src)
|
|
113
|
+
:newData(src.newData),newData_end(src.newData_end),
|
|
114
|
+
oldData(src.oldData),oldData_end(src.oldData_end){}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
//Find the length of the matching substring.
|
|
119
|
+
template<TInt kMaxEqLenLimit>
|
|
120
|
+
static TInt getEqualLengthLimit(const TByte* x,const TByte* x_end,
|
|
121
|
+
const TByte* y,const TByte* y_end){
|
|
122
|
+
const TInt xLen=(TInt)(x_end-x);
|
|
123
|
+
const TInt yLen=(TInt)(y_end-y);
|
|
124
|
+
TInt maxEqLen=(xLen<yLen)?xLen:yLen;
|
|
125
|
+
if (kMaxEqLenLimit)
|
|
126
|
+
maxEqLen=(maxEqLen<=kMaxEqLenLimit)?maxEqLen:kMaxEqLenLimit;
|
|
127
|
+
for (TInt i=0; i<maxEqLen; ++i) {
|
|
128
|
+
if (x[i]!=y[i])
|
|
129
|
+
return i;
|
|
130
|
+
}
|
|
131
|
+
return maxEqLen;
|
|
132
|
+
}
|
|
133
|
+
#define getEqualLength(x,x_end,y,y_end) getEqualLengthLimit<0>(x,x_end,y,y_end)
|
|
134
|
+
|
|
135
|
+
struct TDiffLimit{
|
|
136
|
+
IDiffSearchCoverListener* listener;
|
|
137
|
+
size_t newPos;
|
|
138
|
+
size_t newEnd;
|
|
139
|
+
size_t recoverOldPos;
|
|
140
|
+
size_t recoverOldEnd;
|
|
141
|
+
TCompressDetect& nocover_detect;
|
|
142
|
+
TCompressDetect& cover_detect;
|
|
143
|
+
TOldCover lastCover_back;
|
|
144
|
+
int kMaxMatchDeep;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
//Get the longest match length and its position.
|
|
149
|
+
static TInt getBestMatch(TInt* out_pos,const TSuffixString& sstring,
|
|
150
|
+
const TByte* newData,const TByte* newData_end,
|
|
151
|
+
TInt curNewPos,TDiffLimit* diffLimit=0,size_t* out_limitSkip=0){
|
|
152
|
+
TInt sai=sstring.lower_bound(newData,newData_end);
|
|
153
|
+
if (sai<0) return 0;
|
|
154
|
+
const TInt matchDeep = diffLimit?diffLimit->kMaxMatchDeep:2;
|
|
155
|
+
const TInt kLimitOldPos=(TInt)(diffLimit?diffLimit->recoverOldPos:0);
|
|
156
|
+
const TInt kLimitOldEnd=(TInt)(diffLimit?diffLimit->recoverOldEnd:sstring.SASize());
|
|
157
|
+
|
|
158
|
+
const TByte* src_begin=sstring.src_begin();
|
|
159
|
+
const TByte* src_end=sstring.src_end();
|
|
160
|
+
TInt bestLength= kMinMatchLen -1;
|
|
161
|
+
TInt bestOldPos=-1;
|
|
162
|
+
bool leftOk = false;
|
|
163
|
+
bool rightOk = false;
|
|
164
|
+
for (TInt mdi= 0; mdi< matchDeep; ++mdi) {
|
|
165
|
+
if (mdi&1){
|
|
166
|
+
if (rightOk) continue;
|
|
167
|
+
} else {
|
|
168
|
+
if (leftOk) continue;
|
|
169
|
+
}
|
|
170
|
+
TInt i = sai + (1-(mdi&1)*2) * ((mdi+1)/2);
|
|
171
|
+
if ((i<0)|(i>=(src_end-src_begin))) continue;
|
|
172
|
+
TInt curOldPos=sstring.SA(i);
|
|
173
|
+
|
|
174
|
+
TInt curLength;
|
|
175
|
+
#define kTryEqLenLimit (1024*1+17)
|
|
176
|
+
if (0==diffLimit){
|
|
177
|
+
curLength=getEqualLength(newData,newData_end,src_begin+curOldPos,src_end);
|
|
178
|
+
}else{
|
|
179
|
+
curLength=getEqualLengthLimit<kTryEqLenLimit>(newData,newData_end,src_begin+curOldPos,src_end);
|
|
180
|
+
if ((kLimitOldPos<=curOldPos)&&(curOldPos<kLimitOldEnd)){
|
|
181
|
+
if (curLength==kTryEqLenLimit)
|
|
182
|
+
*out_limitSkip=kTryEqLenLimit/2;
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (curLength>bestLength){
|
|
188
|
+
if (diffLimit){
|
|
189
|
+
hpatch_TCover cover={(size_t)curOldPos,(size_t)curNewPos,(size_t)curLength};
|
|
190
|
+
hpatch_StreamPos_t hitPos;
|
|
191
|
+
diffLimit->listener->limitCover(diffLimit->listener,&cover,&hitPos);
|
|
192
|
+
if (hitPos<=(size_t)bestLength)
|
|
193
|
+
continue;
|
|
194
|
+
if (hitPos==kTryEqLenLimit){
|
|
195
|
+
curLength=getEqualLength(newData,newData_end,src_begin+curOldPos,src_end);
|
|
196
|
+
hpatch_TCover cover={(size_t)curOldPos,(size_t)curNewPos,(size_t)curLength};
|
|
197
|
+
diffLimit->listener->limitCover(diffLimit->listener,&cover,&hitPos);
|
|
198
|
+
}
|
|
199
|
+
curLength=(TInt)hitPos;
|
|
200
|
+
}
|
|
201
|
+
bestLength = curLength;
|
|
202
|
+
bestOldPos= curOldPos;
|
|
203
|
+
}
|
|
204
|
+
if (mdi&1){
|
|
205
|
+
rightOk=true; if (leftOk) break;
|
|
206
|
+
} else {
|
|
207
|
+
leftOk=true; if (rightOk) break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
*out_pos=bestOldPos;
|
|
211
|
+
return bestLength;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
//Roughly estimate the control data cost of the cover line;
|
|
216
|
+
inline static TInt getCoverCtrlCost(const TOldCover& cover,const TOldCover& lastCover){
|
|
217
|
+
static const int kUnLinkOtherScore=0;//0--2
|
|
218
|
+
return _getIntCost<TInt,TUInt>((TInt)(cover.oldPos-lastCover.oldPos))
|
|
219
|
+
+ _getUIntCost((TUInt)cover.length)
|
|
220
|
+
+ _getUIntCost((TUInt)(cover.newPos-lastCover.newPos)) + kUnLinkOtherScore;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//Roughly estimate the possible storage cost if the region is treated as a cover.
|
|
224
|
+
inline static TInt getCoverCost(const TOldCover& cover,const TDiffData& diff){
|
|
225
|
+
return (TInt)getRegionRleCost(diff.newData+cover.newPos,cover.length,diff.oldData+cover.oldPos);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Attempt to extend lastCover to completely replace matchCover;
|
|
229
|
+
static bool tryLinkExtend(TOldCover& lastCover,const TOldCover& matchCover,const TDiffData& diff,TDiffLimit* diffLimit){
|
|
230
|
+
if (lastCover.length<=0) return false;
|
|
231
|
+
const TInt linkSpaceLength=(matchCover.newPos-(lastCover.newPos+lastCover.length));
|
|
232
|
+
assert(linkSpaceLength>=0);
|
|
233
|
+
if (linkSpaceLength>kMaxLinkSpaceLength)
|
|
234
|
+
return false;
|
|
235
|
+
TInt linkOldPos=lastCover.oldPos+lastCover.length+linkSpaceLength;
|
|
236
|
+
if (linkOldPos+matchCover.length>(diff.oldData_end-diff.oldData))
|
|
237
|
+
return false;
|
|
238
|
+
const bool isCollinear=lastCover.isCollinear(matchCover);
|
|
239
|
+
if (diffLimit){
|
|
240
|
+
size_t cnewPos=lastCover.newPos+lastCover.length;
|
|
241
|
+
hpatch_TCover cover={(size_t)(lastCover.oldPos+lastCover.length),cnewPos,
|
|
242
|
+
(size_t)(linkSpaceLength+(isCollinear?0:matchCover.length))};
|
|
243
|
+
if (!diffLimit->listener->limitCover(diffLimit->listener,&cover,0))
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
if (isCollinear){// Already collinear;
|
|
247
|
+
lastCover.Link(matchCover);
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
TInt matchCost=getCoverCtrlCost(matchCover,lastCover);
|
|
252
|
+
TInt lastLinkCost=(TInt)getRegionRleCost(diff.newData+matchCover.newPos,matchCover.length,diff.oldData+linkOldPos);
|
|
253
|
+
if (lastLinkCost>matchCost)
|
|
254
|
+
return false;
|
|
255
|
+
TInt len=lastCover.length+linkSpaceLength+(matchCover.length*2/3);// Extend most of it, leaving the remaining possible extension to extend_cover.
|
|
256
|
+
len+=getEqualLength(diff.newData+lastCover.newPos+len,diff.newData_end,
|
|
257
|
+
diff.oldData+lastCover.oldPos+len,diff.oldData_end);
|
|
258
|
+
if (diffLimit){
|
|
259
|
+
TInt limitLen=diffLimit->newEnd-lastCover.newPos;
|
|
260
|
+
len=len<limitLen?len:limitLen;
|
|
261
|
+
TInt safeLen=lastCover.length+linkSpaceLength+matchCover.length;
|
|
262
|
+
if (len>safeLen){
|
|
263
|
+
hpatch_TCover cover={(size_t)(lastCover.oldPos+safeLen),(size_t)(lastCover.newPos+safeLen),
|
|
264
|
+
(size_t)(len-safeLen)};
|
|
265
|
+
hpatch_StreamPos_t hitPos;
|
|
266
|
+
diffLimit->listener->limitCover(diffLimit->listener,&cover,&hitPos);
|
|
267
|
+
len=(TInt)(safeLen+hitPos);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
while ((len>0) && (diff.newData[lastCover.newPos+len-1]
|
|
271
|
+
!=diff.oldData[lastCover.oldPos+len-1])) {
|
|
272
|
+
--len;
|
|
273
|
+
}
|
|
274
|
+
lastCover.length=len;
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Attempt to set lastCover as an extension of the line where matchCover is located, achieving collinearity (increasing merge possibilities, etc.);
|
|
279
|
+
static void tryCollinear(TOldCover& lastCover,const TOldCover& matchCover,const TDiffData& diff,TDiffLimit* diffLimit){
|
|
280
|
+
if (lastCover.length<=0) return;
|
|
281
|
+
if (lastCover.isCollinear(matchCover)) return; // Already collinear;
|
|
282
|
+
|
|
283
|
+
TInt linkOldPos=matchCover.oldPos-(matchCover.newPos-lastCover.newPos);
|
|
284
|
+
if ((linkOldPos<0)||(linkOldPos+lastCover.length>(diff.oldData_end-diff.oldData)))
|
|
285
|
+
return;
|
|
286
|
+
if (diffLimit){
|
|
287
|
+
hpatch_TCover cover={ (size_t)linkOldPos,(size_t)lastCover.newPos,(size_t)lastCover.length};
|
|
288
|
+
if (!diffLimit->listener->limitCover(diffLimit->listener,&cover,0))
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
TInt lastCost=getCoverCost(lastCover,diff);
|
|
292
|
+
TInt matchLinkCost=(TInt)getRegionRleCost(diff.newData+lastCover.newPos,lastCover.length,diff.oldData+linkOldPos);
|
|
293
|
+
if (lastCost>=matchLinkCost)
|
|
294
|
+
lastCover.oldPos=linkOldPos;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
// Find suitable cover lines.
|
|
299
|
+
static void _search_cover(std::vector<TOldCover>& covers,const TDiffData& diff,
|
|
300
|
+
const TSuffixString& sstring,TDiffLimit* diffLimit,bool isCanExtendCover){
|
|
301
|
+
if (sstring.SASize()<=0) return;
|
|
302
|
+
TInt newPos=diffLimit?diffLimit->newPos:0;
|
|
303
|
+
const TInt newEnd=diffLimit?diffLimit->newEnd:(diff.newData_end-diff.newData);
|
|
304
|
+
if (newEnd-newPos<=kMinMatchLen) return;
|
|
305
|
+
const TInt maxSearchNewPos=newEnd-kMinMatchLen;
|
|
306
|
+
const size_t cover_begin=covers.size();
|
|
307
|
+
|
|
308
|
+
TOldCover lastCover(0,0,0);
|
|
309
|
+
while (newPos<=maxSearchNewPos) {
|
|
310
|
+
TInt matchOldPos=0;
|
|
311
|
+
size_t limitSkip=1;
|
|
312
|
+
TInt matchEqLength=getBestMatch(&matchOldPos,sstring,diff.newData+newPos,diff.newData+newEnd,newPos,
|
|
313
|
+
diffLimit,&limitSkip);
|
|
314
|
+
if (matchEqLength<kMinMatchLen){
|
|
315
|
+
newPos+=limitSkip;
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
TOldCover matchCover(matchOldPos,newPos,matchEqLength);
|
|
319
|
+
if (matchEqLength-getCoverCtrlCost(matchCover,lastCover)<kMinMatchScore){
|
|
320
|
+
++newPos;// The next string to match (matching byte by byte is relatively slow).
|
|
321
|
+
continue;
|
|
322
|
+
}//else matched
|
|
323
|
+
|
|
324
|
+
if (isCanExtendCover){
|
|
325
|
+
if (tryLinkExtend(lastCover,matchCover,diff,diffLimit)){//use link
|
|
326
|
+
if (covers.size()==cover_begin)
|
|
327
|
+
covers.push_back(lastCover);
|
|
328
|
+
else
|
|
329
|
+
covers.back()=lastCover;
|
|
330
|
+
}else{ //use match
|
|
331
|
+
if (covers.size()>cover_begin)// Attempt collinearity;
|
|
332
|
+
tryCollinear(covers.back(),matchCover,diff,diffLimit);
|
|
333
|
+
covers.push_back(matchCover);
|
|
334
|
+
}
|
|
335
|
+
}else{
|
|
336
|
+
covers.push_back(matchCover);
|
|
337
|
+
}
|
|
338
|
+
lastCover=covers.back();
|
|
339
|
+
newPos=std::max(newPos+1,lastCover.newPos+lastCover.length);// The selected cover does not allow overlap, which may not be the optimal strategy;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
//Select the appropriate cover lines and remove the unsuitable ones.
|
|
345
|
+
static void _select_cover(std::vector<TOldCover>& covers,size_t cover_begin,const TDiffData& diff,int kMinSingleMatchScore,
|
|
346
|
+
TCompressDetect& nocover_detect,TCompressDetect& cover_detect,
|
|
347
|
+
TDiffLimit* diffLimit,bool isCanExtendCover){
|
|
348
|
+
TOldCover lastCover(0,0,0);
|
|
349
|
+
if (diffLimit)
|
|
350
|
+
lastCover=diffLimit->lastCover_back;
|
|
351
|
+
const size_t coverSize_old=covers.size();
|
|
352
|
+
size_t insertIndex=cover_begin;
|
|
353
|
+
for (size_t i=cover_begin;i<coverSize_old;++i){
|
|
354
|
+
if (covers[i].length<=0) continue;// Skip the already deleted ones.
|
|
355
|
+
bool isNeedSave=false;
|
|
356
|
+
bool isCanLink=false;
|
|
357
|
+
if (isCanExtendCover&&(!isNeedSave)){// Possibility for forward merging.
|
|
358
|
+
if ((insertIndex>cover_begin)&&(covers[insertIndex-1].isCanLink(covers[i]))){
|
|
359
|
+
if (diffLimit){
|
|
360
|
+
const TOldCover& fc=covers[insertIndex-1];
|
|
361
|
+
hpatch_TCover cover={(size_t)(fc.oldPos+fc.length),(size_t)(fc.newPos+fc.length),
|
|
362
|
+
(size_t)fc.linkSpaceLength(covers[i])};
|
|
363
|
+
if (diffLimit->listener->limitCover(diffLimit->listener,&cover,0)){
|
|
364
|
+
isCanLink=true;
|
|
365
|
+
isNeedSave=true;
|
|
366
|
+
}
|
|
367
|
+
}else{
|
|
368
|
+
isCanLink=true;
|
|
369
|
+
isNeedSave=true;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (isCanExtendCover&&(i+1<coverSize_old)){// Check possibility for backward link merging
|
|
374
|
+
for (size_t j=i+1;j<coverSize_old; ++j) {
|
|
375
|
+
if (!covers[i].isCanLink(covers[j])) break;
|
|
376
|
+
if (diffLimit){
|
|
377
|
+
const TOldCover& fc=covers[i];
|
|
378
|
+
hpatch_TCover cover={(size_t)(fc.oldPos+fc.length),(size_t)(fc.newPos+fc.length),
|
|
379
|
+
(size_t)fc.linkSpaceLength(covers[j])};
|
|
380
|
+
if (diffLimit->listener->limitCover(diffLimit->listener,&cover,0)){
|
|
381
|
+
covers[i].Link(covers[j]);
|
|
382
|
+
covers[j].length=0;//del
|
|
383
|
+
}else{
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
}else{
|
|
387
|
+
covers[i].Link(covers[j]);
|
|
388
|
+
covers[j].length=0;//del
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (!isNeedSave){// Whether to keep the single cover.
|
|
394
|
+
TInt noCoverCost=nocover_detect.cost(diff.newData+covers[i].newPos,covers[i].length);
|
|
395
|
+
TInt coverCost=cover_detect.cost(diff.newData+covers[i].newPos,covers[i].length,
|
|
396
|
+
diff.oldData+covers[i].oldPos);
|
|
397
|
+
TInt coverSorce=noCoverCost-coverCost-getCoverCtrlCost(covers[i],lastCover);
|
|
398
|
+
isNeedSave=(coverSorce>=kMinSingleMatchScore);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (isNeedSave){
|
|
402
|
+
if (isCanLink){// Link merging.
|
|
403
|
+
covers[insertIndex-1].Link(covers[i]);
|
|
404
|
+
cover_detect.add_chars(diff.newData+lastCover.newPos+lastCover.length,
|
|
405
|
+
covers[insertIndex-1].length-lastCover.length,
|
|
406
|
+
diff.oldData+lastCover.oldPos+lastCover.length);
|
|
407
|
+
}else{
|
|
408
|
+
covers[insertIndex++]=covers[i];
|
|
409
|
+
nocover_detect.add_chars(diff.newData+lastCover.newPos+lastCover.length,
|
|
410
|
+
covers[i].newPos-(lastCover.newPos+lastCover.length));
|
|
411
|
+
cover_detect.add_chars(diff.newData+covers[i].newPos,covers[i].length,
|
|
412
|
+
diff.oldData+covers[i].oldPos);
|
|
413
|
+
}
|
|
414
|
+
lastCover=covers[insertIndex-1];
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
covers.resize(insertIndex);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
static void select_cover(std::vector<TOldCover>& covers,size_t cover_begin,const TDiffData& diff,
|
|
421
|
+
int kMinSingleMatchScore,TDiffLimit* diffLimit,bool isCanExtendCover){
|
|
422
|
+
if (diffLimit==0){
|
|
423
|
+
TCompressDetect nocover_detect;
|
|
424
|
+
TCompressDetect cover_detect;
|
|
425
|
+
_select_cover(covers,cover_begin,diff,kMinSingleMatchScore,nocover_detect,cover_detect,0,isCanExtendCover);
|
|
426
|
+
}else{
|
|
427
|
+
_select_cover(covers,cover_begin,diff,kMinSingleMatchScore,diffLimit->nocover_detect,
|
|
428
|
+
diffLimit->cover_detect,diffLimit,isCanExtendCover);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
typedef size_t TFixedFloatSmooth; // Fixed-point number.
|
|
434
|
+
static const TFixedFloatSmooth kFixedFloatSmooth_base=1024;// Position of fixed-point decimal point.
|
|
435
|
+
|
|
436
|
+
// Get the length of positions that can be extended.
|
|
437
|
+
static TInt getCanExtendLength(TInt oldPos,TInt newPos,int inc,TInt newPos_min,TInt lastNewEnd,
|
|
438
|
+
const TDiffData& diff,const TFixedFloatSmooth kExtendMinSameRatio){
|
|
439
|
+
static const unsigned int kSmoothLength=4;
|
|
440
|
+
|
|
441
|
+
TFixedFloatSmooth curBestSameRatio=0;
|
|
442
|
+
TInt curBestLength=0;
|
|
443
|
+
TUInt curSameCount=0;
|
|
444
|
+
const TFixedFloatSmooth kLimitSameCount=(~(TFixedFloatSmooth)0)/kFixedFloatSmooth_base;
|
|
445
|
+
for (TUInt length=1; (oldPos>=0)&&(oldPos<(diff.oldData_end-diff.oldData))
|
|
446
|
+
&&(newPos>=newPos_min)&&(newPos<lastNewEnd); ++length,oldPos+=inc,newPos+=inc) {
|
|
447
|
+
if (diff.oldData[oldPos]==diff.newData[newPos]){
|
|
448
|
+
++curSameCount;
|
|
449
|
+
|
|
450
|
+
if (curSameCount>= kLimitSameCount) break; //for curSameCount*kFixedFloatSmooth_base
|
|
451
|
+
const TFixedFloatSmooth curSameRatio= (curSameCount*kFixedFloatSmooth_base)
|
|
452
|
+
/(length+kSmoothLength);
|
|
453
|
+
if (curSameRatio>=curBestSameRatio){
|
|
454
|
+
curBestSameRatio=curSameRatio;
|
|
455
|
+
curBestLength=length;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if ((curBestSameRatio<kExtendMinSameRatio)||(curBestLength<=2)){
|
|
460
|
+
curBestLength=0;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return curBestLength;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Attempt to extend the cover area.
|
|
467
|
+
static void extend_cover(std::vector<TOldCover>& covers,size_t cover_begin,const TDiffData& diff,
|
|
468
|
+
const TFixedFloatSmooth kExtendMinSameRatio,TDiffLimit* diffLimit=0){
|
|
469
|
+
TInt lastNewEnd=diffLimit?diffLimit->newPos:0;
|
|
470
|
+
for (size_t i=cover_begin; i<covers.size(); ++i) {
|
|
471
|
+
TInt newPos_next;
|
|
472
|
+
if (i+1<covers.size())
|
|
473
|
+
newPos_next=covers[i+1].newPos;
|
|
474
|
+
else
|
|
475
|
+
newPos_next=diffLimit?diffLimit->newEnd:(TInt)(diff.newData_end-diff.newData);
|
|
476
|
+
TOldCover& curCover=covers[i];
|
|
477
|
+
if (diffLimit){
|
|
478
|
+
TInt limit_front=std::min(curCover.newPos-lastNewEnd,curCover.oldPos);
|
|
479
|
+
if (limit_front>0){
|
|
480
|
+
hpatch_TCover cover={(size_t)(curCover.oldPos-limit_front),
|
|
481
|
+
(size_t)(curCover.newPos-limit_front),(size_t)limit_front};
|
|
482
|
+
hpatch_StreamPos_t lenLimit;
|
|
483
|
+
diffLimit->listener->limitCover_front(diffLimit->listener,&cover,&lenLimit);
|
|
484
|
+
lastNewEnd=curCover.newPos-(TInt)lenLimit;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
TInt limit_back=newPos_next-(curCover.newPos+curCover.length);
|
|
488
|
+
if ((curCover.oldPos+curCover.length)+limit_back>(diff.oldData_end-diff.oldData))
|
|
489
|
+
limit_back=(diff.oldData_end-diff.oldData)-(curCover.oldPos+curCover.length);
|
|
490
|
+
if (limit_back>0){
|
|
491
|
+
hpatch_TCover cover={(size_t)(curCover.oldPos+curCover.length),
|
|
492
|
+
(size_t)(curCover.newPos+curCover.length),(size_t)limit_back};
|
|
493
|
+
hpatch_StreamPos_t lenLimit;
|
|
494
|
+
diffLimit->listener->limitCover(diffLimit->listener,&cover,&lenLimit);
|
|
495
|
+
newPos_next=(curCover.newPos+curCover.length)+ (TInt)lenLimit;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
// Extend forward.
|
|
499
|
+
TInt extendLength_front=getCanExtendLength(curCover.oldPos-1,curCover.newPos-1,
|
|
500
|
+
-1,lastNewEnd,newPos_next,diff,kExtendMinSameRatio);
|
|
501
|
+
if (extendLength_front>0){
|
|
502
|
+
curCover.oldPos-=extendLength_front;
|
|
503
|
+
curCover.newPos-=extendLength_front;
|
|
504
|
+
curCover.length+=extendLength_front;
|
|
505
|
+
}
|
|
506
|
+
// Extend backward.
|
|
507
|
+
TInt extendLength_back=getCanExtendLength(curCover.oldPos+curCover.length,
|
|
508
|
+
curCover.newPos+curCover.length,
|
|
509
|
+
1,lastNewEnd,newPos_next,diff,kExtendMinSameRatio);
|
|
510
|
+
if (extendLength_back>0){
|
|
511
|
+
curCover.length+=extendLength_back;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
lastNewEnd=curCover.newPos+curCover.length;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
template<class _TCover,class _TInt>
|
|
519
|
+
static void assert_cover_safe(const _TCover& cover,_TInt lastNewEnd,_TInt newSize,_TInt oldSize){
|
|
520
|
+
check(cover.length>0);
|
|
521
|
+
check(cover.newPos>=lastNewEnd);
|
|
522
|
+
check(cover.newPos<newSize);
|
|
523
|
+
check(cover.newPos+cover.length>0);
|
|
524
|
+
check(cover.newPos+cover.length<=newSize);
|
|
525
|
+
check(cover.oldPos>=0);
|
|
526
|
+
check(cover.oldPos<oldSize);
|
|
527
|
+
check(cover.oldPos+cover.length>0);
|
|
528
|
+
check(cover.oldPos+cover.length<=oldSize);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
static void assert_covers_safe(const TCovers& covers,hpatch_StreamPos_t newSize,hpatch_StreamPos_t oldSize){
|
|
532
|
+
hpatch_StreamPos_t lastNewEnd=0;
|
|
533
|
+
for (size_t i=0;i<covers.coverCount();++i){
|
|
534
|
+
TCover cover;
|
|
535
|
+
covers.covers(i,&cover);
|
|
536
|
+
assert_cover_safe(cover,lastNewEnd,newSize,oldSize);
|
|
537
|
+
lastNewEnd=cover.newPos+cover.length;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
static void assert_covers_safe(const std::vector<TOldCover>& covers,hpatch_StreamPos_t newSize,hpatch_StreamPos_t oldSize){
|
|
541
|
+
const TCovers _covers((void*)covers.data(),covers.size(),
|
|
542
|
+
sizeof(*covers.data())==sizeof(hpatch_TCover32));
|
|
543
|
+
assert_covers_safe(_covers,newSize,oldSize);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
static inline hpatch_StreamPos_t _clipLenByLimit(hpatch_StreamPos_t& clen,hpatch_StreamPos_t kMaxLen){
|
|
547
|
+
hpatch_StreamPos_t alen=clen;
|
|
548
|
+
assert(alen>kMaxLen);
|
|
549
|
+
do{
|
|
550
|
+
alen=(alen+1)>>1;
|
|
551
|
+
} while (alen>kMaxLen);
|
|
552
|
+
clen-=alen;
|
|
553
|
+
return alen;
|
|
554
|
+
}
|
|
555
|
+
static void _limitCoverLenth(std::vector<TOldCover>& covers,hpatch_StreamPos_t kMaxLen){
|
|
556
|
+
assert((0<kMaxLen)&&(0<(TInt)kMaxLen)&&(kMaxLen==(TInt)kMaxLen));
|
|
557
|
+
size_t csize=covers.size();
|
|
558
|
+
size_t isize=0;
|
|
559
|
+
for (size_t i=0;i<csize;++i){
|
|
560
|
+
hpatch_StreamPos_t clen=covers[i].length;
|
|
561
|
+
while (clen>kMaxLen){
|
|
562
|
+
++isize;
|
|
563
|
+
_clipLenByLimit(clen,kMaxLen);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
if (isize==0) return;
|
|
567
|
+
|
|
568
|
+
covers.resize(csize+isize);
|
|
569
|
+
memmove(covers.data()+isize,covers.data(),sizeof(TOldCover)*csize);
|
|
570
|
+
size_t insertIndex=0;
|
|
571
|
+
for (size_t i=isize;i<covers.size();++i){
|
|
572
|
+
hpatch_StreamPos_t clen=covers[i].length;
|
|
573
|
+
while (clen>kMaxLen){
|
|
574
|
+
--isize;
|
|
575
|
+
TInt clipLen=(TInt)_clipLenByLimit(clen,kMaxLen);
|
|
576
|
+
assert(insertIndex<i);
|
|
577
|
+
covers[insertIndex++]=TOldCover(covers[i].oldPos,covers[i].newPos,clipLen);
|
|
578
|
+
covers[i].oldPos+=clipLen;
|
|
579
|
+
covers[i].newPos+=clipLen;
|
|
580
|
+
covers[i].length-=clipLen;
|
|
581
|
+
assert(covers[i].length==clen);
|
|
582
|
+
}
|
|
583
|
+
covers[insertIndex++]=covers[i];
|
|
584
|
+
}
|
|
585
|
+
assert(isize==0);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// Serialized output of diff result.
|
|
589
|
+
static void serialize_diff(const TDiffData& diff,const std::vector<TOldCover>& covers,std::vector<TByte>& out_diff){
|
|
590
|
+
const TUInt coverCount=(TUInt)covers.size();
|
|
591
|
+
std::vector<TByte> length_buf;
|
|
592
|
+
std::vector<TByte> inc_newPos_buf;
|
|
593
|
+
std::vector<TByte> inc_oldPos_buf;
|
|
594
|
+
{
|
|
595
|
+
TInt oldPosBack=0;
|
|
596
|
+
TInt lastNewEnd=0;
|
|
597
|
+
for (TUInt i=0; i<coverCount; ++i) {
|
|
598
|
+
packUInt(length_buf, (TUInt)covers[i].length);
|
|
599
|
+
assert(covers[i].newPos>=lastNewEnd);
|
|
600
|
+
packUInt(inc_newPos_buf,(TUInt)(covers[i].newPos-lastNewEnd)); //save inc_newPos
|
|
601
|
+
if (covers[i].oldPos>=oldPosBack){ //save inc_oldPos
|
|
602
|
+
packUIntWithTag(inc_oldPos_buf,(TUInt)(covers[i].oldPos-oldPosBack), 0, 1);
|
|
603
|
+
}else{
|
|
604
|
+
packUIntWithTag(inc_oldPos_buf,(TUInt)(oldPosBack-covers[i].oldPos), 1, 1);//sub safe
|
|
605
|
+
}
|
|
606
|
+
oldPosBack=covers[i].oldPos;
|
|
607
|
+
lastNewEnd=covers[i].newPos+covers[i].length;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
const TCovers _covers((void*)covers.data(),covers.size(),
|
|
612
|
+
sizeof(*covers.data())==sizeof(hpatch_TCover32));
|
|
613
|
+
hpatch_TStreamInput _newDataStream;
|
|
614
|
+
mem_as_hStreamInput(&_newDataStream,diff.newData,diff.newData_end);
|
|
615
|
+
TNewDataDiffStream newDataDiffStream(_covers,&_newDataStream);
|
|
616
|
+
|
|
617
|
+
packUInt(out_diff, (TUInt)coverCount);
|
|
618
|
+
packUInt(out_diff, (TUInt)length_buf.size());
|
|
619
|
+
packUInt(out_diff, (TUInt)inc_newPos_buf.size());
|
|
620
|
+
packUInt(out_diff, (TUInt)inc_oldPos_buf.size());
|
|
621
|
+
packUInt(out_diff, newDataDiffStream.streamSize);
|
|
622
|
+
pushBack(out_diff,length_buf);
|
|
623
|
+
pushBack(out_diff,inc_newPos_buf);
|
|
624
|
+
pushBack(out_diff,inc_oldPos_buf);
|
|
625
|
+
pushBack(out_diff,&newDataDiffStream);
|
|
626
|
+
|
|
627
|
+
TNewDataSubDiffStream_mem newDataSubDiff(diff.newData,diff.newData_end,
|
|
628
|
+
diff.oldData,diff.oldData_end,_covers);
|
|
629
|
+
bytesRLE_save(out_diff,&newDataSubDiff,kRle_bestSize);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
template<class T>
|
|
633
|
+
static void _outType(std::vector<TByte>& out_data,T* compressPlugin,const char* versionType=kHDiffVersionType){
|
|
634
|
+
//type version
|
|
635
|
+
pushCStr(out_data,versionType);
|
|
636
|
+
pushCStr(out_data,"&");
|
|
637
|
+
{//compressType
|
|
638
|
+
const char* compressType="";
|
|
639
|
+
if (compressPlugin)
|
|
640
|
+
compressType=compressPlugin->compressType();
|
|
641
|
+
size_t compressTypeLen=strlen(compressType);
|
|
642
|
+
check(compressTypeLen<=hpatch_kMaxPluginTypeLength);
|
|
643
|
+
check(0==strchr(compressType,'&'));
|
|
644
|
+
pushCStr(out_data,compressType);
|
|
645
|
+
}
|
|
646
|
+
const TByte _cstrEndTag='\0';//c string end tag
|
|
647
|
+
pushBack(out_data,&_cstrEndTag,(&_cstrEndTag)+1);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
static void _dispose_cover(std::vector<TOldCover>& covers,size_t cover_begin,const TDiffData& diff,
|
|
652
|
+
int kMinSingleMatchScore,TDiffLimit* diffLimit,bool isCanExtendCover){
|
|
653
|
+
if (isCanExtendCover){
|
|
654
|
+
TFixedFloatSmooth kExtendMinSameRatio=kMinSingleMatchScore*36+254;
|
|
655
|
+
if (kExtendMinSameRatio<200) kExtendMinSameRatio=200;
|
|
656
|
+
if (kExtendMinSameRatio>800) kExtendMinSameRatio=800;
|
|
657
|
+
|
|
658
|
+
extend_cover(covers,cover_begin,diff,kExtendMinSameRatio,diffLimit);// First try to extend.
|
|
659
|
+
select_cover(covers,cover_begin,diff,kMinSingleMatchScore,diffLimit,isCanExtendCover);
|
|
660
|
+
extend_cover(covers,cover_begin,diff,kExtendMinSameRatio,diffLimit);// select_cover will delete some cover lines, so re-extend.
|
|
661
|
+
}else{
|
|
662
|
+
select_cover(covers,cover_begin,diff,kMinSingleMatchScore,diffLimit,isCanExtendCover);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
static void search_and_dispose_cover(std::vector<TOldCover>& covers,const TDiffData& diff,
|
|
668
|
+
const TSuffixString& sstring,int kMinSingleMatchScore,
|
|
669
|
+
TDiffLimit* diffLimit,bool isCanExtendCover){
|
|
670
|
+
const size_t cover_begin=covers.size();
|
|
671
|
+
_search_cover(covers,diff,sstring,diffLimit,isCanExtendCover);
|
|
672
|
+
if (covers.size()>cover_begin)
|
|
673
|
+
_dispose_cover(covers,cover_begin,diff,kMinSingleMatchScore,diffLimit,isCanExtendCover);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
#define first_search_and_dispose_cover(covers,diff,sstring,kMinSingleMatchScore,isCanExtendCover) search_and_dispose_cover(covers,diff,sstring,kMinSingleMatchScore,0,isCanExtendCover);
|
|
677
|
+
|
|
678
|
+
#if (_IS_USED_MULTITHREAD)
|
|
679
|
+
const size_t kPartPepeatSize=1024*2;
|
|
680
|
+
struct mt_data_t{
|
|
681
|
+
const TDiffData* diff;
|
|
682
|
+
const TSuffixString* sstring;
|
|
683
|
+
ICoverLinesListener* listener;
|
|
684
|
+
int kMinSingleMatchScore;
|
|
685
|
+
size_t workBlockSize;
|
|
686
|
+
bool isCanExtendCover;
|
|
687
|
+
std::atomic<size_t> workIndex;
|
|
688
|
+
bool nextBlock(hdiff_TRange* out_newRange){
|
|
689
|
+
const size_t kNewSize=(diff->newData_end-diff->newData);
|
|
690
|
+
if (listener)
|
|
691
|
+
return listener->next_search_block_MT(listener,out_newRange);
|
|
692
|
+
size_t i=workIndex++;
|
|
693
|
+
hpatch_StreamPos_t pos=i*(hpatch_StreamPos_t)workBlockSize;
|
|
694
|
+
if (pos<kNewSize){
|
|
695
|
+
out_newRange->beginPos=pos;
|
|
696
|
+
pos+=workBlockSize+kPartPepeatSize;
|
|
697
|
+
pos=(pos<=kNewSize)?pos:kNewSize;
|
|
698
|
+
out_newRange->endPos=pos;
|
|
699
|
+
return true;
|
|
700
|
+
}else{
|
|
701
|
+
return false;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
static void _fsearch_and_dispose_cover_thread(std::vector<TOldCover>* _covers,mt_data_t* mt){
|
|
707
|
+
std::vector<TOldCover>& covers=*_covers;
|
|
708
|
+
const TDiffData& diff=*mt->diff;
|
|
709
|
+
hdiff_TRange newRange;
|
|
710
|
+
while (mt->nextBlock(&newRange)){
|
|
711
|
+
TDiffData diff_part(diff);
|
|
712
|
+
diff_part.newData=diff.newData+(size_t)newRange.beginPos;
|
|
713
|
+
diff_part.newData_end=diff.newData+(size_t)newRange.endPos;
|
|
714
|
+
size_t coverCountBack=covers.size();
|
|
715
|
+
first_search_and_dispose_cover(covers,diff_part,*mt->sstring,mt->kMinSingleMatchScore,mt->isCanExtendCover);
|
|
716
|
+
for (size_t i=coverCountBack;i<covers.size();++i)
|
|
717
|
+
covers[i].newPos+=(TInt)newRange.beginPos;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
#endif
|
|
721
|
+
|
|
722
|
+
static void first_search_and_dispose_cover_MT(std::vector<TOldCover>& covers,const TDiffData& diff,
|
|
723
|
+
const TSuffixString& sstring,int kMinSingleMatchScore,
|
|
724
|
+
ICoverLinesListener* listener,size_t threadNum,bool isCanExtendCover){
|
|
725
|
+
#if (_IS_USED_MULTITHREAD)
|
|
726
|
+
const size_t kMinParallelSize=1024*1024*2;
|
|
727
|
+
const size_t kBestParallelSize=1024*1024*8;
|
|
728
|
+
size_t newSize=diff.newData_end-diff.newData;
|
|
729
|
+
if ((threadNum>1)&&(diff.oldData!=diff.oldData_end)&&(newSize>=kMinParallelSize)){
|
|
730
|
+
const size_t maxThreanNum=newSize/(kMinParallelSize/2);
|
|
731
|
+
threadNum=(threadNum<=maxThreanNum)?threadNum:maxThreanNum;
|
|
732
|
+
size_t workCount=(newSize+kBestParallelSize-1)/kBestParallelSize;
|
|
733
|
+
workCount=(threadNum>workCount)?threadNum:workCount;
|
|
734
|
+
|
|
735
|
+
const size_t threadCount=threadNum-1;
|
|
736
|
+
std::vector<std::thread> threads(threadCount);
|
|
737
|
+
std::vector<std::vector<TOldCover> > threadCovers(threadCount);
|
|
738
|
+
mt_data_t mt_data;
|
|
739
|
+
mt_data.diff=&diff;
|
|
740
|
+
mt_data.sstring=&sstring;
|
|
741
|
+
mt_data.listener=(listener&&listener->next_search_block_MT)?listener:0;
|
|
742
|
+
mt_data.kMinSingleMatchScore=kMinSingleMatchScore;
|
|
743
|
+
mt_data.workBlockSize=(newSize+workCount-1)/workCount;
|
|
744
|
+
mt_data.workIndex=0;
|
|
745
|
+
mt_data.isCanExtendCover=isCanExtendCover;
|
|
746
|
+
if (mt_data.listener&&listener->begin_search_block)
|
|
747
|
+
listener->begin_search_block(listener,newSize,mt_data.workBlockSize,kPartPepeatSize);
|
|
748
|
+
for (size_t i=0;i<threadCount;i++)
|
|
749
|
+
threads[i]=std::thread(_fsearch_and_dispose_cover_thread,&threadCovers[i],&mt_data);
|
|
750
|
+
_fsearch_and_dispose_cover_thread(&covers,&mt_data);
|
|
751
|
+
for (size_t i=0;i<threadCount;i++){
|
|
752
|
+
threads[i].join();
|
|
753
|
+
covers.insert(covers.end(),threadCovers[i].begin(),threadCovers[i].end());
|
|
754
|
+
{ std::vector<TOldCover> tmp; tmp.swap(threadCovers[i]); }
|
|
755
|
+
}
|
|
756
|
+
tm_collate_covers(covers);
|
|
757
|
+
}else
|
|
758
|
+
#endif
|
|
759
|
+
{
|
|
760
|
+
first_search_and_dispose_cover(covers,diff,sstring,kMinSingleMatchScore,isCanExtendCover);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
static const hpatch_StreamPos_t _kNullCoverHitEndPos =hpatch_kNullStreamPos;
|
|
765
|
+
struct TDiffResearchCover:public IDiffResearchCover{
|
|
766
|
+
TDiffResearchCover(TDiffData& diff_,std::vector<TOldCover>& covers_,const TSuffixString& sstring_,
|
|
767
|
+
int kMinSingleMatchScore_,int kMaxMatchDeep_,bool _isCanExtendCover)
|
|
768
|
+
:diff(diff_), covers(covers_),sstring(sstring_),
|
|
769
|
+
kMinSingleMatchScore(kMinSingleMatchScore_),kMaxMatchDeep(kMaxMatchDeep_),
|
|
770
|
+
limitCoverIndex_back(~(size_t)0),limitCoverHitEndPos_back(_kNullCoverHitEndPos),
|
|
771
|
+
isCanExtendCover(_isCanExtendCover){ researchCover=_researchCover; }
|
|
772
|
+
|
|
773
|
+
void _researchRange(TDiffLimit* diffLimit){
|
|
774
|
+
search_and_dispose_cover(curCovers,diff,sstring,kMinSingleMatchScore,diffLimit,isCanExtendCover);
|
|
775
|
+
if (curCovers.empty()) return;
|
|
776
|
+
reCovers.insert(reCovers.end(),curCovers.begin(),curCovers.end());
|
|
777
|
+
curCovers.clear();
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
inline void endResearchCover(){
|
|
781
|
+
if (limitCoverHitEndPos_back!=_kNullCoverHitEndPos){
|
|
782
|
+
TOldCover& cover=covers[limitCoverIndex_back];
|
|
783
|
+
cover.oldPos+=(TInt)limitCoverHitEndPos_back;
|
|
784
|
+
cover.newPos+=(TInt)limitCoverHitEndPos_back;
|
|
785
|
+
cover.length-=(TInt)limitCoverHitEndPos_back;
|
|
786
|
+
limitCoverHitEndPos_back=_kNullCoverHitEndPos;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
inline void doResearchCover(IDiffSearchCoverListener* listener,size_t limitCoverIndex,
|
|
790
|
+
hpatch_StreamPos_t endPosBack,hpatch_StreamPos_t hitPos,hpatch_StreamPos_t hitLen){
|
|
791
|
+
if (limitCoverIndex_back!=limitCoverIndex)
|
|
792
|
+
endResearchCover();
|
|
793
|
+
limitCoverIndex_back=limitCoverIndex;
|
|
794
|
+
limitCoverHitEndPos_back=hitPos+hitLen;
|
|
795
|
+
|
|
796
|
+
const TOldCover& cover=covers[limitCoverIndex];
|
|
797
|
+
TOldCover lastCover_back(0,0,0);
|
|
798
|
+
if (endPosBack<hitPos){
|
|
799
|
+
lastCover_back.oldPos=cover.oldPos+(TInt)endPosBack;
|
|
800
|
+
lastCover_back.newPos=cover.newPos+(TInt)endPosBack;
|
|
801
|
+
lastCover_back.length=(TInt)(hitPos-endPosBack);
|
|
802
|
+
reCovers.push_back(lastCover_back);
|
|
803
|
+
}else {
|
|
804
|
+
assert(endPosBack==hitPos);
|
|
805
|
+
if (limitCoverIndex>0)
|
|
806
|
+
lastCover_back=covers[limitCoverIndex-1];
|
|
807
|
+
if ((!reCovers.empty())&&(reCovers.back().newPos>lastCover_back.newPos))
|
|
808
|
+
lastCover_back=reCovers.back();
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
TDiffLimit diffLimit={listener,cover.newPos+(size_t)hitPos,cover.newPos+(size_t)(hitPos+hitLen),
|
|
812
|
+
cover.oldPos+(size_t)hitPos,cover.oldPos+(size_t)(hitPos+hitLen),
|
|
813
|
+
nocover_detect,cover_detect,lastCover_back,kMaxMatchDeep};
|
|
814
|
+
_researchRange(&diffLimit);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
static void _researchCover(struct IDiffResearchCover* diffi,struct IDiffSearchCoverListener* listener,size_t limitCoverIndex,
|
|
818
|
+
hpatch_StreamPos_t endPosBack,hpatch_StreamPos_t hitPos,hpatch_StreamPos_t hitLen){
|
|
819
|
+
TDiffResearchCover* self=(TDiffResearchCover*)diffi;
|
|
820
|
+
self->doResearchCover(listener,limitCoverIndex,endPosBack,hitPos,hitLen);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
void researchFinish(){
|
|
824
|
+
endResearchCover();
|
|
825
|
+
size_t insert=0;
|
|
826
|
+
for (size_t i=0;i<covers.size();++i){
|
|
827
|
+
if (covers[i].length>0)
|
|
828
|
+
covers[insert++]=covers[i];
|
|
829
|
+
}
|
|
830
|
+
covers.resize(insert);
|
|
831
|
+
covers.insert(covers.end(),reCovers.begin(),reCovers.end());
|
|
832
|
+
std::inplace_merge(covers.begin(),covers.begin()+insert,
|
|
833
|
+
covers.end(),cover_cmp_by_new_t<TOldCover>());
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
TDiffData& diff;
|
|
837
|
+
std::vector<TOldCover>& covers;
|
|
838
|
+
const TSuffixString& sstring;
|
|
839
|
+
int kMinSingleMatchScore;
|
|
840
|
+
int kMaxMatchDeep;
|
|
841
|
+
std::vector<TOldCover> reCovers;
|
|
842
|
+
std::vector<TOldCover> curCovers;
|
|
843
|
+
size_t limitCoverIndex_back;
|
|
844
|
+
hpatch_StreamPos_t limitCoverHitEndPos_back;
|
|
845
|
+
const bool isCanExtendCover;
|
|
846
|
+
TCompressDetect nocover_detect;
|
|
847
|
+
TCompressDetect cover_detect;
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
struct TDiffInsertCover:public IDiffInsertCover{
|
|
851
|
+
inline TDiffInsertCover(std::vector<TOldCover>& _covers)
|
|
852
|
+
:covers(_covers){
|
|
853
|
+
insertCover=_insertCover;
|
|
854
|
+
}
|
|
855
|
+
static void* _insertCover(IDiffInsertCover* diffi,const void* pInsertCovers,size_t insertCoverCount,bool insertIsCover32){
|
|
856
|
+
TDiffInsertCover* self=(TDiffInsertCover*)diffi;
|
|
857
|
+
return self->_insertCover(pInsertCovers,insertCoverCount,insertIsCover32);
|
|
858
|
+
}
|
|
859
|
+
void* _insertCover(const void* pInsertCovers,size_t insertCoverCount,bool insertIsCover32){
|
|
860
|
+
const bool isCover32=sizeof(*covers.data())==sizeof(hpatch_TCover32);
|
|
861
|
+
if (insertIsCover32==isCover32){
|
|
862
|
+
covers.insert(covers.end(),(const TOldCover*)pInsertCovers,
|
|
863
|
+
((const TOldCover*)pInsertCovers)+insertCoverCount);
|
|
864
|
+
}else{
|
|
865
|
+
size_t oldSize=covers.size();
|
|
866
|
+
covers.resize(oldSize +insertCoverCount);
|
|
867
|
+
for (size_t i=0;i<insertCoverCount;i++){
|
|
868
|
+
if (insertIsCover32){
|
|
869
|
+
const hpatch_TCover32& s=((const hpatch_TCover32*)pInsertCovers)[i];
|
|
870
|
+
covers[oldSize+i]=TOldCover((TInt)s.oldPos,(TInt)s.newPos,(TInt)s.length);
|
|
871
|
+
}else{
|
|
872
|
+
const hpatch_TCover& s=((const hpatch_TCover*)pInsertCovers)[i];
|
|
873
|
+
covers[oldSize+i]=TOldCover((TInt)s.oldPos,(TInt)s.newPos,(TInt)s.length);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
return covers.data();
|
|
878
|
+
}
|
|
879
|
+
std::vector<TOldCover>& covers;
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
static void get_diff(TDiffData& diff,std::vector<TOldCover>& covers,
|
|
884
|
+
int kMinSingleMatchScore,
|
|
885
|
+
bool isUseBigCacheMatch,ICoverLinesListener* listener,
|
|
886
|
+
const TSuffixString* sstring,size_t threadNum,
|
|
887
|
+
bool isCanExtendCover=true){
|
|
888
|
+
_out_diff_info(" match covers by suffix string ...\n");
|
|
889
|
+
const bool isCover32=sizeof(*covers.data())==sizeof(hpatch_TCover32);
|
|
890
|
+
if (!isCover32)
|
|
891
|
+
assert(sizeof(*covers.data())==sizeof(hpatch_TCover));
|
|
892
|
+
const hpatch_StreamPos_t maxCoverLen=(listener&&listener->get_limit_cover_length)?
|
|
893
|
+
listener->get_limit_cover_length(listener):kDefaultLimitCoverLen;
|
|
894
|
+
{
|
|
895
|
+
TSuffixString _sstring_default(isUseBigCacheMatch);
|
|
896
|
+
if (sstring==0){
|
|
897
|
+
_out_diff_info(" create suffix string ...\n");
|
|
898
|
+
_sstring_default.resetSuffixString(diff.oldData,diff.oldData_end,threadNum);
|
|
899
|
+
sstring=&_sstring_default;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
_out_diff_info(" search covers by suffix string ...\n");
|
|
903
|
+
first_search_and_dispose_cover_MT(covers,diff,*sstring,kMinSingleMatchScore,listener,threadNum,isCanExtendCover);
|
|
904
|
+
_limitCoverLenth(covers,maxCoverLen);
|
|
905
|
+
assert_covers_safe(covers,diff.newData_end-diff.newData,diff.oldData_end-diff.oldData);
|
|
906
|
+
if (listener&&listener->search_cover_limit&&
|
|
907
|
+
listener->search_cover_limit(listener,covers.data(),covers.size(),isCover32)){
|
|
908
|
+
_out_diff_info(" research covers by limit ...\n");
|
|
909
|
+
TDiffResearchCover diffResearchCover(diff,covers,*sstring,kMinSingleMatchScore,
|
|
910
|
+
listener->get_max_match_deep?listener->get_max_match_deep(listener):kDefaultMaxMatchDeepForLimit,
|
|
911
|
+
isCanExtendCover);
|
|
912
|
+
listener->research_cover(listener,&diffResearchCover,covers.data(),covers.size(),isCover32);
|
|
913
|
+
diffResearchCover.researchFinish();
|
|
914
|
+
_limitCoverLenth(covers,maxCoverLen);
|
|
915
|
+
assert_covers_safe(covers,diff.newData_end-diff.newData,diff.oldData_end-diff.oldData);
|
|
916
|
+
}
|
|
917
|
+
sstring=0;
|
|
918
|
+
_sstring_default.clear();
|
|
919
|
+
}
|
|
920
|
+
if (listener&&listener->insert_cover){
|
|
921
|
+
TDiffInsertCover diffInsertCover(covers);
|
|
922
|
+
hpatch_StreamPos_t newDataSize=(size_t)(diff.newData_end-diff.newData);
|
|
923
|
+
hpatch_StreamPos_t oldDataSize=(size_t)(diff.oldData_end-diff.oldData);
|
|
924
|
+
listener->insert_cover(listener,&diffInsertCover,covers.data(),covers.size(),isCover32,
|
|
925
|
+
&newDataSize,&oldDataSize);
|
|
926
|
+
diff.newData_end=diff.newData+(size_t)newDataSize;
|
|
927
|
+
diff.oldData_end=diff.oldData+(size_t)oldDataSize;
|
|
928
|
+
_limitCoverLenth(covers,maxCoverLen);
|
|
929
|
+
assert_covers_safe(covers,diff.newData_end-diff.newData,diff.oldData_end-diff.oldData);
|
|
930
|
+
}
|
|
931
|
+
if (listener&&listener->search_cover_finish){
|
|
932
|
+
hpatch_StreamPos_t newDataSize=(size_t)(diff.newData_end-diff.newData);
|
|
933
|
+
hpatch_StreamPos_t oldDataSize=(size_t)(diff.oldData_end-diff.oldData);
|
|
934
|
+
size_t newCoverCount=covers.size();
|
|
935
|
+
listener->search_cover_finish(listener,covers.data(),&newCoverCount,isCover32,
|
|
936
|
+
&newDataSize,&oldDataSize);
|
|
937
|
+
check(newCoverCount<=covers.size());
|
|
938
|
+
covers.resize(newCoverCount);
|
|
939
|
+
diff.newData_end=diff.newData+(size_t)newDataSize;
|
|
940
|
+
diff.oldData_end=diff.oldData+(size_t)oldDataSize;
|
|
941
|
+
_limitCoverLenth(covers,maxCoverLen);
|
|
942
|
+
assert_covers_safe(covers,diff.newData_end-diff.newData,diff.oldData_end-diff.oldData);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
}//end namespace
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
void create_diff(const TByte* newData,const TByte* newData_end,
|
|
950
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
951
|
+
std::vector<TByte>& out_diff,
|
|
952
|
+
int kMinSingleMatchScore,bool isUseBigCacheMatch,size_t threadNum){
|
|
953
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
954
|
+
std::vector<TOldCover> covers;
|
|
955
|
+
get_diff(diff,covers,kMinSingleMatchScore,isUseBigCacheMatch,0,0,threadNum);
|
|
956
|
+
serialize_diff(diff,covers,out_diff);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
void create_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
960
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
961
|
+
std::vector<TByte>& out_diff,const hdiff_TCompress* compressPlugin,
|
|
962
|
+
int kMinSingleMatchScore,bool isUseBigCacheMatch,
|
|
963
|
+
ICoverLinesListener* listener,size_t threadNum){
|
|
964
|
+
TVectorAsStreamOutput outDiffStream(out_diff);
|
|
965
|
+
create_compressed_diff(newData,newData_end,oldData,oldData_end,&outDiffStream,
|
|
966
|
+
compressPlugin,kMinSingleMatchScore,isUseBigCacheMatch,listener,threadNum);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
static void serialize_compressed_diff(const hpatch_TStreamInput* newData,
|
|
970
|
+
const hpatch_TStreamInput* oldData,
|
|
971
|
+
bool isZeroSubDiff,const TCovers& covers,
|
|
972
|
+
const hpatch_TStreamOutput* out_diff,
|
|
973
|
+
const hdiff_TCompress* compressPlugin);
|
|
974
|
+
void create_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
975
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
976
|
+
const hpatch_TStreamOutput* out_diff,const hdiff_TCompress* compressPlugin,
|
|
977
|
+
int kMinSingleMatchScore,bool isUseBigCacheMatch,
|
|
978
|
+
ICoverLinesListener* listener,size_t threadNum){
|
|
979
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
980
|
+
std::vector<TOldCover> covers;
|
|
981
|
+
get_diff(diff,covers,kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum);
|
|
982
|
+
|
|
983
|
+
hpatch_TStreamInput _newStream; hpatch_TStreamInput* newStream=&_newStream;
|
|
984
|
+
hpatch_TStreamInput _oldStream; hpatch_TStreamInput* oldStream=&_oldStream;
|
|
985
|
+
mem_as_hStreamInput(newStream,diff.newData,diff.newData_end);
|
|
986
|
+
mem_as_hStreamInput(oldStream,diff.oldData,diff.oldData_end);
|
|
987
|
+
if (listener&&listener->map_streams_befor_serialize)
|
|
988
|
+
listener->map_streams_befor_serialize(listener,(const hpatch_TStreamInput **)&newStream,(const hpatch_TStreamInput **)&oldStream);
|
|
989
|
+
const TCovers _covers((void*)covers.data(),covers.size(),
|
|
990
|
+
sizeof(*covers.data())==sizeof(hpatch_TCover32));
|
|
991
|
+
serialize_compressed_diff(newStream,oldStream,false,_covers,out_diff,compressPlugin);
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
void serialize_single_compressed_diff(const hpatch_TStreamInput* newStream,const hpatch_TStreamInput* oldStream,
|
|
995
|
+
bool isZeroSubDiff,const TCovers& covers,const hpatch_TStreamOutput* out_diff,
|
|
996
|
+
const hdiff_TCompress* compressPlugin,size_t patchStepMemSize){
|
|
997
|
+
_out_diff_info(" serialize single compressed diffData ...\n");
|
|
998
|
+
check(patchStepMemSize>=hpatch_kStreamCacheSize);
|
|
999
|
+
if (patchStepMemSize>newStream->streamSize){
|
|
1000
|
+
patchStepMemSize=(size_t)newStream->streamSize;
|
|
1001
|
+
if (patchStepMemSize<hpatch_kStreamCacheSize)
|
|
1002
|
+
patchStepMemSize=hpatch_kStreamCacheSize;
|
|
1003
|
+
}
|
|
1004
|
+
TStepStream stepStream(newStream,oldStream,isZeroSubDiff,covers,patchStepMemSize);
|
|
1005
|
+
|
|
1006
|
+
TDiffStream outDiff(out_diff);
|
|
1007
|
+
{//type
|
|
1008
|
+
std::vector<TByte> out_type;
|
|
1009
|
+
_outType(out_type,compressPlugin,kHDiffSFVersionType);
|
|
1010
|
+
outDiff.pushBack(out_type.data(),out_type.size());
|
|
1011
|
+
}
|
|
1012
|
+
outDiff.packUInt(newStream->streamSize);
|
|
1013
|
+
outDiff.packUInt(oldStream->streamSize);
|
|
1014
|
+
outDiff.packUInt(stepStream.getCoverCount());
|
|
1015
|
+
outDiff.packUInt(stepStream.getMaxStepMemSize());
|
|
1016
|
+
outDiff.packUInt(stepStream.streamSize);
|
|
1017
|
+
TPlaceholder compressed_sizePos=outDiff.packUInt_pos(compressPlugin?stepStream.streamSize:0);
|
|
1018
|
+
outDiff.pushStream(&stepStream,compressPlugin,compressed_sizePos);
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
void create_single_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
1022
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1023
|
+
std::vector<unsigned char>& out_diff,
|
|
1024
|
+
const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
|
|
1025
|
+
size_t patchStepMemSize,bool isUseBigCacheMatch,
|
|
1026
|
+
ICoverLinesListener* listener,size_t threadNum){
|
|
1027
|
+
TVectorAsStreamOutput outDiffStream(out_diff);
|
|
1028
|
+
create_single_compressed_diff(newData,newData_end,oldData,oldData_end,&outDiffStream,
|
|
1029
|
+
compressPlugin,kMinSingleMatchScore,patchStepMemSize,
|
|
1030
|
+
isUseBigCacheMatch,listener,threadNum);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
void create_single_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
1034
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1035
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1036
|
+
const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
|
|
1037
|
+
size_t patchStepMemSize,bool isUseBigCacheMatch,
|
|
1038
|
+
ICoverLinesListener* listener,size_t threadNum){
|
|
1039
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
1040
|
+
std::vector<TOldCover> covers;
|
|
1041
|
+
get_diff(diff,covers,kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum);
|
|
1042
|
+
|
|
1043
|
+
hpatch_TStreamInput _newStream; hpatch_TStreamInput* newStream=&_newStream;
|
|
1044
|
+
hpatch_TStreamInput _oldStream; hpatch_TStreamInput* oldStream=&_oldStream;
|
|
1045
|
+
mem_as_hStreamInput(newStream,diff.newData,diff.newData_end);
|
|
1046
|
+
mem_as_hStreamInput(oldStream,diff.oldData,diff.oldData_end);
|
|
1047
|
+
if (listener&&listener->map_streams_befor_serialize)
|
|
1048
|
+
listener->map_streams_befor_serialize(listener,(const hpatch_TStreamInput **)&newStream,(const hpatch_TStreamInput **)&oldStream);
|
|
1049
|
+
const TCovers _covers((void*)covers.data(),covers.size(),
|
|
1050
|
+
sizeof(*covers.data())==sizeof(hpatch_TCover32));
|
|
1051
|
+
serialize_single_compressed_diff(newStream,oldStream,false,_covers,
|
|
1052
|
+
out_diff,compressPlugin,patchStepMemSize);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
void create_single_compressed_diff_stream(const hpatch_TStreamInput* newData,
|
|
1056
|
+
const hpatch_TStreamInput* oldData,
|
|
1057
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1058
|
+
const hdiff_TCompress* compressPlugin,
|
|
1059
|
+
size_t kMatchBlockSize,size_t patchStepMemSize,
|
|
1060
|
+
const hdiff_TMTSets_s* mtsets){
|
|
1061
|
+
TCoversBuf covers(newData->streamSize,oldData->streamSize);
|
|
1062
|
+
get_match_covers_by_block(newData,oldData,&covers,kMatchBlockSize,mtsets);
|
|
1063
|
+
serialize_single_compressed_diff(newData,oldData,true,covers,
|
|
1064
|
+
out_diff,compressPlugin,patchStepMemSize);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
bool check_diff(const TByte* newData,const TByte* newData_end,
|
|
1069
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1070
|
+
const TByte* diff,const TByte* diff_end){
|
|
1071
|
+
hpatch_TStreamInput newStream;
|
|
1072
|
+
hpatch_TStreamInput oldStream;
|
|
1073
|
+
hpatch_TStreamInput diffStream;
|
|
1074
|
+
mem_as_hStreamInput(&newStream,newData,newData_end);
|
|
1075
|
+
mem_as_hStreamInput(&oldStream,oldData,oldData_end);
|
|
1076
|
+
mem_as_hStreamInput(&diffStream,diff,diff_end);
|
|
1077
|
+
return check_diff(&newStream,&oldStream,&diffStream);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
bool check_diff(const hpatch_TStreamInput* newData,
|
|
1081
|
+
const hpatch_TStreamInput* oldData,
|
|
1082
|
+
const hpatch_TStreamInput* diff){
|
|
1083
|
+
const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
|
|
1084
|
+
TAutoMem _cache(kACacheBufSize*(1+16));
|
|
1085
|
+
_TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
|
|
1086
|
+
_test_rt(patch_stream_with_cache(&out_newData,oldData,diff,
|
|
1087
|
+
_cache.data()+kACacheBufSize,_cache.data_end()));
|
|
1088
|
+
_test_rt(out_newData.isWriteFinish());
|
|
1089
|
+
return true;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
bool check_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
1093
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1094
|
+
const TByte* diff,const TByte* diff_end,
|
|
1095
|
+
hpatch_TDecompress* decompressPlugin){
|
|
1096
|
+
hpatch_TStreamInput newStream;
|
|
1097
|
+
hpatch_TStreamInput oldStream;
|
|
1098
|
+
hpatch_TStreamInput diffStream;
|
|
1099
|
+
mem_as_hStreamInput(&newStream,newData,newData_end);
|
|
1100
|
+
mem_as_hStreamInput(&oldStream,oldData,oldData_end);
|
|
1101
|
+
mem_as_hStreamInput(&diffStream,diff,diff_end);
|
|
1102
|
+
return check_compressed_diff(&newStream,&oldStream,&diffStream,decompressPlugin);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
bool check_compressed_diff(const hpatch_TStreamInput* newData,
|
|
1106
|
+
const hpatch_TStreamInput* oldData,
|
|
1107
|
+
const hpatch_TStreamInput* compressed_diff,
|
|
1108
|
+
hpatch_TDecompress* decompressPlugin){
|
|
1109
|
+
const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
|
|
1110
|
+
TAutoMem _cache(kACacheBufSize*(1+16));
|
|
1111
|
+
_TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
|
|
1112
|
+
_test_rt(patch_decompress_with_cache(&out_newData,oldData,compressed_diff,decompressPlugin,
|
|
1113
|
+
_cache.data()+kACacheBufSize,_cache.data_end()));
|
|
1114
|
+
_test_rt(out_newData.isWriteFinish());
|
|
1115
|
+
return true;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
bool check_single_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
1119
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1120
|
+
const TByte* diff,const TByte* diff_end,
|
|
1121
|
+
hpatch_TDecompress* decompressPlugin,size_t threadNum){
|
|
1122
|
+
hpatch_TStreamInput newStream;
|
|
1123
|
+
hpatch_TStreamInput oldStream;
|
|
1124
|
+
hpatch_TStreamInput diffStream;
|
|
1125
|
+
mem_as_hStreamInput(&newStream,newData,newData_end);
|
|
1126
|
+
mem_as_hStreamInput(&oldStream,oldData,oldData_end);
|
|
1127
|
+
mem_as_hStreamInput(&diffStream,diff,diff_end);
|
|
1128
|
+
return check_single_compressed_diff(&newStream,&oldStream,&diffStream,decompressPlugin,threadNum);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
bool check_single_compressed_diff(const hpatch_TStreamInput* newData,
|
|
1132
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1133
|
+
const hpatch_TStreamInput* diff,
|
|
1134
|
+
hpatch_TDecompress* decompressPlugin,size_t threadNum){
|
|
1135
|
+
hpatch_TStreamInput oldStream;
|
|
1136
|
+
mem_as_hStreamInput(&oldStream,oldData,oldData_end);
|
|
1137
|
+
return check_single_compressed_diff(newData,&oldStream,diff,decompressPlugin,threadNum);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
static hpatch_BOOL _check_single_onDiffInfo(struct sspatch_listener_t* listener,
|
|
1141
|
+
const hpatch_singleCompressedDiffInfo* info,
|
|
1142
|
+
hpatch_TDecompress** out_decompressPlugin,
|
|
1143
|
+
unsigned char** out_temp_cache,
|
|
1144
|
+
unsigned char** out_temp_cacheEnd){
|
|
1145
|
+
size_t memSize=(size_t)(info->stepMemSize+hdiff_kFileIOBufBestSize*(1+16));
|
|
1146
|
+
*out_temp_cache=(unsigned char*)malloc(memSize);
|
|
1147
|
+
*out_temp_cacheEnd=(*out_temp_cache)+memSize;
|
|
1148
|
+
*out_decompressPlugin=(info->compressType[0]=='\0')?0:(hpatch_TDecompress*)listener->import;
|
|
1149
|
+
return hpatch_TRUE;
|
|
1150
|
+
}
|
|
1151
|
+
static void _check_single_onPatchFinish(struct sspatch_listener_t* listener,
|
|
1152
|
+
unsigned char* temp_cache, unsigned char* temp_cacheEnd){
|
|
1153
|
+
if (temp_cache) free(temp_cache);
|
|
1154
|
+
}
|
|
1155
|
+
bool check_single_compressed_diff(const hpatch_TStreamInput* newData,
|
|
1156
|
+
const hpatch_TStreamInput* oldData,
|
|
1157
|
+
const hpatch_TStreamInput* diff,
|
|
1158
|
+
hpatch_TDecompress* decompressPlugin,size_t threadNum){
|
|
1159
|
+
sspatch_listener_t listener={0};
|
|
1160
|
+
listener.import=decompressPlugin;
|
|
1161
|
+
listener.onDiffInfo=_check_single_onDiffInfo;
|
|
1162
|
+
listener.onPatchFinish=_check_single_onPatchFinish;
|
|
1163
|
+
|
|
1164
|
+
const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
|
|
1165
|
+
TAutoMem _cache(kACacheBufSize*(1+16));
|
|
1166
|
+
_TCheckOutNewDataStream out_newData(newData,_cache.data(),kACacheBufSize);
|
|
1167
|
+
|
|
1168
|
+
_test_rt(patch_single_stream(&listener,&out_newData,oldData,diff,0,0,threadNum));
|
|
1169
|
+
_test_rt(out_newData.isWriteFinish());
|
|
1170
|
+
return true;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
//for test
|
|
1175
|
+
void __hdiff_private__create_compressed_diff(const TByte* newData,const TByte* newData_end,
|
|
1176
|
+
const TByte* oldData,const TByte* oldData_end,
|
|
1177
|
+
std::vector<TByte>& out_diff,
|
|
1178
|
+
const hdiff_TCompress* compressPlugin,int kMinSingleMatchScore,
|
|
1179
|
+
const TSuffixString* sstring){
|
|
1180
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
1181
|
+
std::vector<TOldCover> covers;
|
|
1182
|
+
get_diff(diff,covers,kMinSingleMatchScore,false,0,sstring,1);
|
|
1183
|
+
TVectorAsStreamOutput outDiffStream(out_diff);
|
|
1184
|
+
|
|
1185
|
+
hpatch_TStreamInput _newStream; hpatch_TStreamInput* newStream=&_newStream;
|
|
1186
|
+
hpatch_TStreamInput _oldStream; hpatch_TStreamInput* oldStream=&_oldStream;
|
|
1187
|
+
mem_as_hStreamInput(newStream,diff.newData,diff.newData_end);
|
|
1188
|
+
mem_as_hStreamInput(oldStream,diff.oldData,diff.oldData_end);
|
|
1189
|
+
const TCovers _covers((void*)covers.data(),covers.size(),
|
|
1190
|
+
sizeof(*covers.data())==sizeof(hpatch_TCover32));
|
|
1191
|
+
serialize_compressed_diff(newStream,oldStream,false,_covers,&outDiffStream,compressPlugin);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
//======================
|
|
1196
|
+
|
|
1197
|
+
void get_match_covers_by_block(const hpatch_TStreamInput* newData,const hpatch_TStreamInput* oldData,
|
|
1198
|
+
hpatch_TOutputCovers* out_covers,size_t kMatchBlockSize,const hdiff_TMTSets_s* mtsets){
|
|
1199
|
+
assert(out_covers->push_cover!=0);
|
|
1200
|
+
TDigestMatcher matcher(oldData,newData,kMatchBlockSize,mtsets?*mtsets:hdiff_TMTSets_s_kEmpty);
|
|
1201
|
+
matcher.search_cover(out_covers);
|
|
1202
|
+
}
|
|
1203
|
+
void get_match_covers_by_block(const unsigned char* newData,const unsigned char* newData_end,
|
|
1204
|
+
const unsigned char* oldData,const unsigned char* oldData_end,
|
|
1205
|
+
hpatch_TOutputCovers* out_covers,size_t kMatchBlockSize,size_t threadNum){
|
|
1206
|
+
hdiff_TStreamInput oldData_stream;
|
|
1207
|
+
mem_as_hStreamInput(&oldData_stream,oldData,oldData_end);
|
|
1208
|
+
hdiff_TStreamInput newData_stream;
|
|
1209
|
+
mem_as_hStreamInput(&newData_stream,newData,newData_end);
|
|
1210
|
+
hdiff_TMTSets_s mtsets={threadNum,threadNum,true,true};
|
|
1211
|
+
get_match_covers_by_block(&newData_stream,&oldData_stream,out_covers,kMatchBlockSize,&mtsets);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
|
|
1215
|
+
const unsigned char* oldData,const unsigned char* oldData_end,
|
|
1216
|
+
std::vector<hpatch_TCover_sz>& out_covers,int kMinSingleMatchScore,
|
|
1217
|
+
bool isUseBigCacheMatch,ICoverLinesListener* listener,
|
|
1218
|
+
size_t threadNum,bool isCanExtendCover){
|
|
1219
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
1220
|
+
std::vector<TOldCover> covers;
|
|
1221
|
+
assert(sizeof(TOldCover)==sizeof(hpatch_TCover_sz));
|
|
1222
|
+
{ std::vector<hpatch_TCover_sz> tmp; tmp.swap(out_covers); }
|
|
1223
|
+
get_diff(diff,covers,kMinSingleMatchScore,isUseBigCacheMatch,listener,0,threadNum,isCanExtendCover);
|
|
1224
|
+
void* pcovers=&covers;
|
|
1225
|
+
out_covers.swap(*(std::vector<hpatch_TCover_sz>*)pcovers);
|
|
1226
|
+
}
|
|
1227
|
+
void get_match_covers_by_sstring(const unsigned char* newData,const unsigned char* newData_end,
|
|
1228
|
+
const unsigned char* oldData,const unsigned char* oldData_end,
|
|
1229
|
+
hpatch_TOutputCovers* out_covers,int kMinSingleMatchScore,
|
|
1230
|
+
bool isUseBigCacheMatch,ICoverLinesListener* listener,
|
|
1231
|
+
size_t threadNum,bool isCanExtendCover){
|
|
1232
|
+
std::vector<hpatch_TCover_sz> covers;
|
|
1233
|
+
get_match_covers_by_sstring(newData,newData_end,oldData,oldData_end,covers,
|
|
1234
|
+
kMinSingleMatchScore,isUseBigCacheMatch,listener,threadNum,isCanExtendCover);
|
|
1235
|
+
const hpatch_TCover_sz* pcovers=covers.data();
|
|
1236
|
+
for (size_t i=0;i<covers.size();++i,++pcovers){
|
|
1237
|
+
if (sizeof(*pcovers)==sizeof(hpatch_TCover)){
|
|
1238
|
+
out_covers->push_cover(out_covers,(const hpatch_TCover*)pcovers);
|
|
1239
|
+
}else{
|
|
1240
|
+
hpatch_TCover cover;
|
|
1241
|
+
cover.oldPos=pcovers->oldPos;
|
|
1242
|
+
cover.newPos=pcovers->newPos;
|
|
1243
|
+
cover.length=pcovers->length;
|
|
1244
|
+
out_covers->push_cover(out_covers,&cover);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
static void serialize_compressed_diff(const hpatch_TStreamInput* newData,
|
|
1251
|
+
const hpatch_TStreamInput* oldData,
|
|
1252
|
+
bool isZeroSubDiff,const TCovers& covers,
|
|
1253
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1254
|
+
const hdiff_TCompress* compressPlugin){
|
|
1255
|
+
_out_diff_info(" serialize compressed diffData ...\n");
|
|
1256
|
+
std::vector<TByte> rle_ctrlBuf;
|
|
1257
|
+
std::vector<TByte> rle_codeBuf;
|
|
1258
|
+
{//now rle datas used buf, not used stream
|
|
1259
|
+
TNewDataSubDiffStream subStream(newData,oldData,covers,false,isZeroSubDiff);
|
|
1260
|
+
bytesRLE_save(rle_ctrlBuf,rle_codeBuf,&subStream,kRle_bestSize);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
TDiffStream outDiff(out_diff);
|
|
1264
|
+
{//type
|
|
1265
|
+
std::vector<TByte> out_type;
|
|
1266
|
+
_outType(out_type,compressPlugin);
|
|
1267
|
+
outDiff.pushBack(out_type.data(),out_type.size());
|
|
1268
|
+
}
|
|
1269
|
+
outDiff.packUInt(newData->streamSize);
|
|
1270
|
+
outDiff.packUInt(oldData->streamSize);
|
|
1271
|
+
outDiff.packUInt(covers.coverCount());
|
|
1272
|
+
const hpatch_StreamPos_t cover_buf_size=TCoversStream::getDataSize(covers);
|
|
1273
|
+
outDiff.packUInt(cover_buf_size);
|
|
1274
|
+
TPlaceholder compress_cover_buf_sizePos=
|
|
1275
|
+
outDiff.packUInt_pos(compressPlugin?cover_buf_size:0); //compress_cover_buf size
|
|
1276
|
+
outDiff.packUInt(rle_ctrlBuf.size());//rle_ctrlBuf size
|
|
1277
|
+
TPlaceholder compress_rle_ctrlBuf_sizePos=
|
|
1278
|
+
outDiff.packUInt_pos(compressPlugin?rle_ctrlBuf.size():0); //compress_rle_ctrlBuf size
|
|
1279
|
+
outDiff.packUInt(rle_codeBuf.size());//rle_codeBuf size
|
|
1280
|
+
TPlaceholder compress_rle_codeBuf_sizePos=
|
|
1281
|
+
outDiff.packUInt_pos(compressPlugin?rle_codeBuf.size():0); //compress_rle_codeBuf size
|
|
1282
|
+
const hpatch_StreamPos_t newDataDiff_size=
|
|
1283
|
+
TNewDataDiffStream::getDataSize(covers,newData->streamSize);
|
|
1284
|
+
outDiff.packUInt(newDataDiff_size);
|
|
1285
|
+
TPlaceholder compress_newDataDiff_sizePos=
|
|
1286
|
+
outDiff.packUInt_pos(compressPlugin?newDataDiff_size:0); //compress_newDataDiff size
|
|
1287
|
+
|
|
1288
|
+
{//save covers
|
|
1289
|
+
TCoversStream cover_buf(covers,cover_buf_size);
|
|
1290
|
+
outDiff.pushStream(&cover_buf,compressPlugin,compress_cover_buf_sizePos);
|
|
1291
|
+
}
|
|
1292
|
+
{//save rle
|
|
1293
|
+
TVectorAsStreamInput rle_ctrlStream(rle_ctrlBuf);
|
|
1294
|
+
TVectorAsStreamInput rle_codeStream(rle_codeBuf);
|
|
1295
|
+
outDiff.pushStream(&rle_ctrlStream,compressPlugin,compress_rle_ctrlBuf_sizePos);
|
|
1296
|
+
outDiff.pushStream(&rle_codeStream,compressPlugin,compress_rle_codeBuf_sizePos);
|
|
1297
|
+
}
|
|
1298
|
+
{//save newDataDiff
|
|
1299
|
+
TNewDataDiffStream newDataDiff(covers,newData,newDataDiff_size);
|
|
1300
|
+
outDiff.pushStream(&newDataDiff,compressPlugin,compress_newDataDiff_sizePos);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
void create_compressed_diff_stream(const hpatch_TStreamInput* newData,
|
|
1305
|
+
const hpatch_TStreamInput* oldData,
|
|
1306
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1307
|
+
const hdiff_TCompress* compressPlugin,
|
|
1308
|
+
size_t kMatchBlockSize,const hdiff_TMTSets_s* mtsets){
|
|
1309
|
+
TCoversBuf covers(newData->streamSize,oldData->streamSize);
|
|
1310
|
+
get_match_covers_by_block(newData,oldData,&covers,kMatchBlockSize,mtsets);
|
|
1311
|
+
serialize_compressed_diff(newData,oldData,true,covers,out_diff,compressPlugin);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
void resave_compressed_diff(const hpatch_TStreamInput* in_diff,
|
|
1316
|
+
hpatch_TDecompress* decompressPlugin,
|
|
1317
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1318
|
+
const hdiff_TCompress* compressPlugin,
|
|
1319
|
+
hpatch_StreamPos_t out_diff_curPos){
|
|
1320
|
+
_THDiffzHead head;
|
|
1321
|
+
hpatch_compressedDiffInfo diffInfo;
|
|
1322
|
+
assert(in_diff!=0);
|
|
1323
|
+
assert(in_diff->read!=0);
|
|
1324
|
+
assert(out_diff!=0);
|
|
1325
|
+
assert(out_diff->write!=0);
|
|
1326
|
+
|
|
1327
|
+
{//read head
|
|
1328
|
+
checki(read_diffz_head(&diffInfo,&head,in_diff),
|
|
1329
|
+
"resave_compressed_diff() read_diffz_head() error!");
|
|
1330
|
+
checki((decompressPlugin!=0)||(diffInfo.compressedCount<=0),
|
|
1331
|
+
"resave_compressed_diff() decompressPlugin null error!");
|
|
1332
|
+
if ((decompressPlugin)&&(diffInfo.compressedCount>0)){
|
|
1333
|
+
checki(decompressPlugin->is_can_open(diffInfo.compressType),
|
|
1334
|
+
"resave_compressed_diff() decompressPlugin cannot open compressed data error!");
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
TDiffStream outDiff(out_diff,out_diff_curPos);
|
|
1339
|
+
{//type
|
|
1340
|
+
std::vector<TByte> out_type;
|
|
1341
|
+
_outType(out_type,compressPlugin);
|
|
1342
|
+
outDiff.pushBack(out_type.data(),out_type.size());
|
|
1343
|
+
}
|
|
1344
|
+
{//copy other
|
|
1345
|
+
TStreamClip clip(in_diff,head.typesEndPos,head.compressSizeBeginPos);
|
|
1346
|
+
outDiff.pushStream(&clip);
|
|
1347
|
+
}
|
|
1348
|
+
outDiff.packUInt(head.cover_buf_size);
|
|
1349
|
+
TPlaceholder compress_cover_buf_sizePos=
|
|
1350
|
+
outDiff.packUInt_pos(compressPlugin?head.cover_buf_size:0);//compress_cover_buf size
|
|
1351
|
+
outDiff.packUInt(head.rle_ctrlBuf_size);//rle_ctrlBuf size
|
|
1352
|
+
TPlaceholder compress_rle_ctrlBuf_sizePos=
|
|
1353
|
+
outDiff.packUInt_pos(compressPlugin?head.rle_ctrlBuf_size:0);//compress_rle_ctrlBuf size
|
|
1354
|
+
outDiff.packUInt(head.rle_codeBuf_size);//rle_codeBuf size
|
|
1355
|
+
TPlaceholder compress_rle_codeBuf_sizePos=
|
|
1356
|
+
outDiff.packUInt_pos(compressPlugin?head.rle_codeBuf_size:0);//compress_rle_codeBuf size
|
|
1357
|
+
outDiff.packUInt(head.newDataDiff_size);
|
|
1358
|
+
TPlaceholder compress_newDataDiff_sizePos=
|
|
1359
|
+
outDiff.packUInt_pos(compressPlugin?head.newDataDiff_size:0);//compress_newDataDiff size
|
|
1360
|
+
|
|
1361
|
+
{//save covers
|
|
1362
|
+
TStreamClip clip(in_diff,head.headEndPos,head.coverEndPos,
|
|
1363
|
+
(head.compress_cover_buf_size>0)?decompressPlugin:0,head.cover_buf_size);
|
|
1364
|
+
outDiff.pushStream(&clip,compressPlugin,compress_cover_buf_sizePos);
|
|
1365
|
+
}
|
|
1366
|
+
hpatch_StreamPos_t diffPos0=head.coverEndPos;
|
|
1367
|
+
{//save rle ctrl
|
|
1368
|
+
bool isCompressed=(head.compress_rle_ctrlBuf_size>0);
|
|
1369
|
+
hpatch_StreamPos_t bufSize=isCompressed?head.compress_rle_ctrlBuf_size:head.rle_ctrlBuf_size;
|
|
1370
|
+
TStreamClip clip(in_diff,diffPos0,diffPos0+bufSize,
|
|
1371
|
+
isCompressed?decompressPlugin:0,head.rle_ctrlBuf_size);
|
|
1372
|
+
outDiff.pushStream(&clip,compressPlugin,compress_rle_ctrlBuf_sizePos);
|
|
1373
|
+
diffPos0+=bufSize;
|
|
1374
|
+
}
|
|
1375
|
+
{//save rle code
|
|
1376
|
+
bool isCompressed=(head.compress_rle_codeBuf_size>0);
|
|
1377
|
+
hpatch_StreamPos_t bufSize=isCompressed?head.compress_rle_codeBuf_size:head.rle_codeBuf_size;
|
|
1378
|
+
TStreamClip clip(in_diff,diffPos0,diffPos0+bufSize,
|
|
1379
|
+
isCompressed?decompressPlugin:0,head.rle_codeBuf_size);
|
|
1380
|
+
outDiff.pushStream(&clip,compressPlugin,compress_rle_codeBuf_sizePos);
|
|
1381
|
+
diffPos0+=bufSize;
|
|
1382
|
+
}
|
|
1383
|
+
{//save newDataDiff
|
|
1384
|
+
bool isCompressed=(head.compress_newDataDiff_size>0);
|
|
1385
|
+
hpatch_StreamPos_t bufSize=isCompressed?head.compress_newDataDiff_size:head.newDataDiff_size;
|
|
1386
|
+
TStreamClip clip(in_diff,diffPos0,diffPos0+bufSize,
|
|
1387
|
+
isCompressed?decompressPlugin:0,head.newDataDiff_size);
|
|
1388
|
+
outDiff.pushStream(&clip,compressPlugin,compress_newDataDiff_sizePos);
|
|
1389
|
+
diffPos0+=bufSize;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
hpatch_StreamPos_t
|
|
1395
|
+
resave_single_compressed_diff(const hpatch_TStreamInput* in_diff,
|
|
1396
|
+
hpatch_TDecompress* decompressPlugin,
|
|
1397
|
+
const hpatch_TStreamOutput* out_diff,
|
|
1398
|
+
const hdiff_TCompress* compressPlugin,
|
|
1399
|
+
const hpatch_singleCompressedDiffInfo* diffInfo,
|
|
1400
|
+
hpatch_StreamPos_t in_diff_curPos,
|
|
1401
|
+
hpatch_StreamPos_t out_diff_curPos){
|
|
1402
|
+
hpatch_singleCompressedDiffInfo _diffInfo;
|
|
1403
|
+
if (diffInfo==0){
|
|
1404
|
+
checki(getSingleCompressedDiffInfo(&_diffInfo,in_diff,in_diff_curPos),
|
|
1405
|
+
"getSingleCompressedDiffInfo() return fail!");
|
|
1406
|
+
diffInfo=&_diffInfo;
|
|
1407
|
+
}
|
|
1408
|
+
const bool isCompressed=(diffInfo->compressedSize>0);
|
|
1409
|
+
if (isCompressed){ //check
|
|
1410
|
+
checki(diffInfo->compressedSize+(in_diff_curPos+diffInfo->diffDataPos)==in_diff->streamSize,
|
|
1411
|
+
"resave_single_compressed_diff() diffInfo error!");
|
|
1412
|
+
checki((decompressPlugin!=0)&&(decompressPlugin->is_can_open(diffInfo->compressType)),
|
|
1413
|
+
"resave_single_compressed_diff() decompressPlugin error!");
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
TDiffStream outDiff(out_diff,out_diff_curPos);
|
|
1417
|
+
{//type & head
|
|
1418
|
+
std::vector<TByte> outBuf;
|
|
1419
|
+
_outType(outBuf, compressPlugin,kHDiffSFVersionType);
|
|
1420
|
+
packUInt(outBuf, diffInfo->newDataSize);
|
|
1421
|
+
packUInt(outBuf, diffInfo->oldDataSize);
|
|
1422
|
+
packUInt(outBuf, diffInfo->coverCount);
|
|
1423
|
+
packUInt(outBuf, diffInfo->stepMemSize);
|
|
1424
|
+
packUInt(outBuf, diffInfo->uncompressedSize);
|
|
1425
|
+
outDiff.pushBack(outBuf.data(),outBuf.size());
|
|
1426
|
+
//no compressedSize
|
|
1427
|
+
}
|
|
1428
|
+
{//save single stream data
|
|
1429
|
+
TStreamClip clip(in_diff,diffInfo->diffDataPos+in_diff_curPos,in_diff->streamSize,
|
|
1430
|
+
isCompressed?decompressPlugin:0,diffInfo->uncompressedSize);
|
|
1431
|
+
TPlaceholder compressedSize_pos=outDiff.packUInt_pos(compressPlugin?diffInfo->uncompressedSize:0);
|
|
1432
|
+
outDiff.pushStream(&clip,compressPlugin,compressedSize_pos);
|
|
1433
|
+
}
|
|
1434
|
+
return outDiff.getWritedPos();
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
//----------------------------------------------------------------------------------------------------
|
|
1439
|
+
|
|
1440
|
+
#include "diff_for_hpatch_lite.h"
|
|
1441
|
+
#include "../HPatchLite/hpatch_lite.h"
|
|
1442
|
+
|
|
1443
|
+
namespace{
|
|
1444
|
+
static const char* kHPatchLite_versionType="hI";
|
|
1445
|
+
static const hpi_byte kHPatchLite_versionCode=1;
|
|
1446
|
+
static const hpi_byte kHPatchLite_inplaceCode=2; //for inplace-patch, just adding extraSafeSize
|
|
1447
|
+
|
|
1448
|
+
static inline void hpi_packUInt(std::vector<TByte>& buf,TUInt v){
|
|
1449
|
+
check(v==(hpi_pos_t)v);
|
|
1450
|
+
packUInt(buf,v);
|
|
1451
|
+
}
|
|
1452
|
+
static inline void hpi_packUIntWithTag(std::vector<TByte>& buf,TUInt v,TByte tag,TByte bit){
|
|
1453
|
+
check(v==(hpi_pos_t)v);
|
|
1454
|
+
packUIntWithTag(buf,v,tag,bit);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
static inline TByte hpi_getSavedSizeBytes(TUInt size){
|
|
1458
|
+
check(size==(hpi_pos_t)size);
|
|
1459
|
+
TByte bytes=0;
|
|
1460
|
+
while (size>0){
|
|
1461
|
+
++bytes;
|
|
1462
|
+
size>>=8;
|
|
1463
|
+
}
|
|
1464
|
+
return bytes;
|
|
1465
|
+
}
|
|
1466
|
+
static inline void hpi_saveSize(std::vector<TByte>& buf,TUInt size){
|
|
1467
|
+
check(size==(hpi_pos_t)size);
|
|
1468
|
+
while (size>0){
|
|
1469
|
+
buf.push_back((TByte)size);
|
|
1470
|
+
size>>=8;
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
static bool _getIs0(const TByte* data,size_t length){
|
|
1475
|
+
for (size_t i=0; i<length; ++i) {
|
|
1476
|
+
if (data[i]==0)
|
|
1477
|
+
continue;
|
|
1478
|
+
else
|
|
1479
|
+
return false;
|
|
1480
|
+
}
|
|
1481
|
+
return true;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
static void _getSubDiff(std::vector<TByte>& subDiff,const TDiffData& diff,const TOldCover& cover){
|
|
1485
|
+
subDiff.resize(cover.length);
|
|
1486
|
+
const TByte* pnew=diff.newData+cover.newPos;
|
|
1487
|
+
const TByte* pold=diff.oldData+cover.oldPos;
|
|
1488
|
+
for (size_t i=0;i<subDiff.size();++i)
|
|
1489
|
+
subDiff[i]=pnew[i]-pold[i];
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
struct TInlpacePatchSets{
|
|
1493
|
+
bool isInplacePatchByExtra;
|
|
1494
|
+
hpi_size_t extraSafeSize;
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1497
|
+
static void serialize_lite_diff(const TDiffData& diff,const std::vector<TOldCover>& covers,
|
|
1498
|
+
std::vector<TByte>& out_diff,const hdiffi_TCompress* compressPlugin,
|
|
1499
|
+
const TInlpacePatchSets& inlpacePatchSets){
|
|
1500
|
+
const TUInt coverCount=(TUInt)covers.size();
|
|
1501
|
+
const bool isInplacePatch= inlpacePatchSets.isInplacePatchByExtra;
|
|
1502
|
+
std::vector<TByte> subDiff;
|
|
1503
|
+
std::vector<TByte> buf;
|
|
1504
|
+
hpi_packUInt(buf,coverCount);
|
|
1505
|
+
const TUInt newSize=(TUInt)(diff.newData_end-diff.newData);
|
|
1506
|
+
{
|
|
1507
|
+
TUInt lastOldEnd=0;
|
|
1508
|
+
TUInt lastNewEnd=0;
|
|
1509
|
+
for (TUInt i=0; i<coverCount; ++i) {
|
|
1510
|
+
const TOldCover& cover=covers[i];
|
|
1511
|
+
hpi_packUInt(buf, cover.length);
|
|
1512
|
+
_getSubDiff(subDiff,diff,cover);
|
|
1513
|
+
const TByte isNullSubDiff=_getIs0(subDiff.data(),cover.length)?1:0;
|
|
1514
|
+
if ((TUInt)cover.oldPos>=lastOldEnd){ //save inc_oldPos
|
|
1515
|
+
hpi_packUIntWithTag(buf,(TUInt)(cover.oldPos-lastOldEnd), 0+isNullSubDiff*2,2);
|
|
1516
|
+
}else{
|
|
1517
|
+
hpi_packUIntWithTag(buf,(TUInt)(lastOldEnd-cover.oldPos), 1+isNullSubDiff*2,2);
|
|
1518
|
+
}
|
|
1519
|
+
TUInt backNewLen=cover.newPos-lastNewEnd;
|
|
1520
|
+
assert(backNewLen>=0);
|
|
1521
|
+
hpi_packUInt(buf,(TUInt)backNewLen); //save inc_newPos
|
|
1522
|
+
|
|
1523
|
+
if (backNewLen>0){
|
|
1524
|
+
const TByte* newDataDiff=diff.newData+lastNewEnd;
|
|
1525
|
+
pushBack(buf,newDataDiff,newDataDiff+backNewLen);
|
|
1526
|
+
}
|
|
1527
|
+
if (!isNullSubDiff){
|
|
1528
|
+
pushBack(buf,subDiff.data(),subDiff.data()+cover.length);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
lastOldEnd=cover.oldPos+cover.length;
|
|
1532
|
+
lastNewEnd=cover.newPos+cover.length;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
TUInt backNewLen=(newSize-lastNewEnd);
|
|
1536
|
+
check(backNewLen==0);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
std::vector<TByte> compress_buf;
|
|
1540
|
+
do_compress(compress_buf,buf,compressPlugin->compress);
|
|
1541
|
+
out_diff.push_back(kHPatchLite_versionType[0]);
|
|
1542
|
+
out_diff.push_back(kHPatchLite_versionType[1]);
|
|
1543
|
+
out_diff.push_back(compress_buf.empty()?hpi_compressType_no:compressPlugin->compress_type);
|
|
1544
|
+
TUInt savedUncompressSize=compress_buf.empty()?0:buf.size();
|
|
1545
|
+
const TByte savedVersionCode=isInplacePatch?kHPatchLite_inplaceCode:kHPatchLite_versionCode;
|
|
1546
|
+
out_diff.push_back((savedVersionCode<<6)|
|
|
1547
|
+
(hpi_getSavedSizeBytes(newSize))|
|
|
1548
|
+
(hpi_getSavedSizeBytes(savedUncompressSize)<<3));
|
|
1549
|
+
if (isInplacePatch)
|
|
1550
|
+
out_diff.push_back(hpi_getSavedSizeBytes(inlpacePatchSets.extraSafeSize));
|
|
1551
|
+
hpi_saveSize(out_diff,newSize);
|
|
1552
|
+
hpi_saveSize(out_diff,savedUncompressSize);
|
|
1553
|
+
if (isInplacePatch)
|
|
1554
|
+
hpi_saveSize(out_diff,inlpacePatchSets.extraSafeSize);
|
|
1555
|
+
pushBack(out_diff,compress_buf.empty()?buf:compress_buf);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
} //end namespace
|
|
1559
|
+
|
|
1560
|
+
void create_lite_diff(const unsigned char* newData,const unsigned char* newData_end,
|
|
1561
|
+
const unsigned char* oldData,const unsigned char* oldData_end,
|
|
1562
|
+
std::vector<hpi_byte>& out_lite_diff,const hdiffi_TCompress* compressPlugin,
|
|
1563
|
+
int kMinSingleMatchScore,bool isUseBigCacheMatch,
|
|
1564
|
+
ILiteDiffListener* listener,size_t threadNum){
|
|
1565
|
+
static const int _kMatchScore_optim4bin=6;
|
|
1566
|
+
TDiffData diff(newData,newData_end,oldData,oldData_end);
|
|
1567
|
+
std::vector<TOldCover> covers;
|
|
1568
|
+
get_diff(diff,covers,kMinSingleMatchScore-_kMatchScore_optim4bin,isUseBigCacheMatch,listener,0,threadNum);
|
|
1569
|
+
size_t oldPosEnd=0;
|
|
1570
|
+
size_t newPosEnd=0;
|
|
1571
|
+
if (!covers.empty()){
|
|
1572
|
+
const TOldCover& c=covers.back();
|
|
1573
|
+
oldPosEnd=c.oldPos+c.length;
|
|
1574
|
+
newPosEnd=c.newPos+c.length;
|
|
1575
|
+
}
|
|
1576
|
+
const size_t newSize=newData_end-newData;
|
|
1577
|
+
if (newPosEnd<newSize)
|
|
1578
|
+
covers.push_back(TOldCover(oldPosEnd,newSize,0));
|
|
1579
|
+
|
|
1580
|
+
TInlpacePatchSets inlpacePatchSets={};
|
|
1581
|
+
if (listener&&listener->getInplacePatchExtraSafeSize){
|
|
1582
|
+
if (listener->getInplacePatchExtraSafeSize(listener,&inlpacePatchSets.extraSafeSize))
|
|
1583
|
+
inlpacePatchSets.isInplacePatchByExtra=true;
|
|
1584
|
+
}
|
|
1585
|
+
serialize_lite_diff(diff,covers,out_lite_diff,compressPlugin,inlpacePatchSets);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
namespace{
|
|
1589
|
+
struct TPatchiListener:public hpatchi_listener_t{
|
|
1590
|
+
hpatch_decompressHandle decompresser;
|
|
1591
|
+
hpatch_TDecompress* decompressPlugin;
|
|
1592
|
+
inline TPatchiListener():decompresser(0),newData_cur_pos(0){}
|
|
1593
|
+
inline ~TPatchiListener(){ if (decompresser) decompressPlugin->close(decompressPlugin,decompresser); }
|
|
1594
|
+
const hpi_byte* diffData_cur;
|
|
1595
|
+
const hpi_byte* diffData_end;
|
|
1596
|
+
hpatch_TStreamInput diffStream;
|
|
1597
|
+
hpi_pos_t uncompressSize;
|
|
1598
|
+
const hpi_byte* newData_cur;
|
|
1599
|
+
const hpi_byte* newData_end;
|
|
1600
|
+
const hpi_byte* oldData;
|
|
1601
|
+
const hpi_byte* oldData_end;
|
|
1602
|
+
bool isInplacePatch;
|
|
1603
|
+
hpi_size_t extraSafeSize;//for inplace-patch
|
|
1604
|
+
hpatch_size_t newData_cur_pos;//for inplace-patch
|
|
1605
|
+
|
|
1606
|
+
static hpi_BOOL _read_diff(hpi_TInputStreamHandle inputStream,hpi_byte* out_data,hpi_size_t* data_size){
|
|
1607
|
+
TPatchiListener& self=*(TPatchiListener*)inputStream;
|
|
1608
|
+
const hpi_byte* cur=self.diffData_cur;
|
|
1609
|
+
size_t d_size=self.diffData_end-cur;
|
|
1610
|
+
size_t r_size=*data_size;
|
|
1611
|
+
if (r_size>d_size){
|
|
1612
|
+
r_size=d_size;
|
|
1613
|
+
*data_size=(hpi_size_t)r_size;
|
|
1614
|
+
}
|
|
1615
|
+
memcpy(out_data,cur,r_size);
|
|
1616
|
+
self.diffData_cur=cur+r_size;
|
|
1617
|
+
return hpi_TRUE;
|
|
1618
|
+
}
|
|
1619
|
+
static hpi_BOOL _read_diff_dec(hpi_TInputStreamHandle inputStream,hpi_byte* out_data,hpi_size_t* data_size){
|
|
1620
|
+
TPatchiListener& self=*(TPatchiListener*)inputStream;
|
|
1621
|
+
hpi_size_t r_size=*data_size;
|
|
1622
|
+
if (r_size>self.uncompressSize){
|
|
1623
|
+
r_size=(hpi_size_t)self.uncompressSize;
|
|
1624
|
+
*data_size=(hpi_size_t)self.uncompressSize;
|
|
1625
|
+
}
|
|
1626
|
+
if (!self.decompressPlugin->decompress_part(self.decompresser,out_data,out_data+r_size))
|
|
1627
|
+
return hpi_FALSE;
|
|
1628
|
+
self.uncompressSize-=r_size;
|
|
1629
|
+
return hpi_TRUE;
|
|
1630
|
+
}
|
|
1631
|
+
static hpi_BOOL _write_new(struct hpatchi_listener_t* listener,const hpi_byte* data,hpi_size_t data_size){
|
|
1632
|
+
TPatchiListener& self=*(TPatchiListener*)listener;
|
|
1633
|
+
if (data_size>(size_t)(self.newData_end-self.newData_cur))
|
|
1634
|
+
return hpi_FALSE;
|
|
1635
|
+
if (0!=memcmp(self.newData_cur,data,data_size))
|
|
1636
|
+
return hpi_FALSE;
|
|
1637
|
+
self.newData_cur+=data_size;
|
|
1638
|
+
self.newData_cur_pos+=data_size;
|
|
1639
|
+
return hpi_TRUE;
|
|
1640
|
+
}
|
|
1641
|
+
static hpi_BOOL _read_old(struct hpatchi_listener_t* listener,hpi_pos_t read_from_pos,hpi_byte* out_data,hpi_size_t data_size){
|
|
1642
|
+
TPatchiListener& self=*(TPatchiListener*)listener;
|
|
1643
|
+
size_t dsize=self.oldData_end-self.oldData;
|
|
1644
|
+
if ((read_from_pos>dsize)|(data_size>(size_t)(dsize-read_from_pos))) return hpi_FALSE;
|
|
1645
|
+
memcpy(out_data,self.oldData+(size_t)read_from_pos,data_size);
|
|
1646
|
+
if (self.isInplacePatch){
|
|
1647
|
+
if (read_from_pos<self.newData_cur_pos)
|
|
1648
|
+
return hpi_FALSE;
|
|
1649
|
+
}
|
|
1650
|
+
return hpi_TRUE;
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
}// end namespace
|
|
1654
|
+
|
|
1655
|
+
static
|
|
1656
|
+
bool _try_open_hpatchi_and_inplace(TPatchiListener& listener,hpi_compressType* out_compress_type,
|
|
1657
|
+
hpi_pos_t* out_newSize,hpi_pos_t* out_uncompressSize){
|
|
1658
|
+
listener.isInplacePatch=false;
|
|
1659
|
+
listener.extraSafeSize=0;
|
|
1660
|
+
const hpi_byte* diffData_cur_bck=listener.diffData_cur;
|
|
1661
|
+
if (hpatch_lite_open(&listener,listener._read_diff,out_compress_type,out_newSize,out_uncompressSize))
|
|
1662
|
+
return true;
|
|
1663
|
+
listener.diffData_cur=diffData_cur_bck;//reread diffData from 0 pos
|
|
1664
|
+
if (hpatchi_inplace_open(&listener,listener._read_diff,out_compress_type,out_newSize,out_uncompressSize,&listener.extraSafeSize)){
|
|
1665
|
+
listener.isInplacePatch=true;
|
|
1666
|
+
return true;
|
|
1667
|
+
}
|
|
1668
|
+
return false;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
bool check_lite_diff_open(const hpi_byte* lite_diff,const hpi_byte* lite_diff_end,
|
|
1672
|
+
hpi_compressType* out_compress_type){
|
|
1673
|
+
TPatchiListener listener;
|
|
1674
|
+
listener.diffData_cur=lite_diff;
|
|
1675
|
+
listener.diffData_end=lite_diff_end;
|
|
1676
|
+
hpi_pos_t saved_newSize;
|
|
1677
|
+
hpi_pos_t saved_uncompressSize;
|
|
1678
|
+
if (!_try_open_hpatchi_and_inplace(listener,out_compress_type,
|
|
1679
|
+
&saved_newSize,&saved_uncompressSize)) return false;
|
|
1680
|
+
return true;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
bool check_lite_diff(const hpi_byte* newData,const hpi_byte* newData_end,
|
|
1684
|
+
const hpi_byte* oldData,const hpi_byte* oldData_end,
|
|
1685
|
+
const hpi_byte* lite_diff,const hpi_byte* lite_diff_end,
|
|
1686
|
+
hpatch_TDecompress* decompressPlugin){
|
|
1687
|
+
TPatchiListener listener;
|
|
1688
|
+
listener.diffData_cur=lite_diff;
|
|
1689
|
+
listener.diffData_end=lite_diff_end;
|
|
1690
|
+
hpi_compressType _compress_type;
|
|
1691
|
+
hpi_pos_t saved_newSize;
|
|
1692
|
+
hpi_pos_t saved_uncompressSize;
|
|
1693
|
+
if (!_try_open_hpatchi_and_inplace(listener,&_compress_type,
|
|
1694
|
+
&saved_newSize,&saved_uncompressSize)) return false;
|
|
1695
|
+
if (saved_newSize!=(size_t)(newData_end-newData)) return false;
|
|
1696
|
+
listener.diff_data=&listener;
|
|
1697
|
+
listener.decompressPlugin=(_compress_type!=hpi_compressType_no)?decompressPlugin:0;
|
|
1698
|
+
if (listener.decompressPlugin){
|
|
1699
|
+
listener.uncompressSize=saved_uncompressSize;
|
|
1700
|
+
mem_as_hStreamInput(&listener.diffStream,listener.diffData_cur,lite_diff_end);
|
|
1701
|
+
listener.decompresser=decompressPlugin->open(decompressPlugin,saved_uncompressSize,&listener.diffStream,
|
|
1702
|
+
0,(size_t)(lite_diff_end-listener.diffData_cur));
|
|
1703
|
+
if (listener.decompresser==0) return false;
|
|
1704
|
+
listener.read_diff=listener._read_diff_dec;
|
|
1705
|
+
}else{
|
|
1706
|
+
listener.read_diff=listener._read_diff;
|
|
1707
|
+
}
|
|
1708
|
+
listener.newData_cur=newData;
|
|
1709
|
+
listener.newData_end=newData_end;
|
|
1710
|
+
listener.write_new=listener._write_new;
|
|
1711
|
+
listener.oldData=oldData;
|
|
1712
|
+
listener.oldData_end=oldData_end;
|
|
1713
|
+
listener.read_old=listener._read_old;
|
|
1714
|
+
|
|
1715
|
+
const size_t kACacheBufSize=hpatch_kFileIOBufBetterSize;
|
|
1716
|
+
hdiff_private::TAutoMem _cache(kACacheBufSize+listener.extraSafeSize);
|
|
1717
|
+
|
|
1718
|
+
if (listener.isInplacePatch){
|
|
1719
|
+
if (!hpatchi_inplaceB(&listener,saved_newSize,_cache.data(),listener.extraSafeSize,(hpi_size_t)_cache.size()))
|
|
1720
|
+
return false;
|
|
1721
|
+
}else if (!hpatch_lite_patch(&listener,saved_newSize,_cache.data(),(hpi_size_t)_cache.size())){
|
|
1722
|
+
return false;
|
|
1723
|
+
}
|
|
1724
|
+
return listener.newData_cur==listener.newData_end;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
hpatch_BOOL hdiff_streamDataIsEqual(const hpatch_TStreamInput* x,const hpatch_TStreamInput* y){
|
|
1729
|
+
const hpatch_StreamPos_t ssize=x->streamSize;
|
|
1730
|
+
if (ssize!=y->streamSize) return hpatch_FALSE;
|
|
1731
|
+
const size_t kACacheBufSize=hdiff_kFileIOBufBestSize;
|
|
1732
|
+
hdiff_private::TAutoMem _cache(kACacheBufSize*2);
|
|
1733
|
+
hpatch_byte* bufx=_cache.data();
|
|
1734
|
+
hpatch_byte* bufy=bufx+kACacheBufSize;
|
|
1735
|
+
for (hpatch_StreamPos_t i=0; i<ssize; ){
|
|
1736
|
+
const hpatch_StreamPos_t maxdSize=ssize-i;
|
|
1737
|
+
size_t dataSize=(size_t)(kACacheBufSize<=maxdSize?kACacheBufSize:maxdSize);
|
|
1738
|
+
check(x->read(x,i,bufx,bufx+dataSize));
|
|
1739
|
+
check(y->read(y,i,bufy,bufy+dataSize));
|
|
1740
|
+
if (0!=memcmp(bufx,bufy,dataSize))
|
|
1741
|
+
return hpatch_FALSE;
|
|
1742
|
+
i+=dataSize;
|
|
1743
|
+
}
|
|
1744
|
+
return hpatch_TRUE;
|
|
1745
|
+
}
|
|
1746
|
+
|