react-native-update 10.34.2 → 10.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (746) hide show
  1. package/.gitmodules +4 -4
  2. package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +153 -0
  3. package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +48 -0
  4. package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +157 -0
  5. package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +307 -0
  6. package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +83 -0
  7. package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +47 -0
  8. package/harmony/pushy/src/main/cpp/HDiffPatch/_dir_ignore.h +191 -0
  9. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +37 -0
  10. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +7 -0
  11. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.bat +1 -0
  12. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.sh +1 -0
  13. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +18 -0
  14. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +20 -0
  15. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +28 -0
  16. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +8 -0
  17. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffPatch.workspace +8 -0
  18. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HDiffZ.cbp +219 -0
  19. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/HPatchZ.cbp +156 -0
  20. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/codeblocks/unitTest.cbp +65 -0
  21. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +105 -0
  22. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +237 -0
  23. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj.user +3 -0
  24. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +318 -0
  25. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj.user +3 -0
  26. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +182 -0
  27. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj.user +3 -0
  28. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +30 -0
  29. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  30. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +408 -0
  31. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +573 -0
  32. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +396 -0
  33. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lz4.xcodeproj/project.pbxproj +268 -0
  34. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +361 -0
  35. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +301 -0
  36. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +411 -0
  37. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +504 -0
  38. package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +344 -0
  39. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +166 -0
  40. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +59 -0
  41. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +1152 -0
  42. package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +995 -0
  43. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +797 -0
  44. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +65 -0
  45. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +200 -0
  46. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +178 -0
  47. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +357 -0
  48. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.h +87 -0
  49. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +151 -0
  50. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +770 -0
  51. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +236 -0
  52. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_private.h +47 -0
  53. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +112 -0
  54. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +53 -0
  55. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +61 -0
  56. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +331 -0
  57. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +144 -0
  58. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +176 -0
  59. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +84 -0
  60. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +146 -0
  61. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +61 -0
  62. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +152 -0
  63. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +76 -0
  64. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +524 -0
  65. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +259 -0
  66. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +1570 -0
  67. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +290 -0
  68. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +1221 -0
  69. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +1025 -0
  70. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +116 -0
  71. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +72 -0
  72. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +213 -0
  73. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +63 -0
  74. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +170 -0
  75. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +86 -0
  76. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/config.h +89 -0
  77. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c +13 -0
  78. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +398 -0
  79. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +194 -0
  80. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.c +13 -0
  81. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +204 -0
  82. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +207 -0
  83. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +815 -0
  84. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +586 -0
  85. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/utils.c.inc.h +381 -0
  86. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +352 -0
  87. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +137 -0
  88. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +137 -0
  89. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +70 -0
  90. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +628 -0
  91. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +87 -0
  92. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +363 -0
  93. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +139 -0
  94. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +68 -0
  95. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +115 -0
  96. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +342 -0
  97. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +94 -0
  98. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/checksum_plugin.h +52 -0
  99. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +2292 -0
  100. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +215 -0
  101. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +165 -0
  102. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +251 -0
  103. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +174 -0
  104. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +73 -0
  105. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.cpp +367 -0
  106. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +92 -0
  107. package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +301 -0
  108. package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +292 -0
  109. package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +436 -0
  110. package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +417 -0
  111. package/harmony/pushy/src/main/cpp/lzma/Asm/arm/7zCrcOpt.asm +100 -0
  112. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +147 -0
  113. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +147 -0
  114. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +237 -0
  115. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +1258 -0
  116. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +205 -0
  117. package/harmony/pushy/src/main/cpp/lzma/C/7z.h +202 -0
  118. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +80 -0
  119. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +19 -0
  120. package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +1771 -0
  121. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.c +36 -0
  122. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +35 -0
  123. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf2.c +52 -0
  124. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +128 -0
  125. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +25 -0
  126. package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +115 -0
  127. package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +591 -0
  128. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +286 -0
  129. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +83 -0
  130. package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +176 -0
  131. package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +375 -0
  132. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +27 -0
  133. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.rc +55 -0
  134. package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +306 -0
  135. package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +38 -0
  136. package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +184 -0
  137. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +455 -0
  138. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +51 -0
  139. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +257 -0
  140. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +146 -0
  141. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +311 -0
  142. package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +230 -0
  143. package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +64 -0
  144. package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +82 -0
  145. package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +53 -0
  146. package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +33 -0
  147. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +218 -0
  148. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +336 -0
  149. package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +64 -0
  150. package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +19 -0
  151. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +108 -0
  152. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +20 -0
  153. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +1127 -0
  154. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +121 -0
  155. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +853 -0
  156. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +101 -0
  157. package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +57 -0
  158. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +488 -0
  159. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +120 -0
  160. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +1082 -0
  161. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +79 -0
  162. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +803 -0
  163. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +55 -0
  164. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +111 -0
  165. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +54 -0
  166. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +106 -0
  167. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +1185 -0
  168. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +234 -0
  169. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +2976 -0
  170. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +76 -0
  171. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +40 -0
  172. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +131 -0
  173. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +601 -0
  174. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +141 -0
  175. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +1138 -0
  176. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +201 -0
  177. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +85 -0
  178. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +712 -0
  179. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +142 -0
  180. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +191 -0
  181. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +187 -0
  182. package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +10 -0
  183. package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +30 -0
  184. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +248 -0
  185. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +26 -0
  186. package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +141 -0
  187. package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +18 -0
  188. package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +95 -0
  189. package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +70 -0
  190. package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.c +396 -0
  191. package/harmony/pushy/src/main/cpp/lzma/C/ThreadsP.h +31 -0
  192. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +241 -0
  193. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsw +29 -0
  194. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +686 -0
  195. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.c +4 -0
  196. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +10 -0
  197. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +40 -0
  198. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +75 -0
  199. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +258 -0
  200. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +168 -0
  201. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsw +29 -0
  202. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +28 -0
  203. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +44 -0
  204. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.def +4 -0
  205. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +178 -0
  206. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsw +29 -0
  207. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +14 -0
  208. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +34 -0
  209. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/resource.rc +3 -0
  210. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.c +4 -0
  211. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +10 -0
  212. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +640 -0
  213. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsp +231 -0
  214. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsw +29 -0
  215. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +37 -0
  216. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +38 -0
  217. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/resource.rc +5 -0
  218. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/setup.ico +0 -0
  219. package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +90 -0
  220. package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +460 -0
  221. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +86 -0
  222. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +26 -0
  223. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +69 -0
  224. package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +2766 -0
  225. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +1329 -0
  226. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +60 -0
  227. package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +319 -0
  228. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +240 -0
  229. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +7 -0
  230. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
  231. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +76 -0
  232. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +569 -0
  233. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +70 -0
  234. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +678 -0
  235. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +92 -0
  236. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +423 -0
  237. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +139 -0
  238. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +61 -0
  239. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +763 -0
  240. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +181 -0
  241. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +942 -0
  242. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
  243. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +148 -0
  244. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +1666 -0
  245. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +445 -0
  246. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +202 -0
  247. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +901 -0
  248. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +335 -0
  249. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +174 -0
  250. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +22 -0
  251. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +21 -0
  252. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +22 -0
  253. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +35 -0
  254. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +2500 -0
  255. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +139 -0
  256. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
  257. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +8 -0
  258. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +12 -0
  259. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +19 -0
  260. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +151 -0
  261. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +1125 -0
  262. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
  263. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
  264. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +25 -0
  265. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +232 -0
  266. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +110 -0
  267. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +46 -0
  268. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +67 -0
  269. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +88 -0
  270. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +28 -0
  271. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +191 -0
  272. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +89 -0
  273. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
  274. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +37 -0
  275. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
  276. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
  277. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +8 -0
  278. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +122 -0
  279. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +608 -0
  280. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Icons/7z.ico +0 -0
  281. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +629 -0
  282. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +359 -0
  283. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +8 -0
  284. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +1308 -0
  285. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +11 -0
  286. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +9 -0
  287. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +1910 -0
  288. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
  289. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
  290. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +8 -0
  291. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +154 -0
  292. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
  293. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
  294. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +8 -0
  295. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +96 -0
  296. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
  297. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
  298. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +8 -0
  299. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +116 -0
  300. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
  301. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +799 -0
  302. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +477 -0
  303. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
  304. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
  305. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +8 -0
  306. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +59 -0
  307. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +195 -0
  308. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
  309. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp +715 -0
  310. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
  311. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +912 -0
  312. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
  313. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +482 -0
  314. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
  315. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +8 -0
  316. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +134 -0
  317. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +5 -0
  318. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
  319. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +86 -0
  320. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +137 -0
  321. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
  322. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +803 -0
  323. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
  324. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +364 -0
  325. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
  326. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +13 -0
  327. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +117 -0
  328. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
  329. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
  330. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
  331. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
  332. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +988 -0
  333. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
  334. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +241 -0
  335. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
  336. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +14 -0
  337. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +153 -0
  338. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
  339. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +50 -0
  340. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +250 -0
  341. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +120 -0
  342. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +536 -0
  343. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +192 -0
  344. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
  345. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +10 -0
  346. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +475 -0
  347. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +166 -0
  348. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +435 -0
  349. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +205 -0
  350. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +163 -0
  351. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +92 -0
  352. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +127 -0
  353. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +48 -0
  354. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +367 -0
  355. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +252 -0
  356. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.cpp +3 -0
  357. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +6 -0
  358. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.cpp +3 -0
  359. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +10 -0
  360. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +509 -0
  361. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +264 -0
  362. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +39 -0
  363. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +26 -0
  364. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +111 -0
  365. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +66 -0
  366. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +51 -0
  367. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +35 -0
  368. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +108 -0
  369. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +78 -0
  370. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +106 -0
  371. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +8 -0
  372. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +156 -0
  373. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +60 -0
  374. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +285 -0
  375. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +157 -0
  376. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +56 -0
  377. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +13 -0
  378. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +57 -0
  379. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +26 -0
  380. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +48 -0
  381. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +24 -0
  382. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +666 -0
  383. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +120 -0
  384. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
  385. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +24 -0
  386. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +31 -0
  387. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +17 -0
  388. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +23 -0
  389. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +35 -0
  390. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +41 -0
  391. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +92 -0
  392. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +344 -0
  393. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +120 -0
  394. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +49 -0
  395. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyRegister.cpp +15 -0
  396. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +128 -0
  397. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +265 -0
  398. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +96 -0
  399. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +122 -0
  400. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +42 -0
  401. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
  402. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +343 -0
  403. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +113 -0
  404. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +182 -0
  405. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +46 -0
  406. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
  407. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +170 -0
  408. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +86 -0
  409. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +152 -0
  410. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +58 -0
  411. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
  412. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +8 -0
  413. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +150 -0
  414. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +92 -0
  415. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +245 -0
  416. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +46 -0
  417. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +8 -0
  418. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +8 -0
  419. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +280 -0
  420. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +118 -0
  421. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
  422. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +112 -0
  423. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +57 -0
  424. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +16 -0
  425. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +233 -0
  426. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +40 -0
  427. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +8 -0
  428. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +84 -0
  429. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +220 -0
  430. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +399 -0
  431. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +28 -0
  432. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +23 -0
  433. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +19 -0
  434. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +127 -0
  435. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +5 -0
  436. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersion.h +2 -0
  437. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +2 -0
  438. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +127 -0
  439. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/SubBuild.mak +3 -0
  440. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +993 -0
  441. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +235 -0
  442. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
  443. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
  444. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +8 -0
  445. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +28 -0
  446. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/resource.rc +3 -0
  447. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1295 -0
  448. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +136 -0
  449. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +1715 -0
  450. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +403 -0
  451. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +155 -0
  452. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +10 -0
  453. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +161 -0
  454. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +112 -0
  455. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +3618 -0
  456. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +77 -0
  457. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
  458. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +11 -0
  459. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +190 -0
  460. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +1096 -0
  461. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +42 -0
  462. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +27 -0
  463. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +482 -0
  464. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +94 -0
  465. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +34 -0
  466. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +280 -0
  467. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
  468. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +347 -0
  469. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +110 -0
  470. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +114 -0
  471. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +1074 -0
  472. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +424 -0
  473. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +3553 -0
  474. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +436 -0
  475. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +668 -0
  476. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
  477. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +14 -0
  478. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +80 -0
  479. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +10 -0
  480. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
  481. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +10 -0
  482. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +8 -0
  483. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +19 -0
  484. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +16 -0
  485. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +1704 -0
  486. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +200 -0
  487. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
  488. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +66 -0
  489. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +771 -0
  490. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +162 -0
  491. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +233 -0
  492. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +27 -0
  493. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +70 -0
  494. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +55 -0
  495. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +94 -0
  496. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +26 -0
  497. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +130 -0
  498. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
  499. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +14 -0
  500. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +43 -0
  501. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +13 -0
  502. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +69 -0
  503. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +33 -0
  504. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +825 -0
  505. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +164 -0
  506. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +367 -0
  507. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +48 -0
  508. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +1359 -0
  509. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +27 -0
  510. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +1154 -0
  511. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +175 -0
  512. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
  513. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +66 -0
  514. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +183 -0
  515. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +62 -0
  516. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
  517. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +8 -0
  518. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +702 -0
  519. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +124 -0
  520. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +110 -0
  521. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
  522. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +64 -0
  523. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/resource.rc +7 -0
  524. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +37 -0
  525. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
  526. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1025 -0
  527. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +21 -0
  528. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
  529. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
  530. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
  531. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
  532. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
  533. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1037 -0
  534. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +328 -0
  535. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
  536. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
  537. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +40 -0
  538. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +76 -0
  539. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +122 -0
  540. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +69 -0
  541. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +91 -0
  542. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +17 -0
  543. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
  544. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
  545. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +14 -0
  546. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
  547. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +196 -0
  548. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +170 -0
  549. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
  550. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1337 -0
  551. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +351 -0
  552. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
  553. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +48 -0
  554. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +80 -0
  555. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
  556. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
  557. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
  558. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +95 -0
  559. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +255 -0
  560. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +62 -0
  561. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +177 -0
  562. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +15 -0
  563. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +59 -0
  564. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +418 -0
  565. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
  566. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
  567. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
  568. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +280 -0
  569. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +38 -0
  570. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
  571. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +27 -0
  572. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/resource2.h +2 -0
  573. package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +156 -0
  574. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +35 -0
  575. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +7 -0
  576. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +92 -0
  577. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +53 -0
  578. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +21 -0
  579. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +197 -0
  580. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +63 -0
  581. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +43 -0
  582. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +98 -0
  583. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +15 -0
  584. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +64 -0
  585. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +193 -0
  586. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +28 -0
  587. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +23 -0
  588. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +132 -0
  589. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +18 -0
  590. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +259 -0
  591. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +100 -0
  592. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +277 -0
  593. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +14 -0
  594. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +54 -0
  595. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +45 -0
  596. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +42 -0
  597. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +1659 -0
  598. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +868 -0
  599. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +35 -0
  600. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +17 -0
  601. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.cpp +3 -0
  602. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +634 -0
  603. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +145 -0
  604. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +231 -0
  605. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +163 -0
  606. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +88 -0
  607. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +40 -0
  608. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +8 -0
  609. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +89 -0
  610. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +38 -0
  611. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +163 -0
  612. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +71 -0
  613. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +319 -0
  614. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +88 -0
  615. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +144 -0
  616. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +21 -0
  617. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +124 -0
  618. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +19 -0
  619. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +288 -0
  620. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +12 -0
  621. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +676 -0
  622. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +149 -0
  623. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Init.cpp +7 -0
  624. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +42 -0
  625. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +70 -0
  626. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +185 -0
  627. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +23 -0
  628. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +66 -0
  629. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +65 -0
  630. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +52 -0
  631. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +251 -0
  632. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +170 -0
  633. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +19 -0
  634. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.cpp +10 -0
  635. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +87 -0
  636. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +155 -0
  637. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +146 -0
  638. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +35 -0
  639. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +143 -0
  640. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +50 -0
  641. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +34 -0
  642. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +28 -0
  643. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +42 -0
  644. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +8 -0
  645. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +43 -0
  646. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +27 -0
  647. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +200 -0
  648. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +51 -0
  649. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +109 -0
  650. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +58 -0
  651. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +17 -0
  652. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +66 -0
  653. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +15 -0
  654. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +714 -0
  655. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +117 -0
  656. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +749 -0
  657. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +161 -0
  658. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +432 -0
  659. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +212 -0
  660. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +440 -0
  661. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.cpp +12 -0
  662. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +66 -0
  663. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +839 -0
  664. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +115 -0
  665. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +131 -0
  666. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +27 -0
  667. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +37 -0
  668. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +112 -0
  669. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +40 -0
  670. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +46 -0
  671. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +347 -0
  672. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +114 -0
  673. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +138 -0
  674. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +37 -0
  675. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +390 -0
  676. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +84 -0
  677. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +103 -0
  678. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +16 -0
  679. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +181 -0
  680. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +167 -0
  681. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +358 -0
  682. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +94 -0
  683. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +8 -0
  684. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +10 -0
  685. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +164 -0
  686. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +142 -0
  687. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +40 -0
  688. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +38 -0
  689. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +213 -0
  690. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +32 -0
  691. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +179 -0
  692. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +284 -0
  693. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CRC.cs +55 -0
  694. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CommandLineParser.cs +274 -0
  695. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/InBuffer.cs +72 -0
  696. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/OutBuffer.cs +47 -0
  697. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/IMatchFinder.cs +24 -0
  698. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzBinTree.cs +367 -0
  699. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzInWindow.cs +132 -0
  700. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzOutWindow.cs +110 -0
  701. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaBase.cs +76 -0
  702. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaDecoder.cs +398 -0
  703. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaEncoder.cs +1480 -0
  704. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs +364 -0
  705. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj +90 -0
  706. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln +20 -0
  707. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaBench.cs +340 -0
  708. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs +29 -0
  709. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs +70 -0
  710. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs +42 -0
  711. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoder.cs +234 -0
  712. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs +117 -0
  713. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs +157 -0
  714. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/ICoder.cs +157 -0
  715. package/harmony/pushy/src/main/cpp/lzma/DOC/7zC.txt +187 -0
  716. package/harmony/pushy/src/main/cpp/lzma/DOC/7zFormat.txt +469 -0
  717. package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +173 -0
  718. package/harmony/pushy/src/main/cpp/lzma/DOC/installer.txt +166 -0
  719. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +446 -0
  720. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +357 -0
  721. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-specification.txt +1176 -0
  722. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +328 -0
  723. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/CRC.java +52 -0
  724. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/BinTree.java +382 -0
  725. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/InWindow.java +131 -0
  726. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/OutWindow.java +85 -0
  727. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Base.java +88 -0
  728. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Decoder.java +329 -0
  729. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Encoder.java +1416 -0
  730. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java +55 -0
  731. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java +99 -0
  732. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Decoder.java +88 -0
  733. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Encoder.java +151 -0
  734. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/ICodeProgress.java +6 -0
  735. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaAlone.java +253 -0
  736. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaBench.java +392 -0
  737. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
  738. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
  739. package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
  740. package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
  741. package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
  742. package/harmony/pushy/src/main/cpp/lzma/bin/installer/config.txt +5 -0
  743. package/harmony/pushy/src/main/cpp/lzma/bin/installer/cr.bat +5 -0
  744. package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
  745. package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
  746. package/package.json +1 -1
