react-native-update 10.34.1 → 10.34.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (908) hide show
  1. package/.gitmodules +6 -0
  2. package/harmony/pushy/src/main/cpp/HDiffPatch/CHANGELOG.md +291 -0
  3. package/harmony/pushy/src/main/cpp/HDiffPatch/LICENSE +48 -0
  4. package/harmony/pushy/src/main/cpp/HDiffPatch/Makefile +473 -0
  5. package/harmony/pushy/src/main/cpp/HDiffPatch/README.md +552 -0
  6. package/harmony/pushy/src/main/cpp/HDiffPatch/README_cn.md +547 -0
  7. package/harmony/pushy/src/main/cpp/HDiffPatch/_atosize.h +127 -0
  8. package/harmony/pushy/src/main/cpp/HDiffPatch/_clock_for_demo.h +59 -0
  9. package/harmony/pushy/src/main/cpp/HDiffPatch/_dir_ignore.h +191 -0
  10. package/harmony/pushy/src/main/cpp/HDiffPatch/_hextobytes.h +112 -0
  11. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.cpp +389 -0
  12. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bsdiff_wrapper.h +73 -0
  13. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.c +266 -0
  14. package/harmony/pushy/src/main/cpp/HDiffPatch/bsdiff_wrapper/bspatch_wrapper.h +58 -0
  15. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Android.mk +190 -0
  16. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/Application.mk +8 -0
  17. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.bat +1 -0
  18. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs.sh +1 -0
  19. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.bat +1 -0
  20. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/build_libs_patchers.sh +1 -0
  21. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.c +49 -0
  22. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch.h +31 -0
  23. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/hpatch_jni.c +38 -0
  24. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/android_ndk_jni_mk/java/com/github/sisong/HPatch.java +26 -0
  25. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffPatch.sln +155 -0
  26. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HDiffZ.vcxproj +364 -0
  27. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/HPatchZ.vcxproj +348 -0
  28. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/bzip2.vcxproj +228 -0
  29. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/hpatchz_test.vcxproj +215 -0
  30. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/libdeflate.vcxproj +256 -0
  31. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/longPathAware.exe.manifest +7 -0
  32. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/lzma.vcxproj +271 -0
  33. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/testHashClash.vcxproj +228 -0
  34. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/unitTest.vcxproj +296 -0
  35. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zlib.vcxproj +242 -0
  36. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/vc/zstd.vcxproj +287 -0
  37. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata +39 -0
  38. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  39. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  40. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/bestParams.xcodeproj/project.pbxproj +447 -0
  41. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hdiffz.xcodeproj/project.pbxproj +703 -0
  42. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/hpatchz.xcodeproj/project.pbxproj +463 -0
  43. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/libdeflate.xcodeproj/project.pbxproj +286 -0
  44. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lz4.xcodeproj/project.pbxproj +268 -0
  45. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/lzma.xcodeproj/project.pbxproj +585 -0
  46. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/testHashClash.xcodeproj/project.pbxproj +301 -0
  47. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/unitTest.xcodeproj/project.pbxproj +591 -0
  48. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zlib.xcodeproj/project.pbxproj +308 -0
  49. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode/zstd.xcodeproj/project.pbxproj +524 -0
  50. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.h +33 -0
  51. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatch_objc/hpatch_objc.m +33 -0
  52. package/harmony/pushy/src/main/cpp/HDiffPatch/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj +774 -0
  53. package/harmony/pushy/src/main/cpp/HDiffPatch/checksum_plugin_demo.h +799 -0
  54. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.cpp +201 -0
  55. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_parallel.h +59 -0
  56. package/harmony/pushy/src/main/cpp/HDiffPatch/compress_plugin_demo.h +1526 -0
  57. package/harmony/pushy/src/main/cpp/HDiffPatch/decompress_plugin_demo.h +1637 -0
  58. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.cpp +846 -0
  59. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff.h +79 -0
  60. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.cpp +339 -0
  61. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_diff_tools.h +190 -0
  62. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.cpp +339 -0
  63. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/dir_manifest.h +87 -0
  64. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_diff/file_for_dirDiff.h +43 -0
  65. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.c +836 -0
  66. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch.h +246 -0
  67. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_private.h +47 -0
  68. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.c +112 -0
  69. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_tools.h +69 -0
  70. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/dir_patch_types.h +65 -0
  71. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.c +346 -0
  72. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_dir_output.h +149 -0
  73. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.c +176 -0
  74. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/new_stream.h +84 -0
  75. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.c +146 -0
  76. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/ref_stream.h +61 -0
  77. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.c +152 -0
  78. package/harmony/pushy/src/main/cpp/HDiffPatch/dirDiffPatch/dir_patch/res_handle_limit.h +76 -0
  79. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.c +735 -0
  80. package/harmony/pushy/src/main/cpp/HDiffPatch/file_for_patch.h +240 -0
  81. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz.cpp +1971 -0
  82. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.c +31 -0
  83. package/harmony/pushy/src/main/cpp/HDiffPatch/hdiffz_import_patch.h +42 -0
  84. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatch_dir_listener.h +307 -0
  85. package/harmony/pushy/src/main/cpp/HDiffPatch/hpatchz.c +1786 -0
  86. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.cpp +1746 -0
  87. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff.h +201 -0
  88. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_for_hpatch_lite.h +74 -0
  89. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/diff_types.h +187 -0
  90. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp +478 -0
  91. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/match_block.h +222 -0
  92. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp +383 -0
  93. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.h +73 -0
  94. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.cpp +184 -0
  95. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/compress_detect.h +88 -0
  96. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/config.h +89 -0
  97. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.c.inc.h +325 -0
  98. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.cpp +10 -0
  99. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort.h +97 -0
  100. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.cpp +14 -0
  101. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort64.h +108 -0
  102. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/divsufsort_private.h +186 -0
  103. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/sssort.c.inc.h +780 -0
  104. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/libdivsufsort/trsort.c.inc.h +579 -0
  105. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.c +415 -0
  106. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/adler_roll.h +144 -0
  107. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/bloom_filter.h +164 -0
  108. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/covers.h +148 -0
  109. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.cpp +769 -0
  110. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/digest_matcher.h +97 -0
  111. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.cpp +954 -0
  112. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/limit_mem_diff/stream_serialize.h +299 -0
  113. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.cpp +168 -0
  114. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/match_inplace.h +44 -0
  115. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/mem_buf.h +72 -0
  116. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/pack_uint.h +130 -0
  117. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/qsort_parallel.h +125 -0
  118. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.cpp +428 -0
  119. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HDiff/private_diff/suffix_string.h +133 -0
  120. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/checksum_plugin.h +52 -0
  121. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.c +243 -0
  122. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hcache_old_mt.h +51 -0
  123. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.c +153 -0
  124. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hinput_mt.h +54 -0
  125. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.c +158 -0
  126. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_houtput_mt.h +49 -0
  127. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.c +294 -0
  128. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_hpatch_mt.h +59 -0
  129. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/_patch_private_mt.h +217 -0
  130. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.c +349 -0
  131. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h +110 -0
  132. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.c +2643 -0
  133. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch.h +253 -0
  134. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_private.h +245 -0
  135. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatch/patch_types.h +361 -0
  136. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.c +366 -0
  137. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite.h +91 -0
  138. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_input_cache.h +31 -0
  139. package/harmony/pushy/src/main/cpp/HDiffPatch/libHDiffPatch/HPatchLite/hpatch_lite_types.h +106 -0
  140. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.cpp +170 -0
  141. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_channel.h +250 -0
  142. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import.h +67 -0
  143. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.c +497 -0
  144. package/harmony/pushy/src/main/cpp/HDiffPatch/libParallel/parallel_import_c.h +106 -0
  145. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.cpp +254 -0
  146. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_match_in_old_sign.h +39 -0
  147. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/_sign_diff_type.h +37 -0
  148. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.cpp +62 -0
  149. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sign_diff/sign_diff.h +44 -0
  150. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dict_decompress_plugin.h +156 -0
  151. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.cpp +440 -0
  152. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/dir_sync_client.h +88 -0
  153. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.cpp +332 -0
  154. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_old.h +48 -0
  155. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/match_in_types.h +198 -0
  156. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.cpp +697 -0
  157. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client.h +74 -0
  158. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_private.h +262 -0
  159. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type.h +174 -0
  160. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_client_type_private.h +174 -0
  161. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.cpp +252 -0
  162. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_diff_data.h +67 -0
  163. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.cpp +680 -0
  164. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_client/sync_info_client.h +137 -0
  165. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dict_compress_plugin.h +83 -0
  166. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.cpp +125 -0
  167. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/dir_sync_make.h +56 -0
  168. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/hsynz_plugin.h +55 -0
  169. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.cpp +147 -0
  170. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/match_in_new.h +38 -0
  171. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.cpp +354 -0
  172. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_info_make.h +76 -0
  173. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.cpp +521 -0
  174. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make.h +69 -0
  175. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_hash_clash.h +122 -0
  176. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/sync_make/sync_make_private.h +66 -0
  177. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type.h +36 -0
  178. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_type_private.h +81 -0
  179. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.cpp +247 -0
  180. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_client_wrapper.h +71 -0
  181. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.cpp +351 -0
  182. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_info_client.h +42 -0
  183. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.cpp +124 -0
  184. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_client_wrapper/zsync_match_in_old.h +38 -0
  185. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.cpp +203 -0
  186. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_info_make.h +55 -0
  187. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.cpp +79 -0
  188. package/harmony/pushy/src/main/cpp/HDiffPatch/libhsync/zsync_make_wrapper/zsync_make_wrapper.h +66 -0
  189. package/harmony/pushy/src/main/cpp/HDiffPatch/test/_private_searchBestParams.cpp +301 -0
  190. package/harmony/pushy/src/main/cpp/HDiffPatch/test/hpatchz_test.cpp +291 -0
  191. package/harmony/pushy/src/main/cpp/HDiffPatch/test/testHashClash.cpp +630 -0
  192. package/harmony/pushy/src/main/cpp/HDiffPatch/test/unit_test.cpp +889 -0
  193. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.cpp +628 -0
  194. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcdiff_wrapper.h +95 -0
  195. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_code_table.h +78 -0
  196. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.c +950 -0
  197. package/harmony/pushy/src/main/cpp/HDiffPatch/vcdiff_wrapper/vcpatch_wrapper.h +72 -0
  198. package/harmony/pushy/src/main/cpp/lzma/Asm/arm/7zCrcOpt.asm +100 -0
  199. package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/7zAsm.S +181 -0
  200. package/harmony/pushy/src/main/cpp/lzma/Asm/arm64/LzmaDecOpt.S +1487 -0
  201. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zAsm.asm +341 -0
  202. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/7zCrcOpt.asm +258 -0
  203. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/AesOpt.asm +742 -0
  204. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzFindOpt.asm +540 -0
  205. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/LzmaDecOpt.asm +1339 -0
  206. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sha256Opt.asm +275 -0
  207. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/Sort.asm +860 -0
  208. package/harmony/pushy/src/main/cpp/lzma/Asm/x86/XzCrc64Opt.asm +523 -0
  209. package/harmony/pushy/src/main/cpp/lzma/C/7z.h +204 -0
  210. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.c +89 -0
  211. package/harmony/pushy/src/main/cpp/lzma/C/7zAlloc.h +19 -0
  212. package/harmony/pushy/src/main/cpp/lzma/C/7zArcIn.c +1786 -0
  213. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.c +36 -0
  214. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf.h +35 -0
  215. package/harmony/pushy/src/main/cpp/lzma/C/7zBuf2.c +52 -0
  216. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.c +464 -0
  217. package/harmony/pushy/src/main/cpp/lzma/C/7zCrc.h +28 -0
  218. package/harmony/pushy/src/main/cpp/lzma/C/7zCrcOpt.c +199 -0
  219. package/harmony/pushy/src/main/cpp/lzma/C/7zDec.c +673 -0
  220. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.c +443 -0
  221. package/harmony/pushy/src/main/cpp/lzma/C/7zFile.h +92 -0
  222. package/harmony/pushy/src/main/cpp/lzma/C/7zStream.c +199 -0
  223. package/harmony/pushy/src/main/cpp/lzma/C/7zTypes.h +597 -0
  224. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.h +27 -0
  225. package/harmony/pushy/src/main/cpp/lzma/C/7zVersion.rc +55 -0
  226. package/harmony/pushy/src/main/cpp/lzma/C/7zWindows.h +101 -0
  227. package/harmony/pushy/src/main/cpp/lzma/C/7zip_gcc_c.mak +360 -0
  228. package/harmony/pushy/src/main/cpp/lzma/C/Aes.c +429 -0
  229. package/harmony/pushy/src/main/cpp/lzma/C/Aes.h +60 -0
  230. package/harmony/pushy/src/main/cpp/lzma/C/AesOpt.c +1002 -0
  231. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.c +605 -0
  232. package/harmony/pushy/src/main/cpp/lzma/C/Alloc.h +76 -0
  233. package/harmony/pushy/src/main/cpp/lzma/C/Asm_c.mak +12 -0
  234. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.c +290 -0
  235. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2.h +332 -0
  236. package/harmony/pushy/src/main/cpp/lzma/C/Bcj2Enc.c +506 -0
  237. package/harmony/pushy/src/main/cpp/lzma/C/Bra.c +709 -0
  238. package/harmony/pushy/src/main/cpp/lzma/C/Bra.h +105 -0
  239. package/harmony/pushy/src/main/cpp/lzma/C/Bra86.c +187 -0
  240. package/harmony/pushy/src/main/cpp/lzma/C/BraIA64.c +14 -0
  241. package/harmony/pushy/src/main/cpp/lzma/C/Compiler.h +246 -0
  242. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.c +970 -0
  243. package/harmony/pushy/src/main/cpp/lzma/C/CpuArch.h +686 -0
  244. package/harmony/pushy/src/main/cpp/lzma/C/Delta.c +169 -0
  245. package/harmony/pushy/src/main/cpp/lzma/C/Delta.h +19 -0
  246. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.c +99 -0
  247. package/harmony/pushy/src/main/cpp/lzma/C/DllSecur.h +20 -0
  248. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.c +1746 -0
  249. package/harmony/pushy/src/main/cpp/lzma/C/LzFind.h +160 -0
  250. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.c +1422 -0
  251. package/harmony/pushy/src/main/cpp/lzma/C/LzFindMt.h +114 -0
  252. package/harmony/pushy/src/main/cpp/lzma/C/LzFindOpt.c +578 -0
  253. package/harmony/pushy/src/main/cpp/lzma/C/LzHash.h +34 -0
  254. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.c +493 -0
  255. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Dec.h +121 -0
  256. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.c +1095 -0
  257. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2DecMt.h +81 -0
  258. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.c +807 -0
  259. package/harmony/pushy/src/main/cpp/lzma/C/Lzma2Enc.h +58 -0
  260. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86.h +111 -0
  261. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Dec.c +53 -0
  262. package/harmony/pushy/src/main/cpp/lzma/C/Lzma86Enc.c +103 -0
  263. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.c +1363 -0
  264. package/harmony/pushy/src/main/cpp/lzma/C/LzmaDec.h +237 -0
  265. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.c +3150 -0
  266. package/harmony/pushy/src/main/cpp/lzma/C/LzmaEnc.h +85 -0
  267. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.c +42 -0
  268. package/harmony/pushy/src/main/cpp/lzma/C/LzmaLib.h +138 -0
  269. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.c +604 -0
  270. package/harmony/pushy/src/main/cpp/lzma/C/MtCoder.h +144 -0
  271. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.c +1124 -0
  272. package/harmony/pushy/src/main/cpp/lzma/C/MtDec.h +202 -0
  273. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd.h +169 -0
  274. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.c +1131 -0
  275. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7.h +181 -0
  276. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Dec.c +312 -0
  277. package/harmony/pushy/src/main/cpp/lzma/C/Ppmd7Enc.c +337 -0
  278. package/harmony/pushy/src/main/cpp/lzma/C/Precomp.h +127 -0
  279. package/harmony/pushy/src/main/cpp/lzma/C/RotateDefs.h +50 -0
  280. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.c +492 -0
  281. package/harmony/pushy/src/main/cpp/lzma/C/Sha256.h +86 -0
  282. package/harmony/pushy/src/main/cpp/lzma/C/Sha256Opt.c +451 -0
  283. package/harmony/pushy/src/main/cpp/lzma/C/Sort.c +268 -0
  284. package/harmony/pushy/src/main/cpp/lzma/C/Sort.h +15 -0
  285. package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.c +835 -0
  286. package/harmony/pushy/src/main/cpp/lzma/C/SwapBytes.h +17 -0
  287. package/harmony/pushy/src/main/cpp/lzma/C/Threads.c +812 -0
  288. package/harmony/pushy/src/main/cpp/lzma/C/Threads.h +260 -0
  289. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsp +249 -0
  290. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7z.dsw +29 -0
  291. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/7zMain.c +889 -0
  292. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.c +4 -0
  293. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/Precomp.h +13 -0
  294. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile +44 -0
  295. package/harmony/pushy/src/main/cpp/lzma/C/Util/7z/makefile.gcc +32 -0
  296. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.c +313 -0
  297. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsp +192 -0
  298. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/LzmaUtil.dsw +29 -0
  299. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/Precomp.h +13 -0
  300. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile +30 -0
  301. package/harmony/pushy/src/main/cpp/lzma/C/Util/Lzma/makefile.gcc +21 -0
  302. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.def +4 -0
  303. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsp +206 -0
  304. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLib.dsw +29 -0
  305. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/LzmaLibExports.c +15 -0
  306. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.c +4 -0
  307. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/Precomp.h +13 -0
  308. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/makefile +59 -0
  309. package/harmony/pushy/src/main/cpp/lzma/C/Util/LzmaLib/resource.rc +3 -0
  310. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.c +4 -0
  311. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/Precomp.h +13 -0
  312. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.c +657 -0
  313. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsp +231 -0
  314. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/SfxSetup.dsw +29 -0
  315. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile +44 -0
  316. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/makefile_con +40 -0
  317. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/resource.rc +5 -0
  318. package/harmony/pushy/src/main/cpp/lzma/C/Util/SfxSetup/setup.ico +0 -0
  319. package/harmony/pushy/src/main/cpp/lzma/C/Xz.c +92 -0
  320. package/harmony/pushy/src/main/cpp/lzma/C/Xz.h +542 -0
  321. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.c +140 -0
  322. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64.h +26 -0
  323. package/harmony/pushy/src/main/cpp/lzma/C/XzCrc64Opt.c +261 -0
  324. package/harmony/pushy/src/main/cpp/lzma/C/XzDec.c +2876 -0
  325. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.c +1384 -0
  326. package/harmony/pushy/src/main/cpp/lzma/C/XzEnc.h +64 -0
  327. package/harmony/pushy/src/main/cpp/lzma/C/XzIn.c +385 -0
  328. package/harmony/pushy/src/main/cpp/lzma/C/var_clang.mak +11 -0
  329. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_arm64.mak +12 -0
  330. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x64.mak +11 -0
  331. package/harmony/pushy/src/main/cpp/lzma/C/var_clang_x86.mak +11 -0
  332. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc.mak +12 -0
  333. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_arm64.mak +12 -0
  334. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x64.mak +10 -0
  335. package/harmony/pushy/src/main/cpp/lzma/C/var_gcc_x86.mak +10 -0
  336. package/harmony/pushy/src/main/cpp/lzma/C/var_mac_arm64.mak +11 -0
  337. package/harmony/pushy/src/main/cpp/lzma/C/var_mac_x64.mak +11 -0
  338. package/harmony/pushy/src/main/cpp/lzma/C/warn_clang.mak +1 -0
  339. package/harmony/pushy/src/main/cpp/lzma/C/warn_clang_mac.mak +1 -0
  340. package/harmony/pushy/src/main/cpp/lzma/C/warn_gcc.mak +51 -0
  341. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip.mak +240 -0
  342. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/7zip_gcc.mak +1370 -0
  343. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Aes.mak +10 -0
  344. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
  345. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
  346. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
  347. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zDecode.h +73 -0
  348. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.cpp +721 -0
  349. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zEncode.h +95 -0
  350. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
  351. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
  352. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
  353. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.cpp +795 -0
  354. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandler.h +178 -0
  355. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
  356. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
  357. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zHeader.h +156 -0
  358. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.cpp +1764 -0
  359. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zIn.h +454 -0
  360. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zItem.h +207 -0
  361. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
  362. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zOut.h +346 -0
  363. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
  364. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zProperties.h +26 -0
  365. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
  366. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
  367. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
  368. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.cpp +3088 -0
  369. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
  370. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
  371. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/7z/StdAfx.h +11 -0
  372. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive.def +14 -0
  373. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Archive2.def +21 -0
  374. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
  375. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
  376. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
  377. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
  378. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
  379. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
  380. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
  381. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
  382. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
  383. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
  384. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
  385. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
  386. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/MultiStream.h +86 -0
  387. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
  388. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
  389. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
  390. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
  391. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Common/StdAfx.h +11 -0
  392. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/DllExports2.cpp +175 -0
  393. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/IArchive.h +754 -0
  394. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/Icons/7z.ico +0 -0
  395. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/LzmaHandler.cpp +608 -0
  396. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/SplitHandler.cpp +353 -0
  397. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/StdAfx.h +11 -0
  398. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.cpp +1452 -0
  399. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Archive/XzHandler.h +11 -0
  400. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Asm.mak +12 -0
  401. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
  402. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
  403. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
  404. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
  405. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile +168 -0
  406. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/makefile.gcc +279 -0
  407. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
  408. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
  409. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
  410. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
  411. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
  412. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
  413. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
  414. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/makefile +121 -0
  415. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
  416. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +817 -0
  417. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
  418. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
  419. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
  420. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
  421. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
  422. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
  423. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
  424. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp +715 -0
  425. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
  426. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
  427. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
  428. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
  429. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
  430. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
  431. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile +137 -0
  432. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
  433. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
  434. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
  435. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
  436. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
  437. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
  438. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
  439. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
  440. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +371 -0
  441. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
  442. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
  443. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
  444. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
  445. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
  446. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
  447. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
  448. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
  449. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
  450. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
  451. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
  452. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
  453. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/makefile +159 -0
  454. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
  455. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
  456. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.cpp +358 -0
  457. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CWrappers.h +182 -0
  458. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.cpp +548 -0
  459. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/CreateCoder.h +200 -0
  460. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
  461. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilePathAutoRename.h +10 -0
  462. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.cpp +923 -0
  463. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FileStreams.h +205 -0
  464. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.cpp +577 -0
  465. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/FilterCoder.h +201 -0
  466. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.cpp +182 -0
  467. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InBuffer.h +121 -0
  468. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
  469. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/InOutTempBuffer.h +45 -0
  470. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.cpp +393 -0
  471. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LimitedStreams.h +221 -0
  472. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.cpp +3 -0
  473. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/LockedStream.h +6 -0
  474. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.cpp +3 -0
  475. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodId.h +10 -0
  476. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.cpp +765 -0
  477. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MethodProps.h +349 -0
  478. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.cpp +855 -0
  479. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/MultiOutStream.h +160 -0
  480. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.cpp +37 -0
  481. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OffsetStream.h +22 -0
  482. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.cpp +111 -0
  483. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/OutBuffer.h +133 -0
  484. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.cpp +51 -0
  485. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/ProgressUtils.h +33 -0
  486. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/PropId.cpp +117 -0
  487. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterArc.h +80 -0
  488. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/RegisterCodec.h +106 -0
  489. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StdAfx.h +11 -0
  490. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.cpp +151 -0
  491. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamBinder.h +78 -0
  492. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.cpp +290 -0
  493. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamObjects.h +146 -0
  494. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.cpp +101 -0
  495. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/StreamUtils.h +31 -0
  496. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.cpp +57 -0
  497. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/UniqBlocks.h +41 -0
  498. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.cpp +47 -0
  499. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Common/VirtThread.h +24 -0
  500. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
  501. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Coder.h +127 -0
  502. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
  503. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.cpp +24 -0
  504. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjCoder.h +37 -0
  505. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BcjRegister.cpp +17 -0
  506. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.cpp +106 -0
  507. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchMisc.h +59 -0
  508. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/BranchRegister.cpp +58 -0
  509. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/ByteSwap.cpp +91 -0
  510. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CodecExports.cpp +378 -0
  511. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.cpp +153 -0
  512. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyCoder.h +34 -0
  513. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/CopyRegister.cpp +15 -0
  514. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
  515. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
  516. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
  517. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
  518. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
  519. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
  520. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
  521. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaDecoder.h +113 -0
  522. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
  523. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaEncoder.h +45 -0
  524. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
  525. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
  526. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdDecoder.h +87 -0
  527. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
  528. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdEncoder.h +49 -0
  529. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
  530. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/StdAfx.h +11 -0
  531. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.cpp +151 -0
  532. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzDecoder.h +86 -0
  533. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.cpp +243 -0
  534. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Compress/XzEncoder.h +35 -0
  535. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc.mak +8 -0
  536. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crc64.mak +8 -0
  537. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.cpp +315 -0
  538. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAes.h +130 -0
  539. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
  540. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.cpp +277 -0
  541. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAes.h +122 -0
  542. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
  543. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.cpp +241 -0
  544. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/RandGen.h +41 -0
  545. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Crypto/StdAfx.h +11 -0
  546. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/GuiCommon.rc +119 -0
  547. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Guid.txt +243 -0
  548. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/ICoder.h +480 -0
  549. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IDecl.h +76 -0
  550. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IPassword.h +54 -0
  551. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IProgress.h +20 -0
  552. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/IStream.h +210 -0
  553. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzFindOpt.mak +7 -0
  554. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec.mak +7 -0
  555. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/LzmaDec_gcc.mak +14 -0
  556. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersion.h +2 -0
  557. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/MyVersionInfo.rc +2 -0
  558. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/PropID.h +178 -0
  559. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sha256.mak +13 -0
  560. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/Sort.mak +6 -0
  561. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/SubBuild.mak +3 -0
  562. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
  563. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
  564. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
  565. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
  566. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
  567. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile +29 -0
  568. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
  569. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Client7z/resource.rc +3 -0
  570. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1799 -0
  571. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
  572. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3077 -0
  573. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveExtractCallback.h +641 -0
  574. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
  575. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveName.h +16 -0
  576. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +398 -0
  577. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
  578. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.cpp +5026 -0
  579. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Bench.h +121 -0
  580. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
  581. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DefaultName.h +11 -0
  582. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/DirItem.h +407 -0
  583. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
  584. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
  585. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExitCode.h +27 -0
  586. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.cpp +575 -0
  587. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Extract.h +107 -0
  588. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractMode.h +44 -0
  589. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.cpp +296 -0
  590. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
  591. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
  592. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/HashCalc.h +322 -0
  593. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
  594. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.cpp +1337 -0
  595. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
  596. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.cpp +3702 -0
  597. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/OpenArchive.h +469 -0
  598. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.cpp +745 -0
  599. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
  600. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Property.h +14 -0
  601. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
  602. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SetProperties.h +10 -0
  603. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
  604. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/SortUtils.h +10 -0
  605. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/StdAfx.h +11 -0
  606. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
  607. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/TempFiles.h +19 -0
  608. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.cpp +1931 -0
  609. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/Update.h +221 -0
  610. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
  611. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateAction.h +66 -0
  612. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.cpp +1069 -0
  613. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
  614. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.cpp +302 -0
  615. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdatePair.h +27 -0
  616. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.cpp +74 -0
  617. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
  618. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
  619. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/WorkDir.h +30 -0
  620. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
  621. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
  622. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/BenchCon.h +14 -0
  623. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.mak +46 -0
  624. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Console.manifest +16 -0
  625. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
  626. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
  627. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +946 -0
  628. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
  629. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.cpp +426 -0
  630. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/HashCon.h +58 -0
  631. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.cpp +1417 -0
  632. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/List.h +42 -0
  633. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/Main.cpp +1635 -0
  634. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/MainAr.cpp +235 -0
  635. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
  636. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
  637. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
  638. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
  639. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
  640. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/StdAfx.h +11 -0
  641. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +998 -0
  642. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
  643. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
  644. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
  645. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile +68 -0
  646. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/makefile.gcc +187 -0
  647. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Console/resource.rc +7 -0
  648. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
  649. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
  650. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
  651. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
  652. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
  653. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
  654. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
  655. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
  656. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
  657. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1272 -0
  658. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
  659. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
  660. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
  661. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
  662. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
  663. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
  664. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
  665. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
  666. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
  667. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
  668. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
  669. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
  670. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
  671. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
  672. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
  673. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
  674. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
  675. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
  676. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
  677. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1483 -0
  678. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
  679. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
  680. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
  681. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
  682. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
  683. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
  684. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
  685. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
  686. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
  687. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.cpp +351 -0
  688. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
  689. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resource.h +199 -0
  690. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
  691. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
  692. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/Extract.rc +59 -0
  693. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.cpp +421 -0
  694. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
  695. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
  696. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
  697. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
  698. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
  699. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
  700. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/HashGUI.h +27 -0
  701. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/UI/GUI/resource2.h +2 -0
  702. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang.mak +3 -0
  703. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_arm64.mak +3 -0
  704. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x64.mak +3 -0
  705. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_clang_x86.mak +3 -0
  706. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc.mak +3 -0
  707. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
  708. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x64.mak +3 -0
  709. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_gcc_x86.mak +3 -0
  710. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_arm64.mak +3 -0
  711. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/cmpl_mac_x64.mak +3 -0
  712. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang.mak +11 -0
  713. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_arm64.mak +19 -0
  714. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x64.mak +11 -0
  715. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_clang_x86.mak +11 -0
  716. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc.mak +12 -0
  717. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_arm64.mak +12 -0
  718. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x64.mak +11 -0
  719. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_gcc_x86.mak +10 -0
  720. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_arm64.mak +13 -0
  721. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/var_mac_x64.mak +11 -0
  722. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang.mak +3 -0
  723. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_clang_mac.mak +9 -0
  724. package/harmony/pushy/src/main/cpp/lzma/CPP/7zip/warn_gcc.mak +55 -0
  725. package/harmony/pushy/src/main/cpp/lzma/CPP/Build.mak +252 -0
  726. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/AutoPtr.h +46 -0
  727. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CRC.cpp +7 -0
  728. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.cpp +3 -0
  729. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/C_FileIO.h +6 -0
  730. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ComTry.h +21 -0
  731. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.cpp +231 -0
  732. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CommandLineParser.h +63 -0
  733. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common.h +28 -0
  734. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Common0.h +330 -0
  735. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/CrcReg.cpp +77 -0
  736. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Defs.h +16 -0
  737. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.cpp +93 -0
  738. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynLimBuf.h +41 -0
  739. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/DynamicBuffer.h +76 -0
  740. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.cpp +215 -0
  741. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/IntToString.h +54 -0
  742. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Lang.h +30 -0
  743. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.cpp +150 -0
  744. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/ListFileUtils.h +18 -0
  745. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/LzFindPrepare.cpp +7 -0
  746. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer.h +297 -0
  747. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyBuffer2.h +185 -0
  748. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyCom.h +693 -0
  749. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyException.h +14 -0
  750. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyGuidDef.h +63 -0
  751. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyInitGuid.h +57 -0
  752. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyLinux.h +75 -0
  753. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.cpp +1842 -0
  754. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyString.h +1079 -0
  755. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyTypes.h +38 -0
  756. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyUnknown.h +8 -0
  757. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.cpp +3 -0
  758. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyVector.h +724 -0
  759. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.cpp +292 -0
  760. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/MyWindows.h +325 -0
  761. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.cpp +340 -0
  762. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/NewHandler.h +121 -0
  763. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Prepare.cpp +7 -0
  764. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Sha256Reg.cpp +67 -0
  765. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdAfx.h +8 -0
  766. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.cpp +98 -0
  767. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdInStream.h +46 -0
  768. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.cpp +248 -0
  769. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StdOutStream.h +87 -0
  770. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.cpp +762 -0
  771. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringConvert.h +110 -0
  772. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.cpp +154 -0
  773. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/StringToInt.h +38 -0
  774. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.cpp +123 -0
  775. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/TextConfig.h +19 -0
  776. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.cpp +863 -0
  777. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/UTFConvert.h +384 -0
  778. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.cpp +789 -0
  779. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/Wildcard.h +231 -0
  780. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Init.cpp +7 -0
  781. package/harmony/pushy/src/main/cpp/lzma/CPP/Common/XzCrc64Reg.cpp +39 -0
  782. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/COM.h +86 -0
  783. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.cpp +130 -0
  784. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Clipboard.h +28 -0
  785. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.cpp +269 -0
  786. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/CommonDialog.h +43 -0
  787. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.cpp +66 -0
  788. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ComboBox.h +77 -0
  789. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/CommandBar.h +52 -0
  790. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.cpp +446 -0
  791. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Dialog.h +213 -0
  792. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Edit.h +19 -0
  793. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.cpp +10 -0
  794. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ImageList.h +87 -0
  795. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.cpp +162 -0
  796. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ListView.h +156 -0
  797. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ProgressBar.h +35 -0
  798. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.cpp +165 -0
  799. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/PropertyPage.h +50 -0
  800. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ReBar.h +34 -0
  801. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Static.h +28 -0
  802. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StatusBar.h +42 -0
  803. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/StdAfx.h +11 -0
  804. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/ToolBar.h +43 -0
  805. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Trackbar.h +27 -0
  806. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.cpp +202 -0
  807. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Control/Window2.h +53 -0
  808. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.cpp +178 -0
  809. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/DLL.h +103 -0
  810. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Defs.h +17 -0
  811. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.cpp +133 -0
  812. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ErrorMsg.h +16 -0
  813. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.cpp +1362 -0
  814. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileDir.h +172 -0
  815. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.cpp +1449 -0
  816. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileFind.h +347 -0
  817. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.cpp +954 -0
  818. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileIO.h +467 -0
  819. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileLink.cpp +697 -0
  820. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.cpp +12 -0
  821. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileMapping.h +66 -0
  822. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.cpp +911 -0
  823. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileName.h +142 -0
  824. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.cpp +187 -0
  825. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/FileSystem.h +31 -0
  826. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Handle.h +39 -0
  827. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.cpp +36 -0
  828. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryGlobal.h +55 -0
  829. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.cpp +127 -0
  830. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/MemoryLock.h +40 -0
  831. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/NtCheck.h +58 -0
  832. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.cpp +393 -0
  833. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariant.h +173 -0
  834. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.cpp +274 -0
  835. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/PropVariantConv.h +47 -0
  836. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.cpp +474 -0
  837. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Registry.h +96 -0
  838. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.cpp +103 -0
  839. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/ResourceString.h +17 -0
  840. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.cpp +186 -0
  841. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SecurityUtils.h +150 -0
  842. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.cpp +839 -0
  843. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Shell.h +129 -0
  844. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/StdAfx.h +11 -0
  845. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.cpp +87 -0
  846. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Synchronization.h +386 -0
  847. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.cpp +421 -0
  848. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/System.h +189 -0
  849. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.cpp +1251 -0
  850. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/SystemInfo.h +19 -0
  851. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Thread.h +46 -0
  852. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.cpp +467 -0
  853. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/TimeUtils.h +146 -0
  854. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.cpp +179 -0
  855. package/harmony/pushy/src/main/cpp/lzma/CPP/Windows/Window.h +363 -0
  856. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CRC.cs +55 -0
  857. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/CommandLineParser.cs +274 -0
  858. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/InBuffer.cs +72 -0
  859. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Common/OutBuffer.cs +47 -0
  860. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/IMatchFinder.cs +24 -0
  861. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzBinTree.cs +367 -0
  862. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzInWindow.cs +132 -0
  863. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZ/LzOutWindow.cs +110 -0
  864. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaBase.cs +76 -0
  865. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaDecoder.cs +398 -0
  866. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LZMA/LzmaEncoder.cs +1480 -0
  867. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs +364 -0
  868. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln +20 -0
  869. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/LzmaBench.cs +340 -0
  870. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs +29 -0
  871. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs +70 -0
  872. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs +42 -0
  873. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoder.cs +234 -0
  874. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs +117 -0
  875. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs +157 -0
  876. package/harmony/pushy/src/main/cpp/lzma/CS/7zip/ICoder.cs +157 -0
  877. package/harmony/pushy/src/main/cpp/lzma/DOC/7zC.txt +187 -0
  878. package/harmony/pushy/src/main/cpp/lzma/DOC/7zFormat.txt +469 -0
  879. package/harmony/pushy/src/main/cpp/lzma/DOC/Methods.txt +177 -0
  880. package/harmony/pushy/src/main/cpp/lzma/DOC/installer.txt +166 -0
  881. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-history.txt +651 -0
  882. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-sdk.txt +437 -0
  883. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma-specification.txt +1176 -0
  884. package/harmony/pushy/src/main/cpp/lzma/DOC/lzma.txt +345 -0
  885. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/CRC.java +52 -0
  886. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/BinTree.java +382 -0
  887. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/InWindow.java +131 -0
  888. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZ/OutWindow.java +85 -0
  889. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Base.java +88 -0
  890. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Decoder.java +329 -0
  891. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/LZMA/Encoder.java +1416 -0
  892. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java +55 -0
  893. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java +99 -0
  894. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Decoder.java +88 -0
  895. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/Compression/RangeCoder/Encoder.java +151 -0
  896. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/ICodeProgress.java +6 -0
  897. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaAlone.java +253 -0
  898. package/harmony/pushy/src/main/cpp/lzma/Java/SevenZip/LzmaBench.java +392 -0
  899. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2.sfx +0 -0
  900. package/harmony/pushy/src/main/cpp/lzma/bin/7zS2con.sfx +0 -0
  901. package/harmony/pushy/src/main/cpp/lzma/bin/7zSD.sfx +0 -0
  902. package/harmony/pushy/src/main/cpp/lzma/bin/7zdec.exe +0 -0
  903. package/harmony/pushy/src/main/cpp/lzma/bin/7zr.exe +0 -0
  904. package/harmony/pushy/src/main/cpp/lzma/bin/installer/config.txt +5 -0
  905. package/harmony/pushy/src/main/cpp/lzma/bin/installer/cr.bat +5 -0
  906. package/harmony/pushy/src/main/cpp/lzma/bin/lzma.exe +0 -0
  907. package/harmony/pushy/src/main/cpp/lzma/bin/x64/7zr.exe +0 -0
  908. package/package.json +1 -1
