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,2876 @@
1
+ /* XzDec.c -- Xz Decode
2
+ : Igor Pavlov : Public domain */
3
+
4
+ #include "Precomp.h"
5
+
6
+ // #include <stdio.h>
7
+
8
+ // #define XZ_DUMP
9
+
10
+ /* #define XZ_DUMP */
11
+
12
+ #ifdef XZ_DUMP
13
+ #include <stdio.h>
14
+ #endif
15
+
16
+ // #define SHOW_DEBUG_INFO
17
+
18
+ #ifdef SHOW_DEBUG_INFO
19
+ #include <stdio.h>
20
+ #endif
21
+
22
+ #ifdef SHOW_DEBUG_INFO
23
+ #define PRF(x) x
24
+ #else
25
+ #define PRF(x)
26
+ #endif
27
+
28
+ #define PRF_STR(s) PRF(printf("\n" s "\n"))
29
+ #define PRF_STR_INT(s, d) PRF(printf("\n" s " %d\n", (unsigned)d))
30
+
31
+ #include <stdlib.h>
32
+ #include <string.h>
33
+
34
+ #include "7zCrc.h"
35
+ #include "Alloc.h"
36
+ #include "Bra.h"
37
+ #include "CpuArch.h"
38
+ #include "Delta.h"
39
+ #include "Lzma2Dec.h"
40
+
41
+ // #define USE_SUBBLOCK
42
+
43
+ #ifdef USE_SUBBLOCK
44
+ #include "Bcj3Dec.c"
45
+ #include "SbDec.h"
46
+ #endif
47
+
48
+ #include "Xz.h"
49
+
50
+ #define XZ_CHECK_SIZE_MAX 64
51
+
52
+ #define CODER_BUF_SIZE ((size_t)1 << 17)
53
+
54
+ unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value)
55
+ {
56
+ unsigned i, limit;
57
+ *value = 0;
58
+ limit = (maxSize > 9) ? 9 : (unsigned)maxSize;
59
+
60
+ for (i = 0; i < limit;)
61
+ {
62
+ const unsigned b = p[i];
63
+ *value |= (UInt64)(b & 0x7F) << (7 * i++);
64
+ if ((b & 0x80) == 0)
65
+ return (b == 0 && i != 1) ? 0 : i;
66
+ }
67
+ return 0;
68
+ }
69
+
70
+
71
+ /* ---------- XzBcFilterState ---------- */
72
+
73
+ #define BRA_BUF_SIZE (1 << 14)
74
+
75
+ typedef struct
76
+ {
77
+ size_t bufPos;
78
+ size_t bufConv;
79
+ size_t bufTotal;
80
+ Byte *buf; // must be aligned for 4 bytes
81
+ Xz_Func_BcFilterStateBase_Filter filter_func;
82
+ // int encodeMode;
83
+ CXzBcFilterStateBase base;
84
+ // Byte buf[BRA_BUF_SIZE];
85
+ } CXzBcFilterState;
86
+
87
+
88
+ static void XzBcFilterState_Free(void *pp, ISzAllocPtr alloc)
89
+ {
90
+ if (pp)
91
+ {
92
+ CXzBcFilterState *p = ((CXzBcFilterState *)pp);
93
+ ISzAlloc_Free(alloc, p->buf);
94
+ ISzAlloc_Free(alloc, pp);
95
+ }
96
+ }
97
+
98
+
99
+ static SRes XzBcFilterState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
100
+ {
101
+ CXzBcFilterStateBase *p = &((CXzBcFilterState *)pp)->base;
102
+ UNUSED_VAR(alloc)
103
+ p->ip = 0;
104
+ if (p->methodId == XZ_ID_Delta)
105
+ {
106
+ if (propSize != 1)
107
+ return SZ_ERROR_UNSUPPORTED;
108
+ p->delta = (UInt32)props[0] + 1;
109
+ }
110
+ else
111
+ {
112
+ if (propSize == 4)
113
+ {
114
+ const UInt32 v = GetUi32(props);
115
+ switch (p->methodId)
116
+ {
117
+ case XZ_ID_PPC:
118
+ case XZ_ID_ARM:
119
+ case XZ_ID_SPARC:
120
+ case XZ_ID_ARM64:
121
+ if (v & 3)
122
+ return SZ_ERROR_UNSUPPORTED;
123
+ break;
124
+ case XZ_ID_ARMT:
125
+ case XZ_ID_RISCV:
126
+ if (v & 1)
127
+ return SZ_ERROR_UNSUPPORTED;
128
+ break;
129
+ case XZ_ID_IA64:
130
+ if (v & 0xf)
131
+ return SZ_ERROR_UNSUPPORTED;
132
+ break;
133
+ default: break;
134
+ }
135
+ p->ip = v;
136
+ }
137
+ else if (propSize != 0)
138
+ return SZ_ERROR_UNSUPPORTED;
139
+ }
140
+ return SZ_OK;
141
+ }
142
+
143
+
144
+ static void XzBcFilterState_Init(void *pp)
145
+ {
146
+ CXzBcFilterState *p = ((CXzBcFilterState *)pp);
147
+ p->bufPos = p->bufConv = p->bufTotal = 0;
148
+ p->base.X86_State = Z7_BRANCH_CONV_ST_X86_STATE_INIT_VAL;
149
+ if (p->base.methodId == XZ_ID_Delta)
150
+ Delta_Init(p->base.delta_State);
151
+ }
152
+
153
+
154
+ static const z7_Func_BranchConv g_Funcs_BranchConv_RISC_Dec[] =
155
+ {
156
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_PPC),
157
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_IA64),
158
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_ARM),
159
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_ARMT),
160
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_SPARC),
161
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_ARM64),
162
+ Z7_BRANCH_CONV_DEC_2 (BranchConv_RISCV)
163
+ };
164
+
165
+ static SizeT XzBcFilterStateBase_Filter_Dec(CXzBcFilterStateBase *p, Byte *data, SizeT size)
166
+ {
167
+ switch (p->methodId)
168
+ {
169
+ case XZ_ID_Delta:
170
+ Delta_Decode(p->delta_State, p->delta, data, size);
171
+ break;
172
+ case XZ_ID_X86:
173
+ size = (SizeT)(z7_BranchConvSt_X86_Dec(data, size, p->ip, &p->X86_State) - data);
174
+ break;
175
+ default:
176
+ if (p->methodId >= XZ_ID_PPC)
177
+ {
178
+ const UInt32 i = p->methodId - XZ_ID_PPC;
179
+ if (i < Z7_ARRAY_SIZE(g_Funcs_BranchConv_RISC_Dec))
180
+ size = (SizeT)(g_Funcs_BranchConv_RISC_Dec[i](data, size, p->ip) - data);
181
+ }
182
+ break;
183
+ }
184
+ p->ip += (UInt32)size;
185
+ return size;
186
+ }
187
+
188
+
189
+ static SizeT XzBcFilterState_Filter(void *pp, Byte *data, SizeT size)
190
+ {
191
+ CXzBcFilterState *p = ((CXzBcFilterState *)pp);
192
+ return p->filter_func(&p->base, data, size);
193
+ }
194
+
195
+
196
+ static SRes XzBcFilterState_Code2(void *pp,
197
+ Byte *dest, SizeT *destLen,
198
+ const Byte *src, SizeT *srcLen, int srcWasFinished,
199
+ ECoderFinishMode finishMode,
200
+ // int *wasFinished
201
+ ECoderStatus *status)
202
+ {
203
+ CXzBcFilterState *p = ((CXzBcFilterState *)pp);
204
+ SizeT destRem = *destLen;
205
+ SizeT srcRem = *srcLen;
206
+ UNUSED_VAR(finishMode)
207
+
208
+ *destLen = 0;
209
+ *srcLen = 0;
210
+ // *wasFinished = False;
211
+ *status = CODER_STATUS_NOT_FINISHED;
212
+
213
+ while (destRem != 0)
214
+ {
215
+ {
216
+ size_t size = p->bufConv - p->bufPos;
217
+ if (size)
218
+ {
219
+ if (size > destRem)
220
+ size = destRem;
221
+ memcpy(dest, p->buf + p->bufPos, size);
222
+ p->bufPos += size;
223
+ *destLen += size;
224
+ dest += size;
225
+ destRem -= size;
226
+ continue;
227
+ }
228
+ }
229
+
230
+ p->bufTotal -= p->bufPos;
231
+ memmove(p->buf, p->buf + p->bufPos, p->bufTotal);
232
+ p->bufPos = 0;
233
+ p->bufConv = 0;
234
+ {
235
+ size_t size = BRA_BUF_SIZE - p->bufTotal;
236
+ if (size > srcRem)
237
+ size = srcRem;
238
+ memcpy(p->buf + p->bufTotal, src, size);
239
+ *srcLen += size;
240
+ src += size;
241
+ srcRem -= size;
242
+ p->bufTotal += size;
243
+ }
244
+ if (p->bufTotal == 0)
245
+ break;
246
+
247
+ p->bufConv = p->filter_func(&p->base, p->buf, p->bufTotal);
248
+
249
+ if (p->bufConv == 0)
250
+ {
251
+ if (!srcWasFinished)
252
+ break;
253
+ p->bufConv = p->bufTotal;
254
+ }
255
+ }
256
+
257
+ if (p->bufTotal == p->bufPos && srcRem == 0 && srcWasFinished)
258
+ {
259
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
260
+ // *wasFinished = 1;
261
+ }
262
+
263
+ return SZ_OK;
264
+ }
265
+
266
+
267
+ #define XZ_IS_SUPPORTED_FILTER_ID(id) \
268
+ ((id) >= XZ_ID_Delta && (id) <= XZ_ID_RISCV)
269
+
270
+ SRes Xz_StateCoder_Bc_SetFromMethod_Func(IStateCoder *p, UInt64 id,
271
+ Xz_Func_BcFilterStateBase_Filter func, ISzAllocPtr alloc)
272
+ {
273
+ CXzBcFilterState *decoder;
274
+ if (!XZ_IS_SUPPORTED_FILTER_ID(id))
275
+ return SZ_ERROR_UNSUPPORTED;
276
+ decoder = (CXzBcFilterState *)p->p;
277
+ if (!decoder)
278
+ {
279
+ decoder = (CXzBcFilterState *)ISzAlloc_Alloc(alloc, sizeof(CXzBcFilterState));
280
+ if (!decoder)
281
+ return SZ_ERROR_MEM;
282
+ decoder->buf = ISzAlloc_Alloc(alloc, BRA_BUF_SIZE);
283
+ if (!decoder->buf)
284
+ {
285
+ ISzAlloc_Free(alloc, decoder);
286
+ return SZ_ERROR_MEM;
287
+ }
288
+ p->p = decoder;
289
+ p->Free = XzBcFilterState_Free;
290
+ p->SetProps = XzBcFilterState_SetProps;
291
+ p->Init = XzBcFilterState_Init;
292
+ p->Code2 = XzBcFilterState_Code2;
293
+ p->Filter = XzBcFilterState_Filter;
294
+ decoder->filter_func = func;
295
+ }
296
+ decoder->base.methodId = (UInt32)id;
297
+ // decoder->encodeMode = encodeMode;
298
+ return SZ_OK;
299
+ }
300
+
301
+
302
+
303
+ /* ---------- SbState ---------- */
304
+
305
+ #ifdef USE_SUBBLOCK
306
+
307
+ static void SbState_Free(void *pp, ISzAllocPtr alloc)
308
+ {
309
+ CSbDec *p = (CSbDec *)pp;
310
+ SbDec_Free(p);
311
+ ISzAlloc_Free(alloc, pp);
312
+ }
313
+
314
+ static SRes SbState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
315
+ {
316
+ UNUSED_VAR(pp)
317
+ UNUSED_VAR(props)
318
+ UNUSED_VAR(alloc)
319
+ return (propSize == 0) ? SZ_OK : SZ_ERROR_UNSUPPORTED;
320
+ }
321
+
322
+ static void SbState_Init(void *pp)
323
+ {
324
+ SbDec_Init((CSbDec *)pp);
325
+ }
326
+
327
+ static SRes SbState_Code2(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
328
+ int srcWasFinished, ECoderFinishMode finishMode,
329
+ // int *wasFinished
330
+ ECoderStatus *status)
331
+ {
332
+ CSbDec *p = (CSbDec *)pp;
333
+ SRes res;
334
+ UNUSED_VAR(srcWasFinished)
335
+ p->dest = dest;
336
+ p->destLen = *destLen;
337
+ p->src = src;
338
+ p->srcLen = *srcLen;
339
+ p->finish = finishMode; /* change it */
340
+ res = SbDec_Decode((CSbDec *)pp);
341
+ *destLen -= p->destLen;
342
+ *srcLen -= p->srcLen;
343
+ // *wasFinished = (*destLen == 0 && *srcLen == 0); /* change it */
344
+ *status = (*destLen == 0 && *srcLen == 0) ?
345
+ CODER_STATUS_FINISHED_WITH_MARK :
346
+ CODER_STATUS_NOT_FINISHED;
347
+ return res;
348
+ }
349
+
350
+ static SRes SbState_SetFromMethod(IStateCoder *p, ISzAllocPtr alloc)
351
+ {
352
+ CSbDec *decoder = (CSbDec *)p->p;
353
+ if (!decoder)
354
+ {
355
+ decoder = (CSbDec *)ISzAlloc_Alloc(alloc, sizeof(CSbDec));
356
+ if (!decoder)
357
+ return SZ_ERROR_MEM;
358
+ p->p = decoder;
359
+ p->Free = SbState_Free;
360
+ p->SetProps = SbState_SetProps;
361
+ p->Init = SbState_Init;
362
+ p->Code2 = SbState_Code2;
363
+ p->Filter = NULL;
364
+ }
365
+ SbDec_Construct(decoder);
366
+ SbDec_SetAlloc(decoder, alloc);
367
+ return SZ_OK;
368
+ }
369
+
370
+ #endif
371
+
372
+
373
+
374
+ /* ---------- Lzma2 ---------- */
375
+
376
+ typedef struct
377
+ {
378
+ CLzma2Dec decoder;
379
+ BoolInt outBufMode;
380
+ } CLzma2Dec_Spec;
381
+
382
+
383
+ static void Lzma2State_Free(void *pp, ISzAllocPtr alloc)
384
+ {
385
+ CLzma2Dec_Spec *p = (CLzma2Dec_Spec *)pp;
386
+ if (p->outBufMode)
387
+ Lzma2Dec_FreeProbs(&p->decoder, alloc);
388
+ else
389
+ Lzma2Dec_Free(&p->decoder, alloc);
390
+ ISzAlloc_Free(alloc, pp);
391
+ }
392
+
393
+ static SRes Lzma2State_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
394
+ {
395
+ if (propSize != 1)
396
+ return SZ_ERROR_UNSUPPORTED;
397
+ {
398
+ CLzma2Dec_Spec *p = (CLzma2Dec_Spec *)pp;
399
+ if (p->outBufMode)
400
+ return Lzma2Dec_AllocateProbs(&p->decoder, props[0], alloc);
401
+ else
402
+ return Lzma2Dec_Allocate(&p->decoder, props[0], alloc);
403
+ }
404
+ }
405
+
406
+ static void Lzma2State_Init(void *pp)
407
+ {
408
+ Lzma2Dec_Init(&((CLzma2Dec_Spec *)pp)->decoder);
409
+ }
410
+
411
+
412
+ /*
413
+ if (outBufMode), then (dest) is not used. Use NULL.
414
+ Data is unpacked to (spec->decoder.decoder.dic) output buffer.
415
+ */
416
+
417
+ static SRes Lzma2State_Code2(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
418
+ int srcWasFinished, ECoderFinishMode finishMode,
419
+ // int *wasFinished,
420
+ ECoderStatus *status)
421
+ {
422
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)pp;
423
+ ELzmaStatus status2;
424
+ /* ELzmaFinishMode fm = (finishMode == LZMA_FINISH_ANY) ? LZMA_FINISH_ANY : LZMA_FINISH_END; */
425
+ SRes res;
426
+ UNUSED_VAR(srcWasFinished)
427
+ if (spec->outBufMode)
428
+ {
429
+ SizeT dicPos = spec->decoder.decoder.dicPos;
430
+ SizeT dicLimit = dicPos + *destLen;
431
+ res = Lzma2Dec_DecodeToDic(&spec->decoder, dicLimit, src, srcLen, (ELzmaFinishMode)finishMode, &status2);
432
+ *destLen = spec->decoder.decoder.dicPos - dicPos;
433
+ }
434
+ else
435
+ res = Lzma2Dec_DecodeToBuf(&spec->decoder, dest, destLen, src, srcLen, (ELzmaFinishMode)finishMode, &status2);
436
+ // *wasFinished = (status2 == LZMA_STATUS_FINISHED_WITH_MARK);
437
+ // ECoderStatus values are identical to ELzmaStatus values of LZMA2 decoder
438
+ *status = (ECoderStatus)status2;
439
+ return res;
440
+ }
441
+
442
+
443
+ static SRes Lzma2State_SetFromMethod(IStateCoder *p, Byte *outBuf, size_t outBufSize, ISzAllocPtr alloc)
444
+ {
445
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)p->p;
446
+ if (!spec)
447
+ {
448
+ spec = (CLzma2Dec_Spec *)ISzAlloc_Alloc(alloc, sizeof(CLzma2Dec_Spec));
449
+ if (!spec)
450
+ return SZ_ERROR_MEM;
451
+ p->p = spec;
452
+ p->Free = Lzma2State_Free;
453
+ p->SetProps = Lzma2State_SetProps;
454
+ p->Init = Lzma2State_Init;
455
+ p->Code2 = Lzma2State_Code2;
456
+ p->Filter = NULL;
457
+ Lzma2Dec_CONSTRUCT(&spec->decoder)
458
+ }
459
+ spec->outBufMode = False;
460
+ if (outBuf)
461
+ {
462
+ spec->outBufMode = True;
463
+ spec->decoder.decoder.dic = outBuf;
464
+ spec->decoder.decoder.dicBufSize = outBufSize;
465
+ }
466
+ return SZ_OK;
467
+ }
468
+
469
+
470
+ static SRes Lzma2State_ResetOutBuf(IStateCoder *p, Byte *outBuf, size_t outBufSize)
471
+ {
472
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)p->p;
473
+ if ((spec->outBufMode && !outBuf) || (!spec->outBufMode && outBuf))
474
+ return SZ_ERROR_FAIL;
475
+ if (outBuf)
476
+ {
477
+ spec->decoder.decoder.dic = outBuf;
478
+ spec->decoder.decoder.dicBufSize = outBufSize;
479
+ }
480
+ return SZ_OK;
481
+ }
482
+
483
+
484
+
485
+ static void MixCoder_Construct(CMixCoder *p, ISzAllocPtr alloc)
486
+ {
487
+ unsigned i;
488
+ p->alloc = alloc;
489
+ p->buf = NULL;
490
+ p->numCoders = 0;
491
+
492
+ p->outBufSize = 0;
493
+ p->outBuf = NULL;
494
+ // p->SingleBufMode = False;
495
+
496
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++)
497
+ p->coders[i].p = NULL;
498
+ }
499
+
500
+
501
+ static void MixCoder_Free(CMixCoder *p)
502
+ {
503
+ unsigned i;
504
+ p->numCoders = 0;
505
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++)
506
+ {
507
+ IStateCoder *sc = &p->coders[i];
508
+ if (sc->p)
509
+ {
510
+ sc->Free(sc->p, p->alloc);
511
+ sc->p = NULL;
512
+ }
513
+ }
514
+ if (p->buf)
515
+ {
516
+ ISzAlloc_Free(p->alloc, p->buf);
517
+ p->buf = NULL; /* 9.31: the BUG was fixed */
518
+ }
519
+ }
520
+
521
+ static void MixCoder_Init(CMixCoder *p)
522
+ {
523
+ unsigned i;
524
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX - 1; i++)
525
+ {
526
+ p->size[i] = 0;
527
+ p->pos[i] = 0;
528
+ p->finished[i] = 0;
529
+ }
530
+ for (i = 0; i < p->numCoders; i++)
531
+ {
532
+ IStateCoder *coder = &p->coders[i];
533
+ coder->Init(coder->p);
534
+ p->results[i] = SZ_OK;
535
+ }
536
+ p->outWritten = 0;
537
+ p->wasFinished = False;
538
+ p->res = SZ_OK;
539
+ p->status = CODER_STATUS_NOT_SPECIFIED;
540
+ }
541
+
542
+
543
+ static SRes MixCoder_SetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId, Byte *outBuf, size_t outBufSize)
544
+ {
545
+ IStateCoder *sc = &p->coders[coderIndex];
546
+ p->ids[coderIndex] = methodId;
547
+ if (methodId == XZ_ID_LZMA2)
548
+ return Lzma2State_SetFromMethod(sc, outBuf, outBufSize, p->alloc);
549
+ #ifdef USE_SUBBLOCK
550
+ if (methodId == XZ_ID_Subblock)
551
+ return SbState_SetFromMethod(sc, p->alloc);
552
+ #endif
553
+ if (coderIndex == 0)
554
+ return SZ_ERROR_UNSUPPORTED;
555
+ return Xz_StateCoder_Bc_SetFromMethod_Func(sc, methodId,
556
+ XzBcFilterStateBase_Filter_Dec, p->alloc);
557
+ }
558
+
559
+
560
+ static SRes MixCoder_ResetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId, Byte *outBuf, size_t outBufSize)
561
+ {
562
+ IStateCoder *sc = &p->coders[coderIndex];
563
+ if (methodId == XZ_ID_LZMA2)
564
+ return Lzma2State_ResetOutBuf(sc, outBuf, outBufSize);
565
+ return SZ_ERROR_UNSUPPORTED;
566
+ }
567
+
568
+
569
+
570
+ /*
571
+ if (destFinish) - then unpack data block is finished at (*destLen) position,
572
+ and we can return data that were not processed by filter
573
+
574
+ output (status) can be :
575
+ CODER_STATUS_NOT_FINISHED
576
+ CODER_STATUS_FINISHED_WITH_MARK
577
+ CODER_STATUS_NEEDS_MORE_INPUT - not implemented still
578
+ */
579
+
580
+ static SRes MixCoder_Code(CMixCoder *p,
581
+ Byte *dest, SizeT *destLen, int destFinish,
582
+ const Byte *src, SizeT *srcLen, int srcWasFinished,
583
+ ECoderFinishMode finishMode)
584
+ {
585
+ SizeT destLenOrig = *destLen;
586
+ SizeT srcLenOrig = *srcLen;
587
+
588
+ *destLen = 0;
589
+ *srcLen = 0;
590
+
591
+ if (p->wasFinished)
592
+ return p->res;
593
+
594
+ p->status = CODER_STATUS_NOT_FINISHED;
595
+
596
+ // if (p->SingleBufMode)
597
+ if (p->outBuf)
598
+ {
599
+ SRes res;
600
+ SizeT destLen2, srcLen2;
601
+ int wasFinished;
602
+
603
+ PRF_STR("------- MixCoder Single ----------")
604
+
605
+ srcLen2 = srcLenOrig;
606
+ destLen2 = destLenOrig;
607
+
608
+ {
609
+ IStateCoder *coder = &p->coders[0];
610
+ res = coder->Code2(coder->p, NULL, &destLen2, src, &srcLen2, srcWasFinished, finishMode,
611
+ // &wasFinished,
612
+ &p->status);
613
+ wasFinished = (p->status == CODER_STATUS_FINISHED_WITH_MARK);
614
+ }
615
+
616
+ p->res = res;
617
+
618
+ /*
619
+ if (wasFinished)
620
+ p->status = CODER_STATUS_FINISHED_WITH_MARK;
621
+ else
622
+ {
623
+ if (res == SZ_OK)
624
+ if (destLen2 != destLenOrig)
625
+ p->status = CODER_STATUS_NEEDS_MORE_INPUT;
626
+ }
627
+ */
628
+
629
+
630
+ *srcLen = srcLen2;
631
+ src += srcLen2;
632
+ p->outWritten += destLen2;
633
+
634
+ if (res != SZ_OK || srcWasFinished || wasFinished)
635
+ p->wasFinished = True;
636
+
637
+ if (p->numCoders == 1)
638
+ *destLen = destLen2;
639
+ else if (p->wasFinished)
640
+ {
641
+ unsigned i;
642
+ size_t processed = p->outWritten;
643
+
644
+ for (i = 1; i < p->numCoders; i++)
645
+ {
646
+ IStateCoder *coder = &p->coders[i];
647
+ processed = coder->Filter(coder->p, p->outBuf, processed);
648
+ if (wasFinished || (destFinish && p->outWritten == destLenOrig))
649
+ processed = p->outWritten;
650
+ PRF_STR_INT("filter", i)
651
+ }
652
+ *destLen = processed;
653
+ }
654
+ return res;
655
+ }
656
+
657
+ PRF_STR("standard mix")
658
+
659
+ if (p->numCoders != 1)
660
+ {
661
+ if (!p->buf)
662
+ {
663
+ p->buf = (Byte *)ISzAlloc_Alloc(p->alloc, CODER_BUF_SIZE * (MIXCODER_NUM_FILTERS_MAX - 1));
664
+ if (!p->buf)
665
+ return SZ_ERROR_MEM;
666
+ }
667
+
668
+ finishMode = CODER_FINISH_ANY;
669
+ }
670
+
671
+ for (;;)
672
+ {
673
+ BoolInt processed = False;
674
+ BoolInt allFinished = True;
675
+ SRes resMain = SZ_OK;
676
+ unsigned i;
677
+
678
+ p->status = CODER_STATUS_NOT_FINISHED;
679
+ /*
680
+ if (p->numCoders == 1 && *destLen == destLenOrig && finishMode == LZMA_FINISH_ANY)
681
+ break;
682
+ */
683
+
684
+ for (i = 0; i < p->numCoders; i++)
685
+ {
686
+ SRes res;
687
+ IStateCoder *coder = &p->coders[i];
688
+ Byte *dest2;
689
+ SizeT destLen2, srcLen2; // destLen2_Orig;
690
+ const Byte *src2;
691
+ int srcFinished2;
692
+ int encodingWasFinished;
693
+ ECoderStatus status2;
694
+
695
+ if (i == 0)
696
+ {
697
+ src2 = src;
698
+ srcLen2 = srcLenOrig - *srcLen;
699
+ srcFinished2 = srcWasFinished;
700
+ }
701
+ else
702
+ {
703
+ size_t k = i - 1;
704
+ src2 = p->buf + (CODER_BUF_SIZE * k) + p->pos[k];
705
+ srcLen2 = p->size[k] - p->pos[k];
706
+ srcFinished2 = p->finished[k];
707
+ }
708
+
709
+ if (i == p->numCoders - 1)
710
+ {
711
+ dest2 = dest;
712
+ destLen2 = destLenOrig - *destLen;
713
+ }
714
+ else
715
+ {
716
+ if (p->pos[i] != p->size[i])
717
+ continue;
718
+ dest2 = p->buf + (CODER_BUF_SIZE * i);
719
+ destLen2 = CODER_BUF_SIZE;
720
+ }
721
+
722
+ // destLen2_Orig = destLen2;
723
+
724
+ if (p->results[i] != SZ_OK)
725
+ {
726
+ if (resMain == SZ_OK)
727
+ resMain = p->results[i];
728
+ continue;
729
+ }
730
+
731
+ res = coder->Code2(coder->p,
732
+ dest2, &destLen2,
733
+ src2, &srcLen2, srcFinished2,
734
+ finishMode,
735
+ // &encodingWasFinished,
736
+ &status2);
737
+
738
+ if (res != SZ_OK)
739
+ {
740
+ p->results[i] = res;
741
+ if (resMain == SZ_OK)
742
+ resMain = res;
743
+ }
744
+
745
+ encodingWasFinished = (status2 == CODER_STATUS_FINISHED_WITH_MARK);
746
+
747
+ if (!encodingWasFinished)
748
+ {
749
+ allFinished = False;
750
+ if (p->numCoders == 1 && res == SZ_OK)
751
+ p->status = status2;
752
+ }
753
+
754
+ if (i == 0)
755
+ {
756
+ *srcLen += srcLen2;
757
+ src += srcLen2;
758
+ }
759
+ else
760
+ p->pos[(size_t)i - 1] += srcLen2;
761
+
762
+ if (i == p->numCoders - 1)
763
+ {
764
+ *destLen += destLen2;
765
+ dest += destLen2;
766
+ }
767
+ else
768
+ {
769
+ p->size[i] = destLen2;
770
+ p->pos[i] = 0;
771
+ p->finished[i] = encodingWasFinished;
772
+ }
773
+
774
+ if (destLen2 != 0 || srcLen2 != 0)
775
+ processed = True;
776
+ }
777
+
778
+ if (!processed)
779
+ {
780
+ if (allFinished)
781
+ p->status = CODER_STATUS_FINISHED_WITH_MARK;
782
+ return resMain;
783
+ }
784
+ }
785
+ }
786
+
787
+
788
+ SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf)
789
+ {
790
+ *p = (CXzStreamFlags)GetBe16(buf + XZ_SIG_SIZE);
791
+ if (CrcCalc(buf + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE) !=
792
+ GetUi32(buf + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE))
793
+ return SZ_ERROR_NO_ARCHIVE;
794
+ return XzFlags_IsSupported(*p) ? SZ_OK : SZ_ERROR_UNSUPPORTED;
795
+ }
796
+
797
+ static BoolInt Xz_CheckFooter(CXzStreamFlags flags, UInt64 indexSize, const Byte *buf)
798
+ {
799
+ return indexSize == (((UInt64)GetUi32a(buf + 4) + 1) << 2)
800
+ && GetUi32a(buf) == CrcCalc(buf + 4, 6)
801
+ && flags == GetBe16a(buf + 8)
802
+ && GetUi16a(buf + 10) == (XZ_FOOTER_SIG_0 | (XZ_FOOTER_SIG_1 << 8));
803
+ }
804
+
805
+ #define READ_VARINT_AND_CHECK(buf, pos, size, res) \
806
+ { const unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \
807
+ if (s == 0) return SZ_ERROR_ARCHIVE; \
808
+ pos += s; }
809
+
810
+
811
+ static BoolInt XzBlock_AreSupportedFilters(const CXzBlock *p)
812
+ {
813
+ const unsigned numFilters = XzBlock_GetNumFilters(p) - 1;
814
+ unsigned i;
815
+ {
816
+ const CXzFilter *f = &p->filters[numFilters];
817
+ if (f->id != XZ_ID_LZMA2 || f->propsSize != 1 || f->props[0] > 40)
818
+ return False;
819
+ }
820
+
821
+ for (i = 0; i < numFilters; i++)
822
+ {
823
+ const CXzFilter *f = &p->filters[i];
824
+ if (f->id == XZ_ID_Delta)
825
+ {
826
+ if (f->propsSize != 1)
827
+ return False;
828
+ }
829
+ else if (!XZ_IS_SUPPORTED_FILTER_ID(f->id)
830
+ || (f->propsSize != 0 && f->propsSize != 4))
831
+ return False;
832
+ }
833
+ return True;
834
+ }
835
+
836
+
837
+ SRes XzBlock_Parse(CXzBlock *p, const Byte *header)
838
+ {
839
+ unsigned pos;
840
+ unsigned numFilters, i;
841
+ unsigned headerSize = (unsigned)header[0] << 2;
842
+
843
+ /* (headerSize != 0) : another code checks */
844
+
845
+ if (CrcCalc(header, headerSize) != GetUi32(header + headerSize))
846
+ return SZ_ERROR_ARCHIVE;
847
+
848
+ pos = 1;
849
+ p->flags = header[pos++];
850
+
851
+ p->packSize = (UInt64)(Int64)-1;
852
+ if (XzBlock_HasPackSize(p))
853
+ {
854
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &p->packSize)
855
+ if (p->packSize == 0 || p->packSize + headerSize >= (UInt64)1 << 63)
856
+ return SZ_ERROR_ARCHIVE;
857
+ }
858
+
859
+ p->unpackSize = (UInt64)(Int64)-1;
860
+ if (XzBlock_HasUnpackSize(p))
861
+ {
862
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &p->unpackSize)
863
+ }
864
+
865
+ numFilters = XzBlock_GetNumFilters(p);
866
+ for (i = 0; i < numFilters; i++)
867
+ {
868
+ CXzFilter *filter = p->filters + i;
869
+ UInt64 size;
870
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &filter->id)
871
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &size)
872
+ if (size > headerSize - pos || size > XZ_FILTER_PROPS_SIZE_MAX)
873
+ return SZ_ERROR_ARCHIVE;
874
+ filter->propsSize = (UInt32)size;
875
+ memcpy(filter->props, header + pos, (size_t)size);
876
+ pos += (unsigned)size;
877
+
878
+ #ifdef XZ_DUMP
879
+ printf("\nf[%u] = %2X: ", i, (unsigned)filter->id);
880
+ {
881
+ unsigned i;
882
+ for (i = 0; i < size; i++)
883
+ printf(" %2X", filter->props[i]);
884
+ }
885
+ #endif
886
+ }
887
+
888
+ if (XzBlock_HasUnsupportedFlags(p))
889
+ return SZ_ERROR_UNSUPPORTED;
890
+
891
+ while (pos < headerSize)
892
+ if (header[pos++] != 0)
893
+ return SZ_ERROR_ARCHIVE;
894
+ return SZ_OK;
895
+ }
896
+
897
+
898
+
899
+
900
+ static SRes XzDecMix_Init(CMixCoder *p, const CXzBlock *block, Byte *outBuf, size_t outBufSize)
901
+ {
902
+ unsigned i;
903
+ BoolInt needReInit = True;
904
+ unsigned numFilters = XzBlock_GetNumFilters(block);
905
+
906
+ if (numFilters == p->numCoders && ((p->outBuf && outBuf) || (!p->outBuf && !outBuf)))
907
+ {
908
+ needReInit = False;
909
+ for (i = 0; i < numFilters; i++)
910
+ if (p->ids[i] != block->filters[numFilters - 1 - i].id)
911
+ {
912
+ needReInit = True;
913
+ break;
914
+ }
915
+ }
916
+
917
+ // p->SingleBufMode = (outBuf != NULL);
918
+ p->outBuf = outBuf;
919
+ p->outBufSize = outBufSize;
920
+
921
+ // p->SingleBufMode = False;
922
+ // outBuf = NULL;
923
+
924
+ if (needReInit)
925
+ {
926
+ MixCoder_Free(p);
927
+ for (i = 0; i < numFilters; i++)
928
+ {
929
+ RINOK(MixCoder_SetFromMethod(p, i, block->filters[numFilters - 1 - i].id, outBuf, outBufSize))
930
+ }
931
+ p->numCoders = numFilters;
932
+ }
933
+ else
934
+ {
935
+ RINOK(MixCoder_ResetFromMethod(p, 0, block->filters[numFilters - 1].id, outBuf, outBufSize))
936
+ }
937
+
938
+ for (i = 0; i < numFilters; i++)
939
+ {
940
+ const CXzFilter *f = &block->filters[numFilters - 1 - i];
941
+ IStateCoder *sc = &p->coders[i];
942
+ RINOK(sc->SetProps(sc->p, f->props, f->propsSize, p->alloc))
943
+ }
944
+
945
+ MixCoder_Init(p);
946
+ return SZ_OK;
947
+ }
948
+
949
+
950
+
951
+ void XzUnpacker_Init(CXzUnpacker *p)
952
+ {
953
+ p->state = XZ_STATE_STREAM_HEADER;
954
+ p->pos = 0;
955
+ p->numStartedStreams = 0;
956
+ p->numFinishedStreams = 0;
957
+ p->numTotalBlocks = 0;
958
+ p->padSize = 0;
959
+ p->decodeOnlyOneBlock = 0;
960
+
961
+ p->parseMode = False;
962
+ p->decodeToStreamSignature = False;
963
+
964
+ // p->outBuf = NULL;
965
+ // p->outBufSize = 0;
966
+ p->outDataWritten = 0;
967
+ }
968
+
969
+
970
+ void XzUnpacker_SetOutBuf(CXzUnpacker *p, Byte *outBuf, size_t outBufSize)
971
+ {
972
+ p->outBuf = outBuf;
973
+ p->outBufSize = outBufSize;
974
+ }
975
+
976
+
977
+ void XzUnpacker_Construct(CXzUnpacker *p, ISzAllocPtr alloc)
978
+ {
979
+ MixCoder_Construct(&p->decoder, alloc);
980
+ p->outBuf = NULL;
981
+ p->outBufSize = 0;
982
+ XzUnpacker_Init(p);
983
+ }
984
+
985
+
986
+ void XzUnpacker_Free(CXzUnpacker *p)
987
+ {
988
+ MixCoder_Free(&p->decoder);
989
+ }
990
+
991
+
992
+ void XzUnpacker_PrepareToRandomBlockDecoding(CXzUnpacker *p)
993
+ {
994
+ p->indexSize = 0;
995
+ p->numBlocks = 0;
996
+ Sha256_Init(&p->sha);
997
+ p->state = XZ_STATE_BLOCK_HEADER;
998
+ p->pos = 0;
999
+ p->decodeOnlyOneBlock = 1;
1000
+ }
1001
+
1002
+
1003
+ static void XzUnpacker_UpdateIndex(CXzUnpacker *p, UInt64 packSize, UInt64 unpackSize)
1004
+ {
1005
+ Byte temp[32];
1006
+ unsigned num = Xz_WriteVarInt(temp, packSize);
1007
+ num += Xz_WriteVarInt(temp + num, unpackSize);
1008
+ Sha256_Update(&p->sha, temp, num);
1009
+ p->indexSize += num;
1010
+ p->numBlocks++;
1011
+ }
1012
+
1013
+
1014
+
1015
+ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen,
1016
+ const Byte *src, SizeT *srcLen, int srcFinished,
1017
+ ECoderFinishMode finishMode, ECoderStatus *status)
1018
+ {
1019
+ SizeT destLenOrig = *destLen;
1020
+ SizeT srcLenOrig = *srcLen;
1021
+ *destLen = 0;
1022
+ *srcLen = 0;
1023
+ *status = CODER_STATUS_NOT_SPECIFIED;
1024
+
1025
+ for (;;)
1026
+ {
1027
+ SizeT srcRem;
1028
+
1029
+ if (p->state == XZ_STATE_BLOCK)
1030
+ {
1031
+ SizeT destLen2 = destLenOrig - *destLen;
1032
+ SizeT srcLen2 = srcLenOrig - *srcLen;
1033
+ SRes res;
1034
+
1035
+ ECoderFinishMode finishMode2 = finishMode;
1036
+ BoolInt srcFinished2 = (BoolInt)srcFinished;
1037
+ BoolInt destFinish = False;
1038
+
1039
+ if (p->block.packSize != (UInt64)(Int64)-1)
1040
+ {
1041
+ UInt64 rem = p->block.packSize - p->packSize;
1042
+ if (srcLen2 >= rem)
1043
+ {
1044
+ srcFinished2 = True;
1045
+ srcLen2 = (SizeT)rem;
1046
+ }
1047
+ if (rem == 0 && p->block.unpackSize == p->unpackSize)
1048
+ return SZ_ERROR_DATA;
1049
+ }
1050
+
1051
+ if (p->block.unpackSize != (UInt64)(Int64)-1)
1052
+ {
1053
+ UInt64 rem = p->block.unpackSize - p->unpackSize;
1054
+ if (destLen2 >= rem)
1055
+ {
1056
+ destFinish = True;
1057
+ finishMode2 = CODER_FINISH_END;
1058
+ destLen2 = (SizeT)rem;
1059
+ }
1060
+ }
1061
+
1062
+ /*
1063
+ if (srcLen2 == 0 && destLen2 == 0)
1064
+ {
1065
+ *status = CODER_STATUS_NOT_FINISHED;
1066
+ return SZ_OK;
1067
+ }
1068
+ */
1069
+
1070
+ {
1071
+ res = MixCoder_Code(&p->decoder,
1072
+ (p->outBuf ? NULL : dest), &destLen2, destFinish,
1073
+ src, &srcLen2, srcFinished2,
1074
+ finishMode2);
1075
+
1076
+ *status = p->decoder.status;
1077
+ XzCheck_Update(&p->check, (p->outBuf ? p->outBuf + p->outDataWritten : dest), destLen2);
1078
+ if (!p->outBuf)
1079
+ dest += destLen2;
1080
+ p->outDataWritten += destLen2;
1081
+ }
1082
+
1083
+ (*srcLen) += srcLen2;
1084
+ src += srcLen2;
1085
+ p->packSize += srcLen2;
1086
+ (*destLen) += destLen2;
1087
+ p->unpackSize += destLen2;
1088
+
1089
+ RINOK(res)
1090
+
1091
+ if (*status != CODER_STATUS_FINISHED_WITH_MARK)
1092
+ {
1093
+ if (p->block.packSize == p->packSize
1094
+ && *status == CODER_STATUS_NEEDS_MORE_INPUT)
1095
+ {
1096
+ PRF_STR("CODER_STATUS_NEEDS_MORE_INPUT")
1097
+ *status = CODER_STATUS_NOT_SPECIFIED;
1098
+ return SZ_ERROR_DATA;
1099
+ }
1100
+
1101
+ return SZ_OK;
1102
+ }
1103
+ {
1104
+ XzUnpacker_UpdateIndex(p, XzUnpacker_GetPackSizeForIndex(p), p->unpackSize);
1105
+ p->state = XZ_STATE_BLOCK_FOOTER;
1106
+ p->pos = 0;
1107
+ p->alignPos = 0;
1108
+ *status = CODER_STATUS_NOT_SPECIFIED;
1109
+
1110
+ if ((p->block.packSize != (UInt64)(Int64)-1 && p->block.packSize != p->packSize)
1111
+ || (p->block.unpackSize != (UInt64)(Int64)-1 && p->block.unpackSize != p->unpackSize))
1112
+ {
1113
+ PRF_STR("ERROR: block.size mismatch")
1114
+ return SZ_ERROR_DATA;
1115
+ }
1116
+ }
1117
+ // continue;
1118
+ }
1119
+
1120
+ srcRem = srcLenOrig - *srcLen;
1121
+
1122
+ // XZ_STATE_BLOCK_FOOTER can transit to XZ_STATE_BLOCK_HEADER without input bytes
1123
+ if (srcRem == 0 && p->state != XZ_STATE_BLOCK_FOOTER)
1124
+ {
1125
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
1126
+ return SZ_OK;
1127
+ }
1128
+
1129
+ switch ((int)p->state)
1130
+ {
1131
+ case XZ_STATE_STREAM_HEADER:
1132
+ {
1133
+ if (p->pos < XZ_STREAM_HEADER_SIZE)
1134
+ {
1135
+ if (p->pos < XZ_SIG_SIZE && *src != XZ_SIG[p->pos])
1136
+ return SZ_ERROR_NO_ARCHIVE;
1137
+ if (p->decodeToStreamSignature)
1138
+ return SZ_OK;
1139
+ p->buf[p->pos++] = *src++;
1140
+ (*srcLen)++;
1141
+ }
1142
+ else
1143
+ {
1144
+ RINOK(Xz_ParseHeader(&p->streamFlags, p->buf))
1145
+ p->numStartedStreams++;
1146
+ p->indexSize = 0;
1147
+ p->numBlocks = 0;
1148
+ Sha256_Init(&p->sha);
1149
+ p->state = XZ_STATE_BLOCK_HEADER;
1150
+ p->pos = 0;
1151
+ }
1152
+ break;
1153
+ }
1154
+
1155
+ case XZ_STATE_BLOCK_HEADER:
1156
+ {
1157
+ if (p->pos == 0)
1158
+ {
1159
+ p->buf[p->pos++] = *src++;
1160
+ (*srcLen)++;
1161
+ if (p->buf[0] == 0)
1162
+ {
1163
+ if (p->decodeOnlyOneBlock)
1164
+ return SZ_ERROR_DATA;
1165
+ p->indexPreSize = 1 + Xz_WriteVarInt(p->buf + 1, p->numBlocks);
1166
+ p->indexPos = p->indexPreSize;
1167
+ p->indexSize += p->indexPreSize;
1168
+ Sha256_Final(&p->sha, (Byte *)(void *)p->shaDigest32);
1169
+ Sha256_Init(&p->sha);
1170
+ p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize);
1171
+ p->state = XZ_STATE_STREAM_INDEX;
1172
+ break;
1173
+ }
1174
+ p->blockHeaderSize = ((unsigned)p->buf[0] << 2) + 4;
1175
+ break;
1176
+ }
1177
+
1178
+ if (p->pos != p->blockHeaderSize)
1179
+ {
1180
+ unsigned cur = p->blockHeaderSize - p->pos;
1181
+ if (cur > srcRem)
1182
+ cur = (unsigned)srcRem;
1183
+ memcpy(p->buf + p->pos, src, cur);
1184
+ p->pos += cur;
1185
+ (*srcLen) += cur;
1186
+ src += cur;
1187
+ }
1188
+ else
1189
+ {
1190
+ RINOK(XzBlock_Parse(&p->block, p->buf))
1191
+ if (!XzBlock_AreSupportedFilters(&p->block))
1192
+ return SZ_ERROR_UNSUPPORTED;
1193
+ p->numTotalBlocks++;
1194
+ p->state = XZ_STATE_BLOCK;
1195
+ p->packSize = 0;
1196
+ p->unpackSize = 0;
1197
+ XzCheck_Init(&p->check, XzFlags_GetCheckType(p->streamFlags));
1198
+ if (p->parseMode)
1199
+ {
1200
+ p->headerParsedOk = True;
1201
+ return SZ_OK;
1202
+ }
1203
+ RINOK(XzDecMix_Init(&p->decoder, &p->block, p->outBuf, p->outBufSize))
1204
+ }
1205
+ break;
1206
+ }
1207
+
1208
+ case XZ_STATE_BLOCK_FOOTER:
1209
+ {
1210
+ if ((((unsigned)p->packSize + p->alignPos) & 3) != 0)
1211
+ {
1212
+ if (srcRem == 0)
1213
+ {
1214
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
1215
+ return SZ_OK;
1216
+ }
1217
+ (*srcLen)++;
1218
+ p->alignPos++;
1219
+ if (*src++ != 0)
1220
+ return SZ_ERROR_CRC;
1221
+ }
1222
+ else
1223
+ {
1224
+ const unsigned checkSize = XzFlags_GetCheckSize(p->streamFlags);
1225
+ unsigned cur = checkSize - p->pos;
1226
+ if (cur != 0)
1227
+ {
1228
+ if (srcRem == 0)
1229
+ {
1230
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
1231
+ return SZ_OK;
1232
+ }
1233
+ if (cur > srcRem)
1234
+ cur = (unsigned)srcRem;
1235
+ memcpy(p->buf + p->pos, src, cur);
1236
+ p->pos += cur;
1237
+ (*srcLen) += cur;
1238
+ src += cur;
1239
+ if (checkSize != p->pos)
1240
+ break;
1241
+ }
1242
+ {
1243
+ UInt32 digest32[XZ_CHECK_SIZE_MAX / 4];
1244
+ p->state = XZ_STATE_BLOCK_HEADER;
1245
+ p->pos = 0;
1246
+ if (XzCheck_Final(&p->check, (void *)digest32) && memcmp(digest32, p->buf, checkSize) != 0)
1247
+ return SZ_ERROR_CRC;
1248
+ if (p->decodeOnlyOneBlock)
1249
+ {
1250
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
1251
+ return SZ_OK;
1252
+ }
1253
+ }
1254
+ }
1255
+ break;
1256
+ }
1257
+
1258
+ case XZ_STATE_STREAM_INDEX:
1259
+ {
1260
+ if (p->pos < p->indexPreSize)
1261
+ {
1262
+ (*srcLen)++;
1263
+ if (*src++ != p->buf[p->pos++])
1264
+ return SZ_ERROR_CRC;
1265
+ }
1266
+ else
1267
+ {
1268
+ if (p->indexPos < p->indexSize)
1269
+ {
1270
+ UInt64 cur = p->indexSize - p->indexPos;
1271
+ if (srcRem > cur)
1272
+ srcRem = (SizeT)cur;
1273
+ p->crc = CrcUpdate(p->crc, src, srcRem);
1274
+ Sha256_Update(&p->sha, src, srcRem);
1275
+ (*srcLen) += srcRem;
1276
+ src += srcRem;
1277
+ p->indexPos += srcRem;
1278
+ }
1279
+ else if ((p->indexPos & 3) != 0)
1280
+ {
1281
+ Byte b = *src++;
1282
+ p->crc = CRC_UPDATE_BYTE(p->crc, b);
1283
+ (*srcLen)++;
1284
+ p->indexPos++;
1285
+ p->indexSize++;
1286
+ if (b != 0)
1287
+ return SZ_ERROR_CRC;
1288
+ }
1289
+ else
1290
+ {
1291
+ UInt32 digest32[SHA256_DIGEST_SIZE / 4];
1292
+ p->state = XZ_STATE_STREAM_INDEX_CRC;
1293
+ p->indexSize += 4;
1294
+ p->pos = 0;
1295
+ Sha256_Final(&p->sha, (void *)digest32);
1296
+ if (memcmp(digest32, p->shaDigest32, SHA256_DIGEST_SIZE) != 0)
1297
+ return SZ_ERROR_CRC;
1298
+ }
1299
+ }
1300
+ break;
1301
+ }
1302
+
1303
+ case XZ_STATE_STREAM_INDEX_CRC:
1304
+ {
1305
+ if (p->pos < 4)
1306
+ {
1307
+ (*srcLen)++;
1308
+ p->buf[p->pos++] = *src++;
1309
+ }
1310
+ else
1311
+ {
1312
+ const Byte *ptr = p->buf;
1313
+ p->state = XZ_STATE_STREAM_FOOTER;
1314
+ p->pos = 0;
1315
+ if (CRC_GET_DIGEST(p->crc) != GetUi32a(ptr))
1316
+ return SZ_ERROR_CRC;
1317
+ }
1318
+ break;
1319
+ }
1320
+
1321
+ case XZ_STATE_STREAM_FOOTER:
1322
+ {
1323
+ unsigned cur = XZ_STREAM_FOOTER_SIZE - p->pos;
1324
+ if (cur > srcRem)
1325
+ cur = (unsigned)srcRem;
1326
+ memcpy(p->buf + p->pos, src, cur);
1327
+ p->pos += cur;
1328
+ (*srcLen) += cur;
1329
+ src += cur;
1330
+ if (p->pos == XZ_STREAM_FOOTER_SIZE)
1331
+ {
1332
+ p->state = XZ_STATE_STREAM_PADDING;
1333
+ p->numFinishedStreams++;
1334
+ p->padSize = 0;
1335
+ if (!Xz_CheckFooter(p->streamFlags, p->indexSize, p->buf))
1336
+ return SZ_ERROR_CRC;
1337
+ }
1338
+ break;
1339
+ }
1340
+
1341
+ case XZ_STATE_STREAM_PADDING:
1342
+ {
1343
+ if (*src != 0)
1344
+ {
1345
+ if ((unsigned)p->padSize & 3)
1346
+ return SZ_ERROR_NO_ARCHIVE;
1347
+ p->pos = 0;
1348
+ p->state = XZ_STATE_STREAM_HEADER;
1349
+ }
1350
+ else
1351
+ {
1352
+ (*srcLen)++;
1353
+ src++;
1354
+ p->padSize++;
1355
+ }
1356
+ break;
1357
+ }
1358
+
1359
+ case XZ_STATE_BLOCK: break; /* to disable GCC warning */
1360
+
1361
+ default: return SZ_ERROR_FAIL;
1362
+ }
1363
+ }
1364
+ /*
1365
+ if (p->state == XZ_STATE_FINISHED)
1366
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
1367
+ return SZ_OK;
1368
+ */
1369
+ }
1370
+
1371
+
1372
+ SRes XzUnpacker_CodeFull(CXzUnpacker *p, Byte *dest, SizeT *destLen,
1373
+ const Byte *src, SizeT *srcLen,
1374
+ ECoderFinishMode finishMode, ECoderStatus *status)
1375
+ {
1376
+ XzUnpacker_Init(p);
1377
+ XzUnpacker_SetOutBuf(p, dest, *destLen);
1378
+
1379
+ return XzUnpacker_Code(p,
1380
+ NULL, destLen,
1381
+ src, srcLen, True,
1382
+ finishMode, status);
1383
+ }
1384
+
1385
+
1386
+ BoolInt XzUnpacker_IsBlockFinished(const CXzUnpacker *p)
1387
+ {
1388
+ return (p->state == XZ_STATE_BLOCK_HEADER) && (p->pos == 0);
1389
+ }
1390
+
1391
+ BoolInt XzUnpacker_IsStreamWasFinished(const CXzUnpacker *p)
1392
+ {
1393
+ return (p->state == XZ_STATE_STREAM_PADDING) && (((UInt32)p->padSize & 3) == 0);
1394
+ }
1395
+
1396
+ UInt64 XzUnpacker_GetExtraSize(const CXzUnpacker *p)
1397
+ {
1398
+ UInt64 num = 0;
1399
+ if (p->state == XZ_STATE_STREAM_PADDING)
1400
+ num = p->padSize;
1401
+ else if (p->state == XZ_STATE_STREAM_HEADER)
1402
+ num = p->padSize + p->pos;
1403
+ return num;
1404
+ }
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+ #ifndef Z7_ST
1427
+ #include "MtDec.h"
1428
+ #endif
1429
+
1430
+
1431
+ void XzDecMtProps_Init(CXzDecMtProps *p)
1432
+ {
1433
+ p->inBufSize_ST = 1 << 18;
1434
+ p->outStep_ST = 1 << 20;
1435
+ p->ignoreErrors = False;
1436
+
1437
+ #ifndef Z7_ST
1438
+ p->numThreads = 1;
1439
+ p->inBufSize_MT = 1 << 18;
1440
+ p->memUseMax = sizeof(size_t) << 28;
1441
+ #endif
1442
+ }
1443
+
1444
+
1445
+
1446
+ #ifndef Z7_ST
1447
+
1448
+ /* ---------- CXzDecMtThread ---------- */
1449
+
1450
+ typedef struct
1451
+ {
1452
+ Byte *outBuf;
1453
+ size_t outBufSize;
1454
+ size_t outPreSize;
1455
+ size_t inPreSize;
1456
+ size_t inPreHeaderSize;
1457
+ size_t blockPackSize_for_Index; // including block header and checksum.
1458
+ size_t blockPackTotal; // including stream header, block header and checksum.
1459
+ size_t inCodeSize;
1460
+ size_t outCodeSize;
1461
+ ECoderStatus status;
1462
+ SRes codeRes;
1463
+ BoolInt skipMode;
1464
+ // BoolInt finishedWithMark;
1465
+ EMtDecParseState parseState;
1466
+ BoolInt parsing_Truncated;
1467
+ BoolInt atBlockHeader;
1468
+ CXzStreamFlags streamFlags;
1469
+ // UInt64 numFinishedStreams
1470
+ UInt64 numStreams;
1471
+ UInt64 numTotalBlocks;
1472
+ UInt64 numBlocks;
1473
+
1474
+ BoolInt dec_created;
1475
+ CXzUnpacker dec;
1476
+
1477
+ Byte mtPad[1 << 7];
1478
+ } CXzDecMtThread;
1479
+
1480
+ #endif
1481
+
1482
+
1483
+ /* ---------- CXzDecMt ---------- */
1484
+
1485
+ struct CXzDecMt
1486
+ {
1487
+ CAlignOffsetAlloc alignOffsetAlloc;
1488
+ ISzAllocPtr allocMid;
1489
+
1490
+ CXzDecMtProps props;
1491
+ size_t unpackBlockMaxSize;
1492
+
1493
+ ISeqInStreamPtr inStream;
1494
+ ISeqOutStreamPtr outStream;
1495
+ ICompressProgressPtr progress;
1496
+
1497
+ BoolInt finishMode;
1498
+ BoolInt outSize_Defined;
1499
+ UInt64 outSize;
1500
+
1501
+ UInt64 outProcessed;
1502
+ UInt64 inProcessed;
1503
+ UInt64 readProcessed;
1504
+ BoolInt readWasFinished;
1505
+ SRes readRes;
1506
+ SRes writeRes;
1507
+
1508
+ Byte *outBuf;
1509
+ size_t outBufSize;
1510
+ Byte *inBuf;
1511
+ size_t inBufSize;
1512
+
1513
+ CXzUnpacker dec;
1514
+
1515
+ ECoderStatus status;
1516
+ SRes codeRes;
1517
+
1518
+ #ifndef Z7_ST
1519
+ BoolInt mainDecoderWasCalled;
1520
+ // int statErrorDefined;
1521
+ int finishedDecoderIndex;
1522
+
1523
+ // global values that are used in Parse stage
1524
+ CXzStreamFlags streamFlags;
1525
+ // UInt64 numFinishedStreams
1526
+ UInt64 numStreams;
1527
+ UInt64 numTotalBlocks;
1528
+ UInt64 numBlocks;
1529
+
1530
+ // UInt64 numBadBlocks;
1531
+ SRes mainErrorCode; // it's set to error code, if the size Code() output doesn't patch the size from Parsing stage
1532
+ // it can be = SZ_ERROR_INPUT_EOF
1533
+ // it can be = SZ_ERROR_DATA, in some another cases
1534
+ BoolInt isBlockHeaderState_Parse;
1535
+ BoolInt isBlockHeaderState_Write;
1536
+ UInt64 outProcessed_Parse;
1537
+ BoolInt parsing_Truncated;
1538
+
1539
+ BoolInt mtc_WasConstructed;
1540
+ CMtDec mtc;
1541
+ CXzDecMtThread coders[MTDEC_THREADS_MAX];
1542
+ #endif
1543
+ };
1544
+
1545
+
1546
+
1547
+ CXzDecMtHandle XzDecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid)
1548
+ {
1549
+ CXzDecMt *p = (CXzDecMt *)ISzAlloc_Alloc(alloc, sizeof(CXzDecMt));
1550
+ if (!p)
1551
+ return NULL;
1552
+
1553
+ AlignOffsetAlloc_CreateVTable(&p->alignOffsetAlloc);
1554
+ p->alignOffsetAlloc.baseAlloc = alloc;
1555
+ p->alignOffsetAlloc.numAlignBits = 7;
1556
+ p->alignOffsetAlloc.offset = 0;
1557
+
1558
+ p->allocMid = allocMid;
1559
+
1560
+ p->outBuf = NULL;
1561
+ p->outBufSize = 0;
1562
+ p->inBuf = NULL;
1563
+ p->inBufSize = 0;
1564
+
1565
+ XzUnpacker_Construct(&p->dec, &p->alignOffsetAlloc.vt);
1566
+
1567
+ p->unpackBlockMaxSize = 0;
1568
+
1569
+ XzDecMtProps_Init(&p->props);
1570
+
1571
+ #ifndef Z7_ST
1572
+ p->mtc_WasConstructed = False;
1573
+ {
1574
+ unsigned i;
1575
+ for (i = 0; i < MTDEC_THREADS_MAX; i++)
1576
+ {
1577
+ CXzDecMtThread *coder = &p->coders[i];
1578
+ coder->dec_created = False;
1579
+ coder->outBuf = NULL;
1580
+ coder->outBufSize = 0;
1581
+ }
1582
+ }
1583
+ #endif
1584
+
1585
+ return (CXzDecMtHandle)p;
1586
+ }
1587
+
1588
+
1589
+ #ifndef Z7_ST
1590
+
1591
+ static void XzDecMt_FreeOutBufs(CXzDecMt *p)
1592
+ {
1593
+ unsigned i;
1594
+ for (i = 0; i < MTDEC_THREADS_MAX; i++)
1595
+ {
1596
+ CXzDecMtThread *coder = &p->coders[i];
1597
+ if (coder->outBuf)
1598
+ {
1599
+ ISzAlloc_Free(p->allocMid, coder->outBuf);
1600
+ coder->outBuf = NULL;
1601
+ coder->outBufSize = 0;
1602
+ }
1603
+ }
1604
+ p->unpackBlockMaxSize = 0;
1605
+ }
1606
+
1607
+ #endif
1608
+
1609
+
1610
+
1611
+ static void XzDecMt_FreeSt(CXzDecMt *p)
1612
+ {
1613
+ XzUnpacker_Free(&p->dec);
1614
+
1615
+ if (p->outBuf)
1616
+ {
1617
+ ISzAlloc_Free(p->allocMid, p->outBuf);
1618
+ p->outBuf = NULL;
1619
+ }
1620
+ p->outBufSize = 0;
1621
+
1622
+ if (p->inBuf)
1623
+ {
1624
+ ISzAlloc_Free(p->allocMid, p->inBuf);
1625
+ p->inBuf = NULL;
1626
+ }
1627
+ p->inBufSize = 0;
1628
+ }
1629
+
1630
+
1631
+ // #define GET_CXzDecMt_p CXzDecMt *p = pp;
1632
+
1633
+ void XzDecMt_Destroy(CXzDecMtHandle p)
1634
+ {
1635
+ // GET_CXzDecMt_p
1636
+
1637
+ XzDecMt_FreeSt(p);
1638
+
1639
+ #ifndef Z7_ST
1640
+
1641
+ if (p->mtc_WasConstructed)
1642
+ {
1643
+ MtDec_Destruct(&p->mtc);
1644
+ p->mtc_WasConstructed = False;
1645
+ }
1646
+ {
1647
+ unsigned i;
1648
+ for (i = 0; i < MTDEC_THREADS_MAX; i++)
1649
+ {
1650
+ CXzDecMtThread *t = &p->coders[i];
1651
+ if (t->dec_created)
1652
+ {
1653
+ // we don't need to free dict here
1654
+ XzUnpacker_Free(&t->dec);
1655
+ t->dec_created = False;
1656
+ }
1657
+ }
1658
+ }
1659
+ XzDecMt_FreeOutBufs(p);
1660
+
1661
+ #endif
1662
+
1663
+ ISzAlloc_Free(p->alignOffsetAlloc.baseAlloc, p);
1664
+ }
1665
+
1666
+
1667
+
1668
+ #ifndef Z7_ST
1669
+
1670
+ static void XzDecMt_Callback_Parse(void *obj, unsigned coderIndex, CMtDecCallbackInfo *cc)
1671
+ {
1672
+ CXzDecMt *me = (CXzDecMt *)obj;
1673
+ CXzDecMtThread *coder = &me->coders[coderIndex];
1674
+ size_t srcSize = cc->srcSize;
1675
+
1676
+ cc->srcSize = 0;
1677
+ cc->outPos = 0;
1678
+ cc->state = MTDEC_PARSE_CONTINUE;
1679
+
1680
+ cc->canCreateNewThread = True;
1681
+
1682
+ if (cc->startCall)
1683
+ {
1684
+ coder->outPreSize = 0;
1685
+ coder->inPreSize = 0;
1686
+ coder->inPreHeaderSize = 0;
1687
+ coder->parseState = MTDEC_PARSE_CONTINUE;
1688
+ coder->parsing_Truncated = False;
1689
+ coder->skipMode = False;
1690
+ coder->codeRes = SZ_OK;
1691
+ coder->status = CODER_STATUS_NOT_SPECIFIED;
1692
+ coder->inCodeSize = 0;
1693
+ coder->outCodeSize = 0;
1694
+
1695
+ coder->numStreams = me->numStreams;
1696
+ coder->numTotalBlocks = me->numTotalBlocks;
1697
+ coder->numBlocks = me->numBlocks;
1698
+
1699
+ if (!coder->dec_created)
1700
+ {
1701
+ XzUnpacker_Construct(&coder->dec, &me->alignOffsetAlloc.vt);
1702
+ coder->dec_created = True;
1703
+ }
1704
+
1705
+ XzUnpacker_Init(&coder->dec);
1706
+
1707
+ if (me->isBlockHeaderState_Parse)
1708
+ {
1709
+ coder->dec.streamFlags = me->streamFlags;
1710
+ coder->atBlockHeader = True;
1711
+ XzUnpacker_PrepareToRandomBlockDecoding(&coder->dec);
1712
+ }
1713
+ else
1714
+ {
1715
+ coder->atBlockHeader = False;
1716
+ me->isBlockHeaderState_Parse = True;
1717
+ }
1718
+
1719
+ coder->dec.numStartedStreams = me->numStreams;
1720
+ coder->dec.numTotalBlocks = me->numTotalBlocks;
1721
+ coder->dec.numBlocks = me->numBlocks;
1722
+ }
1723
+
1724
+ while (!coder->skipMode)
1725
+ {
1726
+ ECoderStatus status;
1727
+ SRes res;
1728
+ size_t srcSize2 = srcSize;
1729
+ size_t destSize = (size_t)0 - 1;
1730
+
1731
+ coder->dec.parseMode = True;
1732
+ coder->dec.headerParsedOk = False;
1733
+
1734
+ PRF_STR_INT("Parse", srcSize2)
1735
+
1736
+ res = XzUnpacker_Code(&coder->dec,
1737
+ NULL, &destSize,
1738
+ cc->src, &srcSize2, cc->srcFinished,
1739
+ CODER_FINISH_END, &status);
1740
+
1741
+ // PRF(printf(" res = %d, srcSize2 = %d", res, (unsigned)srcSize2));
1742
+
1743
+ coder->codeRes = res;
1744
+ coder->status = status;
1745
+ cc->srcSize += srcSize2;
1746
+ srcSize -= srcSize2;
1747
+ coder->inPreHeaderSize += srcSize2;
1748
+ coder->inPreSize = coder->inPreHeaderSize;
1749
+
1750
+ if (res != SZ_OK)
1751
+ {
1752
+ cc->state =
1753
+ coder->parseState = MTDEC_PARSE_END;
1754
+ /*
1755
+ if (res == SZ_ERROR_MEM)
1756
+ return res;
1757
+ return SZ_OK;
1758
+ */
1759
+ return; // res;
1760
+ }
1761
+
1762
+ if (coder->dec.headerParsedOk)
1763
+ {
1764
+ const CXzBlock *block = &coder->dec.block;
1765
+ if (XzBlock_HasUnpackSize(block)
1766
+ // && block->unpackSize <= me->props.outBlockMax
1767
+ && XzBlock_HasPackSize(block))
1768
+ {
1769
+ {
1770
+ if (block->unpackSize * 2 * me->mtc.numStartedThreads > me->props.memUseMax)
1771
+ {
1772
+ cc->state = MTDEC_PARSE_OVERFLOW;
1773
+ return; // SZ_OK;
1774
+ }
1775
+ }
1776
+ {
1777
+ const UInt64 packSize = block->packSize;
1778
+ const UInt64 packSizeAligned = packSize + ((0 - (unsigned)packSize) & 3);
1779
+ const unsigned checkSize = XzFlags_GetCheckSize(coder->dec.streamFlags);
1780
+ const UInt64 blockPackSum = coder->inPreSize + packSizeAligned + checkSize;
1781
+ // if (blockPackSum <= me->props.inBlockMax)
1782
+ // unpackBlockMaxSize
1783
+ {
1784
+ coder->blockPackSize_for_Index = (size_t)(coder->dec.blockHeaderSize + packSize + checkSize);
1785
+ coder->blockPackTotal = (size_t)blockPackSum;
1786
+ coder->outPreSize = (size_t)block->unpackSize;
1787
+ coder->streamFlags = coder->dec.streamFlags;
1788
+ me->streamFlags = coder->dec.streamFlags;
1789
+ coder->skipMode = True;
1790
+ break;
1791
+ }
1792
+ }
1793
+ }
1794
+ }
1795
+ else
1796
+ // if (coder->inPreSize <= me->props.inBlockMax)
1797
+ {
1798
+ if (!cc->srcFinished)
1799
+ return; // SZ_OK;
1800
+ cc->state =
1801
+ coder->parseState = MTDEC_PARSE_END;
1802
+ return; // SZ_OK;
1803
+ }
1804
+ cc->state = MTDEC_PARSE_OVERFLOW;
1805
+ return; // SZ_OK;
1806
+ }
1807
+
1808
+ // ---------- skipMode ----------
1809
+ {
1810
+ UInt64 rem = coder->blockPackTotal - coder->inPreSize;
1811
+ size_t cur = srcSize;
1812
+ if (cur > rem)
1813
+ cur = (size_t)rem;
1814
+ cc->srcSize += cur;
1815
+ coder->inPreSize += cur;
1816
+ srcSize -= cur;
1817
+
1818
+ if (coder->inPreSize == coder->blockPackTotal)
1819
+ {
1820
+ if (srcSize == 0)
1821
+ {
1822
+ if (!cc->srcFinished)
1823
+ return; // SZ_OK;
1824
+ cc->state = MTDEC_PARSE_END;
1825
+ }
1826
+ else if ((cc->src)[cc->srcSize] == 0) // we check control byte of next block
1827
+ cc->state = MTDEC_PARSE_END;
1828
+ else
1829
+ {
1830
+ cc->state = MTDEC_PARSE_NEW;
1831
+
1832
+ {
1833
+ size_t blockMax = me->unpackBlockMaxSize;
1834
+ if (blockMax < coder->outPreSize)
1835
+ blockMax = coder->outPreSize;
1836
+ {
1837
+ UInt64 required = (UInt64)blockMax * (me->mtc.numStartedThreads + 1) * 2;
1838
+ if (me->props.memUseMax < required)
1839
+ cc->canCreateNewThread = False;
1840
+ }
1841
+ }
1842
+
1843
+ if (me->outSize_Defined)
1844
+ {
1845
+ // next block can be zero size
1846
+ const UInt64 rem2 = me->outSize - me->outProcessed_Parse;
1847
+ if (rem2 < coder->outPreSize)
1848
+ {
1849
+ coder->parsing_Truncated = True;
1850
+ cc->state = MTDEC_PARSE_END;
1851
+ }
1852
+ me->outProcessed_Parse += coder->outPreSize;
1853
+ }
1854
+ }
1855
+ }
1856
+ else if (cc->srcFinished)
1857
+ cc->state = MTDEC_PARSE_END;
1858
+ else
1859
+ return; // SZ_OK;
1860
+
1861
+ coder->parseState = cc->state;
1862
+ cc->outPos = coder->outPreSize;
1863
+
1864
+ me->numStreams = coder->dec.numStartedStreams;
1865
+ me->numTotalBlocks = coder->dec.numTotalBlocks;
1866
+ me->numBlocks = coder->dec.numBlocks + 1;
1867
+ return; // SZ_OK;
1868
+ }
1869
+ }
1870
+
1871
+
1872
+ static SRes XzDecMt_Callback_PreCode(void *pp, unsigned coderIndex)
1873
+ {
1874
+ CXzDecMt *me = (CXzDecMt *)pp;
1875
+ CXzDecMtThread *coder = &me->coders[coderIndex];
1876
+ Byte *dest;
1877
+
1878
+ if (!coder->dec.headerParsedOk)
1879
+ return SZ_OK;
1880
+
1881
+ dest = coder->outBuf;
1882
+
1883
+ if (!dest || coder->outBufSize < coder->outPreSize)
1884
+ {
1885
+ if (dest)
1886
+ {
1887
+ ISzAlloc_Free(me->allocMid, dest);
1888
+ coder->outBuf = NULL;
1889
+ coder->outBufSize = 0;
1890
+ }
1891
+ {
1892
+ size_t outPreSize = coder->outPreSize;
1893
+ if (outPreSize == 0)
1894
+ outPreSize = 1;
1895
+ dest = (Byte *)ISzAlloc_Alloc(me->allocMid, outPreSize);
1896
+ }
1897
+ if (!dest)
1898
+ return SZ_ERROR_MEM;
1899
+ coder->outBuf = dest;
1900
+ coder->outBufSize = coder->outPreSize;
1901
+
1902
+ if (coder->outBufSize > me->unpackBlockMaxSize)
1903
+ me->unpackBlockMaxSize = coder->outBufSize;
1904
+ }
1905
+
1906
+ // return SZ_ERROR_MEM;
1907
+
1908
+ XzUnpacker_SetOutBuf(&coder->dec, coder->outBuf, coder->outBufSize);
1909
+
1910
+ {
1911
+ SRes res = XzDecMix_Init(&coder->dec.decoder, &coder->dec.block, coder->outBuf, coder->outBufSize);
1912
+ // res = SZ_ERROR_UNSUPPORTED; // to test
1913
+ coder->codeRes = res;
1914
+ if (res != SZ_OK)
1915
+ {
1916
+ // if (res == SZ_ERROR_MEM) return res;
1917
+ if (me->props.ignoreErrors && res != SZ_ERROR_MEM)
1918
+ return SZ_OK;
1919
+ return res;
1920
+ }
1921
+ }
1922
+
1923
+ return SZ_OK;
1924
+ }
1925
+
1926
+
1927
+ static SRes XzDecMt_Callback_Code(void *pp, unsigned coderIndex,
1928
+ const Byte *src, size_t srcSize, int srcFinished,
1929
+ // int finished, int blockFinished,
1930
+ UInt64 *inCodePos, UInt64 *outCodePos, int *stop)
1931
+ {
1932
+ CXzDecMt *me = (CXzDecMt *)pp;
1933
+ CXzDecMtThread *coder = &me->coders[coderIndex];
1934
+
1935
+ *inCodePos = coder->inCodeSize;
1936
+ *outCodePos = coder->outCodeSize;
1937
+ *stop = True;
1938
+
1939
+ if (srcSize > coder->inPreSize - coder->inCodeSize)
1940
+ return SZ_ERROR_FAIL;
1941
+
1942
+ if (coder->inCodeSize < coder->inPreHeaderSize)
1943
+ {
1944
+ size_t step = coder->inPreHeaderSize - coder->inCodeSize;
1945
+ if (step > srcSize)
1946
+ step = srcSize;
1947
+ src += step;
1948
+ srcSize -= step;
1949
+ coder->inCodeSize += step;
1950
+ *inCodePos = coder->inCodeSize;
1951
+ if (coder->inCodeSize < coder->inPreHeaderSize)
1952
+ {
1953
+ *stop = False;
1954
+ return SZ_OK;
1955
+ }
1956
+ }
1957
+
1958
+ if (!coder->dec.headerParsedOk)
1959
+ return SZ_OK;
1960
+ if (!coder->outBuf)
1961
+ return SZ_OK;
1962
+
1963
+ if (coder->codeRes == SZ_OK)
1964
+ {
1965
+ ECoderStatus status;
1966
+ SRes res;
1967
+ size_t srcProcessed = srcSize;
1968
+ size_t outSizeCur = coder->outPreSize - coder->dec.outDataWritten;
1969
+
1970
+ // PRF(printf("\nCallback_Code: Code %d %d\n", (unsigned)srcSize, (unsigned)outSizeCur));
1971
+
1972
+ res = XzUnpacker_Code(&coder->dec,
1973
+ NULL, &outSizeCur,
1974
+ src, &srcProcessed, srcFinished,
1975
+ // coder->finishedWithMark ? CODER_FINISH_END : CODER_FINISH_ANY,
1976
+ CODER_FINISH_END,
1977
+ &status);
1978
+
1979
+ // PRF(printf(" res = %d, srcSize2 = %d, outSizeCur = %d", res, (unsigned)srcProcessed, (unsigned)outSizeCur));
1980
+
1981
+ coder->codeRes = res;
1982
+ coder->status = status;
1983
+ coder->inCodeSize += srcProcessed;
1984
+ coder->outCodeSize = coder->dec.outDataWritten;
1985
+ *inCodePos = coder->inCodeSize;
1986
+ *outCodePos = coder->outCodeSize;
1987
+
1988
+ if (res == SZ_OK)
1989
+ {
1990
+ if (srcProcessed == srcSize)
1991
+ *stop = False;
1992
+ return SZ_OK;
1993
+ }
1994
+ }
1995
+
1996
+ if (me->props.ignoreErrors && coder->codeRes != SZ_ERROR_MEM)
1997
+ {
1998
+ *inCodePos = coder->inPreSize;
1999
+ *outCodePos = coder->outPreSize;
2000
+ return SZ_OK;
2001
+ }
2002
+ return coder->codeRes;
2003
+ }
2004
+
2005
+
2006
+ #define XZDECMT_STREAM_WRITE_STEP (1 << 24)
2007
+
2008
+ static SRes XzDecMt_Callback_Write(void *pp, unsigned coderIndex,
2009
+ BoolInt needWriteToStream,
2010
+ const Byte *src, size_t srcSize, BoolInt isCross,
2011
+ // int srcFinished,
2012
+ BoolInt *needContinue,
2013
+ BoolInt *canRecode)
2014
+ {
2015
+ CXzDecMt *me = (CXzDecMt *)pp;
2016
+ const CXzDecMtThread *coder = &me->coders[coderIndex];
2017
+
2018
+ // PRF(printf("\nWrite processed = %d srcSize = %d\n", (unsigned)me->mtc.inProcessed, (unsigned)srcSize));
2019
+
2020
+ *needContinue = False;
2021
+ *canRecode = True;
2022
+
2023
+ if (!needWriteToStream)
2024
+ return SZ_OK;
2025
+
2026
+ if (!coder->dec.headerParsedOk || !coder->outBuf)
2027
+ {
2028
+ if (me->finishedDecoderIndex < 0)
2029
+ me->finishedDecoderIndex = (int)coderIndex;
2030
+ return SZ_OK;
2031
+ }
2032
+
2033
+ if (me->finishedDecoderIndex >= 0)
2034
+ return SZ_OK;
2035
+
2036
+ me->mtc.inProcessed += coder->inCodeSize;
2037
+
2038
+ *canRecode = False;
2039
+
2040
+ {
2041
+ SRes res;
2042
+ size_t size = coder->outCodeSize;
2043
+ Byte *data = coder->outBuf;
2044
+
2045
+ // we use in me->dec: sha, numBlocks, indexSize
2046
+
2047
+ if (!me->isBlockHeaderState_Write)
2048
+ {
2049
+ XzUnpacker_PrepareToRandomBlockDecoding(&me->dec);
2050
+ me->dec.decodeOnlyOneBlock = False;
2051
+ me->dec.numStartedStreams = coder->dec.numStartedStreams;
2052
+ me->dec.streamFlags = coder->streamFlags;
2053
+
2054
+ me->isBlockHeaderState_Write = True;
2055
+ }
2056
+
2057
+ me->dec.numTotalBlocks = coder->dec.numTotalBlocks;
2058
+ XzUnpacker_UpdateIndex(&me->dec, coder->blockPackSize_for_Index, coder->outPreSize);
2059
+
2060
+ if (coder->outPreSize != size)
2061
+ {
2062
+ if (me->props.ignoreErrors)
2063
+ {
2064
+ memset(data + size, 0, coder->outPreSize - size);
2065
+ size = coder->outPreSize;
2066
+ }
2067
+ // me->numBadBlocks++;
2068
+ if (me->mainErrorCode == SZ_OK)
2069
+ {
2070
+ if ((int)coder->status == LZMA_STATUS_NEEDS_MORE_INPUT)
2071
+ me->mainErrorCode = SZ_ERROR_INPUT_EOF;
2072
+ else
2073
+ me->mainErrorCode = SZ_ERROR_DATA;
2074
+ }
2075
+ }
2076
+
2077
+ if (me->writeRes != SZ_OK)
2078
+ return me->writeRes;
2079
+
2080
+ res = SZ_OK;
2081
+ {
2082
+ if (me->outSize_Defined)
2083
+ {
2084
+ const UInt64 rem = me->outSize - me->outProcessed;
2085
+ if (size > rem)
2086
+ size = (SizeT)rem;
2087
+ }
2088
+
2089
+ for (;;)
2090
+ {
2091
+ size_t cur = size;
2092
+ size_t written;
2093
+ if (cur > XZDECMT_STREAM_WRITE_STEP)
2094
+ cur = XZDECMT_STREAM_WRITE_STEP;
2095
+
2096
+ written = ISeqOutStream_Write(me->outStream, data, cur);
2097
+
2098
+ // PRF(printf("\nWritten ask = %d written = %d\n", (unsigned)cur, (unsigned)written));
2099
+
2100
+ me->outProcessed += written;
2101
+ if (written != cur)
2102
+ {
2103
+ me->writeRes = SZ_ERROR_WRITE;
2104
+ res = me->writeRes;
2105
+ break;
2106
+ }
2107
+ data += cur;
2108
+ size -= cur;
2109
+ // PRF_STR_INT("Written size =", size)
2110
+ if (size == 0)
2111
+ break;
2112
+ res = MtProgress_ProgressAdd(&me->mtc.mtProgress, 0, 0);
2113
+ if (res != SZ_OK)
2114
+ break;
2115
+ }
2116
+ }
2117
+
2118
+ if (coder->codeRes != SZ_OK)
2119
+ if (!me->props.ignoreErrors)
2120
+ {
2121
+ me->finishedDecoderIndex = (int)coderIndex;
2122
+ return res;
2123
+ }
2124
+
2125
+ RINOK(res)
2126
+
2127
+ if (coder->inPreSize != coder->inCodeSize
2128
+ || coder->blockPackTotal != coder->inCodeSize)
2129
+ {
2130
+ me->finishedDecoderIndex = (int)coderIndex;
2131
+ return SZ_OK;
2132
+ }
2133
+
2134
+ if (coder->parseState != MTDEC_PARSE_END)
2135
+ {
2136
+ *needContinue = True;
2137
+ return SZ_OK;
2138
+ }
2139
+ }
2140
+
2141
+ // (coder->state == MTDEC_PARSE_END) means that there are no other working threads
2142
+ // so we can use mtc variables without lock
2143
+
2144
+ PRF_STR_INT("Write MTDEC_PARSE_END", me->mtc.inProcessed)
2145
+
2146
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
2147
+ {
2148
+ CXzUnpacker *dec = &me->dec;
2149
+
2150
+ PRF_STR_INT("PostSingle", srcSize)
2151
+
2152
+ {
2153
+ size_t srcProcessed = srcSize;
2154
+ ECoderStatus status;
2155
+ size_t outSizeCur = 0;
2156
+ SRes res;
2157
+
2158
+ // dec->decodeOnlyOneBlock = False;
2159
+ dec->decodeToStreamSignature = True;
2160
+
2161
+ me->mainDecoderWasCalled = True;
2162
+
2163
+ if (coder->parsing_Truncated)
2164
+ {
2165
+ me->parsing_Truncated = True;
2166
+ return SZ_OK;
2167
+ }
2168
+
2169
+ /*
2170
+ We have processed all xz-blocks of stream,
2171
+ And xz unpacker is at XZ_STATE_BLOCK_HEADER state, where
2172
+ (src) is a pointer to xz-Index structure.
2173
+ We finish reading of current xz-Stream, including Zero padding after xz-Stream.
2174
+ We exit, if we reach extra byte (first byte of new-Stream or another data).
2175
+ But we don't update input stream pointer for that new extra byte.
2176
+ If extra byte is not correct first byte of xz-signature,
2177
+ we have SZ_ERROR_NO_ARCHIVE error here.
2178
+ */
2179
+
2180
+ res = XzUnpacker_Code(dec,
2181
+ NULL, &outSizeCur,
2182
+ src, &srcProcessed,
2183
+ me->mtc.readWasFinished, // srcFinished
2184
+ CODER_FINISH_END, // CODER_FINISH_ANY,
2185
+ &status);
2186
+
2187
+ // res = SZ_ERROR_ARCHIVE; // for failure test
2188
+
2189
+ me->status = status;
2190
+ me->codeRes = res;
2191
+
2192
+ if (isCross)
2193
+ me->mtc.crossStart += srcProcessed;
2194
+
2195
+ me->mtc.inProcessed += srcProcessed;
2196
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
2197
+
2198
+ srcSize -= srcProcessed;
2199
+ src += srcProcessed;
2200
+
2201
+ if (res != SZ_OK)
2202
+ {
2203
+ return SZ_OK;
2204
+ // return res;
2205
+ }
2206
+
2207
+ if (dec->state == XZ_STATE_STREAM_HEADER)
2208
+ {
2209
+ *needContinue = True;
2210
+ me->isBlockHeaderState_Parse = False;
2211
+ me->isBlockHeaderState_Write = False;
2212
+
2213
+ if (!isCross)
2214
+ {
2215
+ Byte *crossBuf = MtDec_GetCrossBuff(&me->mtc);
2216
+ if (!crossBuf)
2217
+ return SZ_ERROR_MEM;
2218
+ if (srcSize != 0)
2219
+ memcpy(crossBuf, src, srcSize);
2220
+ me->mtc.crossStart = 0;
2221
+ me->mtc.crossEnd = srcSize;
2222
+ }
2223
+
2224
+ PRF_STR_INT("XZ_STATE_STREAM_HEADER crossEnd = ", (unsigned)me->mtc.crossEnd)
2225
+
2226
+ return SZ_OK;
2227
+ }
2228
+
2229
+ if (status != CODER_STATUS_NEEDS_MORE_INPUT || srcSize != 0)
2230
+ {
2231
+ return SZ_ERROR_FAIL;
2232
+ }
2233
+
2234
+ if (me->mtc.readWasFinished)
2235
+ {
2236
+ return SZ_OK;
2237
+ }
2238
+ }
2239
+
2240
+ {
2241
+ size_t inPos;
2242
+ size_t inLim;
2243
+ // const Byte *inData;
2244
+ UInt64 inProgressPrev = me->mtc.inProcessed;
2245
+
2246
+ // XzDecMt_Prepare_InBuf_ST(p);
2247
+ Byte *crossBuf = MtDec_GetCrossBuff(&me->mtc);
2248
+ if (!crossBuf)
2249
+ return SZ_ERROR_MEM;
2250
+
2251
+ inPos = 0;
2252
+ inLim = 0;
2253
+
2254
+ // inData = crossBuf;
2255
+
2256
+ for (;;)
2257
+ {
2258
+ SizeT inProcessed;
2259
+ SizeT outProcessed;
2260
+ ECoderStatus status;
2261
+ SRes res;
2262
+
2263
+ if (inPos == inLim)
2264
+ {
2265
+ if (!me->mtc.readWasFinished)
2266
+ {
2267
+ inPos = 0;
2268
+ inLim = me->mtc.inBufSize;
2269
+ me->mtc.readRes = ISeqInStream_Read(me->inStream, (void *)crossBuf, &inLim);
2270
+ me->mtc.readProcessed += inLim;
2271
+ if (inLim == 0 || me->mtc.readRes != SZ_OK)
2272
+ me->mtc.readWasFinished = True;
2273
+ }
2274
+ }
2275
+
2276
+ inProcessed = inLim - inPos;
2277
+ outProcessed = 0;
2278
+
2279
+ res = XzUnpacker_Code(dec,
2280
+ NULL, &outProcessed,
2281
+ crossBuf + inPos, &inProcessed,
2282
+ (inProcessed == 0), // srcFinished
2283
+ CODER_FINISH_END, &status);
2284
+
2285
+ me->codeRes = res;
2286
+ me->status = status;
2287
+ inPos += inProcessed;
2288
+ me->mtc.inProcessed += inProcessed;
2289
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
2290
+
2291
+ if (res != SZ_OK)
2292
+ {
2293
+ return SZ_OK;
2294
+ // return res;
2295
+ }
2296
+
2297
+ if (dec->state == XZ_STATE_STREAM_HEADER)
2298
+ {
2299
+ *needContinue = True;
2300
+ me->mtc.crossStart = inPos;
2301
+ me->mtc.crossEnd = inLim;
2302
+ me->isBlockHeaderState_Parse = False;
2303
+ me->isBlockHeaderState_Write = False;
2304
+ return SZ_OK;
2305
+ }
2306
+
2307
+ if (status != CODER_STATUS_NEEDS_MORE_INPUT)
2308
+ return SZ_ERROR_FAIL;
2309
+
2310
+ if (me->mtc.progress)
2311
+ {
2312
+ UInt64 inDelta = me->mtc.inProcessed - inProgressPrev;
2313
+ if (inDelta >= (1 << 22))
2314
+ {
2315
+ RINOK(MtProgress_Progress_ST(&me->mtc.mtProgress))
2316
+ inProgressPrev = me->mtc.inProcessed;
2317
+ }
2318
+ }
2319
+ if (me->mtc.readWasFinished)
2320
+ return SZ_OK;
2321
+ }
2322
+ }
2323
+ }
2324
+ }
2325
+
2326
+
2327
+ #endif
2328
+
2329
+
2330
+
2331
+ void XzStatInfo_Clear(CXzStatInfo *p)
2332
+ {
2333
+ p->InSize = 0;
2334
+ p->OutSize = 0;
2335
+
2336
+ p->NumStreams = 0;
2337
+ p->NumBlocks = 0;
2338
+
2339
+ p->UnpackSize_Defined = False;
2340
+
2341
+ p->NumStreams_Defined = False;
2342
+ p->NumBlocks_Defined = False;
2343
+
2344
+ p->DataAfterEnd = False;
2345
+ p->DecodingTruncated = False;
2346
+
2347
+ p->DecodeRes = SZ_OK;
2348
+ p->ReadRes = SZ_OK;
2349
+ p->ProgressRes = SZ_OK;
2350
+
2351
+ p->CombinedRes = SZ_OK;
2352
+ p->CombinedRes_Type = SZ_OK;
2353
+ }
2354
+
2355
+
2356
+
2357
+ /*
2358
+ XzDecMt_Decode_ST() can return SZ_OK or the following errors
2359
+ - SZ_ERROR_MEM for memory allocation error
2360
+ - error from XzUnpacker_Code() function
2361
+ - SZ_ERROR_WRITE for ISeqOutStream::Write(). stat->CombinedRes_Type = SZ_ERROR_WRITE in that case
2362
+ - ICompressProgress::Progress() error, stat->CombinedRes_Type = SZ_ERROR_PROGRESS.
2363
+ But XzDecMt_Decode_ST() doesn't return ISeqInStream::Read() errors.
2364
+ ISeqInStream::Read() result is set to p->readRes.
2365
+ also it can set stat->CombinedRes_Type to SZ_ERROR_WRITE or SZ_ERROR_PROGRESS.
2366
+ */
2367
+
2368
+ static SRes XzDecMt_Decode_ST(CXzDecMt *p
2369
+ #ifndef Z7_ST
2370
+ , BoolInt tMode
2371
+ #endif
2372
+ , CXzStatInfo *stat)
2373
+ {
2374
+ size_t outPos;
2375
+ size_t inPos, inLim;
2376
+ const Byte *inData;
2377
+ UInt64 inPrev, outPrev;
2378
+
2379
+ CXzUnpacker *dec;
2380
+
2381
+ #ifndef Z7_ST
2382
+ if (tMode)
2383
+ {
2384
+ XzDecMt_FreeOutBufs(p);
2385
+ tMode = (BoolInt)MtDec_PrepareRead(&p->mtc);
2386
+ }
2387
+ #endif
2388
+
2389
+ if (!p->outBuf || p->outBufSize != p->props.outStep_ST)
2390
+ {
2391
+ ISzAlloc_Free(p->allocMid, p->outBuf);
2392
+ p->outBufSize = 0;
2393
+ p->outBuf = (Byte *)ISzAlloc_Alloc(p->allocMid, p->props.outStep_ST);
2394
+ if (!p->outBuf)
2395
+ return SZ_ERROR_MEM;
2396
+ p->outBufSize = p->props.outStep_ST;
2397
+ }
2398
+
2399
+ if (!p->inBuf || p->inBufSize != p->props.inBufSize_ST)
2400
+ {
2401
+ ISzAlloc_Free(p->allocMid, p->inBuf);
2402
+ p->inBufSize = 0;
2403
+ p->inBuf = (Byte *)ISzAlloc_Alloc(p->allocMid, p->props.inBufSize_ST);
2404
+ if (!p->inBuf)
2405
+ return SZ_ERROR_MEM;
2406
+ p->inBufSize = p->props.inBufSize_ST;
2407
+ }
2408
+
2409
+ dec = &p->dec;
2410
+ dec->decodeToStreamSignature = False;
2411
+ // dec->decodeOnlyOneBlock = False;
2412
+
2413
+ XzUnpacker_SetOutBuf(dec, NULL, 0);
2414
+
2415
+ inPrev = p->inProcessed;
2416
+ outPrev = p->outProcessed;
2417
+
2418
+ inPos = 0;
2419
+ inLim = 0;
2420
+ inData = NULL;
2421
+ outPos = 0;
2422
+
2423
+ for (;;)
2424
+ {
2425
+ SizeT outSize;
2426
+ BoolInt finished;
2427
+ ECoderFinishMode finishMode;
2428
+ SizeT inProcessed;
2429
+ ECoderStatus status;
2430
+ SRes res;
2431
+
2432
+ SizeT outProcessed;
2433
+
2434
+
2435
+
2436
+ if (inPos == inLim)
2437
+ {
2438
+ #ifndef Z7_ST
2439
+ if (tMode)
2440
+ {
2441
+ inData = MtDec_Read(&p->mtc, &inLim);
2442
+ inPos = 0;
2443
+ if (inData)
2444
+ continue;
2445
+ tMode = False;
2446
+ inLim = 0;
2447
+ }
2448
+ #endif
2449
+
2450
+ if (!p->readWasFinished)
2451
+ {
2452
+ inPos = 0;
2453
+ inLim = p->inBufSize;
2454
+ inData = p->inBuf;
2455
+ p->readRes = ISeqInStream_Read(p->inStream, (void *)p->inBuf, &inLim);
2456
+ p->readProcessed += inLim;
2457
+ if (inLim == 0 || p->readRes != SZ_OK)
2458
+ p->readWasFinished = True;
2459
+ }
2460
+ }
2461
+
2462
+ outSize = p->props.outStep_ST - outPos;
2463
+
2464
+ finishMode = CODER_FINISH_ANY;
2465
+ if (p->outSize_Defined)
2466
+ {
2467
+ const UInt64 rem = p->outSize - p->outProcessed;
2468
+ if (outSize >= rem)
2469
+ {
2470
+ outSize = (SizeT)rem;
2471
+ if (p->finishMode)
2472
+ finishMode = CODER_FINISH_END;
2473
+ }
2474
+ }
2475
+
2476
+ inProcessed = inLim - inPos;
2477
+ outProcessed = outSize;
2478
+
2479
+ res = XzUnpacker_Code(dec, p->outBuf + outPos, &outProcessed,
2480
+ inData + inPos, &inProcessed,
2481
+ (inPos == inLim), // srcFinished
2482
+ finishMode, &status);
2483
+
2484
+ p->codeRes = res;
2485
+ p->status = status;
2486
+
2487
+ inPos += inProcessed;
2488
+ outPos += outProcessed;
2489
+ p->inProcessed += inProcessed;
2490
+ p->outProcessed += outProcessed;
2491
+
2492
+ finished = ((inProcessed == 0 && outProcessed == 0) || res != SZ_OK);
2493
+
2494
+ if (finished || outProcessed >= outSize)
2495
+ if (outPos != 0)
2496
+ {
2497
+ const size_t written = ISeqOutStream_Write(p->outStream, p->outBuf, outPos);
2498
+ // p->outProcessed += written; // 21.01: BUG fixed
2499
+ if (written != outPos)
2500
+ {
2501
+ stat->CombinedRes_Type = SZ_ERROR_WRITE;
2502
+ return SZ_ERROR_WRITE;
2503
+ }
2504
+ outPos = 0;
2505
+ }
2506
+
2507
+ if (p->progress && res == SZ_OK)
2508
+ {
2509
+ if (p->inProcessed - inPrev >= (1 << 22) ||
2510
+ p->outProcessed - outPrev >= (1 << 22))
2511
+ {
2512
+ res = ICompressProgress_Progress(p->progress, p->inProcessed, p->outProcessed);
2513
+ if (res != SZ_OK)
2514
+ {
2515
+ stat->CombinedRes_Type = SZ_ERROR_PROGRESS;
2516
+ stat->ProgressRes = res;
2517
+ return res;
2518
+ }
2519
+ inPrev = p->inProcessed;
2520
+ outPrev = p->outProcessed;
2521
+ }
2522
+ }
2523
+
2524
+ if (finished)
2525
+ {
2526
+ // p->codeRes is preliminary error from XzUnpacker_Code.
2527
+ // and it can be corrected later as final result
2528
+ // so we return SZ_OK here instead of (res);
2529
+ return SZ_OK;
2530
+ // return res;
2531
+ }
2532
+ }
2533
+ }
2534
+
2535
+
2536
+
2537
+ /*
2538
+ XzStatInfo_SetStat() transforms
2539
+ CXzUnpacker return code and status to combined CXzStatInfo results.
2540
+ it can convert SZ_OK to SZ_ERROR_INPUT_EOF
2541
+ it can convert SZ_ERROR_NO_ARCHIVE to SZ_OK and (DataAfterEnd = 1)
2542
+ */
2543
+
2544
+ static void XzStatInfo_SetStat(const CXzUnpacker *dec,
2545
+ int finishMode,
2546
+ // UInt64 readProcessed,
2547
+ UInt64 inProcessed,
2548
+ SRes res, // it's result from CXzUnpacker unpacker
2549
+ ECoderStatus status,
2550
+ BoolInt decodingTruncated,
2551
+ CXzStatInfo *stat)
2552
+ {
2553
+ UInt64 extraSize;
2554
+
2555
+ stat->DecodingTruncated = (Byte)(decodingTruncated ? 1 : 0);
2556
+ stat->InSize = inProcessed;
2557
+ stat->NumStreams = dec->numStartedStreams;
2558
+ stat->NumBlocks = dec->numTotalBlocks;
2559
+
2560
+ stat->UnpackSize_Defined = True;
2561
+ stat->NumStreams_Defined = True;
2562
+ stat->NumBlocks_Defined = True;
2563
+
2564
+ extraSize = XzUnpacker_GetExtraSize(dec);
2565
+
2566
+ if (res == SZ_OK)
2567
+ {
2568
+ if (status == CODER_STATUS_NEEDS_MORE_INPUT)
2569
+ {
2570
+ // CODER_STATUS_NEEDS_MORE_INPUT is expected status for correct xz streams
2571
+ // any extra data is part of correct data
2572
+ extraSize = 0;
2573
+ // if xz stream was not finished, then we need more data
2574
+ if (!XzUnpacker_IsStreamWasFinished(dec))
2575
+ res = SZ_ERROR_INPUT_EOF;
2576
+ }
2577
+ else
2578
+ {
2579
+ // CODER_STATUS_FINISHED_WITH_MARK is not possible for multi stream xz decoding
2580
+ // so he we have (status == CODER_STATUS_NOT_FINISHED)
2581
+ // if (status != CODER_STATUS_FINISHED_WITH_MARK)
2582
+ if (!decodingTruncated || finishMode)
2583
+ res = SZ_ERROR_DATA;
2584
+ }
2585
+ }
2586
+ else if (res == SZ_ERROR_NO_ARCHIVE)
2587
+ {
2588
+ /*
2589
+ SZ_ERROR_NO_ARCHIVE is possible for 2 states:
2590
+ XZ_STATE_STREAM_HEADER - if bad signature or bad CRC
2591
+ XZ_STATE_STREAM_PADDING - if non-zero padding data
2592
+ extraSize and inProcessed don't include "bad" byte
2593
+ */
2594
+ // if (inProcessed == extraSize), there was no any good xz stream header, and we keep error
2595
+ if (inProcessed != extraSize) // if there were good xz streams before error
2596
+ {
2597
+ // if (extraSize != 0 || readProcessed != inProcessed)
2598
+ {
2599
+ // he we suppose that all xz streams were finsihed OK, and we have
2600
+ // some extra data after all streams
2601
+ stat->DataAfterEnd = True;
2602
+ res = SZ_OK;
2603
+ }
2604
+ }
2605
+ }
2606
+
2607
+ if (stat->DecodeRes == SZ_OK)
2608
+ stat->DecodeRes = res;
2609
+
2610
+ stat->InSize -= extraSize;
2611
+ }
2612
+
2613
+
2614
+
2615
+ SRes XzDecMt_Decode(CXzDecMtHandle p,
2616
+ const CXzDecMtProps *props,
2617
+ const UInt64 *outDataSize, int finishMode,
2618
+ ISeqOutStreamPtr outStream,
2619
+ // Byte *outBuf, size_t *outBufSize,
2620
+ ISeqInStreamPtr inStream,
2621
+ // const Byte *inData, size_t inDataSize,
2622
+ CXzStatInfo *stat,
2623
+ int *isMT,
2624
+ ICompressProgressPtr progress)
2625
+ {
2626
+ // GET_CXzDecMt_p
2627
+ #ifndef Z7_ST
2628
+ BoolInt tMode;
2629
+ #endif
2630
+
2631
+ XzStatInfo_Clear(stat);
2632
+
2633
+ p->props = *props;
2634
+
2635
+ p->inStream = inStream;
2636
+ p->outStream = outStream;
2637
+ p->progress = progress;
2638
+ // p->stat = stat;
2639
+
2640
+ p->outSize = 0;
2641
+ p->outSize_Defined = False;
2642
+ if (outDataSize)
2643
+ {
2644
+ p->outSize_Defined = True;
2645
+ p->outSize = *outDataSize;
2646
+ }
2647
+
2648
+ p->finishMode = (BoolInt)finishMode;
2649
+
2650
+ // p->outSize = 457; p->outSize_Defined = True; p->finishMode = False; // for test
2651
+
2652
+ p->writeRes = SZ_OK;
2653
+ p->outProcessed = 0;
2654
+ p->inProcessed = 0;
2655
+ p->readProcessed = 0;
2656
+ p->readWasFinished = False;
2657
+ p->readRes = SZ_OK;
2658
+
2659
+ p->codeRes = SZ_OK;
2660
+ p->status = CODER_STATUS_NOT_SPECIFIED;
2661
+
2662
+ XzUnpacker_Init(&p->dec);
2663
+
2664
+ *isMT = False;
2665
+
2666
+ /*
2667
+ p->outBuf = NULL;
2668
+ p->outBufSize = 0;
2669
+ if (!outStream)
2670
+ {
2671
+ p->outBuf = outBuf;
2672
+ p->outBufSize = *outBufSize;
2673
+ *outBufSize = 0;
2674
+ }
2675
+ */
2676
+
2677
+
2678
+ #ifndef Z7_ST
2679
+
2680
+ p->isBlockHeaderState_Parse = False;
2681
+ p->isBlockHeaderState_Write = False;
2682
+ // p->numBadBlocks = 0;
2683
+ p->mainErrorCode = SZ_OK;
2684
+ p->mainDecoderWasCalled = False;
2685
+
2686
+ tMode = False;
2687
+
2688
+ if (p->props.numThreads > 1)
2689
+ {
2690
+ IMtDecCallback2 vt;
2691
+ BoolInt needContinue;
2692
+ SRes res;
2693
+ // we just free ST buffers here
2694
+ // but we still keep state variables, that was set in XzUnpacker_Init()
2695
+ XzDecMt_FreeSt(p);
2696
+
2697
+ p->outProcessed_Parse = 0;
2698
+ p->parsing_Truncated = False;
2699
+
2700
+ p->numStreams = 0;
2701
+ p->numTotalBlocks = 0;
2702
+ p->numBlocks = 0;
2703
+ p->finishedDecoderIndex = -1;
2704
+
2705
+ if (!p->mtc_WasConstructed)
2706
+ {
2707
+ p->mtc_WasConstructed = True;
2708
+ MtDec_Construct(&p->mtc);
2709
+ }
2710
+
2711
+ p->mtc.mtCallback = &vt;
2712
+ p->mtc.mtCallbackObject = p;
2713
+
2714
+ p->mtc.progress = progress;
2715
+ p->mtc.inStream = inStream;
2716
+ p->mtc.alloc = &p->alignOffsetAlloc.vt;
2717
+ // p->mtc.inData = inData;
2718
+ // p->mtc.inDataSize = inDataSize;
2719
+ p->mtc.inBufSize = p->props.inBufSize_MT;
2720
+ // p->mtc.inBlockMax = p->props.inBlockMax;
2721
+ p->mtc.numThreadsMax = p->props.numThreads;
2722
+
2723
+ *isMT = True;
2724
+
2725
+ vt.Parse = XzDecMt_Callback_Parse;
2726
+ vt.PreCode = XzDecMt_Callback_PreCode;
2727
+ vt.Code = XzDecMt_Callback_Code;
2728
+ vt.Write = XzDecMt_Callback_Write;
2729
+
2730
+
2731
+ res = MtDec_Code(&p->mtc);
2732
+
2733
+
2734
+ stat->InSize = p->mtc.inProcessed;
2735
+
2736
+ p->inProcessed = p->mtc.inProcessed;
2737
+ p->readRes = p->mtc.readRes;
2738
+ p->readWasFinished = p->mtc.readWasFinished;
2739
+ p->readProcessed = p->mtc.readProcessed;
2740
+
2741
+ tMode = True;
2742
+ needContinue = False;
2743
+
2744
+ if (res == SZ_OK)
2745
+ {
2746
+ if (p->mtc.mtProgress.res != SZ_OK)
2747
+ {
2748
+ res = p->mtc.mtProgress.res;
2749
+ stat->ProgressRes = res;
2750
+ stat->CombinedRes_Type = SZ_ERROR_PROGRESS;
2751
+ }
2752
+ else
2753
+ needContinue = p->mtc.needContinue;
2754
+ }
2755
+
2756
+ if (!needContinue)
2757
+ {
2758
+ {
2759
+ SRes codeRes;
2760
+ BoolInt truncated = False;
2761
+ ECoderStatus status;
2762
+ const CXzUnpacker *dec;
2763
+
2764
+ stat->OutSize = p->outProcessed;
2765
+
2766
+ if (p->finishedDecoderIndex >= 0)
2767
+ {
2768
+ const CXzDecMtThread *coder = &p->coders[(unsigned)p->finishedDecoderIndex];
2769
+ codeRes = coder->codeRes;
2770
+ dec = &coder->dec;
2771
+ status = coder->status;
2772
+ }
2773
+ else if (p->mainDecoderWasCalled)
2774
+ {
2775
+ codeRes = p->codeRes;
2776
+ dec = &p->dec;
2777
+ status = p->status;
2778
+ truncated = p->parsing_Truncated;
2779
+ }
2780
+ else
2781
+ return SZ_ERROR_FAIL;
2782
+
2783
+ if (p->mainErrorCode != SZ_OK)
2784
+ stat->DecodeRes = p->mainErrorCode;
2785
+
2786
+ XzStatInfo_SetStat(dec, p->finishMode,
2787
+ // p->mtc.readProcessed,
2788
+ p->mtc.inProcessed,
2789
+ codeRes, status,
2790
+ truncated,
2791
+ stat);
2792
+ }
2793
+
2794
+ if (res == SZ_OK)
2795
+ {
2796
+ stat->ReadRes = p->mtc.readRes;
2797
+
2798
+ if (p->writeRes != SZ_OK)
2799
+ {
2800
+ res = p->writeRes;
2801
+ stat->CombinedRes_Type = SZ_ERROR_WRITE;
2802
+ }
2803
+ else if (p->mtc.readRes != SZ_OK
2804
+ // && p->mtc.inProcessed == p->mtc.readProcessed
2805
+ && stat->DecodeRes == SZ_ERROR_INPUT_EOF)
2806
+ {
2807
+ res = p->mtc.readRes;
2808
+ stat->CombinedRes_Type = SZ_ERROR_READ;
2809
+ }
2810
+ else if (stat->DecodeRes != SZ_OK)
2811
+ res = stat->DecodeRes;
2812
+ }
2813
+
2814
+ stat->CombinedRes = res;
2815
+ if (stat->CombinedRes_Type == SZ_OK)
2816
+ stat->CombinedRes_Type = res;
2817
+ return res;
2818
+ }
2819
+
2820
+ PRF_STR("----- decoding ST -----")
2821
+ }
2822
+
2823
+ #endif
2824
+
2825
+
2826
+ *isMT = False;
2827
+
2828
+ {
2829
+ SRes res = XzDecMt_Decode_ST(p
2830
+ #ifndef Z7_ST
2831
+ , tMode
2832
+ #endif
2833
+ , stat
2834
+ );
2835
+
2836
+ #ifndef Z7_ST
2837
+ // we must set error code from MT decoding at first
2838
+ if (p->mainErrorCode != SZ_OK)
2839
+ stat->DecodeRes = p->mainErrorCode;
2840
+ #endif
2841
+
2842
+ XzStatInfo_SetStat(&p->dec,
2843
+ p->finishMode,
2844
+ // p->readProcessed,
2845
+ p->inProcessed,
2846
+ p->codeRes, p->status,
2847
+ False, // truncated
2848
+ stat);
2849
+
2850
+ stat->ReadRes = p->readRes;
2851
+
2852
+ if (res == SZ_OK)
2853
+ {
2854
+ if (p->readRes != SZ_OK
2855
+ // && p->inProcessed == p->readProcessed
2856
+ && stat->DecodeRes == SZ_ERROR_INPUT_EOF)
2857
+ {
2858
+ // we set read error as combined error, only if that error was the reason
2859
+ // of decoding problem
2860
+ res = p->readRes;
2861
+ stat->CombinedRes_Type = SZ_ERROR_READ;
2862
+ }
2863
+ else if (stat->DecodeRes != SZ_OK)
2864
+ res = stat->DecodeRes;
2865
+ }
2866
+
2867
+ stat->CombinedRes = res;
2868
+ if (stat->CombinedRes_Type == SZ_OK)
2869
+ stat->CombinedRes_Type = res;
2870
+ return res;
2871
+ }
2872
+ }
2873
+
2874
+ #undef PRF
2875
+ #undef PRF_STR
2876
+ #undef PRF_STR_INT_2