react-native-update 10.34.3 → 10.34.5

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