@@ -0,0 +1,1786 @@
1
+ //hpatchz.c
2
+ // patch tool
3
+ //
4
+ /*
5
+ This is the HDiffPatch copyright.
6
+
7
+ Copyright (c) 2012-2021 HouSisong All Rights Reserved.
8
+
9
+ Permission is hereby granted, free of charge, to any person
10
+ obtaining a copy of this software and associated documentation
11
+ files (the "Software"), to deal in the Software without
12
+ restriction, including without limitation the rights to use,
13
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the
15
+ Software is furnished to do so, subject to the following
16
+ conditions:
17
+
18
+ The above copyright notice and this permission notice shall be
19
+ included in all copies of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28
+ OTHER DEALINGS IN THE SOFTWARE.
29
+ */
30
+
31
+ #include <string.h>
32
+ #include <stdlib.h>
33
+ #include <stdio.h>
34
+ #include "libHDiffPatch/HPatch/patch.h"
35
+ #include "_clock_for_demo.h"
36
+ #include "_atosize.h"
37
+ #include "file_for_patch.h"
38
+ #include "dirDiffPatch/dir_patch/dir_patch.h"
39
+ #if (_IS_NEED_DIR_DIFF_PATCH)
40
+ #include "hpatch_dir_listener.h"
41
+ #endif
42
+
43
+ #ifndef _IS_NEED_PRINT_LOG
44
+ # define _IS_NEED_PRINT_LOG 1
45
+ #endif
46
+ #if (_IS_NEED_PRINT_LOG)
47
+ # define _log_info_utf8 hpatch_printPath_utf8
48
+ #else
49
+ # define printf(...)
50
+ # define _log_info_utf8(...) do{}while(0)
51
+ #endif
52
+ #ifndef _IS_NEED_PRINT_PROGRESS
53
+ # define _IS_NEED_PRINT_PROGRESS _IS_NEED_PRINT_LOG
54
+ #endif
55
+
56
+ #ifndef _IS_NEED_MAIN
57
+ # define _IS_NEED_MAIN 1
58
+ #endif
59
+ #if (_IS_NEED_MAIN && _IS_USED_MULTITHREAD)
60
+ # include "libParallel/parallel_import_c.h"
61
+ #endif
62
+ #ifndef _IS_NEED_CMDLINE
63
+ # define _IS_NEED_CMDLINE 1
64
+ #endif
65
+ #ifndef _IS_NEED_SINGLE_STREAM_DIFF
66
+ # define _IS_NEED_SINGLE_STREAM_DIFF 1
67
+ #endif
68
+ #ifndef _IS_NEED_BSDIFF
69
+ # define _IS_NEED_BSDIFF 1
70
+ #endif
71
+ #ifndef _IS_NEED_VCDIFF
72
+ # define _IS_NEED_VCDIFF 1
73
+ #endif
74
+ #ifndef _IS_NEED_SFX
75
+ # define _IS_NEED_SFX 1
76
+ #endif
77
+
78
+ #ifndef _IS_NEED_DEFAULT_CompressPlugin
79
+ # define _IS_NEED_DEFAULT_CompressPlugin 1
80
+ #endif
81
+ #if (_IS_NEED_ALL_CompressPlugin)
82
+ # undef _IS_NEED_DEFAULT_CompressPlugin
83
+ # define _IS_NEED_DEFAULT_CompressPlugin 1
84
+ #endif
85
+ #if (_IS_NEED_DEFAULT_CompressPlugin)
86
+ //===== select needs decompress plugins or change to your plugin=====
87
+ # ifndef _IS_NEED_decompressor_ldef_replace_zlib
88
+ # define _IS_NEED_decompressor_ldef_replace_zlib 0
89
+ # endif
90
+ # if (_IS_NEED_decompressor_ldef_replace_zlib)
91
+ # define _CompressPlugin_ldef //optimized zlib&ldef's deflate code decompress speed by libdeflate
92
+ # else
93
+ # define _CompressPlugin_zlib
94
+ # endif
95
+ # define _CompressPlugin_bz2
96
+ # define _CompressPlugin_lzma
97
+ # define _CompressPlugin_lzma2
98
+ # define _CompressPlugin_zstd
99
+ #if (_IS_NEED_VCDIFF)
100
+ # define _CompressPlugin_7zXZ
101
+ #endif
102
+ #endif
103
+ #if (_IS_NEED_ALL_CompressPlugin)
104
+ //===== select needs decompress plugins or change to your plugin=====
105
+ # define _CompressPlugin_lz4 // || _CompressPlugin_lz4hc
106
+ # define _CompressPlugin_brotli
107
+ # define _CompressPlugin_lzham
108
+ # define _CompressPlugin_tuz
109
+ #endif
110
+ #ifdef _CompressPlugin_ldef
111
+ # ifndef _CompressPlugin_ldef_is_use_zlib
112
+ # define _CompressPlugin_ldef_is_use_zlib 1 //now ldef need zlib decompressor for any all of deflate code
113
+ # endif
114
+ # if (_IS_NEED_decompressor_ldef_replace_zlib&&(defined(_CompressPlugin_zlib)))
115
+ # undef _CompressPlugin_zlib
116
+ # endif
117
+ #endif
118
+
119
+ #if (_IS_NEED_BSDIFF)
120
+ # include "bsdiff_wrapper/bspatch_wrapper.h"
121
+ # ifndef _CompressPlugin_bz2
122
+ # define _CompressPlugin_bz2 //bsdiff4 need bz2
123
+ # endif
124
+ #endif
125
+ #if (_IS_NEED_VCDIFF)
126
+ # include "vcdiff_wrapper/vcpatch_wrapper.h"
127
+ #endif
128
+
129
+ #include "decompress_plugin_demo.h"
130
+
131
+ #if (_IS_NEED_DIR_DIFF_PATCH)
132
+
133
+ #ifndef _IS_NEED_DEFAULT_ChecksumPlugin
134
+ # define _IS_NEED_DEFAULT_ChecksumPlugin 1
135
+ #endif
136
+ #if (_IS_NEED_ALL_ChecksumPlugin)
137
+ # undef _IS_NEED_DEFAULT_ChecksumPlugin
138
+ # define _IS_NEED_DEFAULT_ChecksumPlugin 1
139
+ #endif
140
+ #if (_IS_NEED_DEFAULT_ChecksumPlugin)
141
+ //===== select needs checksum plugins or change to your plugin=====
142
+ # define _ChecksumPlugin_crc32 // 32 bit effective //need zlib
143
+ # define _ChecksumPlugin_fadler64 // ? 63 bit effective
144
+ # define _ChecksumPlugin_md5 // 128 bit
145
+ # define _ChecksumPlugin_xxh3 // 64 bit fast
146
+ # define _ChecksumPlugin_xxh128 // 128 bit fast
147
+ #endif
148
+ #if (_IS_NEED_ALL_ChecksumPlugin)
149
+ //===== select needs checksum plugins or change to your plugin=====
150
+ # define _ChecksumPlugin_adler32 // ? 29 bit effective
151
+ # define _ChecksumPlugin_adler64 // ? 30 bit effective
152
+ # define _ChecksumPlugin_fadler32 // ~ 32 bit effective
153
+ # define _ChecksumPlugin_fadler128// ? 81 bit effective
154
+ # define _ChecksumPlugin_blake3 // 256 bit
155
+ #endif
156
+
157
+ #include "checksum_plugin_demo.h"
158
+ #endif
159
+
160
+ #if (_IS_NEED_CMDLINE)
161
+ static void printVersion(){
162
+ printf("HDiffPatch::hpatchz v" HDIFFPATCH_VERSION_STRING "\n");
163
+ }
164
+
165
+ static void printHelpInfo(){
166
+ printf(" -h (or -?)\n"
167
+ " print usage info.\n");
168
+ }
169
+
170
+ int hpatch_printFilesInfos(int fileCount,const char* fileNames[]);
171
+
172
+ #if (_IS_NEED_SFX)
173
+ # ifdef _WIN32
174
+ #define kSFX_curDefaultPath ".\\"
175
+ # else
176
+ #define kSFX_curDefaultPath "./"
177
+ # endif
178
+ #endif
179
+
180
+ static void printUsage(){
181
+ printVersion();
182
+ printf("\n");
183
+ printf("patch usage: hpatchz [options] oldPath diffFile outNewPath\n"
184
+ "print info: hpatchz -info diffFile\n"
185
+ #if (_IS_NEED_SFX)
186
+ "create SFX: hpatchz [-X-exe#selfExecuteFile] diffFile -X#outSelfExtractArchive\n"
187
+ "run SFX: selfExtractArchive [[options] oldPath -X outNewPath]\n"
188
+ "extract SFX: selfExtractArchive (same as: $selfExtractArchive -f {\"\"|\"" kSFX_curDefaultPath "\"} -X "
189
+ "\"" kSFX_curDefaultPath "\")\n"
190
+ #endif
191
+ " if oldPath is empty input parameter \"\"\n"
192
+ "options:\n"
193
+ " -s[-cacheSize] \n"
194
+ " DEFAULT -s-8m; oldPath loaded as Stream;\n"
195
+ " cacheSize can like 262144 or 256k or 64m or 512m etc....\n"
196
+ " requires (cacheSize + 4*decompress buffer size)+O(1) bytes of memory.\n"
197
+ " if diffFile is single compressed diffData(created by hdiffz -SD-stepSize), then requires\n"
198
+ " (cacheSize+ stepSize + 1*decompress buffer size)+O(1) bytes of memory;\n"
199
+ #if (_IS_NEED_BSDIFF||_IS_NEED_VCDIFF)
200
+ " if diffFile is created by"
201
+ #if (_IS_NEED_BSDIFF)
202
+ " hdiffz -BSD,bsdiff4,"
203
+ #endif
204
+ #if (_IS_NEED_VCDIFF)
205
+ " hdiffz -VCD,"
206
+ #endif
207
+ " then requires\n"
208
+ " (cacheSize + 3*decompress buffer size)+O(1) bytes of memory;\n"
209
+ #endif
210
+ #if (_IS_NEED_VCDIFF)
211
+ " if diffFile is created by xdelta3,open-vcdiff, then requires\n"
212
+ " (sourceWindowSize+targetWindowSize + 3*decompress buffer size)+O(1) bytes of memory.\n"
213
+ #endif
214
+ " -m oldPath all loaded into Memory;\n"
215
+ " requires (oldFileSize + 4*decompress buffer size)+O(1) bytes of memory.\n"
216
+ " if diffFile is single compressed diffData(created by hdiffz -SD-stepSize), then requires\n"
217
+ " (oldFileSize+ stepSize + 1*decompress buffer size)+O(1) bytes of memory.\n"
218
+ #if (_IS_NEED_BSDIFF)
219
+ " if diffFile is created by hdiffz -BSD,bsdiff4, then requires\n"
220
+ " (oldFileSize + 3*decompress buffer size)+O(1) bytes of memory.\n"
221
+ #endif
222
+ #if (_IS_NEED_VCDIFF)
223
+ " if diffFile is VCDIFF(created by hdiffz -VCD,xdelta3,open-vcdiff), then requires\n"
224
+ " (sourceWindowSize+targetWindowSize + 3*decompress buffer size)+O(1) bytes of memory.\n"
225
+ #endif
226
+ #if (_IS_USED_MULTITHREAD)
227
+ " -p-parallelThreadNumber\n"
228
+ " if parallelThreadNumber>1 then open multi-thread Parallel mode;\n"
229
+ " now only support single compressed diffData(created by hdiffz -SD-stepSize);\n"
230
+ " can set 1..5, DEFAULT -p-1!\n"
231
+ #endif
232
+ #if (_IS_NEED_DIR_DIFF_PATCH)
233
+ " -C-checksumSets\n"
234
+ " set Checksum data for directory patch, DEFAULT -C-new-copy;\n"
235
+ " checksumSets support (can choose multiple):\n"
236
+ " -C-diff checksum diffFile;\n"
237
+ " -C-old checksum old reference files;\n"
238
+ " -C-new checksum new files edited from old reference files;\n"
239
+ " -C-copy checksum new files copy from old same files;\n"
240
+ " -C-no no checksum;\n"
241
+ " -C-all same as: -C-diff-old-new-copy;\n"
242
+ #endif
243
+ #if (_IS_NEED_VCDIFF)
244
+ " -C-no or -C-new\n"
245
+ " if diffFile is VCDIFF, then to close or open checksum, DEFAULT -C-new.\n"
246
+ #endif
247
+ #if (_IS_NEED_DIR_DIFF_PATCH)
248
+ " -n-maxOpenFileNumber\n"
249
+ " limit Number of open files at same time when stream directory patch;\n"
250
+ " maxOpenFileNumber>=8, DEFAULT -n-24, the best limit value by different\n"
251
+ " operating system.\n"
252
+ #endif
253
+ " -f Force overwrite, ignore write path already exists;\n"
254
+ " DEFAULT (no -f) not overwrite and then return error;\n"
255
+ " support oldPath outNewPath same path!(patch to tempPath and overwrite old)\n"
256
+ " if used -f and outNewPath is exist file:\n"
257
+ #if (_IS_NEED_DIR_DIFF_PATCH)
258
+ " if patch output file, will overwrite;\n"
259
+ #else
260
+ " will overwrite;\n"
261
+ #endif
262
+ #if (_IS_NEED_DIR_DIFF_PATCH)
263
+ " if patch output directory, will always return error;\n"
264
+ #endif
265
+ " if used -f and outNewPath is exist directory:\n"
266
+ #if (_IS_NEED_DIR_DIFF_PATCH)
267
+ " if patch output file, will always return error;\n"
268
+ #else
269
+ " will always return error;\n"
270
+ #endif
271
+ #if (_IS_NEED_DIR_DIFF_PATCH)
272
+ " if patch output directory, will overwrite, but not delete\n"
273
+ " needless existing files in directory.\n"
274
+ #endif
275
+ " -info\n"
276
+ " print infos of diffFile.\n"
277
+ " -v print Version info.\n"
278
+ );
279
+ printHelpInfo();
280
+ printf("\n");
281
+ }
282
+ #endif// _IS_NEED_CMDLINE
283
+
284
+ typedef enum THPatchResult {
285
+ HPATCH_SUCCESS=0,
286
+ HPATCH_OPTIONS_ERROR=1,
287
+ HPATCH_OPENREAD_ERROR,
288
+ HPATCH_OPENWRITE_ERROR,
289
+ HPATCH_FILEREAD_ERROR,
290
+ HPATCH_FILEWRITE_ERROR, // 5 //see 24
291
+ HPATCH_FILEDATA_ERROR,
292
+ HPATCH_FILECLOSE_ERROR,
293
+ HPATCH_MEM_ERROR, //see 22
294
+ HPATCH_HDIFFINFO_ERROR,
295
+ HPATCH_COMPRESSTYPE_ERROR, // 10
296
+ HPATCH_HPATCH_ERROR,
297
+ HPATCH_PATHTYPE_ERROR, //adding begin v3.0
298
+ HPATCH_TEMPPATH_ERROR,
299
+ HPATCH_DELETEPATH_ERROR,
300
+ HPATCH_RENAMEPATH_ERROR, // 15
301
+ HPATCH_SPATCH_ERROR,
302
+ HPATCH_BSPATCH_ERROR,
303
+ HPATCH_VCPATCH_ERROR,
304
+
305
+ HPATCH_DECOMPRESSER_OPEN_ERROR=20,
306
+ HPATCH_DECOMPRESSER_CLOSE_ERROR,
307
+ HPATCH_DECOMPRESSER_MEM_ERROR,
308
+ HPATCH_DECOMPRESSER_DECOMPRESS_ERROR,
309
+ HPATCH_FILEWRITE_NO_SPACE_ERROR,
310
+ HPATCH_MULTITHREAD_ERROR, // 25
311
+
312
+ #if (_IS_NEED_DIR_DIFF_PATCH)
313
+ DIRPATCH_DIRDIFFINFO_ERROR=101,
314
+ DIRPATCH_CHECKSUMTYPE_ERROR,
315
+ DIRPATCH_CHECKSUMSET_ERROR,
316
+ DIRPATCH_CHECKSUM_DIFFDATA_ERROR,
317
+ DIRPATCH_CHECKSUM_OLDDATA_ERROR, // 105
318
+ DIRPATCH_CHECKSUM_NEWDATA_ERROR,
319
+ DIRPATCH_CHECKSUM_COPYDATA_ERROR,
320
+ DIRPATCH_PATCH_ERROR,
321
+ DIRPATCH_LAOD_DIRDIFFDATA_ERROR,
322
+ DIRPATCH_OPEN_OLDPATH_ERROR, // 110
323
+ DIRPATCH_OPEN_NEWPATH_ERROR,
324
+ DIRPATCH_CLOSE_OLDPATH_ERROR,
325
+ DIRPATCH_CLOSE_NEWPATH_ERROR,
326
+ DIRPATCH_PATCHBEGIN_ERROR,
327
+ DIRPATCH_PATCHFINISH_ERROR, // 115
328
+ DIRPATCH_PATCH_FILE_ERROR,
329
+ #endif
330
+ #if (_IS_NEED_SFX)
331
+ HPATCH_CREATE_SFX_DIFFFILETYPE_ERROR=201,
332
+ HPATCH_CREATE_SFX_SFXTYPE_ERROR,
333
+ HPATCH_CREATE_SFX_EXECUTETAG_ERROR,
334
+ HPATCH_RUN_SFX_NOTSFX_ERROR,
335
+ HPATCH_RUN_SFX_DIFFOFFSERT_ERROR, // 205
336
+ #endif
337
+ } THPatchResult;
338
+ #if (_IS_NEED_MAIN && _IS_USED_MULTITHREAD)
339
+ static void _on_mt_error(){
340
+ exit(HPATCH_MULTITHREAD_ERROR);
341
+ }
342
+ #endif
343
+
344
+ int hpatch(const char* oldFileName,const char* diffFileName,const char* outNewFileName,
345
+ hpatch_BOOL isLoadOldAll,size_t patchCacheSize,hpatch_StreamPos_t diffDataOffert,
346
+ hpatch_StreamPos_t diffDataSize,hpatch_BOOL vcpatch_isChecksum,hpatch_BOOL vcpatch_isInMem,size_t threadNum);
347
+ #if (_IS_NEED_DIR_DIFF_PATCH)
348
+ int hpatch_dir(const char* oldPath,const char* diffFileName,const char* outNewPath,
349
+ hpatch_BOOL isLoadOldAll,size_t patchCacheSize,size_t kMaxOpenFileNumber,
350
+ TDirPatchChecksumSet* checksumSet,IHPatchDirListener* hlistener,
351
+ hpatch_StreamPos_t diffDataOffert,hpatch_StreamPos_t diffDataSize,size_t threadNum);
352
+ #endif
353
+ #if (_IS_NEED_SFX)
354
+ int createSfx(const char* selfExecuteFileName,const char* diffFileName,const char* out_sfxFileName);
355
+ hpatch_BOOL getDiffDataOffertInSfx(hpatch_StreamPos_t* out_diffDataOffert,hpatch_StreamPos_t* out_diffDataSize);
356
+ #endif
357
+
358
+ #if (_IS_NEED_MAIN)
359
+ int hpatch_cmd_line(int argc, const char * argv[]);
360
+ # if (_IS_USED_WIN32_UTF8_WAPI)
361
+ int wmain(int argc,wchar_t* argv_w[]){
362
+ char* argv_utf8[hpatch_kPathMaxSize*3/sizeof(char*)];
363
+ if (!_wFileNames_to_utf8((const wchar_t**)argv_w,argc,argv_utf8,sizeof(argv_utf8)))
364
+ return HPATCH_OPTIONS_ERROR;
365
+ SetDefaultStringLocale();
366
+ return hpatch_cmd_line(argc,(const char**)argv_utf8);
367
+ }
368
+ # else
369
+ int main(int argc, const char * argv[]){
370
+ return hpatch_cmd_line(argc,argv);
371
+ }
372
+ # endif
373
+ #endif
374
+
375
+ #if ((_IS_NEED_DIR_DIFF_PATCH)||(_IS_NEED_VCDIFF))
376
+ static hpatch_BOOL _toChecksumSet(const char* psets,TDirPatchChecksumSet* checksumSet){
377
+ while (hpatch_TRUE) {
378
+ const char* pend=findUntilEnd(psets,'-');
379
+ size_t len=(size_t)(pend-psets);
380
+ if (len==0) return hpatch_FALSE; //error no set
381
+ if ((len==3)&&(0==memcmp(psets,"new",len))){
382
+ checksumSet->isCheck_newRefData=hpatch_TRUE;
383
+ }else if ((len==3)&&(0==memcmp(psets,"all",len))){
384
+ checksumSet->isCheck_dirDiffData=hpatch_TRUE;
385
+ checksumSet->isCheck_oldRefData=hpatch_TRUE;
386
+ checksumSet->isCheck_newRefData=hpatch_TRUE;
387
+ checksumSet->isCheck_copyFileData=hpatch_TRUE;
388
+ }else if ((len==2)&&(0==memcmp(psets,"no",len))){
389
+ checksumSet->isCheck_dirDiffData=hpatch_FALSE;
390
+ checksumSet->isCheck_oldRefData=hpatch_FALSE;
391
+ checksumSet->isCheck_newRefData=hpatch_FALSE;
392
+ checksumSet->isCheck_copyFileData=hpatch_FALSE;
393
+ }else
394
+ #if (_IS_NEED_DIR_DIFF_PATCH)
395
+ if ((len==4)&&(0==memcmp(psets,"diff",len))){
396
+ checksumSet->isCheck_dirDiffData=hpatch_TRUE;
397
+ }else if ((len==3)&&(0==memcmp(psets,"old",len))){
398
+ checksumSet->isCheck_oldRefData=hpatch_TRUE;
399
+ }else if ((len==4)&&(0==memcmp(psets,"copy",len))){
400
+ checksumSet->isCheck_copyFileData=hpatch_TRUE;
401
+ }else
402
+ #endif
403
+ {
404
+ return hpatch_FALSE;//error unknow set
405
+ }
406
+ if (*pend=='\0')
407
+ return hpatch_TRUE; //ok
408
+ else
409
+ psets=pend+1;
410
+ }
411
+ }
412
+ #endif
413
+
414
+ #define _return_check(value,exitCode,errorInfo){ \
415
+ if (!(value)) { LOG_ERR(errorInfo " ERROR!\n"); return exitCode; } }
416
+
417
+ #define _options_check(value,errorInfo){ \
418
+ if (!(value)) { LOG_ERR("options " errorInfo " ERROR!\n\n"); \
419
+ printHelpInfo(); return HPATCH_OPTIONS_ERROR; } }
420
+
421
+ #define kPatchCacheSize_min (hpatch_kStreamCacheSize*8)
422
+ #define kPatchCacheSize_bestmin ((size_t)1<<21)
423
+ #define kPatchCacheSize_default ((size_t)1<<23)
424
+
425
+ #define _kNULL_VALUE (-1)
426
+ #define _kNULL_SIZE (~(size_t)0)
427
+
428
+ #define _THREAD_NUMBER_NULL _kNULL_SIZE
429
+ #define _THREAD_NUMBER_DEFUALT 1
430
+ #define _THREAD_NUMBER_MAX 5
431
+
432
+ #if (_IS_NEED_CMDLINE)
433
+ #define _isSwapToPatchTag(tag) (0==strcmp("--patch",tag))
434
+
435
+ int isSwapToPatchMode(int argc,const char* argv[]){
436
+ int i;
437
+ for (i=1;i<argc;++i){
438
+ if (_isSwapToPatchTag(argv[i]))
439
+ return hpatch_TRUE;
440
+ }
441
+ #if (_IS_NEED_SFX)
442
+ if (getDiffDataOffertInSfx(0,0))
443
+ return hpatch_TRUE;
444
+ #endif
445
+ return hpatch_FALSE;
446
+ }
447
+
448
+ int hpatch_cmd_line(int argc, const char * argv[]){
449
+ hpatch_BOOL isPrintFileInfo=_kNULL_VALUE;
450
+ hpatch_BOOL isLoadOldAll=_kNULL_VALUE;
451
+ hpatch_BOOL isForceOverwrite=_kNULL_VALUE;
452
+ hpatch_BOOL isOutputHelp=_kNULL_VALUE;
453
+ hpatch_BOOL isOutputVersion=_kNULL_VALUE;
454
+ hpatch_BOOL isOldPathInputEmpty=_kNULL_VALUE;
455
+ hpatch_BOOL isRunSFX=_kNULL_VALUE;
456
+ size_t threadNum=_THREAD_NUMBER_NULL;
457
+ #if (_IS_NEED_SFX)
458
+ const char* out_SFX=0;
459
+ const char* selfExecuteFile=0;
460
+ #endif
461
+ size_t patchCacheSize=0;
462
+ #if (_IS_NEED_DIR_DIFF_PATCH)
463
+ size_t kMaxOpenFileNumber=_kNULL_SIZE; //only used in stream dir patch
464
+ #endif
465
+ #if ((_IS_NEED_DIR_DIFF_PATCH)||(_IS_NEED_VCDIFF))
466
+ TDirPatchChecksumSet checksumSet={0,hpatch_FALSE,hpatch_TRUE,hpatch_TRUE,hpatch_FALSE}; //DEFAULT
467
+ #endif
468
+ hpatch_BOOL vcpatch_isChecksum=hpatch_TRUE;
469
+ #define kMax_arg_values_size 3
470
+ const char* arg_values[kMax_arg_values_size]={0};
471
+ int arg_values_size=0;
472
+ int i;
473
+ for (i=1; i<argc; ++i) {
474
+ const char* op=argv[i];
475
+ _options_check(op!=0,"?");
476
+ if (_isSwapToPatchTag(op))
477
+ continue;
478
+ if (op[0]!='-'){
479
+ hpatch_BOOL isEmpty=(strlen(op)==0);
480
+ _options_check(arg_values_size<kMax_arg_values_size,"input count");
481
+ if (isEmpty){
482
+ if (isOldPathInputEmpty==_kNULL_VALUE)
483
+ isOldPathInputEmpty=hpatch_TRUE;
484
+ else
485
+ _options_check(!isEmpty,"?"); //error return
486
+ }else{
487
+ if (isOldPathInputEmpty==_kNULL_VALUE)
488
+ isOldPathInputEmpty=hpatch_FALSE;
489
+ }
490
+ arg_values[arg_values_size]=op; //path: file or directory
491
+ ++arg_values_size;
492
+ continue;
493
+ }
494
+ _options_check((op!=0)&&(op[0]=='-'),"?");
495
+ switch (op[1]) {
496
+ case 'm':{
497
+ _options_check((isLoadOldAll==_kNULL_VALUE)&&(op[2]=='\0'),"-m");
498
+ isLoadOldAll=hpatch_TRUE;
499
+ } break;
500
+ case 's':{
501
+ _options_check((isLoadOldAll==_kNULL_VALUE)&&((op[2]=='-')||(op[2]=='\0')),"-s");
502
+ isLoadOldAll=hpatch_FALSE; //stream
503
+ if (op[2]=='-'){
504
+ const char* pnum=op+3;
505
+ _options_check(kmg_to_size(pnum,strlen(pnum),&patchCacheSize),"-s-?");
506
+ }else{
507
+ patchCacheSize=kPatchCacheSize_default;
508
+ }
509
+ } break;
510
+ #if (_IS_USED_MULTITHREAD)
511
+ case 'p':{
512
+ const char* pnum=op+3;
513
+ _options_check((threadNum==_THREAD_NUMBER_NULL)&&(op[2]=='-'),"-p-?");
514
+ _options_check(a_to_size(pnum,strlen(pnum),&threadNum),"-p-?");
515
+ } break;
516
+ #endif
517
+ #if (_IS_NEED_SFX)
518
+ case 'X':{
519
+ if (op[2]=='#'){
520
+ const char* pnum=op+3;
521
+ _options_check(out_SFX==0,"-X#?");
522
+ out_SFX=pnum;
523
+ _options_check(strlen(out_SFX)>0,"-X#?");
524
+ }else if (op[2]=='-'){
525
+ _options_check(selfExecuteFile==0,"-X-?");
526
+ if ((op[3]=='e')&&(op[4]=='x')&&(op[5]=='e')&&(op[6]=='#')){
527
+ selfExecuteFile=op+7;
528
+ _options_check(strlen(selfExecuteFile)>0,"-X-exe#?");
529
+ }else{
530
+ _options_check(hpatch_FALSE,"-X-?");
531
+ }
532
+ }else{
533
+ _options_check((isRunSFX==_kNULL_VALUE)&&(op[2]=='\0'),"-X");
534
+ isRunSFX=hpatch_TRUE;
535
+ }
536
+ } break;
537
+ #endif
538
+ case 'f':{
539
+ _options_check((isForceOverwrite==_kNULL_VALUE)&&(op[2]=='\0'),"-f");
540
+ isForceOverwrite=hpatch_TRUE;
541
+ } break;
542
+ #if ((_IS_NEED_DIR_DIFF_PATCH)||(_IS_NEED_VCDIFF))
543
+ case 'C':{
544
+ const char* psets=op+3;
545
+ _options_check((op[2]=='-'),"-C-?");
546
+ memset(&checksumSet,0,sizeof(checksumSet));//all set false
547
+ _options_check(_toChecksumSet(psets,&checksumSet),"-C-?");
548
+ } break;
549
+ #endif
550
+ #if (_IS_NEED_DIR_DIFF_PATCH)
551
+ case 'n':{
552
+ const char* pnum=op+3;
553
+ _options_check((kMaxOpenFileNumber==_kNULL_SIZE)&&(op[2]=='-'),"-n");
554
+ _options_check(kmg_to_size(pnum,strlen(pnum),&kMaxOpenFileNumber),"-n-?");
555
+ _options_check((kMaxOpenFileNumber!=_kNULL_SIZE),"-n-?");
556
+ } break;
557
+ #endif
558
+ case 'i':{
559
+ _options_check((isPrintFileInfo==_kNULL_VALUE)&&(op[2]=='n')&&(op[3]=='f')
560
+ &&(op[4]=='o')&&(op[5]=='\0'),"-info");
561
+ isPrintFileInfo=hpatch_TRUE;
562
+ } break;
563
+ case '?':
564
+ case 'h':{
565
+ _options_check((isOutputHelp==_kNULL_VALUE)&&(op[2]=='\0'),"-h");
566
+ isOutputHelp=hpatch_TRUE;
567
+ } break;
568
+ case 'v':{
569
+ _options_check((isOutputVersion==_kNULL_VALUE)&&(op[2]=='\0'),"-v");
570
+ isOutputVersion=hpatch_TRUE;
571
+ } break;
572
+ default: {
573
+ _options_check(hpatch_FALSE,"-?");
574
+ } break;
575
+ }//switch
576
+ }
577
+
578
+ if (isOutputHelp==_kNULL_VALUE)
579
+ isOutputHelp=hpatch_FALSE;
580
+ if (isOutputVersion==_kNULL_VALUE)
581
+ isOutputVersion=hpatch_FALSE;
582
+ if (isForceOverwrite==_kNULL_VALUE)
583
+ isForceOverwrite=hpatch_FALSE;
584
+ if (isPrintFileInfo==_kNULL_VALUE)
585
+ isPrintFileInfo=hpatch_FALSE;
586
+ if (isRunSFX==_kNULL_VALUE)
587
+ isRunSFX=hpatch_FALSE;
588
+ if (threadNum==_THREAD_NUMBER_NULL)
589
+ threadNum=_THREAD_NUMBER_DEFUALT;
590
+ #if (_IS_NEED_MAIN && _IS_USED_MULTITHREAD)
591
+ if (threadNum>1)
592
+ _parallel_import_c_on_error=_on_mt_error;
593
+ #endif
594
+ #if (_IS_NEED_SFX)
595
+ if ((argc<=1)&&(!isRunSFX)){
596
+ hpatch_StreamPos_t _diffDataOffert=0;
597
+ hpatch_StreamPos_t _diffDataSize=0;
598
+ if (getDiffDataOffertInSfx(&_diffDataOffert,&_diffDataSize)){//autoExtractSFX
599
+ isForceOverwrite=hpatch_TRUE;
600
+ isRunSFX=hpatch_TRUE;
601
+ }
602
+ }
603
+ #endif
604
+ if ((argc<=1)&&(!isRunSFX)){
605
+ printUsage();
606
+ return HPATCH_OPTIONS_ERROR;
607
+ }
608
+ if (isOutputHelp||isOutputVersion){
609
+ if (isOutputHelp)
610
+ printUsage();//with version
611
+ else
612
+ printVersion();
613
+ #if (_IS_NEED_SFX)
614
+ if ((arg_values_size==0)&&(!isRunSFX)&&(out_SFX==0)&&(selfExecuteFile==0))
615
+ #else
616
+ if (arg_values_size==0)
617
+ #endif
618
+ return 0; //ok
619
+ }
620
+ if (isPrintFileInfo){
621
+ return hpatch_printFilesInfos(arg_values_size,arg_values);
622
+ }
623
+ #if (_IS_NEED_DIR_DIFF_PATCH)
624
+ if (kMaxOpenFileNumber==_kNULL_SIZE)
625
+ kMaxOpenFileNumber=kMaxOpenFileNumber_default_patch;
626
+ if (kMaxOpenFileNumber<kMaxOpenFileNumber_default_min)
627
+ kMaxOpenFileNumber=kMaxOpenFileNumber_default_min;
628
+ #endif
629
+ #if (_IS_NEED_VCDIFF)
630
+ vcpatch_isChecksum=checksumSet.isCheck_newRefData;
631
+ #endif
632
+
633
+ if (isLoadOldAll==_kNULL_VALUE){
634
+ isLoadOldAll=hpatch_FALSE;
635
+ patchCacheSize=kPatchCacheSize_default;
636
+ }
637
+ if (isOldPathInputEmpty==_kNULL_VALUE)
638
+ isOldPathInputEmpty=hpatch_FALSE;
639
+
640
+ #if (_IS_NEED_SFX)
641
+ if ((out_SFX!=0)||(selfExecuteFile!=0)){ //create SFX
642
+ _options_check(out_SFX!=0,"-X#?");
643
+ _options_check(!isRunSFX, "-X");
644
+ _options_check(arg_values_size==1,"-X# input count");
645
+ {
646
+ const char* diffFileName =arg_values[0];
647
+ if (selfExecuteFile==0) selfExecuteFile=argv[0];
648
+ if (!isForceOverwrite){
649
+ hpatch_TPathType outPathType;
650
+ _return_check(hpatch_getPathStat(out_SFX,&outPathType,0),
651
+ HPATCH_PATHTYPE_ERROR,"get outSelfExtractArchive type");
652
+ _return_check(outPathType==kPathType_notExist,
653
+ HPATCH_PATHTYPE_ERROR,"outSelfExtractArchive already exists, overwrite");
654
+ }
655
+ return createSfx(selfExecuteFile,diffFileName,out_SFX);
656
+ }
657
+ }else if (isRunSFX){//patch run as SFX mode
658
+ _options_check((arg_values_size==2)||(arg_values_size==0),"-X input count");
659
+ }else
660
+ #endif
661
+ {//patch default mode
662
+ _options_check(arg_values_size==3,"input count");
663
+ }
664
+ {//patch
665
+ const char* oldPath =0;
666
+ const char* diffFileName=0;
667
+ const char* outNewPath =0;
668
+ #if (_IS_NEED_SFX)
669
+ hpatch_BOOL isSfxDefaultPath=hpatch_FALSE;
670
+ const char* kSFX_emptyPath="";
671
+ #endif
672
+ #if (_IS_NEED_DIR_DIFF_PATCH)
673
+ TDirDiffInfo dirDiffInfo;
674
+ hpatch_BOOL isOutDir;
675
+ #endif
676
+ hpatch_BOOL isSamePath;
677
+ hpatch_StreamPos_t diffDataOffert=0;
678
+ hpatch_StreamPos_t diffDataSize=0;
679
+ #if (_IS_NEED_SFX)
680
+ if (isRunSFX){
681
+ printf("run as SFX mode!\n");
682
+ _return_check(getDiffDataOffertInSfx(&diffDataOffert,&diffDataSize),
683
+ HPATCH_RUN_SFX_NOTSFX_ERROR,"not found diff data in selfExecuteFile");
684
+ diffFileName=argv[0];//selfExecuteFileName
685
+ if (arg_values_size==0){//autoExtractSFX
686
+ oldPath =kSFX_emptyPath;
687
+ outNewPath =kSFX_curDefaultPath;
688
+ isSfxDefaultPath=hpatch_TRUE;
689
+ }else{
690
+ oldPath =arg_values[0];
691
+ outNewPath =arg_values[1];
692
+ }
693
+ //continue
694
+ }else
695
+ #endif
696
+ {
697
+ oldPath =arg_values[0];
698
+ diffFileName=arg_values[1];
699
+ outNewPath =arg_values[2];
700
+ }
701
+
702
+ _return_check(!hpatch_getIsSamePath(oldPath,diffFileName),
703
+ HPATCH_PATHTYPE_ERROR,"oldPath diffFile same path");
704
+ _return_check(!hpatch_getIsSamePath(outNewPath,diffFileName),
705
+ HPATCH_PATHTYPE_ERROR,"outNewPath diffFile same path");
706
+ if (!isForceOverwrite){
707
+ hpatch_TPathType outNewPathType;
708
+ _return_check(hpatch_getPathStat(outNewPath,&outNewPathType,0),
709
+ HPATCH_PATHTYPE_ERROR,"get outNewPath type");
710
+ _return_check(outNewPathType==kPathType_notExist,
711
+ HPATCH_PATHTYPE_ERROR,"outNewPath already exists, overwrite");
712
+ }
713
+ #if (_IS_NEED_DIR_DIFF_PATCH)
714
+ _return_check(getDirDiffInfoByFile(&dirDiffInfo,diffFileName,diffDataOffert,diffDataSize),
715
+ HPATCH_OPENREAD_ERROR,"input diffFile open read");
716
+ isOutDir=(dirDiffInfo.isDirDiff)&&(dirDiffInfo.newPathIsDir);
717
+ #if (_IS_NEED_SFX)
718
+ if (isSfxDefaultPath && (dirDiffInfo.isDirDiff&&dirDiffInfo.oldPathIsDir))
719
+ oldPath=kSFX_curDefaultPath;
720
+ #endif
721
+ #endif
722
+ isSamePath=hpatch_getIsSamePath(oldPath,outNewPath);
723
+ if (isSamePath)
724
+ _return_check(isForceOverwrite,HPATCH_PATHTYPE_ERROR,"oldPath outNewPath same path, overwrite");
725
+ if (!isSamePath){ // out new file or new dir
726
+ #if (_IS_NEED_DIR_DIFF_PATCH)
727
+ if (dirDiffInfo.isDirDiff){
728
+ return hpatch_dir(oldPath,diffFileName,outNewPath,isLoadOldAll,patchCacheSize,kMaxOpenFileNumber,
729
+ &checksumSet,&defaultPatchDirlistener,diffDataOffert,diffDataSize,threadNum);
730
+ }else
731
+ #endif
732
+ {
733
+ return hpatch(oldPath,diffFileName,outNewPath,isLoadOldAll,
734
+ patchCacheSize,diffDataOffert,diffDataSize,vcpatch_isChecksum,hpatch_TRUE,threadNum);
735
+ }
736
+ }else
737
+ #if (_IS_NEED_DIR_DIFF_PATCH)
738
+ if (!isOutDir)
739
+ #endif
740
+ { // isSamePath==true and out to file
741
+ int result;
742
+ char newTempName[hpatch_kPathMaxSize];
743
+ #if (_IS_NEED_DIR_DIFF_PATCH)
744
+ if (dirDiffInfo.isDirDiff)
745
+ _return_check(!dirDiffInfo.oldPathIsDir,
746
+ HPATCH_PATHTYPE_ERROR,"can not use file overwrite oldDirectory");
747
+ #endif
748
+ // 1. patch to newTempName
749
+ // 2. if patch ok then { delelte oldPath; rename newTempName to oldPath; }
750
+ // if patch error then { delelte newTempName; }
751
+ _return_check(hpatch_getTempPathName(outNewPath,newTempName,newTempName+hpatch_kPathMaxSize),
752
+ HPATCH_TEMPPATH_ERROR,"getTempPathName(outNewPath)");
753
+ printf("NOTE: outNewPath temp file will be rename to oldPath name after patch!\n");
754
+ #if (_IS_NEED_DIR_DIFF_PATCH)
755
+ if (dirDiffInfo.isDirDiff){
756
+ result=hpatch_dir(oldPath,diffFileName,newTempName,isLoadOldAll,patchCacheSize,
757
+ kMaxOpenFileNumber,&checksumSet,&defaultPatchDirlistener,
758
+ diffDataOffert,diffDataSize,threadNum);
759
+ }else
760
+ #endif
761
+ {
762
+ result=hpatch(oldPath,diffFileName,newTempName,isLoadOldAll,
763
+ patchCacheSize,diffDataOffert,diffDataSize,vcpatch_isChecksum,hpatch_TRUE,threadNum);
764
+ }
765
+ if (result==HPATCH_SUCCESS){
766
+ _return_check(hpatch_removeFile(oldPath),
767
+ HPATCH_DELETEPATH_ERROR,"removeFile(oldPath)");
768
+ _return_check(hpatch_renamePath(newTempName,oldPath),
769
+ HPATCH_RENAMEPATH_ERROR,"renamePath(temp,oldPath)");
770
+ printf("outNewPath temp file renamed to oldPath name!\n");
771
+ }else{//patch error
772
+ if (!hpatch_removeFile(newTempName)){
773
+ printf("WARNING: can't remove temp file \"");
774
+ _log_info_utf8(newTempName); printf("\"\n");
775
+ }
776
+ }
777
+ return result;
778
+ }
779
+ #if (_IS_NEED_DIR_DIFF_PATCH)
780
+ else{ // isDirDiff==true isSamePath==true and out to dir
781
+ int result;
782
+ char newTempDir[hpatch_kPathMaxSize];
783
+ assert(dirDiffInfo.isDirDiff);
784
+ _return_check(dirDiffInfo.oldPathIsDir,
785
+ HPATCH_PATHTYPE_ERROR,"can not use directory overwrite oldFile");
786
+ _return_check(hpatch_getTempPathName(outNewPath,newTempDir,newTempDir+hpatch_kPathMaxSize),
787
+ HPATCH_TEMPPATH_ERROR,"getTempPathName(outNewPath)");
788
+ printf("NOTE: all in outNewPath temp directory will be move to oldDirectory after patch!\n");
789
+ result=hpatch_dir(oldPath,diffFileName,newTempDir,isLoadOldAll,patchCacheSize,kMaxOpenFileNumber,
790
+ &checksumSet,&tempDirPatchListener,diffDataOffert,diffDataSize,threadNum);
791
+ if (result==HPATCH_SUCCESS){
792
+ printf("all in outNewPath temp directory moved to oldDirectory!\n");
793
+ }else if(!hpatch_isPathNotExist(newTempDir)){
794
+ printf("WARNING: not remove temp directory \"");
795
+ _log_info_utf8(newTempDir); printf("\"\n");
796
+ }
797
+ return result;
798
+ }
799
+ #endif
800
+ }
801
+ }
802
+ #endif //_IS_NEED_CMDLINE
803
+
804
+ #define check_on_error(errorType) { \
805
+ if (result==HPATCH_SUCCESS) result=errorType; if (!_isInClear){ goto clear; } }
806
+ #define check(value,errorType,errorInfo) { \
807
+ if (!(value)){ LOG_ERR(errorInfo " ERROR!\n"); check_on_error(errorType); } }
808
+
809
+ #if (_HPATCH_IS_USED_errno)
810
+ # define check_ferr(fileError,errorType,errorInfo){ \
811
+ if (fileError){ \
812
+ result=HPATCH_SUCCESS; \
813
+ if (ENOSPC==(fileError)){ \
814
+ check(hpatch_FALSE,HPATCH_FILEWRITE_NO_SPACE_ERROR,errorInfo); \
815
+ }else{ \
816
+ check(hpatch_FALSE,errorType,errorInfo); } } }
817
+ #else
818
+ # define check_ferr(fileError,errorType,errorInfo) { \
819
+ if (fileError) { result=HPATCH_SUCCESS; check(hpatch_FALSE,errorType,errorInfo); } }
820
+ #endif
821
+
822
+ #define check_dec(decError) { \
823
+ switch (decError){ \
824
+ case hpatch_dec_ok: break; \
825
+ case hpatch_dec_mem_error: check(0,HPATCH_DECOMPRESSER_MEM_ERROR,"decompressPlugin alloc memory"); \
826
+ case hpatch_dec_open_error: check(0,HPATCH_DECOMPRESSER_OPEN_ERROR,"decompressPlugin open"); \
827
+ case hpatch_dec_close_error: check(0,HPATCH_DECOMPRESSER_CLOSE_ERROR,"decompressPlugin close"); \
828
+ default: { assert(decError==hpatch_dec_error); \
829
+ check(0,HPATCH_DECOMPRESSER_DECOMPRESS_ERROR,"decompressPlugin decompress"); } break; \
830
+ } }
831
+
832
+ #define _try_rt_dec(dec) { if (dec.is_can_open(compressType)) return &dec; }
833
+
834
+ static const hpatch_TDecompress* __find_decompressPlugin(const char* compressType){
835
+ #if ((defined(_CompressPlugin_ldef))&&_IS_NEED_decompressor_ldef_replace_zlib)
836
+ _try_rt_dec(ldefDecompressPlugin);
837
+ #else
838
+ # ifdef _CompressPlugin_zlib
839
+ _try_rt_dec(zlibDecompressPlugin);
840
+ # endif
841
+ #endif
842
+ #ifdef _CompressPlugin_bz2
843
+ _try_rt_dec(bz2DecompressPlugin);
844
+ #endif
845
+ #ifdef _CompressPlugin_lzma
846
+ _try_rt_dec(lzmaDecompressPlugin);
847
+ #endif
848
+ #ifdef _CompressPlugin_lzma2
849
+ _try_rt_dec(lzma2DecompressPlugin);
850
+ #endif
851
+ #if (defined(_CompressPlugin_lz4) || (defined(_CompressPlugin_lz4hc)))
852
+ _try_rt_dec(lz4DecompressPlugin);
853
+ #endif
854
+ #ifdef _CompressPlugin_zstd
855
+ _try_rt_dec(zstdDecompressPlugin);
856
+ #endif
857
+ #ifdef _CompressPlugin_brotli
858
+ _try_rt_dec(brotliDecompressPlugin);
859
+ #endif
860
+ #ifdef _CompressPlugin_lzham
861
+ _try_rt_dec(lzhamDecompressPlugin);
862
+ #endif
863
+ #ifdef _CompressPlugin_tuz
864
+ _try_rt_dec(tuzDecompressPlugin);
865
+ #endif
866
+ return 0;
867
+ }
868
+
869
+
870
+ #if (_IS_NEED_VCDIFF)
871
+ static hpatch_BOOL getVcDiffDecompressPlugin(hpatch_TDecompress* out_decompressPlugin,
872
+ const hpatch_VcDiffInfo* vcdInfo,char* out_compressType){
873
+ const hpatch_TDecompress* decompressPlugin=0;
874
+
875
+ out_compressType[0]='\0';
876
+ memset(out_decompressPlugin,0,sizeof(*out_decompressPlugin));
877
+ switch (vcdInfo->compressorID){
878
+ case 0: return hpatch_TRUE;
879
+ #ifdef _CompressPlugin_7zXZ
880
+ case kVcDiff_compressorID_7zXZ:{
881
+ static const char* _7zXZCompressType="7zXZ";
882
+ _init_CompressPlugin_7zXZ();
883
+ if (vcdInfo->isHDiffzAppHead_a)
884
+ decompressPlugin=&_7zXZDecompressPlugin_a;
885
+ else
886
+ decompressPlugin=&_7zXZDecompressPlugin;
887
+ memcpy(out_compressType,_7zXZCompressType,strlen(_7zXZCompressType)+1);
888
+ } break;
889
+ #endif
890
+ default: return hpatch_FALSE; //now unsupport
891
+ }
892
+ if (decompressPlugin){
893
+ *out_decompressPlugin=*decompressPlugin;
894
+ out_decompressPlugin->decError=hpatch_dec_ok;
895
+ }
896
+ return hpatch_TRUE;
897
+ }
898
+ #endif
899
+
900
+ static hpatch_BOOL getDecompressPlugin(const hpatch_compressedDiffInfo* diffInfo,
901
+ hpatch_TDecompress* out_decompressPlugin){
902
+ const hpatch_TDecompress* decompressPlugin=0;
903
+ memset(out_decompressPlugin,0,sizeof(*out_decompressPlugin));
904
+ if (diffInfo->compressedCount>0){
905
+ decompressPlugin=__find_decompressPlugin(diffInfo->compressType);
906
+ if ((0==decompressPlugin)||(decompressPlugin->open==0)) return hpatch_FALSE; //error
907
+ }
908
+ if (decompressPlugin){
909
+ *out_decompressPlugin=*decompressPlugin;
910
+ out_decompressPlugin->decError=hpatch_dec_ok;
911
+ }
912
+ return hpatch_TRUE;
913
+ }
914
+
915
+ #if (_IS_NEED_DIR_DIFF_PATCH)
916
+ static hpatch_inline
917
+ hpatch_BOOL _trySetChecksum(hpatch_TChecksum** out_checksumPlugin,const char* checksumType,
918
+ hpatch_TChecksum* testChecksumPlugin){
919
+ assert(0==*out_checksumPlugin);
920
+ if (0!=strcmp(checksumType,testChecksumPlugin->checksumType())) return hpatch_FALSE;
921
+ *out_checksumPlugin=testChecksumPlugin;
922
+ return hpatch_TRUE;
923
+ }
924
+ #define __setChecksum(_checksumPlugin) \
925
+ if (_trySetChecksum(out_checksumPlugin,checksumType,_checksumPlugin)) return hpatch_TRUE;
926
+
927
+ static hpatch_BOOL findChecksum(hpatch_TChecksum** out_checksumPlugin,const char* checksumType){
928
+ *out_checksumPlugin=0;
929
+ if (strlen(checksumType)==0) return hpatch_TRUE;
930
+ #ifdef _ChecksumPlugin_fadler64
931
+ __setChecksum(&fadler64ChecksumPlugin);
932
+ #endif
933
+ #ifdef _ChecksumPlugin_xxh128
934
+ __setChecksum(&xxh128ChecksumPlugin);
935
+ #endif
936
+ #ifdef _ChecksumPlugin_xxh3
937
+ __setChecksum(&xxh3ChecksumPlugin);
938
+ #endif
939
+ #ifdef _ChecksumPlugin_md5
940
+ __setChecksum(&md5ChecksumPlugin);
941
+ #endif
942
+ #ifdef _ChecksumPlugin_crc32
943
+ __setChecksum(&crc32ChecksumPlugin);
944
+ #endif
945
+ #ifdef _ChecksumPlugin_adler32
946
+ __setChecksum(&adler32ChecksumPlugin);
947
+ #endif
948
+ #ifdef _ChecksumPlugin_adler64
949
+ __setChecksum(&adler64ChecksumPlugin);
950
+ #endif
951
+ #ifdef _ChecksumPlugin_fadler32
952
+ __setChecksum(&fadler32ChecksumPlugin);
953
+ #endif
954
+ #ifdef _ChecksumPlugin_fadler128
955
+ __setChecksum(&fadler128ChecksumPlugin);
956
+ #endif
957
+ #ifdef _ChecksumPlugin_blake3
958
+ __setChecksum(&blake3ChecksumPlugin);
959
+ #endif
960
+ return hpatch_FALSE;
961
+ }
962
+ #endif
963
+
964
+
965
+ typedef struct _THDiffInfos{
966
+ hpatch_BOOL isSingleCompressedDiff;
967
+ hpatch_BOOL isBsDiff;
968
+ hpatch_BOOL isVcDiff;
969
+ hpatch_compressedDiffInfo diffInfo;
970
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
971
+ hpatch_singleCompressedDiffInfo sdiffInfo;
972
+ #endif
973
+ #if (_IS_NEED_BSDIFF)
974
+ hpatch_BsDiffInfo bsdiffInfo;
975
+ #endif
976
+ #if (_IS_NEED_VCDIFF)
977
+ hpatch_VcDiffInfo vcdiffInfo;
978
+ #endif
979
+ hpatch_TDecompress _decompressPlugin;
980
+ } _THDiffInfos;
981
+
982
+ #define _kUnavailableSize hpatch_kNullStreamPos
983
+
984
+ static int _getHDiffInfos(_THDiffInfos* out_diffInfos,const hpatch_TFileStreamInput* diffData){
985
+ int result=HPATCH_SUCCESS;
986
+ int _isInClear=hpatch_FALSE;
987
+ hpatch_TDecompress* decompressPlugin=&out_diffInfos->_decompressPlugin;
988
+ hpatch_compressedDiffInfo* diffInfo=&out_diffInfos->diffInfo;
989
+ if (getCompressedDiffInfo(diffInfo,&diffData->base)){
990
+ check(diffInfo->oldDataSize!=_kUnavailableSize,HPATCH_HDIFFINFO_ERROR,"saved oldDataSize");
991
+ }else{
992
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
993
+ if (getSingleCompressedDiffInfo(&out_diffInfos->sdiffInfo,&diffData->base,0)){
994
+ out_diffInfos->isSingleCompressedDiff=hpatch_TRUE;
995
+ _singleDiffInfoToHDiffInfo(diffInfo,&out_diffInfos->sdiffInfo);
996
+ check(diffInfo->oldDataSize!=_kUnavailableSize,HPATCH_HDIFFINFO_ERROR,"saved oldDataSize");
997
+ }else
998
+ #endif
999
+ #if (_IS_NEED_BSDIFF)
1000
+ if (getBsDiffInfo(&out_diffInfos->bsdiffInfo,&diffData->base)){
1001
+ const char* bsCompressType="bz2";
1002
+ *decompressPlugin=_bz2DecompressPlugin_unsz;
1003
+ decompressPlugin->decError=hpatch_dec_ok;
1004
+ memcpy(diffInfo->compressType,bsCompressType,strlen(bsCompressType)+1);
1005
+ diffInfo->compressedCount=out_diffInfos->bsdiffInfo.isEndsleyBsdiff?1:3;
1006
+ diffInfo->newDataSize=out_diffInfos->bsdiffInfo.newDataSize;
1007
+ diffInfo->oldDataSize=_kUnavailableSize; //not saved oldDataSize
1008
+ out_diffInfos->isBsDiff=hpatch_TRUE;
1009
+ }else
1010
+ #endif
1011
+ #if (_IS_NEED_VCDIFF)
1012
+ if (getVcDiffInfo(&out_diffInfos->vcdiffInfo,&diffData->base,hpatch_TRUE)){
1013
+ diffInfo->newDataSize=out_diffInfos->vcdiffInfo.sumTargetWindowsSize;
1014
+ diffInfo->oldDataSize=_kUnavailableSize; //not saved oldDataSize
1015
+ out_diffInfos->isVcDiff=hpatch_TRUE;
1016
+ if (getVcDiffDecompressPlugin(decompressPlugin,&out_diffInfos->vcdiffInfo,out_diffInfos->diffInfo.compressType)){
1017
+ if (decompressPlugin->open) out_diffInfos->diffInfo.compressedCount=3;
1018
+ else diffInfo->compressedCount=0;
1019
+ }else{
1020
+ LOG_ERR("can not decompress VCDIFF compressID \"%d\" data ERROR!\n",out_diffInfos->vcdiffInfo.compressorID);
1021
+ check_on_error(HPATCH_COMPRESSTYPE_ERROR);
1022
+ }
1023
+ }else
1024
+ #endif
1025
+ check(hpatch_FALSE,HPATCH_HDIFFINFO_ERROR,"is hdiff file? get diffInfo");
1026
+ }
1027
+ if (decompressPlugin->open==0){
1028
+ if (getDecompressPlugin(diffInfo,decompressPlugin)){
1029
+ }else{
1030
+ LOG_ERR("can not decompress \"%s\" data ERROR!\n",out_diffInfos->diffInfo.compressType);
1031
+ check_on_error(HPATCH_COMPRESSTYPE_ERROR);
1032
+ }
1033
+ }
1034
+ clear:
1035
+ _isInClear=hpatch_TRUE;
1036
+ check(!diffData->fileError,HPATCH_FILEREAD_ERROR,"read file");
1037
+ return result;
1038
+ }
1039
+
1040
+ static void _printHDiffInfos(const _THDiffInfos* diffInfos,hpatch_BOOL isInDirDiff){
1041
+ const hpatch_compressedDiffInfo* diffInfo=&diffInfos->diffInfo;
1042
+ {
1043
+ const char* typeTag="HDiff";
1044
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1045
+ if (diffInfos->isSingleCompressedDiff) typeTag="SHDiff";
1046
+ #endif
1047
+ #if (_IS_NEED_BSDIFF)
1048
+ if (diffInfos->isBsDiff){
1049
+ if (diffInfos->bsdiffInfo.isEndsleyBsdiff)
1050
+ typeTag="BSDiff (endsley/bsdiff)";
1051
+ else
1052
+ typeTag="BSDiff";
1053
+ }
1054
+ #endif
1055
+ #if (_IS_NEED_VCDIFF)
1056
+ if (diffInfos->isVcDiff){
1057
+ if (diffInfos->vcdiffInfo.isHDiffzAppHead_a)
1058
+ typeTag="VCDiff (with hdiffz tag)";
1059
+ else if (diffInfos->vcdiffInfo.isGoogleVersion)
1060
+ typeTag="VCDiff (with google tag)";
1061
+ else
1062
+ typeTag="VCDiff";
1063
+ }
1064
+ #endif
1065
+ printf(" diffDataType: %s %s\n",typeTag,isInDirDiff?"(in DirHDiff)":"");
1066
+ }
1067
+ if (diffInfo->oldDataSize==_kUnavailableSize)
1068
+ printf(" saved oldDataSize: unavailable\n");
1069
+ else
1070
+ printf(" saved oldDataSize: %" PRIu64 "\n",diffInfo->oldDataSize);
1071
+ printf(" saved newDataSize: %" PRIu64 "\n",diffInfo->newDataSize);
1072
+ printf(" compressType: \"%s\" (need decompress %d)\n",diffInfo->compressType,diffInfo->compressedCount);
1073
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1074
+ if (diffInfos->isSingleCompressedDiff)
1075
+ printf(" stepMemSize: %" PRIu64 "\n",diffInfos->sdiffInfo.stepMemSize);
1076
+ #endif
1077
+ #if (_IS_NEED_VCDIFF)
1078
+ if (diffInfos->isVcDiff){
1079
+ printf(" maxSrcWindows: %" PRIu64 "\n",diffInfos->vcdiffInfo.maxSrcWindowsSize);
1080
+ printf(" maxTargetWindows: %" PRIu64 "\n",diffInfos->vcdiffInfo.maxTargetWindowsSize);
1081
+ }
1082
+ #endif
1083
+ }
1084
+
1085
+
1086
+ #if (_IS_NEED_CMDLINE)
1087
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1088
+ #include "dirDiffPatch/dir_patch/dir_patch_private.h"
1089
+
1090
+ static void _printDirDiffInfos(const TDirDiffInfo* dirDiffInfo,const _TDirDiffHead* head){
1091
+ if (!dirDiffInfo->isDirDiff) return;
1092
+ printf(" diffDataType: DirHDiff\n");
1093
+ printf(" checksumType: \"%s\"\n",dirDiffInfo->checksumType);
1094
+ printf(" oldPathIsDir: %s\n",dirDiffInfo->oldPathIsDir?"true":"false");
1095
+ printf(" newPathIsDir: %s\n",dirDiffInfo->newPathIsDir?"true":"false");
1096
+ printf(" new path count: %" PRIu64 " (fileCount:%" PRIu64 ")\n",
1097
+ (hpatch_StreamPos_t)head->newPathCount,(hpatch_StreamPos_t)(head->sameFilePairCount+head->newRefFileCount));
1098
+ printf(" copy from old count: %" PRIu64 " (copySize: %" PRIu64 ")\n",
1099
+ (hpatch_StreamPos_t)head->sameFilePairCount,head->sameFileSize);
1100
+ printf(" ref old file count: %" PRIu64 " (oldRefSize: %" PRIu64 ")\n",
1101
+ (hpatch_StreamPos_t)head->oldRefFileCount,dirDiffInfo->hdiffInfo.oldDataSize);
1102
+ printf(" ref new file count: %" PRIu64 " (newRefSize: %" PRIu64 ")\n",
1103
+ (hpatch_StreamPos_t)head->newRefFileCount,dirDiffInfo->hdiffInfo.newDataSize);
1104
+ printf(" oldSumSize: %" PRIu64 "\n",dirDiffInfo->hdiffInfo.oldDataSize+head->sameFileSize);
1105
+ printf(" newSumSize: %" PRIu64 "\n",dirDiffInfo->hdiffInfo.newDataSize+head->sameFileSize);
1106
+
1107
+ {//hdiffInfo
1108
+ _THDiffInfos diffInfos={0};
1109
+ diffInfos.diffInfo=dirDiffInfo->hdiffInfo;
1110
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1111
+ if (dirDiffInfo->isSingleCompressedDiff){
1112
+ diffInfos.isSingleCompressedDiff=dirDiffInfo->isSingleCompressedDiff;
1113
+ diffInfos.sdiffInfo=dirDiffInfo->sdiffInfo;
1114
+ }
1115
+ #endif
1116
+ _printHDiffInfos(&diffInfos,hpatch_TRUE);
1117
+ }
1118
+ }
1119
+
1120
+ #endif
1121
+
1122
+ static int _printFileInfos(const char* fileName,const char* fileTag){
1123
+ int result=HPATCH_SUCCESS;
1124
+ int _isInClear=hpatch_FALSE;
1125
+ hpatch_BOOL isDirDiff=hpatch_FALSE;
1126
+ hpatch_TFileStreamInput diffData;
1127
+ hpatch_TFileStreamInput_init(&diffData);
1128
+ {//open
1129
+ printf("%sName: \"",fileTag); _log_info_utf8(fileName); printf("\"\n");
1130
+ check(hpatch_TFileStreamInput_open(&diffData,fileName),
1131
+ HPATCH_OPENREAD_ERROR,"open file for read");
1132
+ printf("%sSize: %" PRIu64 "\n",fileTag,diffData.base.streamSize);
1133
+ }
1134
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1135
+ {
1136
+ TDirDiffInfo dirDiffInfo={0};
1137
+ _TDirDiffHead dirHead={0};
1138
+ if (read_dirdiff_head(&dirDiffInfo,&dirHead,&diffData.base))
1139
+ isDirDiff=dirDiffInfo.isDirDiff;
1140
+ check(!diffData.fileError,HPATCH_FILEREAD_ERROR,"read file");
1141
+ if (isDirDiff)
1142
+ _printDirDiffInfos(&dirDiffInfo,&dirHead);
1143
+ }
1144
+ #endif
1145
+ if (!isDirDiff){
1146
+ _THDiffInfos diffInfos={0};
1147
+ result=_getHDiffInfos(&diffInfos,&diffData);
1148
+ if ((result!=HPATCH_SUCCESS)&&(result!=HPATCH_COMPRESSTYPE_ERROR))
1149
+ check_on_error(result);
1150
+ _printHDiffInfos(&diffInfos,isDirDiff);
1151
+ }
1152
+
1153
+ clear:
1154
+ _isInClear=hpatch_TRUE;
1155
+ check(hpatch_TFileStreamInput_close(&diffData),HPATCH_FILECLOSE_ERROR,"file close");
1156
+ return result;
1157
+ }
1158
+
1159
+ int hpatch_printFilesInfos(int fileCount,const char* fileNames[]){
1160
+ int i;
1161
+ int result=0;
1162
+ for (i=0;i<fileCount;++i){
1163
+ if (i>0) printf("\n");
1164
+ int ret=_printFileInfos(fileNames[i],"file");
1165
+ if (result==0) result=ret;
1166
+ }
1167
+ if (fileCount==0)
1168
+ printf("please input diffFile for print it's infos\n");
1169
+ return result;
1170
+ }
1171
+ #endif //_IS_NEED_CMDLINE
1172
+
1173
+
1174
+ #define _free_mem(p) { if (p) { free(p); p=0; } }
1175
+
1176
+ static TByte* getPatchMemCache(hpatch_BOOL isLoadOldAll,size_t patchCacheSize,size_t mustAppendMemSize,
1177
+ hpatch_StreamPos_t oldDataSize,size_t* out_memCacheSize){
1178
+ TByte* temp_cache=0;
1179
+ size_t temp_cache_size;
1180
+ {
1181
+ hpatch_StreamPos_t limitCacheSize;
1182
+ const hpatch_StreamPos_t bestMaxCacheSize=oldDataSize+kPatchCacheSize_bestmin;
1183
+ if (isLoadOldAll){
1184
+ limitCacheSize=bestMaxCacheSize;
1185
+ }else{
1186
+ limitCacheSize=(patchCacheSize<kPatchCacheSize_min)?kPatchCacheSize_min:patchCacheSize;
1187
+ limitCacheSize=(limitCacheSize<bestMaxCacheSize)?limitCacheSize:bestMaxCacheSize;
1188
+ }
1189
+ if (limitCacheSize>(size_t)(_kNULL_SIZE-mustAppendMemSize))//too large
1190
+ limitCacheSize=(size_t)(_kNULL_SIZE-mustAppendMemSize);
1191
+ temp_cache_size=(size_t)limitCacheSize;
1192
+ }
1193
+ while (temp_cache_size>=kPatchCacheSize_min){
1194
+ temp_cache=(TByte*)malloc(mustAppendMemSize+temp_cache_size);
1195
+ if (temp_cache) break;
1196
+ temp_cache_size>>=1;
1197
+ }
1198
+ *out_memCacheSize=(temp_cache)?(mustAppendMemSize+temp_cache_size):0;
1199
+ return temp_cache;
1200
+ }
1201
+
1202
+ #if (_IS_NEED_PRINT_PROGRESS)
1203
+ typedef struct hpatch_TProgressStreamOutput{
1204
+ hpatch_TStreamOutput base;
1205
+ const hpatch_TStreamOutput* streamOutput;
1206
+ double time0;
1207
+ double progressR;
1208
+ unsigned int progress;
1209
+ } hpatch_TProgressStreamOutput;
1210
+ static void _progressStreamOutput_updateProgress(hpatch_TProgressStreamOutput* self,hpatch_StreamPos_t curPos){
1211
+ unsigned int progress=(unsigned int)((curPos*self->progressR)*1000+0.5);
1212
+ progress=((progress<1000)&(((curPos<self->base.streamSize))))?progress:1000;
1213
+ if (progress!=self->progress){
1214
+ double time1=clock_s();
1215
+ hpatch_BOOL isEnd=(progress==1000);
1216
+ if ((time1>=self->time0+1.0/3)|isEnd){
1217
+ const char* progressStr="=============================="; //strlen==30
1218
+ self->progress=progress;
1219
+ self->time0=time1;
1220
+ printf("\r patch progress: [%-30s] %.1f%% %s",
1221
+ progressStr+((1000-progress)*30/1000),progress*0.1,isEnd?"\n":"");
1222
+ fflush(stdout);
1223
+ }
1224
+ }
1225
+ }
1226
+ static hpatch_BOOL _progressStreamOutput_read_writed(const struct hpatch_TStreamOutput* stream,hpatch_StreamPos_t readFromPos,
1227
+ unsigned char* out_data,unsigned char* out_data_end){
1228
+ hpatch_TProgressStreamOutput* self=(hpatch_TProgressStreamOutput*)stream->streamImport;
1229
+ return self->streamOutput->read_writed(self->streamOutput,readFromPos,out_data,out_data_end);
1230
+ }
1231
+ static hpatch_BOOL _progressStreamOutput_write(const struct hpatch_TStreamOutput* stream,hpatch_StreamPos_t writeToPos,
1232
+ const unsigned char* data,const unsigned char* data_end){
1233
+ hpatch_TProgressStreamOutput* self=(hpatch_TProgressStreamOutput*)stream->streamImport;
1234
+ hpatch_BOOL result=self->streamOutput->write(self->streamOutput,writeToPos,data,data_end);
1235
+ if (result) _progressStreamOutput_updateProgress(self,writeToPos+(hpatch_size_t)(data_end-data));
1236
+ return result;
1237
+ }
1238
+
1239
+ static const hpatch_TStreamOutput* _progressStreamInput_wrapper(hpatch_TProgressStreamOutput* self,const hpatch_TStreamOutput* streamOutput){
1240
+ memset(self,0,sizeof(*self));
1241
+ if (!hpatch_getIsAtty(stdout))
1242
+ return streamOutput; //when stdout redirected to a file, not show progress
1243
+ self->base.streamImport=self;
1244
+ self->base.streamSize=streamOutput->streamSize;
1245
+ self->base.write=_progressStreamOutput_write;
1246
+ self->base.read_writed=streamOutput->read_writed?_progressStreamOutput_read_writed:0;
1247
+ self->streamOutput=streamOutput;
1248
+ self->progress=-1;
1249
+ self->progressR=1.0/(streamOutput->streamSize?streamOutput->streamSize:1);
1250
+ _progressStreamOutput_updateProgress(self,0);
1251
+ return &self->base;
1252
+ }
1253
+ #endif //_IS_NEED_PRINT_PROGRESS
1254
+
1255
+ int hpatch(const char* oldFileName,const char* diffFileName,const char* outNewFileName,
1256
+ hpatch_BOOL isLoadOldAll,size_t patchCacheSize,hpatch_StreamPos_t diffDataOffert,
1257
+ hpatch_StreamPos_t diffDataSize,hpatch_BOOL vcpatch_isChecksum,hpatch_BOOL vcpatch_isInMem,size_t threadNum){
1258
+ int result=HPATCH_SUCCESS;
1259
+ int _isInClear=hpatch_FALSE;
1260
+ double time0=clock_s();
1261
+ _THDiffInfos diffInfos={0};
1262
+ hpatch_TDecompress* decompressPlugin=&diffInfos._decompressPlugin;
1263
+ hpatch_TFileStreamOutput newData;
1264
+ hpatch_TFileStreamInput diffData;
1265
+ hpatch_TFileStreamInput oldData;
1266
+ const hpatch_TStreamInput* poldData=&oldData.base;
1267
+ const hpatch_TStreamOutput* pnewData=&newData.base;
1268
+ TByte* temp_cache=0;
1269
+ size_t temp_cache_size;
1270
+ int patch_result=HPATCH_SUCCESS;
1271
+ #if (_IS_NEED_PRINT_PROGRESS)
1272
+ hpatch_TProgressStreamOutput _progressStreamOutput;
1273
+ #endif
1274
+ hpatch_TFileStreamInput_init(&oldData);
1275
+ hpatch_TFileStreamInput_init(&diffData);
1276
+ hpatch_TFileStreamOutput_init(&newData);
1277
+ {//open
1278
+ printf( "old : \""); if (oldFileName) _log_info_utf8(oldFileName);
1279
+ printf("\"\ndiff: \""); _log_info_utf8(diffFileName);
1280
+ printf("\"\nout : \""); _log_info_utf8(outNewFileName);
1281
+ printf("\"\n");
1282
+ if ((0==oldFileName)||(0==strlen(oldFileName))){
1283
+ mem_as_hStreamInput(&oldData.base,0,0);
1284
+ }else{
1285
+ check(hpatch_TFileStreamInput_open(&oldData,oldFileName),
1286
+ HPATCH_OPENREAD_ERROR,"open oldFile for read");
1287
+ }
1288
+ check(hpatch_TFileStreamInput_open(&diffData,diffFileName),
1289
+ HPATCH_OPENREAD_ERROR,"open diffFile for read");
1290
+ #if (_IS_NEED_SFX)
1291
+ if (diffDataOffert>0){ //run sfx
1292
+ check(hpatch_TFileStreamInput_setOffset(&diffData,diffDataOffert),
1293
+ HPATCH_RUN_SFX_DIFFOFFSERT_ERROR,"readed sfx diffFile offset");
1294
+ check(diffData.base.streamSize>=diffDataSize,
1295
+ HPATCH_RUN_SFX_DIFFOFFSERT_ERROR,"readed sfx diffFile size");
1296
+ diffData.base.streamSize=diffDataSize;
1297
+ }
1298
+ #endif
1299
+ }
1300
+ printf(" input oldDataSize: %" PRIu64 "\n",poldData->streamSize);
1301
+ printf(" diffDataSize: %" PRIu64 "\n",diffData.base.streamSize);
1302
+
1303
+ {//info
1304
+ int ret=_getHDiffInfos(&diffInfos,&diffData);
1305
+ #if (_IS_NEED_PRINT_LOG)
1306
+ if ((ret!=HPATCH_SUCCESS)&&(ret!=HPATCH_COMPRESSTYPE_ERROR))
1307
+ check_on_error(ret);
1308
+ _printHDiffInfos(&diffInfos,hpatch_FALSE);
1309
+ printf("\n");
1310
+ #endif
1311
+ if (ret!=HPATCH_SUCCESS)
1312
+ check_on_error(ret);
1313
+ }
1314
+ if (decompressPlugin->open==0) decompressPlugin=0;
1315
+ if ((poldData->streamSize!=diffInfos.diffInfo.oldDataSize)&&(diffInfos.diffInfo.oldDataSize!=_kUnavailableSize)){
1316
+ LOG_ERR("input oldFile oldDataSize %" PRIu64 " != diffFile saved oldDataSize %" PRIu64 " ERROR!\n",
1317
+ poldData->streamSize,diffInfos.diffInfo.oldDataSize);
1318
+ check_on_error(HPATCH_FILEDATA_ERROR);
1319
+ }
1320
+
1321
+ check(hpatch_TFileStreamOutput_open(&newData, outNewFileName,diffInfos.diffInfo.newDataSize),
1322
+ HPATCH_OPENWRITE_ERROR,"open out newFile for write");
1323
+ #if (_IS_NEED_VCDIFF)
1324
+ if (diffInfos.isVcDiff) hpatch_TFileStreamOutput_setRandomOut(&newData,hpatch_TRUE);
1325
+ #endif
1326
+ {
1327
+ hpatch_StreamPos_t maxWindowSize=poldData->streamSize;
1328
+ hpatch_size_t mustAppendMemSize=0;
1329
+ #if (_IS_NEED_VCDIFF)
1330
+ if (diffInfos.isVcDiff){
1331
+ hpatch_StreamPos_t maxSrcTargetSize=diffInfos.vcdiffInfo.maxSrcWindowsSize+diffInfos.vcdiffInfo.maxTargetWindowsSize;
1332
+ maxWindowSize=((!diffInfos.vcdiffInfo.isHDiffzAppHead_a)&&(maxSrcTargetSize<=maxWindowSize+64*(1<<20)))?
1333
+ maxSrcTargetSize:diffInfos.vcdiffInfo.maxSrcWindowsSize;
1334
+ if ((vcpatch_isInMem)&&(!diffInfos.vcdiffInfo.isHDiffzAppHead_a))
1335
+ isLoadOldAll=hpatch_TRUE;
1336
+ }
1337
+ #endif
1338
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1339
+ if (diffInfos.isSingleCompressedDiff){
1340
+ check(diffInfos.sdiffInfo.stepMemSize==(size_t)diffInfos.sdiffInfo.stepMemSize,HPATCH_MEM_ERROR,"stepMemSize too large");
1341
+ mustAppendMemSize=(size_t)diffInfos.sdiffInfo.stepMemSize;
1342
+ }
1343
+ #endif
1344
+ temp_cache=getPatchMemCache(isLoadOldAll,patchCacheSize,mustAppendMemSize,maxWindowSize, &temp_cache_size);
1345
+ }
1346
+ check(temp_cache,HPATCH_MEM_ERROR,"alloc cache memory");
1347
+ #if (_IS_NEED_PRINT_PROGRESS)
1348
+ pnewData=_progressStreamInput_wrapper(&_progressStreamOutput,pnewData);
1349
+ #endif
1350
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1351
+ if (diffInfos.isSingleCompressedDiff){
1352
+ check(temp_cache_size>=diffInfos.sdiffInfo.stepMemSize+hpatch_kStreamCacheSize*3,HPATCH_MEM_ERROR,"alloc cache memory");
1353
+ if (!patch_single_compressed_diff(pnewData,poldData,&diffData.base,diffInfos.sdiffInfo.diffDataPos,
1354
+ diffInfos.sdiffInfo.uncompressedSize,diffInfos.sdiffInfo.compressedSize,decompressPlugin,
1355
+ diffInfos.sdiffInfo.coverCount,(size_t)diffInfos.sdiffInfo.stepMemSize,
1356
+ temp_cache,temp_cache+temp_cache_size,0,threadNum))
1357
+ patch_result=HPATCH_SPATCH_ERROR;
1358
+ }else
1359
+ #endif
1360
+ #if (_IS_NEED_BSDIFF)
1361
+ if (diffInfos.isBsDiff){
1362
+ if (!bspatch_with_cache(pnewData,poldData,&diffData.base,decompressPlugin,
1363
+ temp_cache,temp_cache+temp_cache_size))
1364
+ patch_result=HPATCH_BSPATCH_ERROR;
1365
+ }else
1366
+ #endif
1367
+ #if (_IS_NEED_VCDIFF)
1368
+ if (diffInfos.isVcDiff){
1369
+ if (!vcpatch_with_cache(pnewData,poldData,&diffData.base,decompressPlugin,
1370
+ vcpatch_isChecksum,temp_cache,temp_cache+temp_cache_size))
1371
+ patch_result=HPATCH_VCPATCH_ERROR;
1372
+ }else
1373
+ #endif
1374
+ {
1375
+ if (!patch_decompress_with_cache(pnewData,poldData,&diffData.base,decompressPlugin,
1376
+ temp_cache,temp_cache+temp_cache_size))
1377
+ patch_result=HPATCH_HPATCH_ERROR;
1378
+ }
1379
+ if (patch_result!=HPATCH_SUCCESS){
1380
+ check(!oldData.fileError,HPATCH_FILEREAD_ERROR,"oldFile read");
1381
+ check(!diffData.fileError,HPATCH_FILEREAD_ERROR,"diffFile read");
1382
+ check_ferr(newData.fileError,HPATCH_FILEWRITE_ERROR,"out newFile write");
1383
+ if (decompressPlugin) check_dec(decompressPlugin->decError);
1384
+ check(hpatch_FALSE,patch_result,"patch run");
1385
+ }
1386
+ if (newData.out_length!=newData.base.streamSize){
1387
+ LOG_ERR("out newFile dataSize %" PRIu64 " != diffFile saved newDataSize %" PRIu64 " ERROR!\n",
1388
+ newData.out_length,newData.base.streamSize);
1389
+ check_on_error(HPATCH_FILEDATA_ERROR);
1390
+ }
1391
+ printf(" patch ok!\n");
1392
+
1393
+ clear:
1394
+ _isInClear=hpatch_TRUE;
1395
+ check(hpatch_TFileStreamOutput_close(&newData),HPATCH_FILECLOSE_ERROR,"out newFile close");
1396
+ check(hpatch_TFileStreamInput_close(&diffData),HPATCH_FILECLOSE_ERROR,"diffFile close");
1397
+ check(hpatch_TFileStreamInput_close(&oldData),HPATCH_FILECLOSE_ERROR,"oldFile close");
1398
+ _free_mem(temp_cache);
1399
+ printf("\nhpatchz time: %.3f s\n",(clock_s()-time0));
1400
+ return result;
1401
+ }
1402
+
1403
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1404
+ int hpatch_dir(const char* oldPath,const char* diffFileName,const char* outNewPath,
1405
+ hpatch_BOOL isLoadOldAll,size_t patchCacheSize,size_t kMaxOpenFileNumber,
1406
+ TDirPatchChecksumSet* checksumSet,IHPatchDirListener* hlistener,
1407
+ hpatch_StreamPos_t diffDataOffert,hpatch_StreamPos_t diffDataSize,size_t threadNum){
1408
+ int result=HPATCH_SUCCESS;
1409
+ int _isInClear=hpatch_FALSE;
1410
+ double time0=clock_s();
1411
+ hpatch_TFileStreamInput diffData;
1412
+ TDirPatcher dirPatcher;
1413
+ const TDirDiffInfo* dirDiffInfo=0;
1414
+ TByte* p_temp_mem=0;
1415
+ TByte* temp_cache=0;
1416
+ size_t temp_cache_size;
1417
+ size_t min_temp_cache_size=kPatchCacheSize_min;
1418
+ hpatch_TDecompress _decompressPlugin={0};
1419
+ const hpatch_TStreamInput* oldStream=0;
1420
+ const hpatch_TStreamOutput* newStream=0;
1421
+ #if (_IS_NEED_PRINT_PROGRESS)
1422
+ hpatch_TProgressStreamOutput _progressStreamOutput;
1423
+ #endif
1424
+ hpatch_TFileStreamInput_init(&diffData);
1425
+ TDirPatcher_init(&dirPatcher);
1426
+ if (oldPath) assert(0!=strcmp(oldPath,outNewPath));
1427
+ {//dir diff info
1428
+ hpatch_BOOL rt;
1429
+ hpatch_TPathType oldType;
1430
+ if ((0==oldPath)||(0==strlen(oldPath))){
1431
+ oldType=kPathType_file; //as empty file
1432
+ }else{
1433
+ check(hpatch_getPathStat(oldPath,&oldType,0),HPATCH_PATHTYPE_ERROR,"get oldPath type");
1434
+ check((oldType!=kPathType_notExist),HPATCH_PATHTYPE_ERROR,"oldPath not exist");
1435
+ }
1436
+ check(hpatch_TFileStreamInput_open(&diffData,diffFileName),HPATCH_OPENREAD_ERROR,"open diffFile for read");
1437
+ #if (_IS_NEED_SFX)
1438
+ if (diffDataOffert>0){ //run sfx
1439
+ check(hpatch_TFileStreamInput_setOffset(&diffData,diffDataOffert),
1440
+ HPATCH_RUN_SFX_DIFFOFFSERT_ERROR,"readed sfx diffFile offset");
1441
+ check(diffData.base.streamSize>=diffDataSize,
1442
+ HPATCH_RUN_SFX_DIFFOFFSERT_ERROR,"readed sfx diffFile size");
1443
+ diffData.base.streamSize=diffDataSize;
1444
+ }
1445
+ #endif
1446
+ rt=TDirPatcher_open(&dirPatcher,&diffData.base,&dirDiffInfo);
1447
+ if((!rt)||(!dirDiffInfo->isDirDiff)){
1448
+ check(!diffData.fileError,HPATCH_FILEREAD_ERROR,"read diffFile");
1449
+ check(hpatch_FALSE,DIRPATCH_DIRDIFFINFO_ERROR,"is hdiff file? get dir diff info");
1450
+ }
1451
+ if (dirDiffInfo->oldPathIsDir){
1452
+ check(kPathType_dir==oldType,HPATCH_PATHTYPE_ERROR,"input old path need dir");
1453
+ }else{
1454
+ check(kPathType_file==oldType,HPATCH_PATHTYPE_ERROR,"input old path need file");
1455
+ }
1456
+ printf( dirDiffInfo->oldPathIsDir?"old dir: \"":"old file: \"");
1457
+ if (oldPath) _log_info_utf8(oldPath);
1458
+ if ((oldPath)&&dirDiffInfo->oldPathIsDir&&(!hpatch_getIsDirName(oldPath)))
1459
+ printf("%c",kPatch_dirSeparator);
1460
+ printf( "\"\ndiffFile: \"");
1461
+ _log_info_utf8(diffFileName);
1462
+ printf(dirDiffInfo->newPathIsDir?"\"\nout dir: \"":"\"\nout file: \"");
1463
+ _log_info_utf8(outNewPath);
1464
+ if (dirDiffInfo->newPathIsDir&&(!hpatch_getIsDirName(outNewPath))) printf("%c",kPatch_dirSeparator);
1465
+ printf("\"\n");
1466
+ printf(" diffDataSize: %" PRIu64 "\n",diffData.base.streamSize);
1467
+ #if (_IS_NEED_PRINT_LOG)
1468
+ _printDirDiffInfos(dirDiffInfo,&dirPatcher.dirDiffHead);
1469
+ printf("\n");
1470
+ #endif
1471
+ }
1472
+ {//decompressPlugin
1473
+ hpatch_TDecompress* decompressPlugin=&_decompressPlugin;
1474
+ hpatch_compressedDiffInfo hdiffInfo;
1475
+ hdiffInfo=dirDiffInfo->hdiffInfo;
1476
+ hdiffInfo.compressedCount+=(dirDiffInfo->dirDataIsCompressed)?1:0;
1477
+ if(!getDecompressPlugin(&hdiffInfo,decompressPlugin)){
1478
+ LOG_ERR("can not decompress \"%s\" data ERROR!\n",hdiffInfo.compressType);
1479
+ check_on_error(HPATCH_COMPRESSTYPE_ERROR);
1480
+ }
1481
+ if (decompressPlugin->open==0) decompressPlugin=0;
1482
+ //load dir data
1483
+ check(TDirPatcher_loadDirData(&dirPatcher,decompressPlugin,oldPath,outNewPath),
1484
+ DIRPATCH_LAOD_DIRDIFFDATA_ERROR,"load dir data in diffFile");
1485
+ }
1486
+ check(hlistener->patchBegin(hlistener,&dirPatcher),
1487
+ DIRPATCH_PATCHBEGIN_ERROR,"dir patch begin");
1488
+ {//mem cache
1489
+ size_t mustAppendMemSize=0;
1490
+ #if (_IS_NEED_SINGLE_STREAM_DIFF)
1491
+ if (dirDiffInfo->isSingleCompressedDiff){
1492
+ mustAppendMemSize+=(size_t)dirDiffInfo->sdiffInfo.stepMemSize;
1493
+ min_temp_cache_size+=(size_t)dirDiffInfo->sdiffInfo.stepMemSize;
1494
+ }
1495
+ #endif
1496
+ p_temp_mem=getPatchMemCache(isLoadOldAll,patchCacheSize,mustAppendMemSize,
1497
+ dirDiffInfo->hdiffInfo.oldDataSize, &temp_cache_size);
1498
+ check(p_temp_mem,HPATCH_MEM_ERROR,"alloc cache memory");
1499
+ temp_cache=p_temp_mem;
1500
+ }
1501
+ {// checksumPlugin
1502
+ int wantChecksumCount = checksumSet->isCheck_dirDiffData+checksumSet->isCheck_oldRefData+
1503
+ checksumSet->isCheck_newRefData+checksumSet->isCheck_copyFileData;
1504
+ assert(checksumSet->checksumPlugin==0);
1505
+ if (wantChecksumCount>0){
1506
+ if (strlen(dirDiffInfo->checksumType)==0){
1507
+ memset(checksumSet,0,sizeof(*checksumSet));
1508
+ printf(" WARNING: no checksum saved in diffFile,can not do checksum\n");
1509
+ }else{
1510
+ if (!findChecksum(&checksumSet->checksumPlugin,dirDiffInfo->checksumType)){
1511
+ LOG_ERR("not found checksumType \"%s\" ERROR!\n",dirDiffInfo->checksumType);
1512
+ check_on_error(DIRPATCH_CHECKSUMTYPE_ERROR);
1513
+ }
1514
+ printf("hpatchz run with checksum plugin: \"%s\" (checksumSets:%s%s%s%s)\n\n",dirDiffInfo->checksumType,
1515
+ checksumSet->isCheck_dirDiffData?" diff":"",checksumSet->isCheck_oldRefData?" old":"",
1516
+ checksumSet->isCheck_newRefData?" new":"",checksumSet->isCheck_copyFileData?" copy":"");
1517
+ if (!TDirPatcher_checksum(&dirPatcher,checksumSet,temp_cache,temp_cache+temp_cache_size)){
1518
+ check(!TDirPatcher_isDiffDataChecksumError(&dirPatcher),
1519
+ DIRPATCH_CHECKSUM_DIFFDATA_ERROR,"diffFile checksum");
1520
+ check(hpatch_FALSE,DIRPATCH_CHECKSUMSET_ERROR,"diffFile set checksum");
1521
+ }
1522
+ }
1523
+ }
1524
+ }
1525
+
1526
+ {//old data
1527
+ if (temp_cache_size>=dirDiffInfo->hdiffInfo.oldDataSize+min_temp_cache_size){
1528
+ // all old while auto cache by patch; not need open old files at same time
1529
+ kMaxOpenFileNumber=kMaxOpenFileNumber_limit_min;
1530
+ }
1531
+ check(TDirPatcher_openOldRefAsStream(&dirPatcher,kMaxOpenFileNumber,&oldStream),
1532
+ DIRPATCH_OPEN_OLDPATH_ERROR,"open oldFile");
1533
+ }
1534
+ {//new data
1535
+ check(TDirPatcher_openNewDirAsStream(&dirPatcher,&hlistener->base,&newStream),
1536
+ DIRPATCH_OPEN_NEWPATH_ERROR,"open newFile");
1537
+ }
1538
+ #if (_IS_NEED_PRINT_PROGRESS)
1539
+ newStream=_progressStreamInput_wrapper(&_progressStreamOutput,newStream);
1540
+ #endif
1541
+ //patch
1542
+ if(!TDirPatcher_patch(&dirPatcher,newStream,oldStream,temp_cache,temp_cache+temp_cache_size,threadNum)){
1543
+ check_dec(_decompressPlugin.decError);
1544
+ check(!TDirPatcher_isOldRefDataChecksumError(&dirPatcher),
1545
+ DIRPATCH_CHECKSUM_OLDDATA_ERROR,"oldFile checksum");
1546
+ check(!TDirPatcher_isCopyDataChecksumError(&dirPatcher),
1547
+ DIRPATCH_CHECKSUM_COPYDATA_ERROR,"copyOldFile checksum");
1548
+ check(!TDirPatcher_isNewRefDataChecksumError(&dirPatcher),
1549
+ DIRPATCH_CHECKSUM_NEWDATA_ERROR,"newFile checksum");
1550
+ check(hpatch_FALSE,DIRPATCH_PATCH_ERROR,"dir patch run");
1551
+ }
1552
+ printf(" patch ok!\n");
1553
+ clear:
1554
+ _isInClear=hpatch_TRUE;
1555
+ check(hlistener->patchFinish(hlistener,result==HPATCH_SUCCESS),DIRPATCH_PATCHFINISH_ERROR,"dir patch finish");
1556
+ check(TDirPatcher_closeNewDirStream(&dirPatcher),DIRPATCH_CLOSE_NEWPATH_ERROR,"newPath close");
1557
+ check(TDirPatcher_closeOldRefStream(&dirPatcher),DIRPATCH_CLOSE_OLDPATH_ERROR,"oldPath close");
1558
+ TDirPatcher_close(&dirPatcher);
1559
+ check_ferr(dirPatcher.fileError,DIRPATCH_PATCH_FILE_ERROR,"dir patch file");
1560
+ check_ferr(hlistener->fileError,DIRPATCH_PATCH_FILE_ERROR,"dir patch file");
1561
+ check(hpatch_TFileStreamInput_close(&diffData),HPATCH_FILECLOSE_ERROR,"diffFile close");
1562
+ _free_mem(p_temp_mem);
1563
+ printf("\nhpatchz dir patch time: %.3f s\n",(clock_s()-time0));
1564
+ return result;
1565
+ }
1566
+ #endif
1567
+
1568
+ #if (_IS_NEED_SFX)
1569
+ #define _sfx_guid_size 16
1570
+ #define _sfx_guid_node_size (_sfx_guid_size+sizeof(hpatch_uint32_t)+sizeof(hpatch_uint64_t))
1571
+ //_sfx_guid_node:{fd6c3a9d-1498-4a5d-a9d5-7303a82fd08e-ffffffff-ffffffffffffffff}
1572
+ TByte _sfx_guid_node[_sfx_guid_node_size]={
1573
+ 0xfd,0x6c,0x3a,0x9d,
1574
+ 0x14,0x98,
1575
+ 0x4a,0x5d,
1576
+ 0xa9,0xd5,
1577
+ 0x73,0x03,0xa8,0x2f,0xd0,0x8e,
1578
+ 0xff,0xff,0xff,0xff, // saved diffDataOffert , selfExecute fileSize < 4GB
1579
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; // diffDataSize
1580
+
1581
+ static TByte* _search(TByte* src,TByte* src_end,const TByte* sub,const TByte* sub_end){
1582
+ size_t sub_len=(size_t)(sub_end-sub);
1583
+ TByte* search_last=src_end-sub_len;
1584
+ TByte c0;
1585
+ if (sub_len==0) return src;
1586
+ if ((size_t)(src_end-src)<sub_len) return src_end;
1587
+ c0=*sub;
1588
+ for (;src<=search_last;++src) {
1589
+ if (c0!=*src){
1590
+ continue;
1591
+ }else{
1592
+ hpatch_BOOL is_eq=hpatch_TRUE;
1593
+ size_t i;
1594
+ for (i=1; i<sub_len;++i) {
1595
+ if (sub[i]!=src[i]){
1596
+ is_eq=hpatch_FALSE;
1597
+ break;
1598
+ }
1599
+ }
1600
+ if (!is_eq)
1601
+ continue;
1602
+ else
1603
+ return src;
1604
+ }
1605
+ }
1606
+ return src_end;
1607
+ }
1608
+
1609
+ static int createSfx_notCheckDiffFile_byStream(const hpatch_TStreamInput* selfExecute,
1610
+ const hpatch_TStreamInput* diffData,
1611
+ const hpatch_TStreamOutput* out_sfxData){
1612
+ int result=HPATCH_SUCCESS;
1613
+ int _isInClear=hpatch_FALSE;
1614
+ TByte* buf=0;
1615
+ TByte* pmem=0;
1616
+ hpatch_StreamPos_t writePos=0;
1617
+ hpatch_BOOL isFoundGuid=hpatch_FALSE;
1618
+ const hpatch_StreamPos_t diffDataOffert=selfExecute->streamSize;
1619
+ const hpatch_StreamPos_t diffDataSize=diffData->streamSize;
1620
+ {//mem
1621
+ pmem=(TByte*)malloc(_sfx_guid_node_size+hpatch_kFileIOBufBetterSize);
1622
+ check(pmem!=0,HPATCH_MEM_ERROR,"createSfx() malloc");
1623
+ memset(pmem,0,_sfx_guid_node_size);
1624
+ buf=pmem+_sfx_guid_node_size; // [ _sfx_guid_node_size | hpatch_kFileIOBufBetterSize ]
1625
+ }
1626
+ {//copy exe ,find guid pos and write diffDataOffset
1627
+ const hpatch_uint32_t dataSize=(hpatch_uint32_t)(selfExecute->streamSize);
1628
+ hpatch_StreamPos_t readPos=0;
1629
+ check(dataSize==selfExecute->streamSize,
1630
+ HPATCH_CREATE_SFX_SFXTYPE_ERROR,"createSfx() selfExecute fileSize");
1631
+ while (readPos < dataSize) {
1632
+ TByte* wbuf=0;
1633
+ const TByte* wbuf_end=0;
1634
+ TByte* rbuf_end=0;
1635
+ size_t readLen=hpatch_kFileIOBufBetterSize;
1636
+ if (readLen+readPos > dataSize)
1637
+ readLen=(size_t)(dataSize - readPos);
1638
+ rbuf_end=buf+readLen;
1639
+ check(selfExecute->read(selfExecute,readPos,buf,rbuf_end),
1640
+ HPATCH_FILEREAD_ERROR,"createSfx() read selfExecute");
1641
+ wbuf=(readPos!=0)?pmem:buf;
1642
+ if (!isFoundGuid){ //find in [wbuf..rbuf_end)
1643
+ TByte* pos=_search(wbuf,rbuf_end,_sfx_guid_node,_sfx_guid_node+_sfx_guid_node_size);
1644
+ if (pos!=rbuf_end){
1645
+ size_t i;
1646
+ isFoundGuid=hpatch_TRUE;
1647
+ for (i=0; i<sizeof(hpatch_uint32_t); ++i){
1648
+ size_t di=_sfx_guid_size+i;
1649
+ assert(pos[di]==0xff);
1650
+ pos[di]=(TByte)(diffDataOffert>>(8*i));
1651
+ }
1652
+ for (i=0; i<sizeof(hpatch_uint64_t); ++i){
1653
+ size_t di=_sfx_guid_size+sizeof(hpatch_uint32_t)+i;
1654
+ assert(pos[di]==0xff);
1655
+ pos[di]=(TByte)(diffDataSize>>(8*i));
1656
+ }
1657
+ }
1658
+ }
1659
+ wbuf_end=(readPos+readLen<dataSize)?(rbuf_end-_sfx_guid_node_size):rbuf_end;
1660
+ check(out_sfxData->write(out_sfxData,writePos,wbuf,wbuf_end),
1661
+ HPATCH_FILEWRITE_ERROR,"createSfx() write sfxData");
1662
+ memcpy(pmem,rbuf_end-_sfx_guid_node_size,_sfx_guid_node_size);
1663
+ readPos+=readLen;
1664
+ writePos+=(size_t)(wbuf_end-wbuf);
1665
+ }
1666
+ }
1667
+ assert(writePos==diffDataOffert);
1668
+ check(isFoundGuid,HPATCH_CREATE_SFX_SFXTYPE_ERROR,"createSfx() selfExecute type");
1669
+ {//copy diffData
1670
+ const hpatch_StreamPos_t dataSize=diffData->streamSize;
1671
+ hpatch_StreamPos_t readPos=0;
1672
+ while (readPos < dataSize) {
1673
+ size_t readLen=hpatch_kFileIOBufBetterSize;
1674
+ if (readLen+readPos > dataSize)
1675
+ readLen=(size_t)(dataSize - readPos);
1676
+ check(diffData->read(diffData,readPos,buf,buf+readLen),
1677
+ HPATCH_FILEREAD_ERROR,"createSfx() read diffData");
1678
+ check(out_sfxData->write(out_sfxData,writePos,buf,buf+readLen),
1679
+ HPATCH_FILEWRITE_ERROR,"createSfx() write sfxData");
1680
+ readPos+=readLen;
1681
+ writePos+=readLen;
1682
+ }
1683
+ }
1684
+ clear:
1685
+ _isInClear=hpatch_TRUE;
1686
+ _free_mem(pmem);
1687
+ return result;
1688
+ }
1689
+
1690
+ int createSfx_notCheckDiffFile(const char* selfExecuteFileName,const char* diffFileName,
1691
+ const char* out_sfxFileName){
1692
+ int result=HPATCH_SUCCESS;
1693
+ int _isInClear=hpatch_FALSE;
1694
+ hpatch_TFileStreamInput exeData;
1695
+ hpatch_TFileStreamInput diffData;
1696
+ hpatch_TFileStreamOutput out_sfxData;
1697
+ hpatch_TFileStreamInput_init(&exeData);
1698
+ hpatch_TFileStreamInput_init(&diffData);
1699
+ hpatch_TFileStreamOutput_init(&out_sfxData);
1700
+ printf( "selfExecute: \""); _log_info_utf8(selfExecuteFileName);
1701
+ printf("\"\ndiffFile : \""); _log_info_utf8(diffFileName);
1702
+ printf("\"\nout sfxFile: \""); _log_info_utf8(out_sfxFileName);
1703
+ printf("\"\n\n");
1704
+ {//open
1705
+ hpatch_StreamPos_t sfxFileLength=0;
1706
+ check(hpatch_TFileStreamInput_open(&exeData,selfExecuteFileName),
1707
+ HPATCH_OPENREAD_ERROR,"createSfx() open selfExecuteFile read");
1708
+ sfxFileLength+=exeData.base.streamSize;
1709
+ check(hpatch_TFileStreamInput_open(&diffData,diffFileName),
1710
+ HPATCH_OPENREAD_ERROR,"createSfx() open diffFileName read");
1711
+ sfxFileLength+=diffData.base.streamSize;
1712
+ check(hpatch_TFileStreamOutput_open(&out_sfxData,out_sfxFileName,sfxFileLength),
1713
+ HPATCH_OPENWRITE_ERROR,"createSfx() open sfxFile write");
1714
+ }
1715
+ result=createSfx_notCheckDiffFile_byStream(&exeData.base,&diffData.base,&out_sfxData.base);
1716
+ if (result!=HPATCH_SUCCESS) check_on_error(result);
1717
+ assert(out_sfxData.base.streamSize==out_sfxData.out_length);
1718
+ check(hpatch_TFileStreamOutput_close(&out_sfxData),HPATCH_FILECLOSE_ERROR,"createSfx() out sfxFile close");
1719
+ printf("sfxFileSize: %" PRIu64 "\n",out_sfxData.base.streamSize);
1720
+ if (hpatch_getIsExecuteFile(selfExecuteFileName)){
1721
+ check(hpatch_setIsExecuteFile(out_sfxFileName),
1722
+ HPATCH_CREATE_SFX_EXECUTETAG_ERROR,"createSfx() set sfxFile Execute tag");
1723
+ }
1724
+ printf("out sfxFile ok!\n");
1725
+ clear:
1726
+ _isInClear=hpatch_TRUE;
1727
+ check(hpatch_TFileStreamOutput_close(&out_sfxData),HPATCH_FILECLOSE_ERROR,"createSfx() out sfxFile close");
1728
+ check(hpatch_TFileStreamInput_close(&diffData),HPATCH_FILECLOSE_ERROR,"createSfx() diffFile close");
1729
+ check(hpatch_TFileStreamInput_close(&exeData),HPATCH_FILECLOSE_ERROR,"createSfx() selfExecuteFile close");
1730
+ return result;
1731
+ }
1732
+
1733
+ static hpatch_BOOL _getIsCompressedDiffFile(const char* diffFileName){
1734
+ hpatch_TFileStreamInput diffData;
1735
+ hpatch_compressedDiffInfo diffInfo;
1736
+ hpatch_BOOL result=hpatch_TRUE;
1737
+ hpatch_TFileStreamInput_init(&diffData);
1738
+ if (!hpatch_TFileStreamInput_open(&diffData,diffFileName)) return hpatch_FALSE;
1739
+ result=getCompressedDiffInfo(&diffInfo,&diffData.base);
1740
+ if (!hpatch_TFileStreamInput_close(&diffData)) return hpatch_FALSE;
1741
+ return result;
1742
+ }
1743
+
1744
+ int createSfx(const char* selfExecuteFileName,const char* diffFileName,const char* out_sfxFileName){
1745
+ int result=HPATCH_SUCCESS;
1746
+ int _isInClear=hpatch_FALSE;
1747
+ {//check diffFile type
1748
+ hpatch_BOOL isDiffFile=hpatch_FALSE;
1749
+ #if (_IS_NEED_DIR_DIFF_PATCH)
1750
+ if (!isDiffFile)
1751
+ isDiffFile=getIsDirDiffFile(diffFileName);
1752
+ #endif
1753
+ if (!isDiffFile)
1754
+ isDiffFile=_getIsCompressedDiffFile(diffFileName);
1755
+ check(isDiffFile,HPATCH_CREATE_SFX_DIFFFILETYPE_ERROR,
1756
+ "createSfx() input diffFile is unsupported type");
1757
+ }
1758
+ result=createSfx_notCheckDiffFile(selfExecuteFileName,diffFileName,out_sfxFileName);
1759
+ clear:
1760
+ _isInClear=hpatch_TRUE;
1761
+ return result;
1762
+ }
1763
+
1764
+ hpatch_BOOL getDiffDataOffertInSfx(hpatch_StreamPos_t* out_diffDataOffert,hpatch_StreamPos_t* out_diffDataSize){
1765
+ hpatch_uint32_t diffOff=0;
1766
+ hpatch_uint64_t diffSize=0;
1767
+ size_t i;
1768
+ for (i=0; i<sizeof(hpatch_uint32_t); ++i){
1769
+ size_t si=_sfx_guid_size+i;
1770
+ diffOff|=((hpatch_uint32_t)_sfx_guid_node[si])<<(8*i);
1771
+ }
1772
+ if (diffOff==(~(hpatch_uint32_t)0)) return hpatch_FALSE;
1773
+ assert(diffOff>_sfx_guid_node_size);
1774
+
1775
+ for (i=0; i<sizeof(hpatch_uint64_t); ++i){
1776
+ size_t si=_sfx_guid_size+sizeof(hpatch_uint32_t)+i;
1777
+ diffSize|=((hpatch_uint64_t)_sfx_guid_node[si])<<(8*i);
1778
+ }
1779
+ if (diffSize==(~(hpatch_uint64_t)0)) return hpatch_FALSE;
1780
+
1781
+ if (out_diffDataOffert) *out_diffDataOffert=diffOff;
1782
+ if (out_diffDataSize) *out_diffDataSize=diffSize;
1783
+ return hpatch_TRUE;
1784
+ }
1785
+
1786
+ #endif // _IS_NEED_SFX