@@ -0,0 +1,1570 @@
1
+ //hdiffz.cpp
2
+ // diff tool
3
+ //
4
+ /*
5
+ The MIT License (MIT)
6
+ Copyright (c) 2012-2019 HouSisong
7
+
8
+ Permission is hereby granted, free of charge, to any person
9
+ obtaining a copy of this software and associated documentation
10
+ files (the "Software"), to deal in the Software without
11
+ restriction, including without limitation the rights to use,
12
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the
14
+ Software is furnished to do so, subject to the following
15
+ conditions:
16
+
17
+ The above copyright notice and this permission notice shall be
18
+ included in all copies of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
+ OTHER DEALINGS IN THE SOFTWARE.
28
+ */
29
+
30
+ #include <iostream>
31
+ #include <fstream>
32
+ #include <string>
33
+ #include <vector>
34
+ #include <string.h>
35
+ #include <stdlib.h>
36
+ #include <stdio.h>
37
+ #include <algorithm> //find search
38
+ #include "libHDiffPatch/HDiff/diff.h"
39
+ #include "libHDiffPatch/HPatch/patch.h"
40
+ #include "_clock_for_demo.h"
41
+ #include "_atosize.h"
42
+ #include "file_for_patch.h"
43
+ #include "libHDiffPatch/HDiff/private_diff/mem_buf.h"
44
+
45
+ #include "_dir_ignore.h"
46
+ #if (_IS_NEED_DIR_DIFF_PATCH)
47
+ #include "dirDiffPatch/dir_diff/dir_diff.h"
48
+ #endif
49
+
50
+ #ifndef _IS_NEED_MAIN
51
+ # define _IS_NEED_MAIN 1
52
+ #endif
53
+
54
+ #ifndef _IS_NEED_DEFAULT_CompressPlugin
55
+ # define _IS_NEED_DEFAULT_CompressPlugin 1
56
+ #endif
57
+ #if (_IS_NEED_ALL_CompressPlugin)
58
+ # undef _IS_NEED_DEFAULT_CompressPlugin
59
+ # define _IS_NEED_DEFAULT_CompressPlugin 1
60
+ #endif
61
+ #if (_IS_NEED_DEFAULT_CompressPlugin)
62
+ //===== select needs decompress plugins or change to your plugin=====
63
+ # define _CompressPlugin_zlib // memroy requires less
64
+ # define _CompressPlugin_bz2
65
+ # define _CompressPlugin_lzma // better compresser
66
+ # define _CompressPlugin_lzma2 // better compresser
67
+ #endif
68
+ #if (_IS_NEED_ALL_CompressPlugin)
69
+ //===== select needs decompress plugins or change to your plugin=====
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
74
+ # define _CompressPlugin_lzham // better compresser / decompress faster than lzma2
75
+ #endif
76
+
77
+ #include "compress_plugin_demo.h"
78
+ #include "decompress_plugin_demo.h"
79
+
80
+
81
+ #if (_IS_NEED_DIR_DIFF_PATCH)
82
+
83
+ #ifndef _IS_NEED_DEFAULT_ChecksumPlugin
84
+ # define _IS_NEED_DEFAULT_ChecksumPlugin 1
85
+ #endif
86
+ #if (_IS_NEED_ALL_ChecksumPlugin)
87
+ # undef _IS_NEED_DEFAULT_ChecksumPlugin
88
+ # define _IS_NEED_DEFAULT_ChecksumPlugin 1
89
+ #endif
90
+ #if (_IS_NEED_DEFAULT_ChecksumPlugin)
91
+ //===== select needs checksum plugins or change to your plugin=====
92
+ # define _ChecksumPlugin_crc32 // = 32 bit effective //need zlib
93
+ # define _ChecksumPlugin_fadler64 // ? 63 bit effective
94
+ #endif
95
+ #if (_IS_NEED_ALL_ChecksumPlugin)
96
+ //===== select needs checksum plugins or change to your plugin=====
97
+ # define _ChecksumPlugin_adler32 // ? 29 bit effective
98
+ # define _ChecksumPlugin_adler64 // ? 30 bit effective
99
+ # define _ChecksumPlugin_fadler32 // ~ 32 bit effective
100
+ # define _ChecksumPlugin_fadler128// ? 81 bit effective
101
+ # define _ChecksumPlugin_md5 // ? 128 bit effective
102
+ #endif
103
+
104
+
105
+ #include "checksum_plugin_demo.h"
106
+ #endif
107
+
108
+ static void printVersion(){
109
+ printf("HDiffPatch::hdiffz v" HDIFFPATCH_VERSION_STRING "\n\n");
110
+ }
111
+
112
+ static void printUsage(){
113
+ printVersion();
114
+ printf("diff usage: hdiffz [options] oldPath newPath outDiffFile\n"
115
+ "test usage: hdiffz -t oldPath newPath testDiffFile\n"
116
+ "resave usage: hdiffz [-c-...] diffFile outDiffFile\n"
117
+ #if (_IS_NEED_DIR_DIFF_PATCH)
118
+ "get manifest: hdiffz [-g#...] [-C-checksumType] inputPath -M#outManifestTxtFile\n"
119
+ "manifest diff: hdiffz [options] -M-old#oldManifestFile -M-new#newManifestFile\n"
120
+ " oldPath newPath outDiffFile\n"
121
+ " oldPath newPath inputPath can be file or directory(folder),\n"
122
+ #endif
123
+ " oldPath can empty, and input parameter \"\"\n"
124
+ "memory options:\n"
125
+ " -m[-matchScore]\n"
126
+ " DEFAULT; all file load into Memory; best diffFileSize;\n"
127
+ " requires (newFileSize+ oldFileSize*5(or *9 when oldFileSize>=2GB))+O(1)\n"
128
+ " bytes of memory;\n"
129
+ " matchScore>=0, DEFAULT -m-6, recommended bin: 0--4 text: 4--9 etc...\n"
130
+ " -s[-matchBlockSize]\n"
131
+ " all file load as Stream; fast;\n"
132
+ " requires O(oldFileSize*16/matchBlockSize+matchBlockSize*5)bytes of memory;\n"
133
+ " matchBlockSize>=4, DEFAULT -s-64, recommended 16,32,48,1k,64k,1m etc...\n"
134
+ "special options:\n"
135
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
136
+ " -SD[-stepSize]\n"
137
+ " create single compressed stream diffData! \n"
138
+ " now only for test, must run with -m, and not supprot directory(folder).\n"
139
+ " stepSize>=" _HDIFFPATCH_EXPAND_AND_QUOTE(hpatch_kStreamCacheSize) ", DEFAULT -SD-256k, recommended 64k,2m etc...\n"
140
+ #endif
141
+ #if (_IS_USED_MULTITHREAD)
142
+ " -p-parallelThreadNumber\n"
143
+ " if parallelThreadNumber>1 then open multi-thread Parallel mode;\n"
144
+ " DEFAULT -p-4; requires more memory!\n"
145
+ #endif
146
+ " -c-compressType[-compressLevel]\n"
147
+ " set outDiffFile Compress type & level, DEFAULT uncompress;\n"
148
+ " for resave diffFile,recompress diffFile to outDiffFile by new set;\n"
149
+ " support compress type & level:\n"
150
+ " (re. https://github.com/sisong/lzbench/blob/master/lzbench171_sorted.md )\n"
151
+ #ifdef _CompressPlugin_zlib
152
+ " -c-zlib[-{1..9}] DEFAULT level 9\n"
153
+ # if (_IS_USED_MULTITHREAD)
154
+ " -c-pzlib[-{1..9}] DEFAULT level 6\n"
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"
158
+ # endif
159
+ #endif
160
+ #ifdef _CompressPlugin_bz2
161
+ " -c-bzip2[-{1..9}] (or -bz2) DEFAULT level 9\n"
162
+ # if (_IS_USED_MULTITHREAD)
163
+ " -c-pbzip2[-{1..9}] (or -pbz2) DEFAULT level 8\n"
164
+ " support run by multi-thread parallel, fast!\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"
167
+ # endif
168
+ #endif
169
+ #ifdef _CompressPlugin_lzma
170
+ " -c-lzma[-{0..9}[-dictSize]] DEFAULT level 7\n"
171
+ " dictSize can like 4096 or 4k or 4m or 128m etc..., DEFAULT 8m\n"
172
+ # if (_IS_USED_MULTITHREAD)
173
+ " support run by 2-thread parallel.\n"
174
+ # endif
175
+ #endif
176
+ #ifdef _CompressPlugin_lzma2
177
+ " -c-lzma2[-{0..9}[-dictSize]] DEFAULT level 7\n"
178
+ " dictSize can like 4096 or 4k or 4m or 128m etc..., DEFAULT 8m\n"
179
+ # if (_IS_USED_MULTITHREAD)
180
+ " support run by multi-thread parallel, fast!\n"
181
+ # endif
182
+ " WARNING: code not compatible with it compressed by -c-lzma!\n"
183
+ #endif
184
+ #ifdef _CompressPlugin_lz4
185
+ " -c-lz4[-{1..50}] DEFAULT level 50 (as lz4 acceleration 1)\n"
186
+ #endif
187
+ #ifdef _CompressPlugin_lz4hc
188
+ " -c-lz4hc[-{3..12}] DEFAULT level 11\n"
189
+ #endif
190
+ #ifdef _CompressPlugin_zstd
191
+ " -c-zstd[-{0..22}[-dictBits]] DEFAULT level 20\n"
192
+ " dictBits can 10--31, DEFAULT 24.\n"
193
+ # if (_IS_USED_MULTITHREAD)
194
+ " support run by multi-thread parallel, fast!\n"
195
+ # endif
196
+ #endif
197
+ #ifdef _CompressPlugin_brotli
198
+ " -c-brotli[-{0..11}[-dictBits]] DEFAULT level 9\n"
199
+ " dictBits can 10--30, DEFAULT 24.\n"
200
+ #endif
201
+ #ifdef _CompressPlugin_lzham
202
+ " -c-lzham[-{0..5}[-dictBits]] DEFAULT level 4\n"
203
+ " dictBits can 15--29, DEFAULT 24.\n"
204
+ # if (_IS_USED_MULTITHREAD)
205
+ " support run by multi-thread parallel, fast!\n"
206
+ # endif
207
+ #endif
208
+ #if (_IS_NEED_DIR_DIFF_PATCH)
209
+ " -C-checksumType\n"
210
+ " set outDiffFile Checksum type for directory diff, DEFAULT "
211
+ #ifdef _ChecksumPlugin_fadler64
212
+ "-C-fadler64;\n"
213
+ #else
214
+ # ifdef _ChecksumPlugin_crc32
215
+ "-C-crc32;\n"
216
+ # else
217
+ "no checksum;\n"
218
+ # endif
219
+ " (if need checksum for diff between two files, add -D)\n"
220
+ #endif
221
+ " support checksum type:\n"
222
+ " -C-no no checksum\n"
223
+ #ifdef _ChecksumPlugin_crc32
224
+ # ifdef _ChecksumPlugin_fadler64
225
+ " -C-crc32\n"
226
+ # else
227
+ " -C-crc32 DEFAULT\n"
228
+ # endif
229
+ #endif
230
+ #ifdef _ChecksumPlugin_adler32
231
+ " -C-adler32\n"
232
+ #endif
233
+ #ifdef _ChecksumPlugin_adler64
234
+ " -C-adler64\n"
235
+ #endif
236
+ #ifdef _ChecksumPlugin_fadler32
237
+ " -C-fadler32\n"
238
+ #endif
239
+ #ifdef _ChecksumPlugin_fadler64
240
+ " -C-fadler64 DEFAULT\n"
241
+ #endif
242
+ #ifdef _ChecksumPlugin_fadler128
243
+ " -C-fadler128\n"
244
+ #endif
245
+ #ifdef _ChecksumPlugin_md5
246
+ " -C-md5\n"
247
+ #endif
248
+ " -n-maxOpenFileNumber\n"
249
+ " limit Number of open files at same time when stream directory diff;\n"
250
+ " maxOpenFileNumber>=8, DEFAULT -n-48, the best limit value by different\n"
251
+ " operating system.\n"
252
+ " -g#ignorePath[#ignorePath#...]\n"
253
+ " set iGnore path list when Directory Diff; ignore path list such as:\n"
254
+ " #.DS_Store#desktop.ini#*thumbs*.db#.git*#.svn/#cache_*/00*11/*.tmp\n"
255
+ " # means separator between names; (if char # in name, need write #: )\n"
256
+ " * means can match any chars in name; (if char * in name, need write *: );\n"
257
+ " / at the end of name means must match directory;\n"
258
+ " -g-old#ignorePath[#ignorePath#...]\n"
259
+ " set iGnore path list in oldPath when Directory Diff;\n"
260
+ " if oldFile can be changed, need add it in old ignore list;\n"
261
+ " -g-new#ignorePath[#ignorePath#...]\n"
262
+ " set iGnore path list in newPath when Directory Diff;\n"
263
+ " in general, new ignore list should is empty;\n"
264
+ " -M#outManifestTxtFile\n"
265
+ " create a Manifest file for inputPath; it is a text file, saved infos of\n"
266
+ " all files and directoriy list in inputPath; this file while be used in \n"
267
+ " manifest diff, support re-checksum data by manifest diff;\n"
268
+ " can be used to protect historical versions be modified!\n"
269
+ " -M-old#oldManifestFile\n"
270
+ " oldManifestFile is created from oldPath; if no oldPath not need -M-old;\n"
271
+ " -M-new#newManifestFile\n"
272
+ " newManifestFile is created from newPath;\n"
273
+ " -D force run Directory diff between two files; DEFAULT (no -D) run \n"
274
+ " directory diff need oldPath or newPath is directory.\n"
275
+ #endif //_IS_NEED_DIR_DIFF_PATCH
276
+ " -d Diff only, do't run patch check, DEFAULT run patch check.\n"
277
+ " -t Test only, run patch check, patch(oldPath,testDiffFile)==newPath ? \n"
278
+ " -f Force overwrite, ignore write path already exists;\n"
279
+ " DEFAULT (no -f) not overwrite and then return error;\n"
280
+ " if used -f and write path is exist directory, will always return error.\n"
281
+ " -h or -?\n"
282
+ " output Help info (this usage).\n"
283
+ " -v output Version info.\n\n"
284
+ );
285
+ }
286
+
287
+ typedef enum THDiffResult {
288
+ HDIFF_SUCCESS=0,
289
+ HDIFF_OPTIONS_ERROR,
290
+ HDIFF_OPENREAD_ERROR,
291
+ HDIFF_OPENWRITE_ERROR,
292
+ HDIFF_FILECLOSE_ERROR,
293
+ HDIFF_MEM_ERROR,
294
+ HDIFF_DIFF_ERROR,
295
+ HDIFF_PATCH_ERROR,
296
+ HDIFF_RESAVE_FILEREAD_ERROR,
297
+ HDIFF_RESAVE_DIFFINFO_ERROR,
298
+ HDIFF_RESAVE_COMPRESSTYPE_ERROR,
299
+ HDIFF_RESAVE_ERROR,
300
+ HDIFF_RESAVE_CHECKSUMTYPE_ERROR,
301
+
302
+ HDIFF_PATHTYPE_ERROR, //adding begin v3.0
303
+ HDIFF_TEMPPATH_ERROR,
304
+ HDIFF_DELETEPATH_ERROR,
305
+ HDIFF_RENAMEPATH_ERROR,
306
+
307
+ DIRDIFF_DIFF_ERROR=101,
308
+ DIRDIFF_PATCH_ERROR,
309
+ MANIFEST_CREATE_ERROR,
310
+ MANIFEST_TEST_ERROR,
311
+ } THDiffResult;
312
+
313
+ int hdiff_cmd_line(int argc,const char * argv[]);
314
+
315
+ #if (_IS_NEED_DIR_DIFF_PATCH)
316
+ int hdiff_dir(const char* oldPath,const char* newPath,const char* outDiffFileName,
317
+ hpatch_BOOL oldIsDir, hpatch_BOOL newIsDir,
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,
321
+ const std::vector<std::string>& ignorePathListBase,const std::vector<std::string>& ignoreOldPathList,
322
+ const std::vector<std::string>& ignoreNewPathList,
323
+ const std::string& oldManifestFileName,const std::string& newManifestFileName);
324
+ int create_manifest(const char* inputPath,const char* outManifestFileName,
325
+ hpatch_TChecksum* checksumPlugin,const std::vector<std::string>& ignorePathList);
326
+ #endif
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);
331
+ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
332
+ const hdiff_TCompress* compressPlugin);
333
+
334
+
335
+ #if (_IS_NEED_MAIN)
336
+ # if (_IS_USED_WIN32_UTF8_WAPI)
337
+ int wmain(int argc,wchar_t* argv_w[]){
338
+ hdiff_private::TAutoMem _mem(hpatch_kPathMaxSize*4);
339
+ char** argv_utf8=(char**)_mem.data();
340
+ if (!_wFileNames_to_utf8((const wchar_t**)argv_w,argc,argv_utf8,_mem.size()))
341
+ return HDIFF_OPTIONS_ERROR;
342
+ SetDefaultStringLocale();
343
+ return hdiff_cmd_line(argc,(const char**)argv_utf8);
344
+ }
345
+ # else
346
+ int main(int argc,char* argv[]){
347
+ return hdiff_cmd_line(argc,(const char**)argv);
348
+ }
349
+ # endif
350
+ #endif
351
+
352
+
353
+ static hpatch_BOOL _getIsCompressedDiffFile(const char* diffFileName){
354
+ hpatch_TFileStreamInput diffData;
355
+ hpatch_TFileStreamInput_init(&diffData);
356
+ if (!hpatch_TFileStreamInput_open(&diffData,diffFileName)) return hpatch_FALSE;
357
+ hpatch_compressedDiffInfo diffInfo;
358
+ hpatch_BOOL result=getCompressedDiffInfo(&diffInfo,&diffData.base);
359
+ if (!hpatch_TFileStreamInput_close(&diffData)) return hpatch_FALSE;
360
+ return result;
361
+ }
362
+
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;
368
+ }
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);
374
+ #endif
375
+ #ifdef _CompressPlugin_bz2
376
+ _trySetDecompress(out_decompressPlugin,compressType,&bz2DecompressPlugin);
377
+ #endif
378
+ #ifdef _CompressPlugin_lzma
379
+ _trySetDecompress(out_decompressPlugin,compressType,&lzmaDecompressPlugin);
380
+ #endif
381
+ #ifdef _CompressPlugin_lzma2
382
+ _trySetDecompress(out_decompressPlugin,compressType,&lzma2DecompressPlugin);
383
+ #endif
384
+ #if (defined(_CompressPlugin_lz4) || (defined(_CompressPlugin_lz4hc)))
385
+ _trySetDecompress(out_decompressPlugin,compressType,&lz4DecompressPlugin);
386
+ #endif
387
+ #ifdef _CompressPlugin_zstd
388
+ _trySetDecompress(out_decompressPlugin,compressType,&zstdDecompressPlugin);
389
+ #endif
390
+ #ifdef _CompressPlugin_brotli
391
+ _trySetDecompress(out_decompressPlugin,compressType,&brotliDecompressPlugin);
392
+ #endif
393
+ #ifdef _CompressPlugin_lzham
394
+ _trySetDecompress(out_decompressPlugin,compressType,&lzhamDecompressPlugin);
395
+ #endif
396
+ return 0!=*out_decompressPlugin;
397
+ }
398
+
399
+ #if (_IS_NEED_DIR_DIFF_PATCH)
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;
405
+ }
406
+ static hpatch_BOOL findChecksum(hpatch_TChecksum** out_checksumPlugin,const char* checksumType){
407
+ *out_checksumPlugin=0;
408
+ if (strlen(checksumType)==0) return hpatch_TRUE;
409
+ #ifdef _ChecksumPlugin_crc32
410
+ _trySetChecksum(out_checksumPlugin,checksumType,&crc32ChecksumPlugin);
411
+ #endif
412
+ #ifdef _ChecksumPlugin_adler32
413
+ _trySetChecksum(out_checksumPlugin,checksumType,&adler32ChecksumPlugin);
414
+ #endif
415
+ #ifdef _ChecksumPlugin_adler64
416
+ _trySetChecksum(out_checksumPlugin,checksumType,&adler64ChecksumPlugin);
417
+ #endif
418
+ #ifdef _ChecksumPlugin_fadler32
419
+ _trySetChecksum(out_checksumPlugin,checksumType,&fadler32ChecksumPlugin);
420
+ #endif
421
+ #ifdef _ChecksumPlugin_fadler64
422
+ _trySetChecksum(out_checksumPlugin,checksumType,&fadler64ChecksumPlugin);
423
+ #endif
424
+ #ifdef _ChecksumPlugin_fadler128
425
+ _trySetChecksum(out_checksumPlugin,checksumType,&fadler128ChecksumPlugin);
426
+ #endif
427
+ #ifdef _ChecksumPlugin_md5
428
+ _trySetChecksum(out_checksumPlugin,checksumType,&md5ChecksumPlugin);
429
+ #endif
430
+ return (0!=*out_checksumPlugin);
431
+ }
432
+
433
+ static hpatch_BOOL _getOptChecksum(hpatch_TChecksum** out_checksumPlugin,
434
+ const char* checksumType,const char* kNoChecksum){
435
+ assert(0==*out_checksumPlugin);
436
+ if (0==strcmp(checksumType,kNoChecksum))
437
+ return hpatch_TRUE;
438
+ else if (strlen(checksumType)==0)
439
+ return hpatch_FALSE;
440
+ else
441
+ return findChecksum(out_checksumPlugin,checksumType);
442
+ }
443
+
444
+ #endif //_IS_NEED_DIR_DIFF_PATCH
445
+
446
+
447
+ static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,const char* ptypeEnd,
448
+ const char* cmpType,const char* cmpType2=0,
449
+ size_t* compressLevel=0,size_t levelMin=0,size_t levelMax=0,size_t levelDefault=0,
450
+ size_t* dictSize=0,size_t dictSizeMin=0,size_t dictSizeMax=0,size_t dictSizeDefault=0){
451
+ if (*isMatchedType) return true; //ok
452
+ const size_t ctypeLen=strlen(cmpType);
453
+ const size_t ctype2Len=(cmpType2!=0)?strlen(cmpType2):0;
454
+ if ( ((ctypeLen==(size_t)(ptypeEnd-ptype))&&(0==strncmp(ptype,cmpType,ctypeLen)))
455
+ || ((cmpType2!=0)&&(ctype2Len==(size_t)(ptypeEnd-ptype))&&(0==strncmp(ptype,cmpType2,ctype2Len))) )
456
+ *isMatchedType=cmpType; //ok
457
+ else
458
+ return true;//type mismatch
459
+
460
+ if ((compressLevel)&&(ptypeEnd[0]=='-')){
461
+ const char* plevel=ptypeEnd+1;
462
+ const char* plevelEnd=findUntilEnd(plevel,'-');
463
+ if (!a_to_size(plevel,plevelEnd-plevel,compressLevel)) return false; //error
464
+ if (*compressLevel<levelMin) *compressLevel=levelMin;
465
+ else if (*compressLevel>levelMax) *compressLevel=levelMax;
466
+ if ((dictSize)&&(plevelEnd[0]=='-')){
467
+ const char* pdictSize=plevelEnd+1;
468
+ const char* pdictSizeEnd=findUntilEnd(pdictSize,'-');
469
+ if (!kmg_to_size(pdictSize,pdictSizeEnd-pdictSize,dictSize)) return false; //error
470
+ if (*dictSize<dictSizeMin) *dictSize=dictSizeMin;
471
+ else if (*dictSize>dictSizeMax) *dictSize=dictSizeMax;
472
+ }else{
473
+ if (plevelEnd[0]!='\0') return false; //error
474
+ if (dictSize) *dictSize=dictSizeDefault;
475
+ }
476
+ }else{
477
+ if (ptypeEnd[0]!='\0') return false; //error
478
+ if (compressLevel) *compressLevel=levelDefault;
479
+ if (dictSize) *dictSize=dictSizeDefault;
480
+ }
481
+ return true;
482
+ }
483
+
484
+ #define _options_check(value,errorInfo){ \
485
+ if (!(value)) { fprintf(stderr,"options " errorInfo " ERROR!\n\n"); printUsage(); return HDIFF_OPTIONS_ERROR; } }
486
+
487
+ static int _checkSetCompress(hdiff_TCompress** out_compressPlugin,
488
+ hpatch_TDecompress** out_decompressPlugin,
489
+ const char* ptype,const char* ptypeEnd){
490
+ const char* isMatchedType=0;
491
+ size_t compressLevel=0;
492
+ #if (defined _CompressPlugin_lzma)||(defined _CompressPlugin_lzma2)
493
+ size_t dictSize=0;
494
+ const size_t defaultDictSize=(1<<20)*8;
495
+ #endif
496
+ #if (defined _CompressPlugin_zstd)||(defined _CompressPlugin_brotli)||(defined _CompressPlugin_lzham)
497
+ size_t dictBits=0;
498
+ const size_t defaultDictBits=20+4;
499
+ #endif
500
+ #ifdef _CompressPlugin_zlib
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"))){
513
+ static TCompressPlugin_pzlib _pzlibCompressPlugin=pzlibCompressPlugin;
514
+ _pzlibCompressPlugin.base.compress_level=(int)compressLevel;
515
+ *out_compressPlugin=&_pzlibCompressPlugin.base.base;
516
+ *out_decompressPlugin=&zlibDecompressPlugin; }
517
+ # endif // _IS_USED_MULTITHREAD
518
+ #endif
519
+ #ifdef _CompressPlugin_bz2
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; }
527
+ # if (_IS_USED_MULTITHREAD)
528
+ //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")))){
532
+ static TCompressPlugin_pbz2 _pbz2CompressPlugin=pbz2CompressPlugin;
533
+ _pbz2CompressPlugin.base.compress_level=(int)compressLevel;
534
+ *out_compressPlugin=&_pbz2CompressPlugin.base.base;
535
+ *out_decompressPlugin=&bz2DecompressPlugin; }
536
+ # endif // _IS_USED_MULTITHREAD
537
+ #endif
538
+ #ifdef _CompressPlugin_lzma
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; }
548
+ #endif
549
+ #ifdef _CompressPlugin_lzma2
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; }
559
+ #endif
560
+ #ifdef _CompressPlugin_lz4
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; }
568
+ #endif
569
+ #ifdef _CompressPlugin_lz4hc
570
+ _options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lz4hc",0,
571
+ &compressLevel,3,12,11),"-c-lz4hc-?");
572
+ if ((isMatchedType)&&(0==strcmp(isMatchedType,"lz4hc"))){
573
+ static TCompressPlugin_lz4hc _lz4hcCompressPlugin=lz4hcCompressPlugin;
574
+ _lz4hcCompressPlugin.compress_level=(int)compressLevel;
575
+ *out_compressPlugin=&_lz4hcCompressPlugin.base;
576
+ *out_decompressPlugin=&lz4DecompressPlugin; }
577
+ #endif
578
+ #ifdef _CompressPlugin_zstd
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; }
588
+ #endif
589
+ #ifdef _CompressPlugin_brotli
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; }
599
+ #endif
600
+ #ifdef _CompressPlugin_lzham
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-?");
612
+ return HDIFF_SUCCESS;
613
+ }
614
+
615
+ #define _return_check(value,exitCode,errorInfo){ \
616
+ if (!(value)) { fprintf(stderr,errorInfo " ERROR!\n"); return exitCode; } }
617
+
618
+ #define _kNULL_VALUE ((hpatch_BOOL)(-1))
619
+ #define _kNULL_SIZE (~(size_t)0)
620
+
621
+ #define _THREAD_NUMBER_NULL 0
622
+ #define _THREAD_NUMBER_MIN 1
623
+ #define _THREAD_NUMBER_DEFUALT kDefaultCompressThreadNumber
624
+ #define _THREAD_NUMBER_MAX (1<<8)
625
+
626
+ int hdiff_cmd_line(int argc, const char * argv[]){
627
+ hpatch_BOOL isLoadAll=_kNULL_VALUE;
628
+ hpatch_BOOL isPatchCheck=_kNULL_VALUE;
629
+ hpatch_BOOL isDiff=_kNULL_VALUE;
630
+ hpatch_BOOL isForceOverwrite=_kNULL_VALUE;
631
+ hpatch_BOOL isOutputHelp=_kNULL_VALUE;
632
+ hpatch_BOOL isOutputVersion=_kNULL_VALUE;
633
+ hpatch_BOOL isOldPathInputEmpty=_kNULL_VALUE;
634
+ size_t matchValue=0;
635
+ size_t threadNum = _THREAD_NUMBER_NULL;
636
+ hdiff_TCompress* compressPlugin=0;
637
+ hpatch_TDecompress* decompressPlugin=0;
638
+ hpatch_BOOL isSingleStreamDiff=_kNULL_VALUE;
639
+ size_t singleStreamStepSize=_kNULL_SIZE;
640
+ #if (_IS_NEED_DIR_DIFF_PATCH)
641
+ hpatch_BOOL isForceRunDirDiff=_kNULL_VALUE;
642
+ size_t kMaxOpenFileNumber=_kNULL_SIZE; //only used in stream dir diff
643
+ hpatch_BOOL isSetChecksum=_kNULL_VALUE;
644
+ hpatch_TChecksum* checksumPlugin=0;
645
+ std::string manifestOut;
646
+ std::string manifestOld;
647
+ std::string manifestNew;
648
+ std::vector<std::string> ignorePathList;
649
+ std::vector<std::string> ignoreOldPathList;
650
+ std::vector<std::string> ignoreNewPathList;
651
+ #endif
652
+ std::vector<const char *> arg_values;
653
+ for (int i=1; i<argc; ++i) {
654
+ const char* op=argv[i];
655
+ _options_check(op!=0,"?");
656
+ if (op[0]!='-'){
657
+ hpatch_BOOL isEmpty=(strlen(op)==0);
658
+ if (isEmpty){
659
+ if (isOldPathInputEmpty==_kNULL_VALUE)
660
+ isOldPathInputEmpty=hpatch_TRUE;
661
+ else
662
+ _options_check(!isEmpty,"?"); //error return
663
+ }else{
664
+ if (isOldPathInputEmpty==_kNULL_VALUE)
665
+ isOldPathInputEmpty=hpatch_FALSE;
666
+ }
667
+ arg_values.push_back(op); //path:file or directory
668
+ continue;
669
+ }
670
+ switch (op[1]) {
671
+ case 'm':{ //diff in memory
672
+ _options_check((isLoadAll==_kNULL_VALUE)&&((op[2]=='-')||(op[2]=='\0')),"-m");
673
+ isLoadAll=hpatch_TRUE;
674
+ if (op[2]=='-'){
675
+ const char* pnum=op+3;
676
+ _options_check(kmg_to_size(pnum,strlen(pnum),&matchValue),"-m-?");
677
+ _options_check((0<=(int)matchValue)&&(matchValue==(size_t)(int)matchValue),"-m-?");
678
+ }else{
679
+ matchValue=kMinSingleMatchScore_default;
680
+ }
681
+ } break;
682
+ case 's':{
683
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
684
+ _options_check((isSingleStreamDiff!=hpatch_TRUE),"-SD");
685
+ #endif
686
+ isLoadAll=hpatch_FALSE; //diff by stream
687
+ if (op[2]=='-'){
688
+ const char* pnum=op+3;
689
+ _options_check(kmg_to_size(pnum,strlen(pnum),&matchValue),"-s-?");
690
+ }else{
691
+ matchValue=kMatchBlockSize_default;
692
+ }
693
+ } break;
694
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
695
+ case 'S':{
696
+ _options_check((isSingleStreamDiff==_kNULL_VALUE)&&(isLoadAll!=hpatch_FALSE)
697
+ &&(op[2]=='D')&&((op[3]=='\0')||(op[3]=='-')),"-SD");
698
+ isSingleStreamDiff=hpatch_TRUE;
699
+ if (op[3]=='-'){
700
+ const char* pnum=op+4;
701
+ _options_check(kmg_to_size(pnum,strlen(pnum),&singleStreamStepSize),"-SD-?");
702
+ _options_check((singleStreamStepSize>=hpatch_kStreamCacheSize),"-SD-?");
703
+ }else{
704
+ singleStreamStepSize=kDefaultStepMemSize;
705
+ }
706
+ } break;
707
+ #endif
708
+ case '?':
709
+ case 'h':{
710
+ _options_check((isOutputHelp==_kNULL_VALUE)&&(op[2]=='\0'),"-h");
711
+ isOutputHelp=hpatch_TRUE;
712
+ } break;
713
+ case 'v':{
714
+ _options_check((isOutputVersion==_kNULL_VALUE)&&(op[2]=='\0'),"-v");
715
+ isOutputVersion=hpatch_TRUE;
716
+ } break;
717
+ case 't':{
718
+ _options_check((isPatchCheck==_kNULL_VALUE)&&(op[2]=='\0'),"-t");
719
+ isPatchCheck=hpatch_TRUE; //test diffFile
720
+ } break;
721
+ case 'f':{
722
+ _options_check((isForceOverwrite==_kNULL_VALUE)&&(op[2]=='\0'),"-f");
723
+ isForceOverwrite=hpatch_TRUE;
724
+ } break;
725
+ case 'd':{
726
+ _options_check((isDiff==_kNULL_VALUE)&&(op[2]=='\0'),"-d");
727
+ isDiff=hpatch_TRUE; //diff only
728
+ } break;
729
+ #if (_IS_USED_MULTITHREAD)
730
+ case 'p':{
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-?");
735
+ } break;
736
+ #endif
737
+ case 'c':{
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;
744
+ } break;
745
+ #if (_IS_NEED_DIR_DIFF_PATCH)
746
+ case 'C':{
747
+ _options_check((isSetChecksum==_kNULL_VALUE)&&(checksumPlugin==0)&&(op[2]=='-'),"-C");
748
+ const char* ptype=op+3;
749
+ isSetChecksum=hpatch_TRUE;
750
+ _options_check(_getOptChecksum(&checksumPlugin,ptype,"no"),"-C-?");
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;
757
+ case 'g':{
758
+ if (op[2]=='#'){ //-g#
759
+ const char* plist=op+3;
760
+ _options_check(_getIgnorePathSetList(ignorePathList,plist),"-g#?");
761
+ }else if (op[2]=='-'){
762
+ const char* plist=op+7;
763
+ if ((op[3]=='o')&&(op[4]=='l')&&(op[5]=='d')&&(op[6]=='#')){
764
+ _options_check(_getIgnorePathSetList(ignoreOldPathList,plist),"-g-old#?");
765
+ }else if ((op[3]=='n')&&(op[4]=='e')&&(op[5]=='w')&&(op[6]=='#')){
766
+ _options_check(_getIgnorePathSetList(ignoreNewPathList,plist),"-g-new#?");
767
+ }else{
768
+ _options_check(hpatch_FALSE,"-g-?");
769
+ }
770
+ }else{
771
+ _options_check(hpatch_FALSE,"-g?");
772
+ }
773
+ } break;
774
+ case 'M':{
775
+ if (op[2]=='#'){ //-M#
776
+ const char* plist=op+3;
777
+ _options_check(manifestOut.empty()&&manifestOld.empty()&&manifestNew.empty(),"-M#");
778
+ manifestOut=plist;
779
+ }else if (op[2]=='-'){
780
+ const char* plist=op+7;
781
+ if ((op[3]=='o')&&(op[4]=='l')&&(op[5]=='d')&&(op[6]=='#')){
782
+ _options_check(manifestOut.empty()&&manifestOld.empty(),"-M-old#");
783
+ manifestOld=plist;
784
+ }else if ((op[3]=='n')&&(op[4]=='e')&&(op[5]=='w')&&(op[6]=='#')){
785
+ _options_check(manifestOut.empty()&&manifestNew.empty(),"-M-new#");
786
+ manifestNew=plist;
787
+ }else{
788
+ _options_check(hpatch_FALSE,"-M-?");
789
+ }
790
+ }else{
791
+ _options_check(hpatch_FALSE,"-M?");
792
+ }
793
+ } break;
794
+ case 'D':{
795
+ _options_check((isForceRunDirDiff==_kNULL_VALUE)&&(op[2]=='\0'),"-D");
796
+ isForceRunDirDiff=hpatch_TRUE; //force run DirDiff
797
+ } break;
798
+ #endif
799
+ default: {
800
+ _options_check(hpatch_FALSE,"-?");
801
+ } break;
802
+ }//switch
803
+ }
804
+
805
+ if (isOutputHelp==_kNULL_VALUE)
806
+ isOutputHelp=hpatch_FALSE;
807
+ if (isOutputVersion==_kNULL_VALUE)
808
+ isOutputVersion=hpatch_FALSE;
809
+ if (isForceOverwrite==_kNULL_VALUE)
810
+ isForceOverwrite=hpatch_FALSE;
811
+ if (isOutputHelp||isOutputVersion){
812
+ if (isOutputHelp)
813
+ printUsage();//with version
814
+ else
815
+ printVersion();
816
+ if (arg_values.empty())
817
+ return 0; //ok
818
+ }
819
+ if (isSingleStreamDiff==_kNULL_VALUE)
820
+ isSingleStreamDiff=hpatch_FALSE;
821
+ #if (_IS_NEED_DIR_DIFF_PATCH)
822
+ if (kMaxOpenFileNumber==_kNULL_SIZE)
823
+ kMaxOpenFileNumber=kMaxOpenFileNumber_default_diff;
824
+ if (kMaxOpenFileNumber<kMaxOpenFileNumber_default_min)
825
+ kMaxOpenFileNumber=kMaxOpenFileNumber_default_min;
826
+ #endif
827
+ if (threadNum==_THREAD_NUMBER_NULL)
828
+ threadNum=_THREAD_NUMBER_DEFUALT;
829
+ else if (threadNum>_THREAD_NUMBER_MAX)
830
+ threadNum=_THREAD_NUMBER_MAX;
831
+ if (compressPlugin!=0){
832
+ compressPlugin->setParallelThreadNumber(compressPlugin,(int)threadNum);
833
+ }
834
+
835
+ if (isOldPathInputEmpty==_kNULL_VALUE)
836
+ isOldPathInputEmpty=hpatch_FALSE;
837
+ _options_check((arg_values.size()==1)||(arg_values.size()==2)||(arg_values.size()==3),"input count");
838
+ if (arg_values.size()==3){ //diff
839
+ if (isLoadAll==_kNULL_VALUE){
840
+ isLoadAll=hpatch_TRUE;
841
+ matchValue=kMinSingleMatchScore_default;
842
+ }
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
855
+ }
856
+ assert(isPatchCheck||isDiff);
857
+
858
+ #if (_IS_NEED_DIR_DIFF_PATCH)
859
+ if (isForceRunDirDiff==_kNULL_VALUE)
860
+ isForceRunDirDiff=hpatch_FALSE;
861
+ if (isSetChecksum==_kNULL_VALUE)
862
+ isSetChecksum=hpatch_FALSE;
863
+
864
+ if ((!manifestOld.empty())||(!manifestNew.empty())){
865
+ isForceRunDirDiff=hpatch_TRUE;
866
+ _options_check(manifestOut.empty()&&(!manifestNew.empty()),"-M?");
867
+ if (isOldPathInputEmpty){
868
+ _options_check(manifestOld.empty(),"-M?");
869
+ }else{
870
+ _options_check(!manifestOld.empty(),"-M?");
871
+ }
872
+ _options_check(ignorePathList.empty()&&ignoreOldPathList.empty()
873
+ &&ignoreNewPathList.empty(),"-M can't run with -g");
874
+ }
875
+ #endif
876
+
877
+ const char* oldPath =arg_values[0];
878
+ const char* newPath =arg_values[1];
879
+ const char* outDiffFileName=arg_values[2];
880
+
881
+ _return_check(!hpatch_getIsSamePath(oldPath,outDiffFileName),
882
+ HDIFF_PATHTYPE_ERROR,"oldPath outDiffFile same path");
883
+ _return_check(!hpatch_getIsSamePath(newPath,outDiffFileName),
884
+ HDIFF_PATHTYPE_ERROR,"newPath outDiffFile same path");
885
+ if (!isForceOverwrite){
886
+ hpatch_TPathType outDiffFileType;
887
+ _return_check(hpatch_getPathStat(outDiffFileName,&outDiffFileType,0),
888
+ HDIFF_PATHTYPE_ERROR,"get outDiffFile type");
889
+ _return_check((outDiffFileType==kPathType_notExist)||(!isDiff),
890
+ HDIFF_PATHTYPE_ERROR,"diff outDiffFile already exists, overwrite");
891
+ }
892
+ hpatch_TPathType oldType;
893
+ hpatch_TPathType newType;
894
+ if (isOldPathInputEmpty){
895
+ oldType=kPathType_file; //as empty file
896
+ isLoadAll=hpatch_FALSE; //not need -m, set as -s
897
+ matchValue=hpatch_kStreamCacheSize; //not used
898
+ }else{
899
+ _return_check(hpatch_getPathStat(oldPath,&oldType,0),HDIFF_PATHTYPE_ERROR,"get oldPath type");
900
+ _return_check((oldType!=kPathType_notExist),HDIFF_PATHTYPE_ERROR,"oldPath not exist");
901
+ }
902
+ _return_check(hpatch_getPathStat(newPath,&newType,0),HDIFF_PATHTYPE_ERROR,"get newPath type");
903
+ _return_check((newType!=kPathType_notExist),HDIFF_PATHTYPE_ERROR,"newPath not exist");
904
+ #if (_IS_NEED_DIR_DIFF_PATCH)
905
+ hpatch_BOOL isUseDirDiff=isForceRunDirDiff||(kPathType_dir==oldType)||(kPathType_dir==newType);
906
+ if (isUseDirDiff){
907
+ #ifdef _ChecksumPlugin_fadler64
908
+ if (isSetChecksum==hpatch_FALSE){
909
+ checksumPlugin=&fadler64ChecksumPlugin; //DEFAULT
910
+ isSetChecksum=hpatch_TRUE;
911
+ }
912
+ #else
913
+ # ifdef _ChecksumPlugin_crc32
914
+ if (isSetChecksum==hpatch_FALSE){
915
+ checksumPlugin=&crc32ChecksumPlugin; //DEFAULT
916
+ isSetChecksum=hpatch_TRUE;
917
+ }
918
+ # endif
919
+ #endif
920
+ }else
921
+ {
922
+ _options_check(checksumPlugin==0,"-C now only support dir diff, unsupport diff");
923
+ }
924
+ #endif //_IS_NEED_DIR_DIFF_PATCH
925
+
926
+ #if (_IS_NEED_DIR_DIFF_PATCH)
927
+ if (isUseDirDiff){
928
+ return hdiff_dir(oldPath,newPath,outDiffFileName, (kPathType_dir==oldType),
929
+ (kPathType_dir==newType), isDiff,isLoadAll,matchValue,isPatchCheck,
930
+ compressPlugin,decompressPlugin,checksumPlugin,kMaxOpenFileNumber,
931
+ ignorePathList,ignoreOldPathList,ignoreNewPathList,
932
+ manifestOld,manifestNew);
933
+ }else
934
+ #endif
935
+ {
936
+ return hdiff(oldPath,newPath,outDiffFileName,isDiff,isLoadAll,matchValue,isPatchCheck,
937
+ compressPlugin,decompressPlugin,isSingleStreamDiff,singleStreamStepSize);
938
+ }
939
+ #if (_IS_NEED_DIR_DIFF_PATCH)
940
+ }else if (!manifestOut.empty()){ //() //create manifest
941
+ _options_check(arg_values.size()==1,"create manifest file used one inputPath");
942
+ _options_check(ignoreOldPathList.empty(),"-g-old unsupport run with create manifest file mode");
943
+ _options_check(ignoreNewPathList.empty(),"-g-new unsupport run with create manifest file mode");
944
+ if (isSetChecksum==_kNULL_VALUE)
945
+ isSetChecksum=hpatch_FALSE;
946
+ #ifdef _ChecksumPlugin_fadler64
947
+ if (isSetChecksum==hpatch_FALSE){
948
+ checksumPlugin=&fadler64ChecksumPlugin; //DEFAULT
949
+ isSetChecksum=hpatch_TRUE;
950
+ }
951
+ #else
952
+ # ifdef _ChecksumPlugin_crc32
953
+ if (isSetChecksum==hpatch_FALSE){
954
+ checksumPlugin=&crc32ChecksumPlugin; //DEFAULT
955
+ isSetChecksum=hpatch_TRUE;
956
+ }
957
+ # endif
958
+ #endif
959
+
960
+ if (checksumPlugin==0) { printf("WARNING: create manifest file not set chercksum!\n\n"); }
961
+ const char* inputPath =arg_values[0];
962
+ if (!isForceOverwrite){
963
+ hpatch_TPathType outFileType;
964
+ _return_check(hpatch_getPathStat(manifestOut.c_str(),&outFileType,0),
965
+ HDIFF_PATHTYPE_ERROR,"get outManifestFile type");
966
+ _return_check(outFileType==kPathType_notExist,
967
+ HDIFF_PATHTYPE_ERROR,"create outManifestFile already exists, overwrite");
968
+ }
969
+ return create_manifest(inputPath,manifestOut.c_str(),checksumPlugin,ignorePathList);
970
+ #endif
971
+ }else{// (arg_values.size()==2) //resave
972
+ _options_check(!isOldPathInputEmpty,"can't resave, must input a diffFile");
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
+
977
+ #if (_IS_NEED_DIR_DIFF_PATCH)
978
+ _options_check((isForceRunDirDiff==_kNULL_VALUE),"-D unsupport run with resave mode");
979
+ _options_check((checksumPlugin==0),"-C unsupport run with resave mode");
980
+ #endif
981
+ const char* diffFileName =arg_values[0];
982
+ const char* outDiffFileName=arg_values[1];
983
+ hpatch_BOOL isDiffFile=_getIsCompressedDiffFile(diffFileName);
984
+ #if (_IS_NEED_DIR_DIFF_PATCH)
985
+ isDiffFile=isDiffFile || getIsDirDiffFile(diffFileName);
986
+ #endif
987
+ _return_check(isDiffFile,HDIFF_RESAVE_DIFFINFO_ERROR,"can't resave, input file is not diffFile");
988
+ if (!isForceOverwrite){
989
+ hpatch_TPathType outDiffFileType;
990
+ _return_check(hpatch_getPathStat(outDiffFileName,&outDiffFileType,0),
991
+ HDIFF_PATHTYPE_ERROR,"get outDiffFile type");
992
+ _return_check(outDiffFileType==kPathType_notExist,
993
+ HDIFF_PATHTYPE_ERROR,"resave outDiffFile already exists, overwrite");
994
+ }
995
+ hpatch_BOOL isSamePath=hpatch_getIsSamePath(diffFileName,outDiffFileName);
996
+ if (isSamePath)
997
+ _return_check(isForceOverwrite,HDIFF_PATHTYPE_ERROR,"diffFile outDiffFile same name");
998
+
999
+ if (!isSamePath){
1000
+ return hdiff_resave(diffFileName,outDiffFileName,compressPlugin);
1001
+ }else{
1002
+ // 1. resave to newDiffTempName
1003
+ // 2. if resave ok then { delelte oldDiffFile; rename newDiffTempName to oldDiffName; }
1004
+ // if resave error then { delelte newDiffTempName; }
1005
+ char newDiffTempName[hpatch_kPathMaxSize];
1006
+ _return_check(hpatch_getTempPathName(outDiffFileName,newDiffTempName,newDiffTempName+hpatch_kPathMaxSize),
1007
+ HDIFF_TEMPPATH_ERROR,"getTempPathName(diffFile)");
1008
+ printf("NOTE: out_diff temp file will be rename to in_diff name after resave!\n");
1009
+ int result=hdiff_resave(diffFileName,newDiffTempName,compressPlugin);
1010
+ if (result==0){//resave ok
1011
+ _return_check(hpatch_removeFile(diffFileName),
1012
+ HDIFF_DELETEPATH_ERROR,"removeFile(diffFile)");
1013
+ _return_check(hpatch_renamePath(newDiffTempName,diffFileName),
1014
+ HDIFF_RENAMEPATH_ERROR,"renamePath(temp,diffFile)");
1015
+ printf("out_diff temp file renamed to in_diff name!\n");
1016
+ }else{//resave error
1017
+ if (!hpatch_removeFile(newDiffTempName)){
1018
+ printf("WARNING: can't remove temp file \"");
1019
+ hpatch_printPath_utf8(newDiffTempName); printf("\"\n");
1020
+ }
1021
+ }
1022
+ return result;
1023
+ }
1024
+ }
1025
+ }
1026
+
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);
1039
+ }
1040
+ _check_readFile(file.base.read(&file.base,0,out_mem.data(),out_mem.data_end()));
1041
+ return hpatch_TFileStreamInput_close(&file);
1042
+ }
1043
+
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
+ }
1052
+
1053
+ #define _check_on_error(errorType) { \
1054
+ if (result==HDIFF_SUCCESS) result=errorType; if (!_isInClear){ goto clear; } }
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
+ }
1140
+
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){
1144
+ double diff_time0=clock_s();
1145
+ int result=HDIFF_SUCCESS;
1146
+ int _isInClear=hpatch_FALSE;
1147
+ hpatch_TFileStreamInput oldData;
1148
+ hpatch_TFileStreamInput newData;
1149
+ hpatch_TFileStreamOutput diffData_out;
1150
+ hpatch_TFileStreamInput diffData_in;
1151
+ hpatch_TFileStreamInput_init(&oldData);
1152
+ hpatch_TFileStreamInput_init(&newData);
1153
+ hpatch_TFileStreamOutput_init(&diffData_out);
1154
+ hpatch_TFileStreamInput_init(&diffData_in);
1155
+
1156
+ if (0==strcmp(oldFileName,"")){ // isOldPathInputEmpty
1157
+ mem_as_hStreamInput(&oldData.base,0,0);
1158
+ }else{
1159
+ check(hpatch_TFileStreamInput_open(&oldData,oldFileName),HDIFF_OPENREAD_ERROR,"open oldFile");
1160
+ }
1161
+ check(hpatch_TFileStreamInput_open(&newData,newFileName),HDIFF_OPENREAD_ERROR,"open newFile");
1162
+ printf("oldDataSize : %" PRIu64 "\nnewDataSize : %" PRIu64 "\n",
1163
+ oldData.base.streamSize,newData.base.streamSize);
1164
+ if (isDiff){
1165
+ check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),
1166
+ HDIFF_OPENWRITE_ERROR,"open out diffFile");
1167
+ hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
1168
+ try{
1169
+ create_compressed_diff_stream(&newData.base,&oldData.base, &diffData_out.base,
1170
+ compressPlugin,matchBlockSize);
1171
+ diffData_out.base.streamSize=diffData_out.out_length;
1172
+ }catch(const std::exception& e){
1173
+ check(false,HDIFF_DIFF_ERROR,"stream diff run an error: "+e.what());
1174
+ }
1175
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
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");
1179
+ }
1180
+ if (isPatchCheck){
1181
+ double patch_time0=clock_s();
1182
+ printf("\nload diffFile for test by patch check:\n");
1183
+ check(hpatch_TFileStreamInput_open(&diffData_in,outDiffFileName),HDIFF_OPENREAD_ERROR,"open check diffFile");
1184
+ printf("diffDataSize: %" PRIu64 "\n",diffData_in.base.streamSize);
1185
+
1186
+ hpatch_TDecompress* saved_decompressPlugin=0;
1187
+ {
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");
1192
+ }
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");
1198
+ }
1199
+ clear:
1200
+ _isInClear=hpatch_TRUE;
1201
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
1202
+ check(hpatch_TFileStreamInput_close(&diffData_in),HDIFF_FILECLOSE_ERROR,"in diffFile close");
1203
+ check(hpatch_TFileStreamInput_close(&newData),HDIFF_FILECLOSE_ERROR,"newFile close");
1204
+ check(hpatch_TFileStreamInput_close(&oldData),HDIFF_FILECLOSE_ERROR,"oldFile close");
1205
+ return result;
1206
+ }
1207
+
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){
1212
+ double time0=clock_s();
1213
+ std::string fnameInfo=std::string("old : \"")+oldFileName+"\"\n"
1214
+ +"new : \""+newFileName+"\"\n"
1215
+ +(isDiff?"out : \"":"test: \"")+outDiffFileName+"\"\n";
1216
+ hpatch_printPath_utf8(fnameInfo.c_str());
1217
+
1218
+ if (isDiff) {
1219
+ const char* compressType="";
1220
+ if (compressPlugin) compressType=compressPlugin->compressType();
1221
+ printf("hdiffz run with compress plugin: \"%s\"\n",compressType);
1222
+ }
1223
+
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)
1234
+ printf("\nall time: %.3f s\n",(clock_s()-time0));
1235
+ return exitCode;
1236
+ }
1237
+
1238
+ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
1239
+ const hdiff_TCompress* compressPlugin){
1240
+ double time0=clock_s();
1241
+ std::string fnameInfo=std::string("in_diff : \"")+diffFileName+"\"\n"
1242
+ +"out_diff: \""+outDiffFileName+"\"\n";
1243
+ hpatch_printPath_utf8(fnameInfo.c_str());
1244
+
1245
+ int result=HDIFF_SUCCESS;
1246
+ hpatch_BOOL _isInClear=hpatch_FALSE;
1247
+ hpatch_BOOL isDirDiff=false;
1248
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1249
+ std::string dirCompressType;
1250
+ TDirDiffInfo dirDiffInfo;
1251
+ hpatch_TChecksum* checksumPlugin=0;
1252
+ #endif
1253
+ hpatch_TFileStreamInput diffData_in;
1254
+ hpatch_TFileStreamOutput diffData_out;
1255
+ hpatch_TFileStreamInput_init(&diffData_in);
1256
+ hpatch_TFileStreamOutput_init(&diffData_out);
1257
+
1258
+ hpatch_TDecompress* decompressPlugin=0;
1259
+ check(hpatch_TFileStreamInput_open(&diffData_in,diffFileName),HDIFF_OPENREAD_ERROR,"open diffFile");
1260
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1261
+ check(getDirDiffInfo(&diffData_in.base,&dirDiffInfo),HDIFF_OPENREAD_ERROR,"read diffFile");
1262
+ isDirDiff=dirDiffInfo.isDirDiff;
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){
1278
+ if (diffInfo.compressedCount>0){
1279
+ check(false,HDIFF_RESAVE_COMPRESSTYPE_ERROR,
1280
+ "can no decompress \""+diffInfo.compressType+" data");
1281
+ }else{
1282
+ if (strlen(diffInfo.compressType)>0)
1283
+ printf(" diffFile added useless compress tag \"%s\"\n",diffInfo.compressType);
1284
+ decompressPlugin=0;
1285
+ }
1286
+ }else{
1287
+ printf("resave %s with decompress plugin: \"%s\" (need decompress %d)\n",(isDirDiff?"dirDiffFile":"diffFile"),diffInfo.compressType,diffInfo.compressedCount);
1288
+ }
1289
+ }
1290
+ {
1291
+ const char* compressType="";
1292
+ if (compressPlugin) compressType=compressPlugin->compressType();
1293
+ printf("resave %s with compress plugin: \"%s\"\n",
1294
+ (isDirDiff?"dirDiffFile":"diffFile"),compressType);
1295
+ }
1296
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1297
+ if (isDirDiff){ //checksumPlugin
1298
+ if (strlen(dirDiffInfo.checksumType)>0){
1299
+ check(findChecksum(&checksumPlugin,dirDiffInfo.checksumType), HDIFF_RESAVE_CHECKSUMTYPE_ERROR,
1300
+ "not found checksum plugin dirDiffFile used: \""+dirDiffInfo.checksumType+"\"\n");
1301
+ check(checksumPlugin->checksumByteSize()==dirDiffInfo.checksumByteSize,HDIFF_RESAVE_CHECKSUMTYPE_ERROR,
1302
+ "found checksum plugin not same as dirDiffFile used: \""+dirDiffInfo.checksumType+"\"\n");
1303
+ }
1304
+ printf("resave dirDiffFile with checksum plugin: \"%s\"\n",dirDiffInfo.checksumType);
1305
+ }
1306
+ #endif
1307
+
1308
+ check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),HDIFF_OPENWRITE_ERROR,
1309
+ "open out diffFile");
1310
+ hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
1311
+ printf("inDiffSize : %" PRIu64 "\n",diffData_in.base.streamSize);
1312
+ try{
1313
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1314
+ if (isDirDiff){
1315
+ resave_dirdiff(&diffData_in.base,decompressPlugin,
1316
+ &diffData_out.base,compressPlugin,checksumPlugin);
1317
+ }else
1318
+ #endif
1319
+ {
1320
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1321
+ _options_check(checksumPlugin==0,"-C now only support dir diff, unsupport diff");
1322
+ #endif
1323
+ resave_compressed_diff(&diffData_in.base,decompressPlugin,
1324
+ &diffData_out.base,compressPlugin);
1325
+ }
1326
+ diffData_out.base.streamSize=diffData_out.out_length;
1327
+ }catch(const std::exception& e){
1328
+ check(false,HDIFF_RESAVE_ERROR,"resave diff run an error: "+e.what());
1329
+ }
1330
+ printf("outDiffSize: %" PRIu64 "\n",diffData_out.base.streamSize);
1331
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
1332
+ printf(" out diff file ok!\n");
1333
+
1334
+ printf("\nhdiffz resave diffFile time: %.3f s\n",(clock_s()-time0));
1335
+ clear:
1336
+ _isInClear=hpatch_TRUE;
1337
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
1338
+ check(hpatch_TFileStreamInput_close(&diffData_in),HDIFF_FILECLOSE_ERROR,"in diffFile close");
1339
+ return result;
1340
+ }
1341
+
1342
+
1343
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1344
+
1345
+ struct DirPathIgnoreListener:public CDirPathIgnore,IDirPathIgnore{
1346
+ DirPathIgnoreListener(const std::vector<std::string>& ignorePathListBase,
1347
+ const std::vector<std::string>& ignorePathList,bool isPrintIgnore=true)
1348
+ :CDirPathIgnore(ignorePathListBase,ignorePathList,isPrintIgnore){}
1349
+ //IDirPathIgnore
1350
+ virtual bool isNeedIgnore(const std::string& path,size_t rootPathNameLen){
1351
+ return CDirPathIgnore::isNeedIgnore(path,rootPathNameLen);
1352
+ }
1353
+ };
1354
+
1355
+ struct DirDiffListener:public IDirDiffListener{
1356
+ virtual bool isExecuteFile(const std::string& fileName) {
1357
+ bool result= 0!=hpatch_getIsExecuteFile(fileName.c_str());
1358
+ if (result){
1359
+ std::string info=" got new file Execute tag:\""+fileName+"\"\n";
1360
+ hpatch_printPath_utf8(info.c_str());
1361
+ }
1362
+ return result;
1363
+ }
1364
+ virtual void diffRefInfo(size_t oldPathCount,size_t newPathCount,size_t sameFilePairCount,
1365
+ hpatch_StreamPos_t sameFileSize,size_t refOldFileCount,size_t refNewFileCount,
1366
+ hpatch_StreamPos_t refOldFileSize,hpatch_StreamPos_t refNewFileSize){
1367
+ printf("\n");
1368
+ printf("DirDiff old path count: %" PRIu64 "\n",(hpatch_StreamPos_t)oldPathCount);
1369
+ printf(" new path count: %" PRIu64 " (fileCount:%" PRIu64 ")\n",
1370
+ (hpatch_StreamPos_t)newPathCount,(hpatch_StreamPos_t)(sameFilePairCount+refNewFileCount));
1371
+ printf(" same file count: %" PRIu64 " (dataSize: %" PRIu64 ")\n",
1372
+ (hpatch_StreamPos_t)sameFilePairCount,sameFileSize);
1373
+ printf(" ref old file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refOldFileCount);
1374
+ printf(" diff new file count: %" PRIu64 "\n",(hpatch_StreamPos_t)refNewFileCount);
1375
+ printf("\nrun hdiffz:\n");
1376
+ printf(" oldRefSize : %" PRIu64 "\n",refOldFileSize);
1377
+ printf(" newRefSize : %" PRIu64 " (all newSize: %" PRIu64 ")\n",refNewFileSize,refNewFileSize+sameFileSize);
1378
+ }
1379
+
1380
+ double _runHDiffBegin_time0;
1381
+ virtual void runHDiffBegin(){ _runHDiffBegin_time0=clock_s(); }
1382
+ virtual void runHDiffEnd(hpatch_StreamPos_t diffDataSize){
1383
+ printf(" diffDataSize: %" PRIu64 "\n",diffDataSize);
1384
+ printf(" diff time: %.3f s\n",clock_s()-_runHDiffBegin_time0);
1385
+ }
1386
+ };
1387
+
1388
+ static void check_manifest(TManifest& out_manifest,const std::string& rootPath,const std::string& manifestFileName){
1389
+ TManifestSaved manifest;
1390
+ load_manifestFile(manifest,rootPath,manifestFileName);
1391
+ hpatch_TChecksum* checksumPlugin=0;
1392
+ findChecksum(&checksumPlugin,manifest.checksumType.c_str());
1393
+ checksum_manifest(manifest,checksumPlugin);
1394
+ out_manifest.rootPath.swap(manifest.rootPath);
1395
+ out_manifest.pathList.swap(manifest.pathList);
1396
+ }
1397
+
1398
+ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileName,
1399
+ hpatch_BOOL oldIsDir, hpatch_BOOL newIsDir,
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,
1403
+ const std::vector<std::string>& ignorePathListBase,const std::vector<std::string>& ignoreOldPathList,
1404
+ const std::vector<std::string>& ignoreNewPathList,
1405
+ const std::string& oldManifestFileName,const std::string& newManifestFileName){
1406
+ double time0=clock_s();
1407
+ std::string oldPath(_oldPath);
1408
+ std::string newPath(_newPath);
1409
+ if (oldIsDir) assignDirTag(oldPath); else assert(!hpatch_getIsDirName(oldPath.c_str()));
1410
+ if (newIsDir) assignDirTag(newPath); else assert(!hpatch_getIsDirName(newPath.c_str()));
1411
+ std::string fnameInfo=std::string("")
1412
+ +(oldIsDir?"oldDir : \"":"oldFile: \"")+oldPath+"\"\n"
1413
+ +(newIsDir?"newDir : \"":"newFile: \"")+newPath+"\"\n"
1414
+ +(isDiff? "outDiff: \"":" test : \"")+outDiffFileName+"\"\n";
1415
+ hpatch_printPath_utf8(fnameInfo.c_str());
1416
+
1417
+ bool isManifest= (!newManifestFileName.empty());
1418
+ if (isDiff) {
1419
+ const char* checksumType="";
1420
+ const char* compressType="";
1421
+ if (checksumPlugin)
1422
+ checksumType=checksumPlugin->checksumType();
1423
+ if (compressPlugin) compressType=compressPlugin->compressType();
1424
+ printf("hdiffz run %sdir diff with compress plugin: \"%s\"\n",isManifest?"manifest ":"",compressType);
1425
+ printf("hdiffz run %sdir diff with checksum plugin: \"%s\"\n",isManifest?"manifest ":"",checksumType);
1426
+ }
1427
+ printf("\n");
1428
+
1429
+ int result=HDIFF_SUCCESS;
1430
+ bool _isInClear=false;
1431
+ hpatch_TFileStreamOutput diffData_out;
1432
+ hpatch_TFileStreamInput diffData_in;
1433
+ hpatch_TFileStreamOutput_init(&diffData_out);
1434
+ hpatch_TFileStreamInput_init(&diffData_in);
1435
+
1436
+ TManifest oldManifest;
1437
+ TManifest newManifest;
1438
+ if (isManifest){
1439
+ double check_time0=clock_s();
1440
+ try {
1441
+ if (!oldPath.empty())// isOldPathInputEmpty
1442
+ check_manifest(oldManifest,oldPath,oldManifestFileName);
1443
+ check_manifest(newManifest,newPath,newManifestFileName);
1444
+ }catch(const std::exception& e){
1445
+ check(false,MANIFEST_TEST_ERROR,"check by manifest found an error: "+e.what());
1446
+ }
1447
+ printf("check manifest time: %.3f s\n",(clock_s()-check_time0));
1448
+ printf(" check path datas by manifest ok!\n\n");
1449
+ }else{
1450
+ DirPathIgnoreListener oldDirPathIgnore(ignorePathListBase,ignoreOldPathList);
1451
+ DirPathIgnoreListener newDirPathIgnore(ignorePathListBase,ignoreNewPathList);
1452
+ get_manifest(&oldDirPathIgnore,oldPath,oldManifest);
1453
+ get_manifest(&newDirPathIgnore,newPath,newManifest);
1454
+ }
1455
+
1456
+ if (isDiff){
1457
+ double diff_time0=clock_s();
1458
+ try {
1459
+ check(hpatch_TFileStreamOutput_open(&diffData_out,outDiffFileName,~(hpatch_StreamPos_t)0),
1460
+ HDIFF_OPENWRITE_ERROR,"open out diffFile");
1461
+ hpatch_TFileStreamOutput_setRandomOut(&diffData_out,hpatch_TRUE);
1462
+ DirDiffListener listener;
1463
+ dir_diff(&listener,oldManifest,newManifest,&diffData_out.base,isLoadAll!=0,matchValue,
1464
+ compressPlugin,checksumPlugin,kMaxOpenFileNumber);
1465
+ diffData_out.base.streamSize=diffData_out.out_length;
1466
+ }catch(const std::exception& e){
1467
+ check(false,DIRDIFF_DIFF_ERROR,"dir diff run an error: "+e.what());
1468
+ }
1469
+ printf("\ndiffDataSize : %" PRIu64 "\n",diffData_out.base.streamSize);
1470
+ printf("dir diff time: %.3f s\n",(clock_s()-diff_time0));
1471
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
1472
+ printf(" out dirDiffFile ok!\n");
1473
+ }
1474
+ if (isPatchCheck){
1475
+ double patch_time0=clock_s();
1476
+ printf("\nload %sdirDiffFile for test by patch check:\n",isManifest?"manifest ":"");
1477
+ check(hpatch_TFileStreamInput_open(&diffData_in,outDiffFileName),
1478
+ HDIFF_OPENREAD_ERROR,"open check diffFile");
1479
+ printf("diffDataSize : %" PRIu64 "\n",diffData_in.base.streamSize);
1480
+ hpatch_TDecompress* saved_decompressPlugin=0;
1481
+ hpatch_TChecksum* saved_checksumPlugin=0;
1482
+ {
1483
+ TDirDiffInfo dirinfo;
1484
+ check(getDirDiffInfo(&diffData_in.base,&dirinfo),DIRDIFF_PATCH_ERROR,"get dir diff info");
1485
+ check(dirinfo.isDirDiff,DIRDIFF_PATCH_ERROR,"dir diffFile data");
1486
+ findDecompress(&saved_decompressPlugin,dirinfo.hdiffInfo.compressType);
1487
+ findChecksum(&saved_checksumPlugin,dirinfo.checksumType);
1488
+ }
1489
+ //check(check_dirOldDataChecksum(oldPath.c_str(),&diffData_in.base,
1490
+ // saved_decompressPlugin,saved_checksumPlugin),
1491
+ // DIRDIFF_PATCH_ERROR,"part diff data check_dirOldDataChecksum");
1492
+ DirDiffListener listener;
1493
+ check(check_dirdiff(&listener,oldManifest,newManifest,&diffData_in.base,
1494
+ saved_decompressPlugin,saved_checksumPlugin,kMaxOpenFileNumber),
1495
+ DIRDIFF_PATCH_ERROR,"dir patch check diff data");
1496
+
1497
+ printf("dir patch time: %.3f s\n",(clock_s()-patch_time0));
1498
+ printf(" patch check diff data ok!\n");
1499
+ }
1500
+
1501
+ printf("\nall time: %.3f s\n",(clock_s()-time0));
1502
+ clear:
1503
+ _isInClear=true;
1504
+ check(hpatch_TFileStreamOutput_close(&diffData_out),HDIFF_FILECLOSE_ERROR,"out diffFile close");
1505
+ check(hpatch_TFileStreamInput_close(&diffData_in),HDIFF_FILECLOSE_ERROR,"in diffFile close");
1506
+ return result;
1507
+ }
1508
+
1509
+ int create_manifest(const char* _inputPath,const char* outManifestFileName,
1510
+ hpatch_TChecksum* checksumPlugin,const std::vector<std::string>& ignorePathList){
1511
+ double time0=clock_s();
1512
+ int result=HDIFF_SUCCESS;
1513
+ bool _isInClear=false;
1514
+ std::string inputPath(_inputPath);
1515
+ {
1516
+ hpatch_TPathType inputType;
1517
+ check(hpatch_getPathStat(_inputPath,&inputType,0),HDIFF_PATHTYPE_ERROR,"get inputPath type");
1518
+ check((inputType!=kPathType_notExist),HDIFF_PATHTYPE_ERROR,"inputPath not exist");
1519
+ hpatch_BOOL inputIsDir=(inputType==kPathType_dir);
1520
+ if (inputIsDir) assignDirTag(inputPath);
1521
+ std::string fnameInfo=std::string("")
1522
+ +(inputIsDir? "inputDir : \"":"inputFile: \"")+inputPath+"\"\n"
1523
+ + "outManifest: \""+outManifestFileName+"\"\n";
1524
+ hpatch_printPath_utf8(fnameInfo.c_str());
1525
+ }
1526
+ {
1527
+ const char* checksumType="";
1528
+ if (checksumPlugin) checksumType=checksumPlugin->checksumType();
1529
+ printf("hdiffz run create Manifest with checksum plugin: \"%s\"\n",checksumType);
1530
+ printf("\n");
1531
+ }
1532
+
1533
+ hpatch_TFileStreamOutput manifestData_out;
1534
+ hpatch_TFileStreamOutput_init(&manifestData_out);
1535
+ {//create
1536
+ try {
1537
+ std::vector<std::string> emptyPathList;
1538
+ check(hpatch_TFileStreamOutput_open(&manifestData_out,outManifestFileName,~(hpatch_StreamPos_t)0),
1539
+ HDIFF_OPENWRITE_ERROR,"open out manifestFile");
1540
+ //hpatch_TFileStreamOutput_setRandomOut(&manifestData_out,hpatch_TRUE);
1541
+ DirPathIgnoreListener dirPathIgnore(ignorePathList,emptyPathList);
1542
+ save_manifest(&dirPathIgnore,inputPath,&manifestData_out.base,checksumPlugin);
1543
+ manifestData_out.base.streamSize=manifestData_out.out_length;
1544
+ }catch(const std::exception& e){
1545
+ check(false,MANIFEST_CREATE_ERROR,"create manifest run an error: "+e.what());
1546
+ }
1547
+ printf("\nManifestFile size: %" PRIu64 "\n",manifestData_out.base.streamSize);
1548
+ check(hpatch_TFileStreamOutput_close(&manifestData_out),HDIFF_FILECLOSE_ERROR,"check manifestFile close");
1549
+ printf(" out manifestFile ok!\n");
1550
+ printf("create manifest time: %.3f s\n",(clock_s()-time0));
1551
+ }
1552
+ {//test
1553
+ double time1=clock_s();
1554
+ TManifest manifest;
1555
+ try {
1556
+ check_manifest(manifest,inputPath,outManifestFileName);
1557
+ }catch(const std::exception& e){
1558
+ check(false,MANIFEST_TEST_ERROR,"test manifestFile found an error: "+e.what());
1559
+ }
1560
+ printf(" test manifestFile ok!\n");
1561
+ printf("test manifest time: %.3f s\n",(clock_s()-time1));
1562
+ }
1563
+
1564
+ printf("\nall time: %.3f s\n",(clock_s()-time0));
1565
+ clear:
1566
+ _isInClear=true;
1567
+ check(hpatch_TFileStreamOutput_close(&manifestData_out),HDIFF_FILECLOSE_ERROR,"check manifestFile close");
1568
+ return result;
1569
+ }
1570
+ #endif //_IS_NEED_DIR_DIFF_PATCH