7zip-native 0.0.0-stage → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1327) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +293 -2
  3. package/THIRD_PARTY_NOTICES.md +23 -0
  4. package/bench/args.mts +69 -0
  5. package/bench/benchmark.mts +102 -0
  6. package/bench/compare.mts +546 -0
  7. package/bench/concurrency.mts +196 -0
  8. package/binding.gyp +51 -0
  9. package/dist/index.cjs +528 -0
  10. package/dist/index.d.cts +63 -0
  11. package/dist/index.d.mts +63 -0
  12. package/dist/index.d.ts +63 -0
  13. package/dist/index.mjs +524 -0
  14. package/docs/architecture.md +112 -0
  15. package/examples/basic.mts +19 -0
  16. package/native/addon.cpp +2154 -0
  17. package/package.json +85 -5
  18. package/prebuilds/darwin-arm64/7zip_native.node +0 -0
  19. package/prebuilds/darwin-arm64/lib7z.dylib +0 -0
  20. package/prebuilds/darwin-x64/7zip_native.node +0 -0
  21. package/prebuilds/darwin-x64/lib7z.dylib +0 -0
  22. package/prebuilds/linux-arm/7z.so +0 -0
  23. package/prebuilds/linux-arm/7zip_native.node +0 -0
  24. package/prebuilds/linux-arm64/7z.so +0 -0
  25. package/prebuilds/linux-arm64/7zip_native.node +0 -0
  26. package/prebuilds/linux-ia32/7z.so +0 -0
  27. package/prebuilds/linux-ia32/7zip_native.node +0 -0
  28. package/prebuilds/linux-x64/7z.so +0 -0
  29. package/prebuilds/linux-x64/7zip_native.node +0 -0
  30. package/prebuilds/win32-arm64/7z.dll +0 -0
  31. package/prebuilds/win32-arm64/7zip_native.node +0 -0
  32. package/prebuilds/win32-x64/7z.dll +0 -0
  33. package/prebuilds/win32-x64/7zip_native.node +0 -0
  34. package/vendor/7zip/.gitattributes +2 -0
  35. package/vendor/7zip/Asm/arm/7zCrcOpt.asm +100 -0
  36. package/vendor/7zip/Asm/arm64/7zAsm.S +187 -0
  37. package/vendor/7zip/Asm/arm64/LzmaDecOpt.S +1487 -0
  38. package/vendor/7zip/Asm/x86/7zAsm.asm +341 -0
  39. package/vendor/7zip/Asm/x86/7zCrcOpt.asm +258 -0
  40. package/vendor/7zip/Asm/x86/AesOpt.asm +742 -0
  41. package/vendor/7zip/Asm/x86/LzFindOpt.asm +540 -0
  42. package/vendor/7zip/Asm/x86/LzmaDecOpt.asm +1339 -0
  43. package/vendor/7zip/Asm/x86/Sha1Opt.asm +263 -0
  44. package/vendor/7zip/Asm/x86/Sha256Opt.asm +275 -0
  45. package/vendor/7zip/Asm/x86/Sort.asm +860 -0
  46. package/vendor/7zip/Asm/x86/XzCrc64Opt.asm +523 -0
  47. package/vendor/7zip/C/7z.h +204 -0
  48. package/vendor/7zip/C/7zAlloc.c +89 -0
  49. package/vendor/7zip/C/7zAlloc.h +19 -0
  50. package/vendor/7zip/C/7zArcIn.c +1701 -0
  51. package/vendor/7zip/C/7zBuf.c +36 -0
  52. package/vendor/7zip/C/7zBuf.h +35 -0
  53. package/vendor/7zip/C/7zBuf2.c +52 -0
  54. package/vendor/7zip/C/7zCrc.c +420 -0
  55. package/vendor/7zip/C/7zCrc.h +28 -0
  56. package/vendor/7zip/C/7zCrcOpt.c +199 -0
  57. package/vendor/7zip/C/7zDec.c +672 -0
  58. package/vendor/7zip/C/7zFile.c +443 -0
  59. package/vendor/7zip/C/7zFile.h +91 -0
  60. package/vendor/7zip/C/7zStream.c +199 -0
  61. package/vendor/7zip/C/7zTypes.h +600 -0
  62. package/vendor/7zip/C/7zVersion.h +27 -0
  63. package/vendor/7zip/C/7zVersion.rc +55 -0
  64. package/vendor/7zip/C/7zWindows.h +107 -0
  65. package/vendor/7zip/C/7zip_gcc_c.mak +366 -0
  66. package/vendor/7zip/C/Aes.c +429 -0
  67. package/vendor/7zip/C/Aes.h +60 -0
  68. package/vendor/7zip/C/AesOpt.c +1002 -0
  69. package/vendor/7zip/C/Alloc.c +774 -0
  70. package/vendor/7zip/C/Alloc.h +76 -0
  71. package/vendor/7zip/C/Asm_c.mak +12 -0
  72. package/vendor/7zip/C/Bcj2.c +290 -0
  73. package/vendor/7zip/C/Bcj2.h +332 -0
  74. package/vendor/7zip/C/Bcj2Enc.c +509 -0
  75. package/vendor/7zip/C/Blake2.h +105 -0
  76. package/vendor/7zip/C/Blake2s.c +2672 -0
  77. package/vendor/7zip/C/Bra.c +709 -0
  78. package/vendor/7zip/C/Bra.h +105 -0
  79. package/vendor/7zip/C/Bra86.c +187 -0
  80. package/vendor/7zip/C/BraIA64.c +14 -0
  81. package/vendor/7zip/C/BwtSort.c +630 -0
  82. package/vendor/7zip/C/BwtSort.h +27 -0
  83. package/vendor/7zip/C/Compiler.h +287 -0
  84. package/vendor/7zip/C/CpuArch.c +970 -0
  85. package/vendor/7zip/C/CpuArch.h +719 -0
  86. package/vendor/7zip/C/Delta.c +169 -0
  87. package/vendor/7zip/C/Delta.h +19 -0
  88. package/vendor/7zip/C/DllSecur.c +99 -0
  89. package/vendor/7zip/C/DllSecur.h +20 -0
  90. package/vendor/7zip/C/HuffEnc.c +361 -0
  91. package/vendor/7zip/C/HuffEnc.h +23 -0
  92. package/vendor/7zip/C/LzFind.c +1746 -0
  93. package/vendor/7zip/C/LzFind.h +160 -0
  94. package/vendor/7zip/C/LzFindMt.c +1422 -0
  95. package/vendor/7zip/C/LzFindMt.h +114 -0
  96. package/vendor/7zip/C/LzFindOpt.c +578 -0
  97. package/vendor/7zip/C/LzHash.h +34 -0
  98. package/vendor/7zip/C/Lzma2Dec.c +493 -0
  99. package/vendor/7zip/C/Lzma2Dec.h +121 -0
  100. package/vendor/7zip/C/Lzma2DecMt.c +1095 -0
  101. package/vendor/7zip/C/Lzma2DecMt.h +81 -0
  102. package/vendor/7zip/C/Lzma2Enc.c +799 -0
  103. package/vendor/7zip/C/Lzma2Enc.h +58 -0
  104. package/vendor/7zip/C/Lzma86.h +111 -0
  105. package/vendor/7zip/C/Lzma86Dec.c +53 -0
  106. package/vendor/7zip/C/Lzma86Enc.c +103 -0
  107. package/vendor/7zip/C/LzmaDec.c +1367 -0
  108. package/vendor/7zip/C/LzmaDec.h +237 -0
  109. package/vendor/7zip/C/LzmaEnc.c +3154 -0
  110. package/vendor/7zip/C/LzmaEnc.h +85 -0
  111. package/vendor/7zip/C/LzmaLib.c +42 -0
  112. package/vendor/7zip/C/LzmaLib.h +138 -0
  113. package/vendor/7zip/C/Md5.c +206 -0
  114. package/vendor/7zip/C/Md5.h +34 -0
  115. package/vendor/7zip/C/MtCoder.c +604 -0
  116. package/vendor/7zip/C/MtCoder.h +144 -0
  117. package/vendor/7zip/C/MtDec.c +1124 -0
  118. package/vendor/7zip/C/MtDec.h +202 -0
  119. package/vendor/7zip/C/Ppmd.h +169 -0
  120. package/vendor/7zip/C/Ppmd7.c +1131 -0
  121. package/vendor/7zip/C/Ppmd7.h +181 -0
  122. package/vendor/7zip/C/Ppmd7Dec.c +312 -0
  123. package/vendor/7zip/C/Ppmd7Enc.c +340 -0
  124. package/vendor/7zip/C/Ppmd7aDec.c +295 -0
  125. package/vendor/7zip/C/Ppmd8.c +1574 -0
  126. package/vendor/7zip/C/Ppmd8.h +181 -0
  127. package/vendor/7zip/C/Ppmd8Dec.c +295 -0
  128. package/vendor/7zip/C/Ppmd8Enc.c +337 -0
  129. package/vendor/7zip/C/Precomp.h +127 -0
  130. package/vendor/7zip/C/RotateDefs.h +50 -0
  131. package/vendor/7zip/C/Sha1.c +441 -0
  132. package/vendor/7zip/C/Sha1.h +86 -0
  133. package/vendor/7zip/C/Sha1Opt.c +424 -0
  134. package/vendor/7zip/C/Sha256.c +492 -0
  135. package/vendor/7zip/C/Sha256.h +86 -0
  136. package/vendor/7zip/C/Sha256Opt.c +451 -0
  137. package/vendor/7zip/C/Sha3.c +359 -0
  138. package/vendor/7zip/C/Sha3.h +36 -0
  139. package/vendor/7zip/C/Sha512.c +711 -0
  140. package/vendor/7zip/C/Sha512.h +86 -0
  141. package/vendor/7zip/C/Sha512Opt.c +395 -0
  142. package/vendor/7zip/C/Sort.c +268 -0
  143. package/vendor/7zip/C/Sort.h +15 -0
  144. package/vendor/7zip/C/SwapBytes.c +835 -0
  145. package/vendor/7zip/C/SwapBytes.h +17 -0
  146. package/vendor/7zip/C/Threads.c +826 -0
  147. package/vendor/7zip/C/Threads.h +260 -0
  148. package/vendor/7zip/C/Util/7z/7z.dsp +249 -0
  149. package/vendor/7zip/C/Util/7z/7z.dsw +29 -0
  150. package/vendor/7zip/C/Util/7z/7zMain.c +1210 -0
  151. package/vendor/7zip/C/Util/7z/Precomp.c +4 -0
  152. package/vendor/7zip/C/Util/7z/Precomp.h +13 -0
  153. package/vendor/7zip/C/Util/7z/makefile +44 -0
  154. package/vendor/7zip/C/Util/7z/makefile.gcc +32 -0
  155. package/vendor/7zip/C/Util/7zipInstall/7zip.ico +0 -0
  156. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.c +1699 -0
  157. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsp +248 -0
  158. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.dsw +29 -0
  159. package/vendor/7zip/C/Util/7zipInstall/7zipInstall.manifest +18 -0
  160. package/vendor/7zip/C/Util/7zipInstall/Precomp.c +4 -0
  161. package/vendor/7zip/C/Util/7zipInstall/Precomp.h +13 -0
  162. package/vendor/7zip/C/Util/7zipInstall/makefile +47 -0
  163. package/vendor/7zip/C/Util/7zipInstall/resource.h +9 -0
  164. package/vendor/7zip/C/Util/7zipInstall/resource.rc +48 -0
  165. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.c +1234 -0
  166. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsp +132 -0
  167. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.dsw +29 -0
  168. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.ico +0 -0
  169. package/vendor/7zip/C/Util/7zipUninstall/7zipUninstall.manifest +18 -0
  170. package/vendor/7zip/C/Util/7zipUninstall/Precomp.c +4 -0
  171. package/vendor/7zip/C/Util/7zipUninstall/Precomp.h +13 -0
  172. package/vendor/7zip/C/Util/7zipUninstall/makefile +18 -0
  173. package/vendor/7zip/C/Util/7zipUninstall/resource.h +9 -0
  174. package/vendor/7zip/C/Util/7zipUninstall/resource.rc +48 -0
  175. package/vendor/7zip/C/Util/Lzma/LzmaUtil.c +313 -0
  176. package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsp +192 -0
  177. package/vendor/7zip/C/Util/Lzma/LzmaUtil.dsw +29 -0
  178. package/vendor/7zip/C/Util/Lzma/Precomp.h +13 -0
  179. package/vendor/7zip/C/Util/Lzma/makefile +30 -0
  180. package/vendor/7zip/C/Util/Lzma/makefile.gcc +21 -0
  181. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.def +4 -0
  182. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsp +206 -0
  183. package/vendor/7zip/C/Util/LzmaLib/LzmaLib.dsw +29 -0
  184. package/vendor/7zip/C/Util/LzmaLib/LzmaLibExports.c +15 -0
  185. package/vendor/7zip/C/Util/LzmaLib/Precomp.c +4 -0
  186. package/vendor/7zip/C/Util/LzmaLib/Precomp.h +13 -0
  187. package/vendor/7zip/C/Util/LzmaLib/makefile +59 -0
  188. package/vendor/7zip/C/Util/LzmaLib/resource.rc +3 -0
  189. package/vendor/7zip/C/Util/SfxSetup/Precomp.c +4 -0
  190. package/vendor/7zip/C/Util/SfxSetup/Precomp.h +13 -0
  191. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.c +657 -0
  192. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsp +231 -0
  193. package/vendor/7zip/C/Util/SfxSetup/SfxSetup.dsw +29 -0
  194. package/vendor/7zip/C/Util/SfxSetup/makefile +44 -0
  195. package/vendor/7zip/C/Util/SfxSetup/makefile_con +40 -0
  196. package/vendor/7zip/C/Util/SfxSetup/resource.rc +5 -0
  197. package/vendor/7zip/C/Util/SfxSetup/setup.ico +0 -0
  198. package/vendor/7zip/C/Xxh64.c +389 -0
  199. package/vendor/7zip/C/Xxh64.h +50 -0
  200. package/vendor/7zip/C/Xz.c +92 -0
  201. package/vendor/7zip/C/Xz.h +542 -0
  202. package/vendor/7zip/C/XzCrc64.c +140 -0
  203. package/vendor/7zip/C/XzCrc64.h +26 -0
  204. package/vendor/7zip/C/XzCrc64Opt.c +261 -0
  205. package/vendor/7zip/C/XzDec.c +2865 -0
  206. package/vendor/7zip/C/XzEnc.c +1374 -0
  207. package/vendor/7zip/C/XzEnc.h +62 -0
  208. package/vendor/7zip/C/XzIn.c +385 -0
  209. package/vendor/7zip/C/ZstdDec.c +4067 -0
  210. package/vendor/7zip/C/ZstdDec.h +173 -0
  211. package/vendor/7zip/C/var_clang.mak +11 -0
  212. package/vendor/7zip/C/var_clang_arm64.mak +12 -0
  213. package/vendor/7zip/C/var_clang_x64.mak +11 -0
  214. package/vendor/7zip/C/var_clang_x86.mak +11 -0
  215. package/vendor/7zip/C/var_gcc.mak +12 -0
  216. package/vendor/7zip/C/var_gcc_arm64.mak +12 -0
  217. package/vendor/7zip/C/var_gcc_x64.mak +10 -0
  218. package/vendor/7zip/C/var_gcc_x86.mak +10 -0
  219. package/vendor/7zip/C/var_mac_arm64.mak +13 -0
  220. package/vendor/7zip/C/var_mac_x64.mak +13 -0
  221. package/vendor/7zip/C/warn_clang.mak +1 -0
  222. package/vendor/7zip/C/warn_clang_mac.mak +1 -0
  223. package/vendor/7zip/C/warn_gcc.mak +51 -0
  224. package/vendor/7zip/CPP/7zip/7zip.mak +240 -0
  225. package/vendor/7zip/CPP/7zip/7zip_gcc.mak +1376 -0
  226. package/vendor/7zip/CPP/7zip/Aes.mak +10 -0
  227. package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsp +650 -0
  228. package/vendor/7zip/CPP/7zip/Archive/7z/7z.dsw +29 -0
  229. package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.cpp +3 -0
  230. package/vendor/7zip/CPP/7zip/Archive/7z/7zCompressionMode.h +92 -0
  231. package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.cpp +599 -0
  232. package/vendor/7zip/CPP/7zip/Archive/7z/7zDecode.h +73 -0
  233. package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.cpp +702 -0
  234. package/vendor/7zip/CPP/7zip/Archive/7z/7zEncode.h +95 -0
  235. package/vendor/7zip/CPP/7zip/Archive/7z/7zExtract.cpp +444 -0
  236. package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.cpp +264 -0
  237. package/vendor/7zip/CPP/7zip/Archive/7z/7zFolderInStream.h +101 -0
  238. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.cpp +800 -0
  239. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandler.h +178 -0
  240. package/vendor/7zip/CPP/7zip/Archive/7z/7zHandlerOut.cpp +1162 -0
  241. package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.cpp +19 -0
  242. package/vendor/7zip/CPP/7zip/Archive/7z/7zHeader.h +156 -0
  243. package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.cpp +1815 -0
  244. package/vendor/7zip/CPP/7zip/Archive/7z/7zIn.h +454 -0
  245. package/vendor/7zip/CPP/7zip/Archive/7z/7zItem.h +207 -0
  246. package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.cpp +1026 -0
  247. package/vendor/7zip/CPP/7zip/Archive/7z/7zOut.h +346 -0
  248. package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.cpp +182 -0
  249. package/vendor/7zip/CPP/7zip/Archive/7z/7zProperties.h +26 -0
  250. package/vendor/7zip/CPP/7zip/Archive/7z/7zRegister.cpp +27 -0
  251. package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.cpp +31 -0
  252. package/vendor/7zip/CPP/7zip/Archive/7z/7zSpecStream.h +49 -0
  253. package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.cpp +3087 -0
  254. package/vendor/7zip/CPP/7zip/Archive/7z/7zUpdate.h +167 -0
  255. package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.cpp +3 -0
  256. package/vendor/7zip/CPP/7zip/Archive/7z/StdAfx.h +11 -0
  257. package/vendor/7zip/CPP/7zip/Archive/7z/makefile +81 -0
  258. package/vendor/7zip/CPP/7zip/Archive/7z/resource.rc +11 -0
  259. package/vendor/7zip/CPP/7zip/Archive/ApfsHandler.cpp +4470 -0
  260. package/vendor/7zip/CPP/7zip/Archive/ApmHandler.cpp +420 -0
  261. package/vendor/7zip/CPP/7zip/Archive/ArHandler.cpp +844 -0
  262. package/vendor/7zip/CPP/7zip/Archive/Archive.def +15 -0
  263. package/vendor/7zip/CPP/7zip/Archive/Archive2.def +22 -0
  264. package/vendor/7zip/CPP/7zip/Archive/ArchiveExports.cpp +158 -0
  265. package/vendor/7zip/CPP/7zip/Archive/ArjHandler.cpp +977 -0
  266. package/vendor/7zip/CPP/7zip/Archive/AvbHandler.cpp +616 -0
  267. package/vendor/7zip/CPP/7zip/Archive/Base64Handler.cpp +488 -0
  268. package/vendor/7zip/CPP/7zip/Archive/Bz2Handler.cpp +482 -0
  269. package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.cpp +122 -0
  270. package/vendor/7zip/CPP/7zip/Archive/Cab/CabBlockInStream.h +28 -0
  271. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.cpp +1270 -0
  272. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHandler.h +29 -0
  273. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.cpp +15 -0
  274. package/vendor/7zip/CPP/7zip/Archive/Cab/CabHeader.h +41 -0
  275. package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.cpp +485 -0
  276. package/vendor/7zip/CPP/7zip/Archive/Cab/CabIn.h +169 -0
  277. package/vendor/7zip/CPP/7zip/Archive/Cab/CabItem.h +69 -0
  278. package/vendor/7zip/CPP/7zip/Archive/Cab/CabRegister.cpp +19 -0
  279. package/vendor/7zip/CPP/7zip/Archive/Cab/StdAfx.h +11 -0
  280. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.cpp +790 -0
  281. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmHandler.h +27 -0
  282. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.cpp +1026 -0
  283. package/vendor/7zip/CPP/7zip/Archive/Chm/ChmIn.h +282 -0
  284. package/vendor/7zip/CPP/7zip/Archive/Chm/StdAfx.h +11 -0
  285. package/vendor/7zip/CPP/7zip/Archive/ComHandler.cpp +1449 -0
  286. package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.cpp +1144 -0
  287. package/vendor/7zip/CPP/7zip/Archive/Common/CoderMixer2.h +447 -0
  288. package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.cpp +17 -0
  289. package/vendor/7zip/CPP/7zip/Archive/Common/DummyOutStream.h +23 -0
  290. package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.cpp +90 -0
  291. package/vendor/7zip/CPP/7zip/Archive/Common/FindSignature.h +12 -0
  292. package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.cpp +315 -0
  293. package/vendor/7zip/CPP/7zip/Archive/Common/HandlerOut.h +169 -0
  294. package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +57 -0
  295. package/vendor/7zip/CPP/7zip/Archive/Common/InStreamWithCRC.h +64 -0
  296. package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.cpp +140 -0
  297. package/vendor/7zip/CPP/7zip/Archive/Common/ItemNameUtils.h +33 -0
  298. package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.cpp +193 -0
  299. package/vendor/7zip/CPP/7zip/Archive/Common/MultiStream.h +86 -0
  300. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp +18 -0
  301. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithCRC.h +35 -0
  302. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp +29 -0
  303. package/vendor/7zip/CPP/7zip/Archive/Common/OutStreamWithSha1.h +61 -0
  304. package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.cpp +3 -0
  305. package/vendor/7zip/CPP/7zip/Archive/Common/ParseProperties.h +6 -0
  306. package/vendor/7zip/CPP/7zip/Archive/Common/StdAfx.h +11 -0
  307. package/vendor/7zip/CPP/7zip/Archive/CpioHandler.cpp +1110 -0
  308. package/vendor/7zip/CPP/7zip/Archive/CramfsHandler.cpp +784 -0
  309. package/vendor/7zip/CPP/7zip/Archive/DeflateProps.cpp +3 -0
  310. package/vendor/7zip/CPP/7zip/Archive/DeflateProps.h +6 -0
  311. package/vendor/7zip/CPP/7zip/Archive/DllExports.cpp +96 -0
  312. package/vendor/7zip/CPP/7zip/Archive/DllExports2.cpp +184 -0
  313. package/vendor/7zip/CPP/7zip/Archive/DmgHandler.cpp +2336 -0
  314. package/vendor/7zip/CPP/7zip/Archive/ElfHandler.cpp +1284 -0
  315. package/vendor/7zip/CPP/7zip/Archive/ExtHandler.cpp +2860 -0
  316. package/vendor/7zip/CPP/7zip/Archive/FatHandler.cpp +1325 -0
  317. package/vendor/7zip/CPP/7zip/Archive/FlvHandler.cpp +521 -0
  318. package/vendor/7zip/CPP/7zip/Archive/GptHandler.cpp +473 -0
  319. package/vendor/7zip/CPP/7zip/Archive/GzHandler.cpp +1200 -0
  320. package/vendor/7zip/CPP/7zip/Archive/HandlerCont.cpp +320 -0
  321. package/vendor/7zip/CPP/7zip/Archive/HandlerCont.h +134 -0
  322. package/vendor/7zip/CPP/7zip/Archive/HfsHandler.cpp +2631 -0
  323. package/vendor/7zip/CPP/7zip/Archive/HfsHandler.h +87 -0
  324. package/vendor/7zip/CPP/7zip/Archive/IArchive.h +755 -0
  325. package/vendor/7zip/CPP/7zip/Archive/Icons/7z.ico +0 -0
  326. package/vendor/7zip/CPP/7zip/Archive/Icons/apfs.ico +0 -0
  327. package/vendor/7zip/CPP/7zip/Archive/Icons/arj.ico +0 -0
  328. package/vendor/7zip/CPP/7zip/Archive/Icons/bz2.ico +0 -0
  329. package/vendor/7zip/CPP/7zip/Archive/Icons/cab.ico +0 -0
  330. package/vendor/7zip/CPP/7zip/Archive/Icons/cpio.ico +0 -0
  331. package/vendor/7zip/CPP/7zip/Archive/Icons/deb.ico +0 -0
  332. package/vendor/7zip/CPP/7zip/Archive/Icons/dmg.ico +0 -0
  333. package/vendor/7zip/CPP/7zip/Archive/Icons/fat.ico +0 -0
  334. package/vendor/7zip/CPP/7zip/Archive/Icons/gz.ico +0 -0
  335. package/vendor/7zip/CPP/7zip/Archive/Icons/hfs.ico +0 -0
  336. package/vendor/7zip/CPP/7zip/Archive/Icons/iso.ico +0 -0
  337. package/vendor/7zip/CPP/7zip/Archive/Icons/lzh.ico +0 -0
  338. package/vendor/7zip/CPP/7zip/Archive/Icons/lzma.ico +0 -0
  339. package/vendor/7zip/CPP/7zip/Archive/Icons/ntfs.ico +0 -0
  340. package/vendor/7zip/CPP/7zip/Archive/Icons/rar.ico +0 -0
  341. package/vendor/7zip/CPP/7zip/Archive/Icons/rpm.ico +0 -0
  342. package/vendor/7zip/CPP/7zip/Archive/Icons/split.ico +0 -0
  343. package/vendor/7zip/CPP/7zip/Archive/Icons/squashfs.ico +0 -0
  344. package/vendor/7zip/CPP/7zip/Archive/Icons/tar.ico +0 -0
  345. package/vendor/7zip/CPP/7zip/Archive/Icons/vhd.ico +0 -0
  346. package/vendor/7zip/CPP/7zip/Archive/Icons/wim.ico +0 -0
  347. package/vendor/7zip/CPP/7zip/Archive/Icons/xar.ico +0 -0
  348. package/vendor/7zip/CPP/7zip/Archive/Icons/xz.ico +0 -0
  349. package/vendor/7zip/CPP/7zip/Archive/Icons/z.ico +0 -0
  350. package/vendor/7zip/CPP/7zip/Archive/Icons/zip.ico +0 -0
  351. package/vendor/7zip/CPP/7zip/Archive/Icons/zst.ico +0 -0
  352. package/vendor/7zip/CPP/7zip/Archive/IhexHandler.cpp +493 -0
  353. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.cpp +498 -0
  354. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHandler.h +24 -0
  355. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.cpp +12 -0
  356. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoHeader.h +64 -0
  357. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.cpp +801 -0
  358. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoIn.h +328 -0
  359. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoItem.h +316 -0
  360. package/vendor/7zip/CPP/7zip/Archive/Iso/IsoRegister.cpp +21 -0
  361. package/vendor/7zip/CPP/7zip/Archive/Iso/StdAfx.h +11 -0
  362. package/vendor/7zip/CPP/7zip/Archive/LpHandler.cpp +1172 -0
  363. package/vendor/7zip/CPP/7zip/Archive/LvmHandler.cpp +1108 -0
  364. package/vendor/7zip/CPP/7zip/Archive/LzhHandler.cpp +719 -0
  365. package/vendor/7zip/CPP/7zip/Archive/LzmaHandler.cpp +606 -0
  366. package/vendor/7zip/CPP/7zip/Archive/MachoHandler.cpp +1075 -0
  367. package/vendor/7zip/CPP/7zip/Archive/MbrHandler.cpp +648 -0
  368. package/vendor/7zip/CPP/7zip/Archive/MslzHandler.cpp +389 -0
  369. package/vendor/7zip/CPP/7zip/Archive/MubHandler.cpp +248 -0
  370. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.cpp +295 -0
  371. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisDecode.h +97 -0
  372. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.cpp +703 -0
  373. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisHandler.h +30 -0
  374. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.cpp +6231 -0
  375. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisIn.h +462 -0
  376. package/vendor/7zip/CPP/7zip/Archive/Nsis/NsisRegister.cpp +20 -0
  377. package/vendor/7zip/CPP/7zip/Archive/Nsis/StdAfx.h +11 -0
  378. package/vendor/7zip/CPP/7zip/Archive/NtfsHandler.cpp +2944 -0
  379. package/vendor/7zip/CPP/7zip/Archive/PeHandler.cpp +3427 -0
  380. package/vendor/7zip/CPP/7zip/Archive/PpmdHandler.cpp +414 -0
  381. package/vendor/7zip/CPP/7zip/Archive/QcowHandler.cpp +713 -0
  382. package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.cpp +3483 -0
  383. package/vendor/7zip/CPP/7zip/Archive/Rar/Rar5Handler.h +527 -0
  384. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.cpp +1775 -0
  385. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHandler.h +115 -0
  386. package/vendor/7zip/CPP/7zip/Archive/Rar/RarHeader.h +209 -0
  387. package/vendor/7zip/CPP/7zip/Archive/Rar/RarItem.h +97 -0
  388. package/vendor/7zip/CPP/7zip/Archive/Rar/RarVol.h +136 -0
  389. package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.cpp +3 -0
  390. package/vendor/7zip/CPP/7zip/Archive/Rar/StdAfx.h +11 -0
  391. package/vendor/7zip/CPP/7zip/Archive/RpmHandler.cpp +775 -0
  392. package/vendor/7zip/CPP/7zip/Archive/SparseHandler.cpp +558 -0
  393. package/vendor/7zip/CPP/7zip/Archive/SplitHandler.cpp +353 -0
  394. package/vendor/7zip/CPP/7zip/Archive/SquashfsHandler.cpp +2373 -0
  395. package/vendor/7zip/CPP/7zip/Archive/StdAfx.h +11 -0
  396. package/vendor/7zip/CPP/7zip/Archive/SwfHandler.cpp +996 -0
  397. package/vendor/7zip/CPP/7zip/Archive/Tar/StdAfx.h +11 -0
  398. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.cpp +1105 -0
  399. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandler.h +57 -0
  400. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHandlerOut.cpp +332 -0
  401. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.cpp +99 -0
  402. package/vendor/7zip/CPP/7zip/Archive/Tar/TarHeader.h +90 -0
  403. package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.cpp +1151 -0
  404. package/vendor/7zip/CPP/7zip/Archive/Tar/TarIn.h +151 -0
  405. package/vendor/7zip/CPP/7zip/Archive/Tar/TarItem.h +365 -0
  406. package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.cpp +644 -0
  407. package/vendor/7zip/CPP/7zip/Archive/Tar/TarOut.h +53 -0
  408. package/vendor/7zip/CPP/7zip/Archive/Tar/TarRegister.cpp +31 -0
  409. package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.cpp +563 -0
  410. package/vendor/7zip/CPP/7zip/Archive/Tar/TarUpdate.h +74 -0
  411. package/vendor/7zip/CPP/7zip/Archive/Udf/StdAfx.h +11 -0
  412. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.cpp +427 -0
  413. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfHandler.h +32 -0
  414. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.cpp +1756 -0
  415. package/vendor/7zip/CPP/7zip/Archive/Udf/UdfIn.h +508 -0
  416. package/vendor/7zip/CPP/7zip/Archive/UefiHandler.cpp +1884 -0
  417. package/vendor/7zip/CPP/7zip/Archive/VdiHandler.cpp +433 -0
  418. package/vendor/7zip/CPP/7zip/Archive/VhdHandler.cpp +1106 -0
  419. package/vendor/7zip/CPP/7zip/Archive/VhdxHandler.cpp +2085 -0
  420. package/vendor/7zip/CPP/7zip/Archive/VmdkHandler.cpp +1530 -0
  421. package/vendor/7zip/CPP/7zip/Archive/Wim/StdAfx.h +11 -0
  422. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.cpp +1291 -0
  423. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandler.h +117 -0
  424. package/vendor/7zip/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +2008 -0
  425. package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.cpp +2104 -0
  426. package/vendor/7zip/CPP/7zip/Archive/Wim/WimIn.h +719 -0
  427. package/vendor/7zip/CPP/7zip/Archive/Wim/WimRegister.cpp +29 -0
  428. package/vendor/7zip/CPP/7zip/Archive/XarHandler.cpp +1316 -0
  429. package/vendor/7zip/CPP/7zip/Archive/XzHandler.cpp +1452 -0
  430. package/vendor/7zip/CPP/7zip/Archive/XzHandler.h +11 -0
  431. package/vendor/7zip/CPP/7zip/Archive/ZHandler.cpp +208 -0
  432. package/vendor/7zip/CPP/7zip/Archive/Zip/StdAfx.h +11 -0
  433. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +484 -0
  434. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipAddCommon.h +76 -0
  435. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipCompressionMode.h +62 -0
  436. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.cpp +1679 -0
  437. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandler.h +94 -0
  438. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHandlerOut.cpp +626 -0
  439. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipHeader.h +201 -0
  440. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.cpp +3474 -0
  441. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipIn.h +456 -0
  442. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.cpp +464 -0
  443. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipItem.h +356 -0
  444. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.cpp +428 -0
  445. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipOut.h +103 -0
  446. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipRegister.cpp +38 -0
  447. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.cpp +2165 -0
  448. package/vendor/7zip/CPP/7zip/Archive/Zip/ZipUpdate.h +107 -0
  449. package/vendor/7zip/CPP/7zip/Archive/ZstdHandler.cpp +1147 -0
  450. package/vendor/7zip/CPP/7zip/Archive/makefile +23 -0
  451. package/vendor/7zip/CPP/7zip/Asm.mak +12 -0
  452. package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsp +3324 -0
  453. package/vendor/7zip/CPP/7zip/Bundles/Alone/Alone.dsw +29 -0
  454. package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.cpp +3 -0
  455. package/vendor/7zip/CPP/7zip/Bundles/Alone/StdAfx.h +11 -0
  456. package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile +245 -0
  457. package/vendor/7zip/CPP/7zip/Bundles/Alone/makefile.gcc +354 -0
  458. package/vendor/7zip/CPP/7zip/Bundles/Alone/resource.rc +7 -0
  459. package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.cpp +3 -0
  460. package/vendor/7zip/CPP/7zip/Bundles/Alone2/StdAfx.h +11 -0
  461. package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile +31 -0
  462. package/vendor/7zip/CPP/7zip/Bundles/Alone2/makefile.gcc +108 -0
  463. package/vendor/7zip/CPP/7zip/Bundles/Alone2/resource.rc +7 -0
  464. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsp +2090 -0
  465. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/Alone.dsw +29 -0
  466. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.cpp +3 -0
  467. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/StdAfx.h +11 -0
  468. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile +168 -0
  469. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/makefile.gcc +276 -0
  470. package/vendor/7zip/CPP/7zip/Bundles/Alone7z/resource.rc +7 -0
  471. package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsp +2275 -0
  472. package/vendor/7zip/CPP/7zip/Bundles/Fm/FM.dsw +29 -0
  473. package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.cpp +3 -0
  474. package/vendor/7zip/CPP/7zip/Bundles/Fm/StdAfx.h +6 -0
  475. package/vendor/7zip/CPP/7zip/Bundles/Fm/makefile +82 -0
  476. package/vendor/7zip/CPP/7zip/Bundles/Fm/resource.rc +7 -0
  477. package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.cpp +3 -0
  478. package/vendor/7zip/CPP/7zip/Bundles/Format7z/StdAfx.h +11 -0
  479. package/vendor/7zip/CPP/7zip/Bundles/Format7z/makefile +148 -0
  480. package/vendor/7zip/CPP/7zip/Bundles/Format7z/resource.rc +5 -0
  481. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.cpp +3 -0
  482. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/StdAfx.h +11 -0
  483. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/makefile +116 -0
  484. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtract/resource.rc +5 -0
  485. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp +3 -0
  486. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h +11 -0
  487. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/makefile +98 -0
  488. package/vendor/7zip/CPP/7zip/Bundles/Format7zExtractR/resource.rc +5 -0
  489. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc.mak +310 -0
  490. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Arc_gcc.mak +395 -0
  491. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsp +3486 -0
  492. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/Format7z.dsw +29 -0
  493. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.cpp +3 -0
  494. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/StdAfx.h +11 -0
  495. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile +20 -0
  496. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/makefile.gcc +55 -0
  497. package/vendor/7zip/CPP/7zip/Bundles/Format7zF/resource.rc +39 -0
  498. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.cpp +3 -0
  499. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/StdAfx.h +11 -0
  500. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/makefile +121 -0
  501. package/vendor/7zip/CPP/7zip/Bundles/Format7zR/resource.rc +5 -0
  502. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp +815 -0
  503. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp +540 -0
  504. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw +29 -0
  505. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp +3 -0
  506. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/StdAfx.h +11 -0
  507. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile +68 -0
  508. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/makefile.gcc +131 -0
  509. package/vendor/7zip/CPP/7zip/Bundles/LzmaCon/resource.rc +3 -0
  510. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/7z.ico +0 -0
  511. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsp +1017 -0
  512. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SFXCon.dsw +29 -0
  513. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/SfxCon.cpp +521 -0
  514. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.cpp +3 -0
  515. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/StdAfx.h +11 -0
  516. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile +137 -0
  517. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/makefile.gcc +215 -0
  518. package/vendor/7zip/CPP/7zip/Bundles/SFXCon/resource.rc +9 -0
  519. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp +246 -0
  520. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h +83 -0
  521. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp +135 -0
  522. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h +11 -0
  523. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp +872 -0
  524. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw +29 -0
  525. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +359 -0
  526. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp +3 -0
  527. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/StdAfx.h +6 -0
  528. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/makefile +121 -0
  529. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.h +6 -0
  530. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/resource.rc +16 -0
  531. package/vendor/7zip/CPP/7zip/Bundles/SFXSetup/setup.ico +0 -0
  532. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/7z.ico +0 -0
  533. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsp +1074 -0
  534. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SFXWin.dsw +29 -0
  535. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +268 -0
  536. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.cpp +3 -0
  537. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/StdAfx.h +6 -0
  538. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/makefile +159 -0
  539. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.h +1 -0
  540. package/vendor/7zip/CPP/7zip/Bundles/SFXWin/resource.rc +55 -0
  541. package/vendor/7zip/CPP/7zip/Bundles/makefile +19 -0
  542. package/vendor/7zip/CPP/7zip/Common/CWrappers.cpp +358 -0
  543. package/vendor/7zip/CPP/7zip/Common/CWrappers.h +182 -0
  544. package/vendor/7zip/CPP/7zip/Common/CreateCoder.cpp +548 -0
  545. package/vendor/7zip/CPP/7zip/Common/CreateCoder.h +200 -0
  546. package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.cpp +46 -0
  547. package/vendor/7zip/CPP/7zip/Common/FilePathAutoRename.h +10 -0
  548. package/vendor/7zip/CPP/7zip/Common/FileStreams.cpp +923 -0
  549. package/vendor/7zip/CPP/7zip/Common/FileStreams.h +205 -0
  550. package/vendor/7zip/CPP/7zip/Common/FilterCoder.cpp +582 -0
  551. package/vendor/7zip/CPP/7zip/Common/FilterCoder.h +201 -0
  552. package/vendor/7zip/CPP/7zip/Common/InBuffer.cpp +182 -0
  553. package/vendor/7zip/CPP/7zip/Common/InBuffer.h +121 -0
  554. package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.cpp +237 -0
  555. package/vendor/7zip/CPP/7zip/Common/InOutTempBuffer.h +45 -0
  556. package/vendor/7zip/CPP/7zip/Common/LimitedStreams.cpp +395 -0
  557. package/vendor/7zip/CPP/7zip/Common/LimitedStreams.h +221 -0
  558. package/vendor/7zip/CPP/7zip/Common/LockedStream.cpp +3 -0
  559. package/vendor/7zip/CPP/7zip/Common/LockedStream.h +6 -0
  560. package/vendor/7zip/CPP/7zip/Common/MemBlocks.cpp +215 -0
  561. package/vendor/7zip/CPP/7zip/Common/MemBlocks.h +72 -0
  562. package/vendor/7zip/CPP/7zip/Common/MethodId.cpp +3 -0
  563. package/vendor/7zip/CPP/7zip/Common/MethodId.h +10 -0
  564. package/vendor/7zip/CPP/7zip/Common/MethodProps.cpp +765 -0
  565. package/vendor/7zip/CPP/7zip/Common/MethodProps.h +348 -0
  566. package/vendor/7zip/CPP/7zip/Common/MultiOutStream.cpp +855 -0
  567. package/vendor/7zip/CPP/7zip/Common/MultiOutStream.h +160 -0
  568. package/vendor/7zip/CPP/7zip/Common/OffsetStream.cpp +37 -0
  569. package/vendor/7zip/CPP/7zip/Common/OffsetStream.h +22 -0
  570. package/vendor/7zip/CPP/7zip/Common/OutBuffer.cpp +111 -0
  571. package/vendor/7zip/CPP/7zip/Common/OutBuffer.h +133 -0
  572. package/vendor/7zip/CPP/7zip/Common/OutMemStream.cpp +158 -0
  573. package/vendor/7zip/CPP/7zip/Common/OutMemStream.h +104 -0
  574. package/vendor/7zip/CPP/7zip/Common/ProgressMt.cpp +53 -0
  575. package/vendor/7zip/CPP/7zip/Common/ProgressMt.h +43 -0
  576. package/vendor/7zip/CPP/7zip/Common/ProgressUtils.cpp +51 -0
  577. package/vendor/7zip/CPP/7zip/Common/ProgressUtils.h +33 -0
  578. package/vendor/7zip/CPP/7zip/Common/PropId.cpp +115 -0
  579. package/vendor/7zip/CPP/7zip/Common/RegisterArc.h +80 -0
  580. package/vendor/7zip/CPP/7zip/Common/RegisterCodec.h +106 -0
  581. package/vendor/7zip/CPP/7zip/Common/StdAfx.h +11 -0
  582. package/vendor/7zip/CPP/7zip/Common/StreamBinder.cpp +151 -0
  583. package/vendor/7zip/CPP/7zip/Common/StreamBinder.h +78 -0
  584. package/vendor/7zip/CPP/7zip/Common/StreamObjects.cpp +290 -0
  585. package/vendor/7zip/CPP/7zip/Common/StreamObjects.h +146 -0
  586. package/vendor/7zip/CPP/7zip/Common/StreamUtils.cpp +101 -0
  587. package/vendor/7zip/CPP/7zip/Common/StreamUtils.h +31 -0
  588. package/vendor/7zip/CPP/7zip/Common/UniqBlocks.cpp +57 -0
  589. package/vendor/7zip/CPP/7zip/Common/UniqBlocks.h +41 -0
  590. package/vendor/7zip/CPP/7zip/Common/VirtThread.cpp +47 -0
  591. package/vendor/7zip/CPP/7zip/Common/VirtThread.h +24 -0
  592. package/vendor/7zip/CPP/7zip/Compress/BZip2Const.h +71 -0
  593. package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.cpp +28 -0
  594. package/vendor/7zip/CPP/7zip/Compress/BZip2Crc.h +31 -0
  595. package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.cpp +1777 -0
  596. package/vendor/7zip/CPP/7zip/Compress/BZip2Decoder.h +388 -0
  597. package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.cpp +1116 -0
  598. package/vendor/7zip/CPP/7zip/Compress/BZip2Encoder.h +273 -0
  599. package/vendor/7zip/CPP/7zip/Compress/BZip2Register.cpp +25 -0
  600. package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.cpp +867 -0
  601. package/vendor/7zip/CPP/7zip/Compress/Bcj2Coder.h +127 -0
  602. package/vendor/7zip/CPP/7zip/Compress/Bcj2Register.cpp +24 -0
  603. package/vendor/7zip/CPP/7zip/Compress/BcjCoder.cpp +24 -0
  604. package/vendor/7zip/CPP/7zip/Compress/BcjCoder.h +37 -0
  605. package/vendor/7zip/CPP/7zip/Compress/BcjRegister.cpp +17 -0
  606. package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.cpp +32 -0
  607. package/vendor/7zip/CPP/7zip/Compress/BitlDecoder.h +225 -0
  608. package/vendor/7zip/CPP/7zip/Compress/BitlEncoder.h +57 -0
  609. package/vendor/7zip/CPP/7zip/Compress/BitmDecoder.h +106 -0
  610. package/vendor/7zip/CPP/7zip/Compress/BitmEncoder.h +90 -0
  611. package/vendor/7zip/CPP/7zip/Compress/BranchMisc.cpp +106 -0
  612. package/vendor/7zip/CPP/7zip/Compress/BranchMisc.h +59 -0
  613. package/vendor/7zip/CPP/7zip/Compress/BranchRegister.cpp +58 -0
  614. package/vendor/7zip/CPP/7zip/Compress/ByteSwap.cpp +91 -0
  615. package/vendor/7zip/CPP/7zip/Compress/Codec.def +7 -0
  616. package/vendor/7zip/CPP/7zip/Compress/CodecExports.cpp +378 -0
  617. package/vendor/7zip/CPP/7zip/Compress/CopyCoder.cpp +153 -0
  618. package/vendor/7zip/CPP/7zip/Compress/CopyCoder.h +34 -0
  619. package/vendor/7zip/CPP/7zip/Compress/CopyRegister.cpp +15 -0
  620. package/vendor/7zip/CPP/7zip/Compress/Deflate64Register.cpp +25 -0
  621. package/vendor/7zip/CPP/7zip/Compress/DeflateConst.h +131 -0
  622. package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.cpp +566 -0
  623. package/vendor/7zip/CPP/7zip/Compress/DeflateDecoder.h +154 -0
  624. package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.cpp +1045 -0
  625. package/vendor/7zip/CPP/7zip/Compress/DeflateEncoder.h +203 -0
  626. package/vendor/7zip/CPP/7zip/Compress/DeflateRegister.cpp +25 -0
  627. package/vendor/7zip/CPP/7zip/Compress/DeltaFilter.cpp +126 -0
  628. package/vendor/7zip/CPP/7zip/Compress/DllExports2Compress.cpp +38 -0
  629. package/vendor/7zip/CPP/7zip/Compress/DllExportsCompress.cpp +59 -0
  630. package/vendor/7zip/CPP/7zip/Compress/HuffmanDecoder.h +528 -0
  631. package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.cpp +250 -0
  632. package/vendor/7zip/CPP/7zip/Compress/ImplodeDecoder.h +61 -0
  633. package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.cpp +3 -0
  634. package/vendor/7zip/CPP/7zip/Compress/ImplodeHuffmanDecoder.h +6 -0
  635. package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.cpp +14 -0
  636. package/vendor/7zip/CPP/7zip/Compress/LzOutWindow.h +102 -0
  637. package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.cpp +950 -0
  638. package/vendor/7zip/CPP/7zip/Compress/LzfseDecoder.h +63 -0
  639. package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.cpp +220 -0
  640. package/vendor/7zip/CPP/7zip/Compress/LzhDecoder.h +68 -0
  641. package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.cpp +267 -0
  642. package/vendor/7zip/CPP/7zip/Compress/Lzma2Decoder.h +87 -0
  643. package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.cpp +134 -0
  644. package/vendor/7zip/CPP/7zip/Compress/Lzma2Encoder.h +30 -0
  645. package/vendor/7zip/CPP/7zip/Compress/Lzma2Register.cpp +22 -0
  646. package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.cpp +350 -0
  647. package/vendor/7zip/CPP/7zip/Compress/LzmaDecoder.h +113 -0
  648. package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.cpp +374 -0
  649. package/vendor/7zip/CPP/7zip/Compress/LzmaEncoder.h +45 -0
  650. package/vendor/7zip/CPP/7zip/Compress/LzmaRegister.cpp +22 -0
  651. package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.cpp +619 -0
  652. package/vendor/7zip/CPP/7zip/Compress/LzmsDecoder.h +209 -0
  653. package/vendor/7zip/CPP/7zip/Compress/Lzx.h +61 -0
  654. package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.cpp +1517 -0
  655. package/vendor/7zip/CPP/7zip/Compress/LzxDecoder.h +106 -0
  656. package/vendor/7zip/CPP/7zip/Compress/Mtf8.h +225 -0
  657. package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.cpp +219 -0
  658. package/vendor/7zip/CPP/7zip/Compress/PpmdDecoder.h +87 -0
  659. package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.cpp +193 -0
  660. package/vendor/7zip/CPP/7zip/Compress/PpmdEncoder.h +49 -0
  661. package/vendor/7zip/CPP/7zip/Compress/PpmdRegister.cpp +22 -0
  662. package/vendor/7zip/CPP/7zip/Compress/PpmdZip.cpp +309 -0
  663. package/vendor/7zip/CPP/7zip/Compress/PpmdZip.h +78 -0
  664. package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.cpp +355 -0
  665. package/vendor/7zip/CPP/7zip/Compress/QuantumDecoder.h +60 -0
  666. package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.cpp +518 -0
  667. package/vendor/7zip/CPP/7zip/Compress/Rar1Decoder.h +70 -0
  668. package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.cpp +472 -0
  669. package/vendor/7zip/CPP/7zip/Compress/Rar2Decoder.h +111 -0
  670. package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.cpp +939 -0
  671. package/vendor/7zip/CPP/7zip/Compress/Rar3Decoder.h +283 -0
  672. package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.cpp +1153 -0
  673. package/vendor/7zip/CPP/7zip/Compress/Rar3Vm.h +195 -0
  674. package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.cpp +2060 -0
  675. package/vendor/7zip/CPP/7zip/Compress/Rar5Decoder.h +132 -0
  676. package/vendor/7zip/CPP/7zip/Compress/RarCodecsRegister.cpp +33 -0
  677. package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.cpp +290 -0
  678. package/vendor/7zip/CPP/7zip/Compress/ShrinkDecoder.h +38 -0
  679. package/vendor/7zip/CPP/7zip/Compress/StdAfx.h +11 -0
  680. package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.cpp +399 -0
  681. package/vendor/7zip/CPP/7zip/Compress/XpressDecoder.h +18 -0
  682. package/vendor/7zip/CPP/7zip/Compress/XzDecoder.cpp +151 -0
  683. package/vendor/7zip/CPP/7zip/Compress/XzDecoder.h +86 -0
  684. package/vendor/7zip/CPP/7zip/Compress/XzEncoder.cpp +243 -0
  685. package/vendor/7zip/CPP/7zip/Compress/XzEncoder.h +35 -0
  686. package/vendor/7zip/CPP/7zip/Compress/ZDecoder.cpp +392 -0
  687. package/vendor/7zip/CPP/7zip/Compress/ZDecoder.h +41 -0
  688. package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.cpp +136 -0
  689. package/vendor/7zip/CPP/7zip/Compress/ZlibDecoder.h +78 -0
  690. package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.cpp +61 -0
  691. package/vendor/7zip/CPP/7zip/Compress/ZlibEncoder.h +42 -0
  692. package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.cpp +437 -0
  693. package/vendor/7zip/CPP/7zip/Compress/ZstdDecoder.h +98 -0
  694. package/vendor/7zip/CPP/7zip/Compress/makefile +7 -0
  695. package/vendor/7zip/CPP/7zip/Crc.mak +8 -0
  696. package/vendor/7zip/CPP/7zip/Crc64.mak +8 -0
  697. package/vendor/7zip/CPP/7zip/Crypto/7zAes.cpp +315 -0
  698. package/vendor/7zip/CPP/7zip/Crypto/7zAes.h +130 -0
  699. package/vendor/7zip/CPP/7zip/Crypto/7zAesRegister.cpp +17 -0
  700. package/vendor/7zip/CPP/7zip/Crypto/Codec.def +4 -0
  701. package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.cpp +94 -0
  702. package/vendor/7zip/CPP/7zip/Crypto/HmacSha1.h +31 -0
  703. package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.cpp +53 -0
  704. package/vendor/7zip/CPP/7zip/Crypto/HmacSha256.h +27 -0
  705. package/vendor/7zip/CPP/7zip/Crypto/MyAes.cpp +277 -0
  706. package/vendor/7zip/CPP/7zip/Crypto/MyAes.h +122 -0
  707. package/vendor/7zip/CPP/7zip/Crypto/MyAesReg.cpp +29 -0
  708. package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.cpp +48 -0
  709. package/vendor/7zip/CPP/7zip/Crypto/Pbkdf2HmacSha1.h +19 -0
  710. package/vendor/7zip/CPP/7zip/Crypto/RandGen.cpp +242 -0
  711. package/vendor/7zip/CPP/7zip/Crypto/RandGen.h +41 -0
  712. package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.cpp +130 -0
  713. package/vendor/7zip/CPP/7zip/Crypto/Rar20Crypto.h +54 -0
  714. package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.cpp +273 -0
  715. package/vendor/7zip/CPP/7zip/Crypto/Rar5Aes.h +97 -0
  716. package/vendor/7zip/CPP/7zip/Crypto/RarAes.cpp +202 -0
  717. package/vendor/7zip/CPP/7zip/Crypto/RarAes.h +54 -0
  718. package/vendor/7zip/CPP/7zip/Crypto/Sha1Cls.h +37 -0
  719. package/vendor/7zip/CPP/7zip/Crypto/StdAfx.h +11 -0
  720. package/vendor/7zip/CPP/7zip/Crypto/WzAes.cpp +231 -0
  721. package/vendor/7zip/CPP/7zip/Crypto/WzAes.h +161 -0
  722. package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.cpp +114 -0
  723. package/vendor/7zip/CPP/7zip/Crypto/ZipCrypto.h +80 -0
  724. package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.cpp +265 -0
  725. package/vendor/7zip/CPP/7zip/Crypto/ZipStrong.h +73 -0
  726. package/vendor/7zip/CPP/7zip/GuiCommon.rc +119 -0
  727. package/vendor/7zip/CPP/7zip/Guid.txt +243 -0
  728. package/vendor/7zip/CPP/7zip/ICoder.h +480 -0
  729. package/vendor/7zip/CPP/7zip/IDecl.h +76 -0
  730. package/vendor/7zip/CPP/7zip/IPassword.h +54 -0
  731. package/vendor/7zip/CPP/7zip/IProgress.h +20 -0
  732. package/vendor/7zip/CPP/7zip/IStream.h +210 -0
  733. package/vendor/7zip/CPP/7zip/LzFindOpt.mak +7 -0
  734. package/vendor/7zip/CPP/7zip/LzmaDec.mak +7 -0
  735. package/vendor/7zip/CPP/7zip/LzmaDec_gcc.mak +14 -0
  736. package/vendor/7zip/CPP/7zip/MyVersion.h +2 -0
  737. package/vendor/7zip/CPP/7zip/MyVersionInfo.rc +2 -0
  738. package/vendor/7zip/CPP/7zip/PropID.h +178 -0
  739. package/vendor/7zip/CPP/7zip/Sha1.mak +13 -0
  740. package/vendor/7zip/CPP/7zip/Sha256.mak +13 -0
  741. package/vendor/7zip/CPP/7zip/Sort.mak +6 -0
  742. package/vendor/7zip/CPP/7zip/SubBuild.mak +3 -0
  743. package/vendor/7zip/CPP/7zip/UI/Agent/Agent.cpp +2003 -0
  744. package/vendor/7zip/CPP/7zip/UI/Agent/Agent.h +365 -0
  745. package/vendor/7zip/CPP/7zip/UI/Agent/AgentOut.cpp +776 -0
  746. package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.cpp +1098 -0
  747. package/vendor/7zip/CPP/7zip/UI/Agent/AgentProxy.h +198 -0
  748. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolder.cpp +57 -0
  749. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOpen.cpp +243 -0
  750. package/vendor/7zip/CPP/7zip/UI/Agent/ArchiveFolderOut.cpp +457 -0
  751. package/vendor/7zip/CPP/7zip/UI/Agent/IFolderArchive.h +123 -0
  752. package/vendor/7zip/CPP/7zip/UI/Agent/StdAfx.h +11 -0
  753. package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +208 -0
  754. package/vendor/7zip/CPP/7zip/UI/Agent/UpdateCallbackAgent.h +22 -0
  755. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.cpp +1145 -0
  756. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsp +331 -0
  757. package/vendor/7zip/CPP/7zip/UI/Client7z/Client7z.dsw +29 -0
  758. package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.cpp +3 -0
  759. package/vendor/7zip/CPP/7zip/UI/Client7z/StdAfx.h +11 -0
  760. package/vendor/7zip/CPP/7zip/UI/Client7z/makefile +29 -0
  761. package/vendor/7zip/CPP/7zip/UI/Client7z/makefile.gcc +72 -0
  762. package/vendor/7zip/CPP/7zip/UI/Client7z/resource.rc +3 -0
  763. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +1913 -0
  764. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveCommandLine.h +170 -0
  765. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +3243 -0
  766. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveExtractCallback.h +640 -0
  767. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.cpp +176 -0
  768. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveName.h +16 -0
  769. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp +403 -0
  770. package/vendor/7zip/CPP/7zip/UI/Common/ArchiveOpenCallback.h +182 -0
  771. package/vendor/7zip/CPP/7zip/UI/Common/Bench.cpp +5036 -0
  772. package/vendor/7zip/CPP/7zip/UI/Common/Bench.h +121 -0
  773. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.cpp +343 -0
  774. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall.h +28 -0
  775. package/vendor/7zip/CPP/7zip/UI/Common/CompressCall2.cpp +327 -0
  776. package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.cpp +37 -0
  777. package/vendor/7zip/CPP/7zip/UI/Common/DefaultName.h +11 -0
  778. package/vendor/7zip/CPP/7zip/UI/Common/DirItem.h +407 -0
  779. package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.cpp +1637 -0
  780. package/vendor/7zip/CPP/7zip/UI/Common/EnumDirItems.h +38 -0
  781. package/vendor/7zip/CPP/7zip/UI/Common/ExitCode.h +27 -0
  782. package/vendor/7zip/CPP/7zip/UI/Common/Extract.cpp +593 -0
  783. package/vendor/7zip/CPP/7zip/UI/Common/Extract.h +118 -0
  784. package/vendor/7zip/CPP/7zip/UI/Common/ExtractMode.h +44 -0
  785. package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.cpp +299 -0
  786. package/vendor/7zip/CPP/7zip/UI/Common/ExtractingFilePath.h +31 -0
  787. package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.cpp +2273 -0
  788. package/vendor/7zip/CPP/7zip/UI/Common/HashCalc.h +322 -0
  789. package/vendor/7zip/CPP/7zip/UI/Common/IFileExtractCallback.h +112 -0
  790. package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.cpp +1354 -0
  791. package/vendor/7zip/CPP/7zip/UI/Common/LoadCodecs.h +482 -0
  792. package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.cpp +3690 -0
  793. package/vendor/7zip/CPP/7zip/UI/Common/OpenArchive.h +469 -0
  794. package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.cpp +746 -0
  795. package/vendor/7zip/CPP/7zip/UI/Common/PropIDUtils.h +18 -0
  796. package/vendor/7zip/CPP/7zip/UI/Common/Property.h +14 -0
  797. package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.cpp +88 -0
  798. package/vendor/7zip/CPP/7zip/UI/Common/SetProperties.h +10 -0
  799. package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.cpp +25 -0
  800. package/vendor/7zip/CPP/7zip/UI/Common/SortUtils.h +10 -0
  801. package/vendor/7zip/CPP/7zip/UI/Common/StdAfx.h +11 -0
  802. package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.cpp +20 -0
  803. package/vendor/7zip/CPP/7zip/UI/Common/TempFiles.h +19 -0
  804. package/vendor/7zip/CPP/7zip/UI/Common/Update.cpp +1931 -0
  805. package/vendor/7zip/CPP/7zip/UI/Common/Update.h +221 -0
  806. package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.cpp +64 -0
  807. package/vendor/7zip/CPP/7zip/UI/Common/UpdateAction.h +66 -0
  808. package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.cpp +1078 -0
  809. package/vendor/7zip/CPP/7zip/UI/Common/UpdateCallback.h +197 -0
  810. package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.cpp +303 -0
  811. package/vendor/7zip/CPP/7zip/UI/Common/UpdatePair.h +27 -0
  812. package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.cpp +75 -0
  813. package/vendor/7zip/CPP/7zip/UI/Common/UpdateProduce.h +60 -0
  814. package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.cpp +84 -0
  815. package/vendor/7zip/CPP/7zip/UI/Common/WorkDir.h +30 -0
  816. package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.cpp +599 -0
  817. package/vendor/7zip/CPP/7zip/UI/Common/ZipRegistry.h +212 -0
  818. package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.cpp +41 -0
  819. package/vendor/7zip/CPP/7zip/UI/Console/BenchCon.h +14 -0
  820. package/vendor/7zip/CPP/7zip/UI/Console/Console.dsp +1052 -0
  821. package/vendor/7zip/CPP/7zip/UI/Console/Console.dsw +29 -0
  822. package/vendor/7zip/CPP/7zip/UI/Console/Console.mak +45 -0
  823. package/vendor/7zip/CPP/7zip/UI/Console/Console.manifest +16 -0
  824. package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.cpp +98 -0
  825. package/vendor/7zip/CPP/7zip/UI/Console/ConsoleClose.h +39 -0
  826. package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp +954 -0
  827. package/vendor/7zip/CPP/7zip/UI/Console/ExtractCallbackConsole.h +211 -0
  828. package/vendor/7zip/CPP/7zip/UI/Console/HashCon.cpp +426 -0
  829. package/vendor/7zip/CPP/7zip/UI/Console/HashCon.h +58 -0
  830. package/vendor/7zip/CPP/7zip/UI/Console/List.cpp +1417 -0
  831. package/vendor/7zip/CPP/7zip/UI/Console/List.h +42 -0
  832. package/vendor/7zip/CPP/7zip/UI/Console/Main.cpp +1663 -0
  833. package/vendor/7zip/CPP/7zip/UI/Console/MainAr.cpp +235 -0
  834. package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +115 -0
  835. package/vendor/7zip/CPP/7zip/UI/Console/OpenCallbackConsole.h +73 -0
  836. package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.cpp +186 -0
  837. package/vendor/7zip/CPP/7zip/UI/Console/PercentPrinter.h +66 -0
  838. package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.cpp +3 -0
  839. package/vendor/7zip/CPP/7zip/UI/Console/StdAfx.h +11 -0
  840. package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +1012 -0
  841. package/vendor/7zip/CPP/7zip/UI/Console/UpdateCallbackConsole.h +148 -0
  842. package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.cpp +118 -0
  843. package/vendor/7zip/CPP/7zip/UI/Console/UserInputUtils.h +27 -0
  844. package/vendor/7zip/CPP/7zip/UI/Console/makefile +68 -0
  845. package/vendor/7zip/CPP/7zip/UI/Console/makefile.gcc +184 -0
  846. package/vendor/7zip/CPP/7zip/UI/Console/resource.rc +7 -0
  847. package/vendor/7zip/CPP/7zip/UI/Explorer/7-zip.dll.manifest +1 -0
  848. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.cpp +1837 -0
  849. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenu.h +173 -0
  850. package/vendor/7zip/CPP/7zip/UI/Explorer/ContextMenuFlags.h +27 -0
  851. package/vendor/7zip/CPP/7zip/UI/Explorer/DllExportsExplorer.cpp +268 -0
  852. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.def +9 -0
  853. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsp +620 -0
  854. package/vendor/7zip/CPP/7zip/UI/Explorer/Explorer.dsw +29 -0
  855. package/vendor/7zip/CPP/7zip/UI/Explorer/MenuLogo.bmp +0 -0
  856. package/vendor/7zip/CPP/7zip/UI/Explorer/MyExplorerCommand.h +217 -0
  857. package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.cpp +43 -0
  858. package/vendor/7zip/CPP/7zip/UI/Explorer/MyMessages.h +16 -0
  859. package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.cpp +225 -0
  860. package/vendor/7zip/CPP/7zip/UI/Explorer/RegistryContextMenu.h +13 -0
  861. package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.cpp +3 -0
  862. package/vendor/7zip/CPP/7zip/UI/Explorer/StdAfx.h +6 -0
  863. package/vendor/7zip/CPP/7zip/UI/Explorer/makefile +76 -0
  864. package/vendor/7zip/CPP/7zip/UI/Explorer/resource.h +15 -0
  865. package/vendor/7zip/CPP/7zip/UI/Explorer/resource.rc +10 -0
  866. package/vendor/7zip/CPP/7zip/UI/Explorer/resource2.rc +19 -0
  867. package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.cpp +274 -0
  868. package/vendor/7zip/CPP/7zip/UI/Far/ExtractEngine.h +43 -0
  869. package/vendor/7zip/CPP/7zip/UI/Far/Far.cpp +588 -0
  870. package/vendor/7zip/CPP/7zip/UI/Far/Far.def +35 -0
  871. package/vendor/7zip/CPP/7zip/UI/Far/Far.dsp +831 -0
  872. package/vendor/7zip/CPP/7zip/UI/Far/Far.dsw +29 -0
  873. package/vendor/7zip/CPP/7zip/UI/Far/FarPlugin.h +560 -0
  874. package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.cpp +523 -0
  875. package/vendor/7zip/CPP/7zip/UI/Far/FarUtils.h +203 -0
  876. package/vendor/7zip/CPP/7zip/UI/Far/Messages.h +136 -0
  877. package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.cpp +145 -0
  878. package/vendor/7zip/CPP/7zip/UI/Far/OverwriteDialogFar.h +37 -0
  879. package/vendor/7zip/CPP/7zip/UI/Far/Plugin.cpp +937 -0
  880. package/vendor/7zip/CPP/7zip/UI/Far/Plugin.h +97 -0
  881. package/vendor/7zip/CPP/7zip/UI/Far/PluginCommon.cpp +50 -0
  882. package/vendor/7zip/CPP/7zip/UI/Far/PluginDelete.cpp +144 -0
  883. package/vendor/7zip/CPP/7zip/UI/Far/PluginRead.cpp +301 -0
  884. package/vendor/7zip/CPP/7zip/UI/Far/PluginWrite.cpp +840 -0
  885. package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.cpp +305 -0
  886. package/vendor/7zip/CPP/7zip/UI/Far/ProgressBox.h +85 -0
  887. package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.cpp +3 -0
  888. package/vendor/7zip/CPP/7zip/UI/Far/StdAfx.h +11 -0
  889. package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.cpp +327 -0
  890. package/vendor/7zip/CPP/7zip/UI/Far/UpdateCallbackFar.h +58 -0
  891. package/vendor/7zip/CPP/7zip/UI/Far/makefile +105 -0
  892. package/vendor/7zip/CPP/7zip/UI/Far/resource.rc +3 -0
  893. package/vendor/7zip/CPP/7zip/UI/FileManager/7zFM.exe.manifest +23 -0
  894. package/vendor/7zip/CPP/7zip/UI/FileManager/7zipLogo.ico +0 -0
  895. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.cpp +81 -0
  896. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.h +19 -0
  897. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialog.rc +26 -0
  898. package/vendor/7zip/CPP/7zip/UI/FileManager/AboutDialogRes.h +8 -0
  899. package/vendor/7zip/CPP/7zip/UI/FileManager/Add.bmp +0 -0
  900. package/vendor/7zip/CPP/7zip/UI/FileManager/Add2.bmp +0 -0
  901. package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.cpp +865 -0
  902. package/vendor/7zip/CPP/7zip/UI/FileManager/AltStreamsFolder.h +92 -0
  903. package/vendor/7zip/CPP/7zip/UI/FileManager/App.cpp +1004 -0
  904. package/vendor/7zip/CPP/7zip/UI/FileManager/App.h +314 -0
  905. package/vendor/7zip/CPP/7zip/UI/FileManager/AppState.h +95 -0
  906. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp +1132 -0
  907. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.h +32 -0
  908. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog.rc +25 -0
  909. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.cpp +1873 -0
  910. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.h +10 -0
  911. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2.rc +32 -0
  912. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialog2Res.h +9 -0
  913. package/vendor/7zip/CPP/7zip/UI/FileManager/BrowseDialogRes.h +9 -0
  914. package/vendor/7zip/CPP/7zip/UI/FileManager/ClassDefs.cpp +12 -0
  915. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.cpp +64 -0
  916. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.h +28 -0
  917. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialog.rc +16 -0
  918. package/vendor/7zip/CPP/7zip/UI/FileManager/ComboDialogRes.h +4 -0
  919. package/vendor/7zip/CPP/7zip/UI/FileManager/Copy.bmp +0 -0
  920. package/vendor/7zip/CPP/7zip/UI/FileManager/Copy2.bmp +0 -0
  921. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.cpp +103 -0
  922. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.h +31 -0
  923. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialog.rc +20 -0
  924. package/vendor/7zip/CPP/7zip/UI/FileManager/CopyDialogRes.h +8 -0
  925. package/vendor/7zip/CPP/7zip/UI/FileManager/Delete.bmp +0 -0
  926. package/vendor/7zip/CPP/7zip/UI/FileManager/Delete2.bmp +0 -0
  927. package/vendor/7zip/CPP/7zip/UI/FileManager/DialogSize.h +16 -0
  928. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.cpp +57 -0
  929. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.h +25 -0
  930. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialog.rc +15 -0
  931. package/vendor/7zip/CPP/7zip/UI/FileManager/EditDialogRes.h +2 -0
  932. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.cpp +159 -0
  933. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.h +30 -0
  934. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage.rc +19 -0
  935. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPage2.rc +14 -0
  936. package/vendor/7zip/CPP/7zip/UI/FileManager/EditPageRes.h +15 -0
  937. package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.cpp +109 -0
  938. package/vendor/7zip/CPP/7zip/UI/FileManager/EnumFormatEtc.h +10 -0
  939. package/vendor/7zip/CPP/7zip/UI/FileManager/Extract.bmp +0 -0
  940. package/vendor/7zip/CPP/7zip/UI/FileManager/Extract2.bmp +0 -0
  941. package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.cpp +1284 -0
  942. package/vendor/7zip/CPP/7zip/UI/FileManager/ExtractCallback.h +347 -0
  943. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.cpp +1230 -0
  944. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsp +1699 -0
  945. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.dsw +29 -0
  946. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.ico +0 -0
  947. package/vendor/7zip/CPP/7zip/UI/FileManager/FM.mak +102 -0
  948. package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.cpp +512 -0
  949. package/vendor/7zip/CPP/7zip/UI/FileManager/FSDrives.h +52 -0
  950. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.cpp +1179 -0
  951. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolder.h +220 -0
  952. package/vendor/7zip/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +871 -0
  953. package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +394 -0
  954. package/vendor/7zip/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h +27 -0
  955. package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.cpp +78 -0
  956. package/vendor/7zip/CPP/7zip/UI/FileManager/FilePlugins.h +33 -0
  957. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.cpp +172 -0
  958. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.h +32 -0
  959. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage.rc +23 -0
  960. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPage2.rc +11 -0
  961. package/vendor/7zip/CPP/7zip/UI/FileManager/FoldersPageRes.h +12 -0
  962. package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.cpp +28 -0
  963. package/vendor/7zip/CPP/7zip/UI/FileManager/FormatUtils.h +14 -0
  964. package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.cpp +78 -0
  965. package/vendor/7zip/CPP/7zip/UI/FileManager/HelpUtils.h +10 -0
  966. package/vendor/7zip/CPP/7zip/UI/FileManager/IFolder.h +187 -0
  967. package/vendor/7zip/CPP/7zip/UI/FileManager/Info.bmp +0 -0
  968. package/vendor/7zip/CPP/7zip/UI/FileManager/Info2.bmp +0 -0
  969. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.cpp +359 -0
  970. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.h +36 -0
  971. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPage.rc +40 -0
  972. package/vendor/7zip/CPP/7zip/UI/FileManager/LangPageRes.h +9 -0
  973. package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.cpp +333 -0
  974. package/vendor/7zip/CPP/7zip/UI/FileManager/LangUtils.h +48 -0
  975. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.cpp +402 -0
  976. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.h +34 -0
  977. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialog.rc +38 -0
  978. package/vendor/7zip/CPP/7zip/UI/FileManager/LinkDialogRes.h +22 -0
  979. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.cpp +321 -0
  980. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.h +46 -0
  981. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialog.rc +14 -0
  982. package/vendor/7zip/CPP/7zip/UI/FileManager/ListViewDialogRes.h +2 -0
  983. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.cpp +218 -0
  984. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.h +48 -0
  985. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialog.rc +49 -0
  986. package/vendor/7zip/CPP/7zip/UI/FileManager/MemDialogRes.h +13 -0
  987. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.cpp +439 -0
  988. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.h +57 -0
  989. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage.rc +24 -0
  990. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPage2.rc +28 -0
  991. package/vendor/7zip/CPP/7zip/UI/FileManager/MenuPageRes.h +15 -0
  992. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.cpp +76 -0
  993. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.h +25 -0
  994. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialog.rc +14 -0
  995. package/vendor/7zip/CPP/7zip/UI/FileManager/MessagesDialogRes.h +3 -0
  996. package/vendor/7zip/CPP/7zip/UI/FileManager/Move.bmp +0 -0
  997. package/vendor/7zip/CPP/7zip/UI/FileManager/Move2.bmp +0 -0
  998. package/vendor/7zip/CPP/7zip/UI/FileManager/MyCom2.h +46 -0
  999. package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +964 -0
  1000. package/vendor/7zip/CPP/7zip/UI/FileManager/MyLoadMenu.h +40 -0
  1001. package/vendor/7zip/CPP/7zip/UI/FileManager/MyWindowsNew.h +119 -0
  1002. package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.cpp +276 -0
  1003. package/vendor/7zip/CPP/7zip/UI/FileManager/NetFolder.h +36 -0
  1004. package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.cpp +86 -0
  1005. package/vendor/7zip/CPP/7zip/UI/FileManager/OpenCallback.h +69 -0
  1006. package/vendor/7zip/CPP/7zip/UI/FileManager/OptionsDialog.cpp +89 -0
  1007. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.cpp +288 -0
  1008. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.h +89 -0
  1009. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialog.rc +93 -0
  1010. package/vendor/7zip/CPP/7zip/UI/FileManager/OverwriteDialogRes.h +19 -0
  1011. package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.cpp +1177 -0
  1012. package/vendor/7zip/CPP/7zip/UI/FileManager/Panel.h +1020 -0
  1013. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCopy.cpp +477 -0
  1014. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelCrc.cpp +422 -0
  1015. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelDrag.cpp +3006 -0
  1016. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +1122 -0
  1017. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +1836 -0
  1018. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelItems.cpp +1476 -0
  1019. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelKey.cpp +357 -0
  1020. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelListNotify.cpp +838 -0
  1021. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelMenu.cpp +1160 -0
  1022. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelOperations.cpp +533 -0
  1023. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSelect.cpp +317 -0
  1024. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSort.cpp +288 -0
  1025. package/vendor/7zip/CPP/7zip/UI/FileManager/PanelSplitFile.cpp +562 -0
  1026. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.cpp +58 -0
  1027. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.h +28 -0
  1028. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialog.rc +18 -0
  1029. package/vendor/7zip/CPP/7zip/UI/FileManager/PasswordDialogRes.h +5 -0
  1030. package/vendor/7zip/CPP/7zip/UI/FileManager/PluginInterface.h +32 -0
  1031. package/vendor/7zip/CPP/7zip/UI/FileManager/PluginLoader.h +33 -0
  1032. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.cpp +3 -0
  1033. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgramLocation.h +6 -0
  1034. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.cpp +201 -0
  1035. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.h +171 -0
  1036. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog.rc +12 -0
  1037. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +1484 -0
  1038. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.h +355 -0
  1039. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2.rc +40 -0
  1040. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2Res.h +49 -0
  1041. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialog2a.rc +85 -0
  1042. package/vendor/7zip/CPP/7zip/UI/FileManager/ProgressDialogRes.h +3 -0
  1043. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.cpp +23 -0
  1044. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.h +10 -0
  1045. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyName.rc +109 -0
  1046. package/vendor/7zip/CPP/7zip/UI/FileManager/PropertyNameRes.h +104 -0
  1047. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.cpp +167 -0
  1048. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryAssociations.h +31 -0
  1049. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.cpp +145 -0
  1050. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryPlugins.h +29 -0
  1051. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.cpp +194 -0
  1052. package/vendor/7zip/CPP/7zip/UI/FileManager/RegistryUtils.h +50 -0
  1053. package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.cpp +342 -0
  1054. package/vendor/7zip/CPP/7zip/UI/FileManager/RootFolder.h +24 -0
  1055. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.cpp +453 -0
  1056. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.h +37 -0
  1057. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage.rc +22 -0
  1058. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPage2.rc +37 -0
  1059. package/vendor/7zip/CPP/7zip/UI/FileManager/SettingsPageRes.h +23 -0
  1060. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.cpp +114 -0
  1061. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.h +28 -0
  1062. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialog.rc +16 -0
  1063. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitDialogRes.h +8 -0
  1064. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.cpp +96 -0
  1065. package/vendor/7zip/CPP/7zip/UI/FileManager/SplitUtils.h +15 -0
  1066. package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.cpp +3 -0
  1067. package/vendor/7zip/CPP/7zip/UI/FileManager/StdAfx.h +67 -0
  1068. package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.cpp +39 -0
  1069. package/vendor/7zip/CPP/7zip/UI/FileManager/StringUtils.h +11 -0
  1070. package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.cpp +352 -0
  1071. package/vendor/7zip/CPP/7zip/UI/FileManager/SysIconUtils.h +65 -0
  1072. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.cpp +472 -0
  1073. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.h +126 -0
  1074. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPage.rc +43 -0
  1075. package/vendor/7zip/CPP/7zip/UI/FileManager/SystemPageRes.h +9 -0
  1076. package/vendor/7zip/CPP/7zip/UI/FileManager/Test.bmp +0 -0
  1077. package/vendor/7zip/CPP/7zip/UI/FileManager/Test2.bmp +0 -0
  1078. package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.cpp +193 -0
  1079. package/vendor/7zip/CPP/7zip/UI/FileManager/TextPairs.h +32 -0
  1080. package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.cpp +147 -0
  1081. package/vendor/7zip/CPP/7zip/UI/FileManager/UpdateCallback100.h +49 -0
  1082. package/vendor/7zip/CPP/7zip/UI/FileManager/VerCtrl.cpp +428 -0
  1083. package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.cpp +315 -0
  1084. package/vendor/7zip/CPP/7zip/UI/FileManager/ViewSettings.h +115 -0
  1085. package/vendor/7zip/CPP/7zip/UI/FileManager/makefile +110 -0
  1086. package/vendor/7zip/CPP/7zip/UI/FileManager/resource.h +199 -0
  1087. package/vendor/7zip/CPP/7zip/UI/FileManager/resource.rc +296 -0
  1088. package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.h +25 -0
  1089. package/vendor/7zip/CPP/7zip/UI/FileManager/resourceGui.rc +30 -0
  1090. package/vendor/7zip/CPP/7zip/UI/GUI/7zG.exe.manifest +23 -0
  1091. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.cpp +1921 -0
  1092. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.h +15 -0
  1093. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialog.rc +288 -0
  1094. package/vendor/7zip/CPP/7zip/UI/GUI/BenchmarkDialogRes.h +79 -0
  1095. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.cpp +3821 -0
  1096. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.h +483 -0
  1097. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialog.rc +233 -0
  1098. package/vendor/7zip/CPP/7zip/UI/GUI/CompressDialogRes.h +125 -0
  1099. package/vendor/7zip/CPP/7zip/UI/GUI/CompressOptionsDialog.rc +79 -0
  1100. package/vendor/7zip/CPP/7zip/UI/GUI/Extract.rc +59 -0
  1101. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.cpp +420 -0
  1102. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.h +113 -0
  1103. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialog.rc +98 -0
  1104. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractDialogRes.h +24 -0
  1105. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.cpp +297 -0
  1106. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractGUI.h +39 -0
  1107. package/vendor/7zip/CPP/7zip/UI/GUI/ExtractRes.h +51 -0
  1108. package/vendor/7zip/CPP/7zip/UI/GUI/FM.ico +0 -0
  1109. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.cpp +502 -0
  1110. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsp +1275 -0
  1111. package/vendor/7zip/CPP/7zip/UI/GUI/GUI.dsw +29 -0
  1112. package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.cpp +341 -0
  1113. package/vendor/7zip/CPP/7zip/UI/GUI/HashGUI.h +27 -0
  1114. package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.cpp +3 -0
  1115. package/vendor/7zip/CPP/7zip/UI/GUI/StdAfx.h +6 -0
  1116. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +295 -0
  1117. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI.h +31 -0
  1118. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.cpp +130 -0
  1119. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateCallbackGUI2.h +53 -0
  1120. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.cpp +605 -0
  1121. package/vendor/7zip/CPP/7zip/UI/GUI/UpdateGUI.h +33 -0
  1122. package/vendor/7zip/CPP/7zip/UI/GUI/makefile +148 -0
  1123. package/vendor/7zip/CPP/7zip/UI/GUI/resource.rc +26 -0
  1124. package/vendor/7zip/CPP/7zip/UI/GUI/resource2.h +2 -0
  1125. package/vendor/7zip/CPP/7zip/UI/GUI/resource2.rc +10 -0
  1126. package/vendor/7zip/CPP/7zip/UI/GUI/resource3.h +10 -0
  1127. package/vendor/7zip/CPP/7zip/UI/GUI/resource3.rc +15 -0
  1128. package/vendor/7zip/CPP/7zip/UI/makefile +12 -0
  1129. package/vendor/7zip/CPP/7zip/cmpl_clang.mak +3 -0
  1130. package/vendor/7zip/CPP/7zip/cmpl_clang_arm64.mak +3 -0
  1131. package/vendor/7zip/CPP/7zip/cmpl_clang_x64.mak +3 -0
  1132. package/vendor/7zip/CPP/7zip/cmpl_clang_x86.mak +3 -0
  1133. package/vendor/7zip/CPP/7zip/cmpl_gcc.mak +3 -0
  1134. package/vendor/7zip/CPP/7zip/cmpl_gcc_arm.mak +3 -0
  1135. package/vendor/7zip/CPP/7zip/cmpl_gcc_arm64.mak +3 -0
  1136. package/vendor/7zip/CPP/7zip/cmpl_gcc_x64.mak +3 -0
  1137. package/vendor/7zip/CPP/7zip/cmpl_gcc_x86.mak +3 -0
  1138. package/vendor/7zip/CPP/7zip/cmpl_mac_arm64.mak +3 -0
  1139. package/vendor/7zip/CPP/7zip/cmpl_mac_x64.mak +3 -0
  1140. package/vendor/7zip/CPP/7zip/makefile +10 -0
  1141. package/vendor/7zip/CPP/7zip/var_clang.mak +11 -0
  1142. package/vendor/7zip/CPP/7zip/var_clang_arm64.mak +19 -0
  1143. package/vendor/7zip/CPP/7zip/var_clang_x64.mak +11 -0
  1144. package/vendor/7zip/CPP/7zip/var_clang_x86.mak +11 -0
  1145. package/vendor/7zip/CPP/7zip/var_gcc.mak +12 -0
  1146. package/vendor/7zip/CPP/7zip/var_gcc_arm.mak +34 -0
  1147. package/vendor/7zip/CPP/7zip/var_gcc_arm64.mak +12 -0
  1148. package/vendor/7zip/CPP/7zip/var_gcc_x64.mak +11 -0
  1149. package/vendor/7zip/CPP/7zip/var_gcc_x86.mak +10 -0
  1150. package/vendor/7zip/CPP/7zip/var_mac_arm64.mak +13 -0
  1151. package/vendor/7zip/CPP/7zip/var_mac_x64.mak +13 -0
  1152. package/vendor/7zip/CPP/7zip/warn_clang.mak +3 -0
  1153. package/vendor/7zip/CPP/7zip/warn_clang_mac.mak +9 -0
  1154. package/vendor/7zip/CPP/7zip/warn_gcc.mak +55 -0
  1155. package/vendor/7zip/CPP/Build.mak +259 -0
  1156. package/vendor/7zip/CPP/Common/AutoPtr.h +46 -0
  1157. package/vendor/7zip/CPP/Common/CRC.cpp +7 -0
  1158. package/vendor/7zip/CPP/Common/C_FileIO.cpp +3 -0
  1159. package/vendor/7zip/CPP/Common/C_FileIO.h +6 -0
  1160. package/vendor/7zip/CPP/Common/CksumReg.cpp +55 -0
  1161. package/vendor/7zip/CPP/Common/ComTry.h +21 -0
  1162. package/vendor/7zip/CPP/Common/CommandLineParser.cpp +231 -0
  1163. package/vendor/7zip/CPP/Common/CommandLineParser.h +63 -0
  1164. package/vendor/7zip/CPP/Common/Common.h +28 -0
  1165. package/vendor/7zip/CPP/Common/Common0.h +342 -0
  1166. package/vendor/7zip/CPP/Common/CrcReg.cpp +77 -0
  1167. package/vendor/7zip/CPP/Common/Defs.h +16 -0
  1168. package/vendor/7zip/CPP/Common/DynLimBuf.cpp +93 -0
  1169. package/vendor/7zip/CPP/Common/DynLimBuf.h +41 -0
  1170. package/vendor/7zip/CPP/Common/DynamicBuffer.h +76 -0
  1171. package/vendor/7zip/CPP/Common/IntToString.cpp +215 -0
  1172. package/vendor/7zip/CPP/Common/IntToString.h +54 -0
  1173. package/vendor/7zip/CPP/Common/Lang.cpp +173 -0
  1174. package/vendor/7zip/CPP/Common/Lang.h +30 -0
  1175. package/vendor/7zip/CPP/Common/ListFileUtils.cpp +150 -0
  1176. package/vendor/7zip/CPP/Common/ListFileUtils.h +18 -0
  1177. package/vendor/7zip/CPP/Common/LzFindPrepare.cpp +7 -0
  1178. package/vendor/7zip/CPP/Common/Md5Reg.cpp +44 -0
  1179. package/vendor/7zip/CPP/Common/MyBuffer.h +343 -0
  1180. package/vendor/7zip/CPP/Common/MyBuffer2.h +185 -0
  1181. package/vendor/7zip/CPP/Common/MyCom.h +693 -0
  1182. package/vendor/7zip/CPP/Common/MyException.h +14 -0
  1183. package/vendor/7zip/CPP/Common/MyGuidDef.h +63 -0
  1184. package/vendor/7zip/CPP/Common/MyInitGuid.h +57 -0
  1185. package/vendor/7zip/CPP/Common/MyLinux.h +75 -0
  1186. package/vendor/7zip/CPP/Common/MyMap.cpp +140 -0
  1187. package/vendor/7zip/CPP/Common/MyMap.h +28 -0
  1188. package/vendor/7zip/CPP/Common/MyString.cpp +1842 -0
  1189. package/vendor/7zip/CPP/Common/MyString.h +1079 -0
  1190. package/vendor/7zip/CPP/Common/MyTypes.h +38 -0
  1191. package/vendor/7zip/CPP/Common/MyUnknown.h +8 -0
  1192. package/vendor/7zip/CPP/Common/MyVector.cpp +3 -0
  1193. package/vendor/7zip/CPP/Common/MyVector.h +772 -0
  1194. package/vendor/7zip/CPP/Common/MyWindows.cpp +292 -0
  1195. package/vendor/7zip/CPP/Common/MyWindows.h +325 -0
  1196. package/vendor/7zip/CPP/Common/MyXml.cpp +349 -0
  1197. package/vendor/7zip/CPP/Common/MyXml.h +45 -0
  1198. package/vendor/7zip/CPP/Common/NewHandler.cpp +340 -0
  1199. package/vendor/7zip/CPP/Common/NewHandler.h +121 -0
  1200. package/vendor/7zip/CPP/Common/Random.cpp +28 -0
  1201. package/vendor/7zip/CPP/Common/Random.h +14 -0
  1202. package/vendor/7zip/CPP/Common/Sha1Prepare.cpp +7 -0
  1203. package/vendor/7zip/CPP/Common/Sha1Reg.cpp +67 -0
  1204. package/vendor/7zip/CPP/Common/Sha256Prepare.cpp +7 -0
  1205. package/vendor/7zip/CPP/Common/Sha256Reg.cpp +67 -0
  1206. package/vendor/7zip/CPP/Common/Sha3Reg.cpp +76 -0
  1207. package/vendor/7zip/CPP/Common/Sha512Prepare.cpp +7 -0
  1208. package/vendor/7zip/CPP/Common/Sha512Reg.cpp +83 -0
  1209. package/vendor/7zip/CPP/Common/StdAfx.h +8 -0
  1210. package/vendor/7zip/CPP/Common/StdInStream.cpp +98 -0
  1211. package/vendor/7zip/CPP/Common/StdInStream.h +46 -0
  1212. package/vendor/7zip/CPP/Common/StdOutStream.cpp +271 -0
  1213. package/vendor/7zip/CPP/Common/StdOutStream.h +87 -0
  1214. package/vendor/7zip/CPP/Common/StringConvert.cpp +762 -0
  1215. package/vendor/7zip/CPP/Common/StringConvert.h +110 -0
  1216. package/vendor/7zip/CPP/Common/StringToInt.cpp +154 -0
  1217. package/vendor/7zip/CPP/Common/StringToInt.h +38 -0
  1218. package/vendor/7zip/CPP/Common/TextConfig.cpp +123 -0
  1219. package/vendor/7zip/CPP/Common/TextConfig.h +19 -0
  1220. package/vendor/7zip/CPP/Common/UTFConvert.cpp +863 -0
  1221. package/vendor/7zip/CPP/Common/UTFConvert.h +384 -0
  1222. package/vendor/7zip/CPP/Common/Wildcard.cpp +789 -0
  1223. package/vendor/7zip/CPP/Common/Wildcard.h +231 -0
  1224. package/vendor/7zip/CPP/Common/Xxh64Reg.cpp +97 -0
  1225. package/vendor/7zip/CPP/Common/XzCrc64Init.cpp +7 -0
  1226. package/vendor/7zip/CPP/Common/XzCrc64Reg.cpp +39 -0
  1227. package/vendor/7zip/CPP/Windows/COM.cpp +41 -0
  1228. package/vendor/7zip/CPP/Windows/COM.h +86 -0
  1229. package/vendor/7zip/CPP/Windows/Clipboard.cpp +130 -0
  1230. package/vendor/7zip/CPP/Windows/Clipboard.h +28 -0
  1231. package/vendor/7zip/CPP/Windows/CommonDialog.cpp +269 -0
  1232. package/vendor/7zip/CPP/Windows/CommonDialog.h +43 -0
  1233. package/vendor/7zip/CPP/Windows/Console.cpp +10 -0
  1234. package/vendor/7zip/CPP/Windows/Console.h +52 -0
  1235. package/vendor/7zip/CPP/Windows/Control/ComboBox.cpp +75 -0
  1236. package/vendor/7zip/CPP/Windows/Control/ComboBox.h +79 -0
  1237. package/vendor/7zip/CPP/Windows/Control/CommandBar.h +52 -0
  1238. package/vendor/7zip/CPP/Windows/Control/Dialog.cpp +446 -0
  1239. package/vendor/7zip/CPP/Windows/Control/Dialog.h +213 -0
  1240. package/vendor/7zip/CPP/Windows/Control/Edit.h +19 -0
  1241. package/vendor/7zip/CPP/Windows/Control/ImageList.cpp +10 -0
  1242. package/vendor/7zip/CPP/Windows/Control/ImageList.h +87 -0
  1243. package/vendor/7zip/CPP/Windows/Control/ListView.cpp +162 -0
  1244. package/vendor/7zip/CPP/Windows/Control/ListView.h +156 -0
  1245. package/vendor/7zip/CPP/Windows/Control/ProgressBar.h +35 -0
  1246. package/vendor/7zip/CPP/Windows/Control/PropertyPage.cpp +165 -0
  1247. package/vendor/7zip/CPP/Windows/Control/PropertyPage.h +50 -0
  1248. package/vendor/7zip/CPP/Windows/Control/ReBar.h +34 -0
  1249. package/vendor/7zip/CPP/Windows/Control/Static.h +28 -0
  1250. package/vendor/7zip/CPP/Windows/Control/StatusBar.h +42 -0
  1251. package/vendor/7zip/CPP/Windows/Control/StdAfx.h +11 -0
  1252. package/vendor/7zip/CPP/Windows/Control/ToolBar.h +43 -0
  1253. package/vendor/7zip/CPP/Windows/Control/Trackbar.h +27 -0
  1254. package/vendor/7zip/CPP/Windows/Control/Window2.cpp +202 -0
  1255. package/vendor/7zip/CPP/Windows/Control/Window2.h +53 -0
  1256. package/vendor/7zip/CPP/Windows/DLL.cpp +178 -0
  1257. package/vendor/7zip/CPP/Windows/DLL.h +103 -0
  1258. package/vendor/7zip/CPP/Windows/ErrorMsg.cpp +133 -0
  1259. package/vendor/7zip/CPP/Windows/ErrorMsg.h +16 -0
  1260. package/vendor/7zip/CPP/Windows/FileDir.cpp +1388 -0
  1261. package/vendor/7zip/CPP/Windows/FileDir.h +173 -0
  1262. package/vendor/7zip/CPP/Windows/FileFind.cpp +1458 -0
  1263. package/vendor/7zip/CPP/Windows/FileFind.h +345 -0
  1264. package/vendor/7zip/CPP/Windows/FileIO.cpp +1188 -0
  1265. package/vendor/7zip/CPP/Windows/FileIO.h +508 -0
  1266. package/vendor/7zip/CPP/Windows/FileLink.cpp +697 -0
  1267. package/vendor/7zip/CPP/Windows/FileMapping.cpp +12 -0
  1268. package/vendor/7zip/CPP/Windows/FileMapping.h +66 -0
  1269. package/vendor/7zip/CPP/Windows/FileName.cpp +911 -0
  1270. package/vendor/7zip/CPP/Windows/FileName.h +142 -0
  1271. package/vendor/7zip/CPP/Windows/FileSystem.cpp +187 -0
  1272. package/vendor/7zip/CPP/Windows/FileSystem.h +31 -0
  1273. package/vendor/7zip/CPP/Windows/Handle.h +39 -0
  1274. package/vendor/7zip/CPP/Windows/MemoryGlobal.cpp +36 -0
  1275. package/vendor/7zip/CPP/Windows/MemoryGlobal.h +55 -0
  1276. package/vendor/7zip/CPP/Windows/MemoryLock.cpp +127 -0
  1277. package/vendor/7zip/CPP/Windows/MemoryLock.h +40 -0
  1278. package/vendor/7zip/CPP/Windows/Menu.cpp +265 -0
  1279. package/vendor/7zip/CPP/Windows/Menu.h +170 -0
  1280. package/vendor/7zip/CPP/Windows/NationalTime.cpp +37 -0
  1281. package/vendor/7zip/CPP/Windows/NationalTime.h +20 -0
  1282. package/vendor/7zip/CPP/Windows/Net.cpp +398 -0
  1283. package/vendor/7zip/CPP/Windows/Net.h +87 -0
  1284. package/vendor/7zip/CPP/Windows/NtCheck.h +58 -0
  1285. package/vendor/7zip/CPP/Windows/ProcessMessages.cpp +22 -0
  1286. package/vendor/7zip/CPP/Windows/ProcessMessages.h +12 -0
  1287. package/vendor/7zip/CPP/Windows/ProcessUtils.cpp +102 -0
  1288. package/vendor/7zip/CPP/Windows/ProcessUtils.h +138 -0
  1289. package/vendor/7zip/CPP/Windows/PropVariant.cpp +393 -0
  1290. package/vendor/7zip/CPP/Windows/PropVariant.h +173 -0
  1291. package/vendor/7zip/CPP/Windows/PropVariantConv.cpp +274 -0
  1292. package/vendor/7zip/CPP/Windows/PropVariantConv.h +47 -0
  1293. package/vendor/7zip/CPP/Windows/PropVariantUtils.cpp +161 -0
  1294. package/vendor/7zip/CPP/Windows/PropVariantUtils.h +34 -0
  1295. package/vendor/7zip/CPP/Windows/Registry.cpp +474 -0
  1296. package/vendor/7zip/CPP/Windows/Registry.h +96 -0
  1297. package/vendor/7zip/CPP/Windows/ResourceString.cpp +103 -0
  1298. package/vendor/7zip/CPP/Windows/ResourceString.h +17 -0
  1299. package/vendor/7zip/CPP/Windows/SecurityUtils.cpp +186 -0
  1300. package/vendor/7zip/CPP/Windows/SecurityUtils.h +154 -0
  1301. package/vendor/7zip/CPP/Windows/Shell.cpp +839 -0
  1302. package/vendor/7zip/CPP/Windows/Shell.h +129 -0
  1303. package/vendor/7zip/CPP/Windows/StdAfx.h +11 -0
  1304. package/vendor/7zip/CPP/Windows/Synchronization.cpp +87 -0
  1305. package/vendor/7zip/CPP/Windows/Synchronization.h +386 -0
  1306. package/vendor/7zip/CPP/Windows/System.cpp +423 -0
  1307. package/vendor/7zip/CPP/Windows/System.h +209 -0
  1308. package/vendor/7zip/CPP/Windows/SystemInfo.cpp +1312 -0
  1309. package/vendor/7zip/CPP/Windows/SystemInfo.h +19 -0
  1310. package/vendor/7zip/CPP/Windows/Thread.h +46 -0
  1311. package/vendor/7zip/CPP/Windows/TimeUtils.cpp +467 -0
  1312. package/vendor/7zip/CPP/Windows/TimeUtils.h +154 -0
  1313. package/vendor/7zip/CPP/Windows/WinDefs.h +17 -0
  1314. package/vendor/7zip/CPP/Windows/Window.cpp +179 -0
  1315. package/vendor/7zip/CPP/Windows/Window.h +363 -0
  1316. package/vendor/7zip/DOC/7zC.txt +187 -0
  1317. package/vendor/7zip/DOC/7zFormat.txt +469 -0
  1318. package/vendor/7zip/DOC/7zip.hhp +84 -0
  1319. package/vendor/7zip/DOC/7zip.wxs +403 -0
  1320. package/vendor/7zip/DOC/License.txt +151 -0
  1321. package/vendor/7zip/DOC/Methods.txt +177 -0
  1322. package/vendor/7zip/DOC/copying.txt +502 -0
  1323. package/vendor/7zip/DOC/lzma.txt +345 -0
  1324. package/vendor/7zip/DOC/readme.txt +299 -0
  1325. package/vendor/7zip/DOC/src-history.txt +884 -0
  1326. package/vendor/7zip/DOC/unRarLicense.txt +41 -0
  1327. package/vendor/7zip/README.md +2 -0
@@ -0,0 +1,3154 @@
1
+ /* LzmaEnc.c -- LZMA Encoder
2
+ Igor Pavlov : Public domain */
3
+
4
+ #include "Precomp.h"
5
+
6
+ #include <string.h>
7
+
8
+ /* #define SHOW_STAT */
9
+ /* #define SHOW_STAT2 */
10
+
11
+ #if defined(SHOW_STAT) || defined(SHOW_STAT2)
12
+ #include <stdio.h>
13
+ #endif
14
+
15
+ #include "CpuArch.h"
16
+ #include "LzmaEnc.h"
17
+
18
+ #include "LzFind.h"
19
+ #ifndef Z7_ST
20
+ #include "LzFindMt.h"
21
+ #endif
22
+
23
+ /* the following LzmaEnc_* declarations is internal LZMA interface for LZMA2 encoder */
24
+
25
+ SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle p, ISeqInStreamPtr inStream, UInt32 keepWindowSize,
26
+ ISzAllocPtr alloc, ISzAllocPtr allocBig);
27
+ SRes LzmaEnc_MemPrepare(CLzmaEncHandle p, const Byte *src, SizeT srcLen,
28
+ UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig);
29
+ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle p, BoolInt reInit,
30
+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize);
31
+ const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle p);
32
+ void LzmaEnc_Finish(CLzmaEncHandle p);
33
+ void LzmaEnc_SaveState(CLzmaEncHandle p);
34
+ void LzmaEnc_RestoreState(CLzmaEncHandle p);
35
+
36
+ #ifdef SHOW_STAT
37
+ static unsigned g_STAT_OFFSET = 0;
38
+ #endif
39
+
40
+ /* for good normalization speed we still reserve 256 MB before 4 GB range */
41
+ #define kLzmaMaxHistorySize ((UInt32)15 << 28)
42
+
43
+ // #define kNumTopBits 24
44
+ #define kTopValue ((UInt32)1 << 24)
45
+
46
+ #define kNumBitModelTotalBits 11
47
+ #define kBitModelTotal (1 << kNumBitModelTotalBits)
48
+ #define kNumMoveBits 5
49
+ #define kProbInitValue (kBitModelTotal >> 1)
50
+
51
+ #define kNumMoveReducingBits 4
52
+ #define kNumBitPriceShiftBits 4
53
+ // #define kBitPrice (1 << kNumBitPriceShiftBits)
54
+
55
+ #define REP_LEN_COUNT 64
56
+
57
+ void LzmaEncProps_Init(CLzmaEncProps *p)
58
+ {
59
+ p->level = 5;
60
+ p->dictSize = p->mc = 0;
61
+ p->reduceSize = (UInt64)(Int64)-1;
62
+ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
63
+ p->numHashOutBits = 0;
64
+ p->writeEndMark = 0;
65
+ p->affinityGroup = -1;
66
+ p->affinity = 0;
67
+ p->affinityInGroup = 0;
68
+ }
69
+
70
+ void LzmaEncProps_Normalize(CLzmaEncProps *p)
71
+ {
72
+ int level = p->level;
73
+ if (level < 0) level = 5;
74
+ p->level = level;
75
+
76
+ if (p->dictSize == 0)
77
+ p->dictSize = (unsigned)level <= 4 ?
78
+ (UInt32)1 << (level * 2 + 16) :
79
+ (unsigned)level <= sizeof(size_t) / 2 + 4 ?
80
+ (UInt32)1 << (level + 20) :
81
+ (UInt32)1 << (sizeof(size_t) / 2 + 24);
82
+
83
+ if (p->dictSize > p->reduceSize)
84
+ {
85
+ UInt32 v = (UInt32)p->reduceSize;
86
+ const UInt32 kReduceMin = ((UInt32)1 << 12);
87
+ if (v < kReduceMin)
88
+ v = kReduceMin;
89
+ if (p->dictSize > v)
90
+ p->dictSize = v;
91
+ }
92
+
93
+ if (p->lc < 0) p->lc = 3;
94
+ if (p->lp < 0) p->lp = 0;
95
+ if (p->pb < 0) p->pb = 2;
96
+
97
+ if (p->algo < 0) p->algo = (unsigned)level < 5 ? 0 : 1;
98
+ if (p->fb < 0) p->fb = (unsigned)level < 7 ? 32 : 64;
99
+ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
100
+ if (p->numHashBytes < 0) p->numHashBytes = (p->btMode ? 4 : 5);
101
+ if (p->mc == 0) p->mc = (16 + ((unsigned)p->fb >> 1)) >> (p->btMode ? 0 : 1);
102
+
103
+ if (p->numThreads < 0)
104
+ p->numThreads =
105
+ #ifndef Z7_ST
106
+ ((p->btMode && p->algo) ? 2 : 1);
107
+ #else
108
+ 1;
109
+ #endif
110
+ }
111
+
112
+ UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
113
+ {
114
+ CLzmaEncProps props = *props2;
115
+ LzmaEncProps_Normalize(&props);
116
+ return props.dictSize;
117
+ }
118
+
119
+
120
+ /*
121
+ x86/x64:
122
+
123
+ BSR:
124
+ IF (SRC == 0) ZF = 1, DEST is undefined;
125
+ AMD : DEST is unchanged;
126
+ IF (SRC != 0) ZF = 0; DEST is index of top non-zero bit
127
+ BSR is slow in some processors
128
+
129
+ LZCNT:
130
+ IF (SRC == 0) CF = 1, DEST is size_in_bits_of_register(src) (32 or 64)
131
+ IF (SRC != 0) CF = 0, DEST = num_lead_zero_bits
132
+ IF (DEST == 0) ZF = 1;
133
+
134
+ LZCNT works only in new processors starting from Haswell.
135
+ if LZCNT is not supported by processor, then it's executed as BSR.
136
+ LZCNT can be faster than BSR, if supported.
137
+ */
138
+
139
+ // #define LZMA_LOG_BSR
140
+
141
+ #if defined(MY_CPU_ARM_OR_ARM64) /* || defined(MY_CPU_X86_OR_AMD64) */
142
+
143
+ #if (defined(__clang__) && (__clang_major__ >= 6)) \
144
+ || (defined(__GNUC__) && (__GNUC__ >= 6))
145
+ #define LZMA_LOG_BSR
146
+ #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
147
+ // #if defined(MY_CPU_ARM_OR_ARM64)
148
+ #define LZMA_LOG_BSR
149
+ // #endif
150
+ #endif
151
+ #endif
152
+
153
+ // #include <intrin.h>
154
+
155
+ #ifdef LZMA_LOG_BSR
156
+
157
+ #if defined(__clang__) \
158
+ || defined(__GNUC__)
159
+
160
+ /*
161
+ C code: : (30 - __builtin_clz(x))
162
+ gcc9/gcc10 for x64 /x86 : 30 - (bsr(x) xor 31)
163
+ clang10 for x64 : 31 + (bsr(x) xor -32)
164
+ */
165
+
166
+ #define MY_clz(x) ((unsigned)__builtin_clz(x))
167
+ // __lzcnt32
168
+ // __builtin_ia32_lzcnt_u32
169
+
170
+ #else // #if defined(_MSC_VER)
171
+
172
+ #ifdef MY_CPU_ARM_OR_ARM64
173
+
174
+ #define MY_clz _CountLeadingZeros
175
+
176
+ #else // if defined(MY_CPU_X86_OR_AMD64)
177
+
178
+ // #define MY_clz __lzcnt // we can use lzcnt (unsupported by old CPU)
179
+ // _BitScanReverse code is not optimal for some MSVC compilers
180
+ #define BSR2_RET(pos, res) { unsigned long zz; _BitScanReverse(&zz, (pos)); zz--; \
181
+ res = (zz + zz) + (pos >> zz); }
182
+
183
+ #endif // MY_CPU_X86_OR_AMD64
184
+
185
+ #endif // _MSC_VER
186
+
187
+
188
+ #ifndef BSR2_RET
189
+
190
+ #define BSR2_RET(pos, res) { unsigned zz = 30 - MY_clz(pos); \
191
+ res = (zz + zz) + (pos >> zz); }
192
+
193
+ #endif
194
+
195
+
196
+ unsigned GetPosSlot1(UInt32 pos);
197
+ unsigned GetPosSlot1(UInt32 pos)
198
+ {
199
+ unsigned res;
200
+ BSR2_RET(pos, res)
201
+ return res;
202
+ }
203
+ #define GetPosSlot2(pos, res) { BSR2_RET(pos, res) }
204
+ #define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res) }
205
+
206
+
207
+ #else // ! LZMA_LOG_BSR
208
+
209
+ #define kNumLogBits (11 + sizeof(size_t) / 8 * 3)
210
+
211
+ #define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)
212
+
213
+ static void LzmaEnc_FastPosInit(Byte *g_FastPos)
214
+ {
215
+ unsigned slot;
216
+ g_FastPos[0] = 0;
217
+ g_FastPos[1] = 1;
218
+ g_FastPos += 2;
219
+
220
+ for (slot = 2; slot < kNumLogBits * 2; slot++)
221
+ {
222
+ size_t k = ((size_t)1 << ((slot >> 1) - 1));
223
+ size_t j;
224
+ for (j = 0; j < k; j++)
225
+ g_FastPos[j] = (Byte)slot;
226
+ g_FastPos += k;
227
+ }
228
+ }
229
+
230
+ /* we can use ((limit - pos) >> 31) only if (pos < ((UInt32)1 << 31)) */
231
+ /*
232
+ #define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
233
+ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \
234
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
235
+ */
236
+
237
+ /*
238
+ #define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
239
+ (0 - (((((UInt32)1 << (kNumLogBits)) - 1) - (pos >> 6)) >> 31))); \
240
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
241
+ */
242
+
243
+ #define BSR2_RET(pos, res) { unsigned zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \
244
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
245
+
246
+ /*
247
+ #define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \
248
+ p->g_FastPos[pos >> 6] + 12 : \
249
+ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }
250
+ */
251
+
252
+ #define GetPosSlot1(pos) p->g_FastPos[pos]
253
+ #define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
254
+ #define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos & (kNumFullDistances - 1)]; else BSR2_RET(pos, res); }
255
+
256
+ #endif // LZMA_LOG_BSR
257
+
258
+
259
+ #define LZMA_NUM_REPS 4
260
+
261
+ typedef UInt16 CState;
262
+ typedef UInt16 CExtra;
263
+
264
+ typedef struct
265
+ {
266
+ UInt32 price;
267
+ CState state;
268
+ CExtra extra;
269
+ // 0 : normal
270
+ // 1 : LIT : MATCH
271
+ // > 1 : MATCH (extra-1) : LIT : REP0 (len)
272
+ UInt32 len;
273
+ UInt32 dist;
274
+ UInt32 reps[LZMA_NUM_REPS];
275
+ } COptimal;
276
+
277
+
278
+ // 18.06
279
+ #define kNumOpts (1 << 11)
280
+ #define kPackReserve (kNumOpts * 8)
281
+ // #define kNumOpts (1 << 12)
282
+ // #define kPackReserve (1 + kNumOpts * 2)
283
+
284
+ #define kNumLenToPosStates 4
285
+ #define kNumPosSlotBits 6
286
+ // #define kDicLogSizeMin 0
287
+ #define kDicLogSizeMax 32
288
+ #define kDistTableSizeMax (kDicLogSizeMax * 2)
289
+
290
+ #define kNumAlignBits 4
291
+ #define kAlignTableSize (1 << kNumAlignBits)
292
+ #define kAlignMask (kAlignTableSize - 1)
293
+
294
+ #define kStartPosModelIndex 4
295
+ #define kEndPosModelIndex 14
296
+ #define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
297
+
298
+ typedef
299
+ #ifdef Z7_LZMA_PROB32
300
+ UInt32
301
+ #else
302
+ UInt16
303
+ #endif
304
+ CLzmaProb;
305
+
306
+ #define LZMA_PB_MAX 4
307
+ #define LZMA_LC_MAX 8
308
+ #define LZMA_LP_MAX 4
309
+
310
+ #define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)
311
+
312
+ #define kLenNumLowBits 3
313
+ #define kLenNumLowSymbols (1 << kLenNumLowBits)
314
+ #define kLenNumHighBits 8
315
+ #define kLenNumHighSymbols (1 << kLenNumHighBits)
316
+ #define kLenNumSymbolsTotal (kLenNumLowSymbols * 2 + kLenNumHighSymbols)
317
+
318
+ #define LZMA_MATCH_LEN_MIN 2
319
+ #define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
320
+
321
+ #define kNumStates 12
322
+
323
+
324
+ typedef struct
325
+ {
326
+ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)];
327
+ CLzmaProb high[kLenNumHighSymbols];
328
+ } CLenEnc;
329
+
330
+
331
+ typedef struct
332
+ {
333
+ unsigned tableSize;
334
+ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];
335
+ // UInt32 prices1[LZMA_NUM_PB_STATES_MAX][kLenNumLowSymbols * 2];
336
+ // UInt32 prices2[kLenNumSymbolsTotal];
337
+ } CLenPriceEnc;
338
+
339
+ #define GET_PRICE_LEN(p, posState, len) \
340
+ ((p)->prices[posState][(size_t)(len) - LZMA_MATCH_LEN_MIN])
341
+
342
+ /*
343
+ #define GET_PRICE_LEN(p, posState, len) \
344
+ ((p)->prices2[(size_t)(len) - 2] + ((p)->prices1[posState][((len) - 2) & (kLenNumLowSymbols * 2 - 1)] & (((len) - 2 - kLenNumLowSymbols * 2) >> 9)))
345
+ */
346
+
347
+ typedef struct
348
+ {
349
+ UInt32 range;
350
+ unsigned cache;
351
+ UInt64 low;
352
+ UInt64 cacheSize;
353
+ Byte *buf;
354
+ Byte *bufLim;
355
+ Byte *bufBase;
356
+ ISeqOutStreamPtr outStream;
357
+ UInt64 processed;
358
+ SRes res;
359
+ } CRangeEnc;
360
+
361
+
362
+ typedef struct
363
+ {
364
+ CLzmaProb *litProbs;
365
+
366
+ unsigned state;
367
+ UInt32 reps[LZMA_NUM_REPS];
368
+
369
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
370
+ CLzmaProb isRep[kNumStates];
371
+ CLzmaProb isRepG0[kNumStates];
372
+ CLzmaProb isRepG1[kNumStates];
373
+ CLzmaProb isRepG2[kNumStates];
374
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
375
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
376
+
377
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
378
+ CLzmaProb posEncoders[kNumFullDistances];
379
+
380
+ CLenEnc lenProbs;
381
+ CLenEnc repLenProbs;
382
+
383
+ } CSaveState;
384
+
385
+
386
+ typedef UInt32 CProbPrice;
387
+
388
+
389
+ struct CLzmaEnc
390
+ {
391
+ void *matchFinderObj;
392
+ IMatchFinder2 matchFinder;
393
+
394
+ unsigned optCur;
395
+ unsigned optEnd;
396
+
397
+ unsigned longestMatchLen;
398
+ unsigned numPairs;
399
+ UInt32 numAvail;
400
+
401
+ unsigned state;
402
+ unsigned numFastBytes;
403
+ unsigned additionalOffset;
404
+ UInt32 reps[LZMA_NUM_REPS];
405
+ unsigned lpMask, pbMask;
406
+ CLzmaProb *litProbs;
407
+ CRangeEnc rc;
408
+
409
+ UInt32 backRes;
410
+
411
+ unsigned lc, lp, pb;
412
+ unsigned lclp;
413
+
414
+ BoolInt fastMode;
415
+ BoolInt writeEndMark;
416
+ BoolInt finished;
417
+ BoolInt multiThread;
418
+ BoolInt needInit;
419
+ // BoolInt _maxMode;
420
+
421
+ UInt64 nowPos64;
422
+
423
+ unsigned matchPriceCount;
424
+ // unsigned alignPriceCount;
425
+ int repLenEncCounter;
426
+
427
+ unsigned distTableSize;
428
+
429
+ UInt32 dictSize;
430
+ SRes result;
431
+
432
+ #ifndef Z7_ST
433
+ BoolInt mtMode;
434
+ // begin of CMatchFinderMt is used in LZ thread
435
+ CMatchFinderMt matchFinderMt;
436
+ // end of CMatchFinderMt is used in BT and HASH threads
437
+ // #else
438
+ // CMatchFinder matchFinderBase;
439
+ #endif
440
+ CMatchFinder matchFinderBase;
441
+
442
+
443
+ // we suppose that we have 8-bytes alignment after CMatchFinder
444
+
445
+ #ifndef Z7_ST
446
+ Byte pad[128];
447
+ #endif
448
+
449
+ // LZ thread
450
+ CProbPrice ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
451
+
452
+ // we want {len , dist} pairs to be 8-bytes aligned in matches array
453
+ UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2];
454
+
455
+ // we want 8-bytes alignment here
456
+ UInt32 alignPrices[kAlignTableSize];
457
+ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
458
+ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];
459
+
460
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
461
+ CLzmaProb isRep[kNumStates];
462
+ CLzmaProb isRepG0[kNumStates];
463
+ CLzmaProb isRepG1[kNumStates];
464
+ CLzmaProb isRepG2[kNumStates];
465
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
466
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
467
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
468
+ CLzmaProb posEncoders[kNumFullDistances];
469
+
470
+ CLenEnc lenProbs;
471
+ CLenEnc repLenProbs;
472
+
473
+ #ifndef LZMA_LOG_BSR
474
+ Byte g_FastPos[1 << kNumLogBits];
475
+ #endif
476
+
477
+ CLenPriceEnc lenEnc;
478
+ CLenPriceEnc repLenEnc;
479
+
480
+ COptimal opt[kNumOpts];
481
+
482
+ CSaveState saveState;
483
+
484
+ // BoolInt mf_Failure;
485
+ #ifndef Z7_ST
486
+ Byte pad2[128];
487
+ #endif
488
+ };
489
+
490
+
491
+ #define MFB (p->matchFinderBase)
492
+ /*
493
+ #ifndef Z7_ST
494
+ #define MFB (p->matchFinderMt.MatchFinder)
495
+ #endif
496
+ */
497
+
498
+ // #define GET_CLzmaEnc_p CLzmaEnc *p = (CLzmaEnc*)(void *)p;
499
+ // #define GET_const_CLzmaEnc_p const CLzmaEnc *p = (const CLzmaEnc*)(const void *)p;
500
+
501
+ #define COPY_ARR(dest, src, arr) memcpy((dest)->arr, (src)->arr, sizeof((src)->arr));
502
+
503
+ #define COPY_LZMA_ENC_STATE(d, s, p) \
504
+ (d)->state = (s)->state; \
505
+ COPY_ARR(d, s, reps) \
506
+ COPY_ARR(d, s, posAlignEncoder) \
507
+ COPY_ARR(d, s, isRep) \
508
+ COPY_ARR(d, s, isRepG0) \
509
+ COPY_ARR(d, s, isRepG1) \
510
+ COPY_ARR(d, s, isRepG2) \
511
+ COPY_ARR(d, s, isMatch) \
512
+ COPY_ARR(d, s, isRep0Long) \
513
+ COPY_ARR(d, s, posSlotEncoder) \
514
+ COPY_ARR(d, s, posEncoders) \
515
+ (d)->lenProbs = (s)->lenProbs; \
516
+ (d)->repLenProbs = (s)->repLenProbs; \
517
+ memcpy((d)->litProbs, (s)->litProbs, ((size_t)0x300 * sizeof(CLzmaProb)) << (p)->lclp);
518
+
519
+ void LzmaEnc_SaveState(CLzmaEncHandle p)
520
+ {
521
+ // GET_CLzmaEnc_p
522
+ CSaveState *v = &p->saveState;
523
+ COPY_LZMA_ENC_STATE(v, p, p)
524
+ }
525
+
526
+ void LzmaEnc_RestoreState(CLzmaEncHandle p)
527
+ {
528
+ // GET_CLzmaEnc_p
529
+ const CSaveState *v = &p->saveState;
530
+ COPY_LZMA_ENC_STATE(p, v, p)
531
+ }
532
+
533
+
534
+ Z7_NO_INLINE
535
+ SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props2)
536
+ {
537
+ // GET_CLzmaEnc_p
538
+ CLzmaEncProps props = *props2;
539
+ LzmaEncProps_Normalize(&props);
540
+
541
+ if (props.lc > LZMA_LC_MAX
542
+ || props.lp > LZMA_LP_MAX
543
+ || props.pb > LZMA_PB_MAX)
544
+ return SZ_ERROR_PARAM;
545
+
546
+
547
+ if (props.dictSize > kLzmaMaxHistorySize)
548
+ props.dictSize = kLzmaMaxHistorySize;
549
+
550
+ #ifndef LZMA_LOG_BSR
551
+ {
552
+ const UInt64 dict64 = props.dictSize;
553
+ if (dict64 > ((UInt64)1 << kDicLogSizeMaxCompress))
554
+ return SZ_ERROR_PARAM;
555
+ }
556
+ #endif
557
+
558
+ p->dictSize = props.dictSize;
559
+ {
560
+ unsigned fb = (unsigned)props.fb;
561
+ if (fb < 5)
562
+ fb = 5;
563
+ if (fb > LZMA_MATCH_LEN_MAX)
564
+ fb = LZMA_MATCH_LEN_MAX;
565
+ p->numFastBytes = fb;
566
+ }
567
+ p->lc = (unsigned)props.lc;
568
+ p->lp = (unsigned)props.lp;
569
+ p->pb = (unsigned)props.pb;
570
+ p->fastMode = (props.algo == 0);
571
+ // p->_maxMode = True;
572
+ MFB.btMode = (Byte)(props.btMode ? 1 : 0);
573
+ // MFB.btMode = (Byte)(props.btMode);
574
+ {
575
+ unsigned numHashBytes = 4;
576
+ if (props.btMode)
577
+ {
578
+ if (props.numHashBytes < 2) numHashBytes = 2;
579
+ else if (props.numHashBytes < 4) numHashBytes = (unsigned)props.numHashBytes;
580
+ }
581
+ if (props.numHashBytes >= 5) numHashBytes = 5;
582
+
583
+ MFB.numHashBytes = numHashBytes;
584
+ // MFB.numHashBytes_Min = 2;
585
+ MFB.numHashOutBits = (Byte)props.numHashOutBits;
586
+ }
587
+
588
+ MFB.cutValue = props.mc;
589
+
590
+ p->writeEndMark = (BoolInt)props.writeEndMark;
591
+
592
+ #ifndef Z7_ST
593
+ /*
594
+ if (newMultiThread != _multiThread)
595
+ {
596
+ ReleaseMatchFinder();
597
+ _multiThread = newMultiThread;
598
+ }
599
+ */
600
+ p->multiThread = (props.numThreads > 1);
601
+ p->matchFinderMt.btSync.affinity =
602
+ p->matchFinderMt.hashSync.affinity = props.affinity;
603
+ p->matchFinderMt.btSync.affinityGroup =
604
+ p->matchFinderMt.hashSync.affinityGroup = props.affinityGroup;
605
+ p->matchFinderMt.btSync.affinityInGroup =
606
+ p->matchFinderMt.hashSync.affinityInGroup = props.affinityInGroup;
607
+ #endif
608
+
609
+ return SZ_OK;
610
+ }
611
+
612
+
613
+ void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize)
614
+ {
615
+ // GET_CLzmaEnc_p
616
+ MFB.expectedDataSize = expectedDataSiize;
617
+ }
618
+
619
+
620
+ #define kState_Start 0
621
+ #define kState_LitAfterMatch 4
622
+ #define kState_LitAfterRep 5
623
+ #define kState_MatchAfterLit 7
624
+ #define kState_RepAfterLit 8
625
+
626
+ static const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
627
+ static const Byte kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
628
+ static const Byte kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
629
+ static const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
630
+
631
+ #define IsLitState(s) ((s) < 7)
632
+ #define GetLenToPosState2(len) (((len) < kNumLenToPosStates - 1) ? (len) : kNumLenToPosStates - 1)
633
+ #define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
634
+
635
+ #define kInfinityPrice (1 << 30)
636
+
637
+ static void RangeEnc_Construct(CRangeEnc *p)
638
+ {
639
+ p->outStream = NULL;
640
+ p->bufBase = NULL;
641
+ }
642
+
643
+ #define RangeEnc_GetProcessed(p) ( (p)->processed + (size_t)((p)->buf - (p)->bufBase) + (p)->cacheSize)
644
+ #define RangeEnc_GetProcessed_sizet(p) ((size_t)(p)->processed + (size_t)((p)->buf - (p)->bufBase) + (size_t)(p)->cacheSize)
645
+
646
+ #define RC_BUF_SIZE (1 << 16)
647
+
648
+ static int RangeEnc_Alloc(CRangeEnc *p, ISzAllocPtr alloc)
649
+ {
650
+ if (!p->bufBase)
651
+ {
652
+ p->bufBase = (Byte *)ISzAlloc_Alloc(alloc, RC_BUF_SIZE);
653
+ if (!p->bufBase)
654
+ return 0;
655
+ p->bufLim = p->bufBase + RC_BUF_SIZE;
656
+ }
657
+ return 1;
658
+ }
659
+
660
+ static void RangeEnc_Free(CRangeEnc *p, ISzAllocPtr alloc)
661
+ {
662
+ ISzAlloc_Free(alloc, p->bufBase);
663
+ p->bufBase = NULL;
664
+ }
665
+
666
+ static void RangeEnc_Init(CRangeEnc *p)
667
+ {
668
+ p->range = 0xFFFFFFFF;
669
+ p->cache = 0;
670
+ p->low = 0;
671
+ p->cacheSize = 0;
672
+
673
+ p->buf = p->bufBase;
674
+
675
+ p->processed = 0;
676
+ p->res = SZ_OK;
677
+ }
678
+
679
+ Z7_NO_INLINE static void RangeEnc_FlushStream(CRangeEnc *p)
680
+ {
681
+ const size_t num = (size_t)(p->buf - p->bufBase);
682
+ if (p->res == SZ_OK)
683
+ {
684
+ if (num != ISeqOutStream_Write(p->outStream, p->bufBase, num))
685
+ p->res = SZ_ERROR_WRITE;
686
+ }
687
+ p->processed += num;
688
+ p->buf = p->bufBase;
689
+ }
690
+
691
+ Z7_NO_INLINE static void Z7_FASTCALL RangeEnc_ShiftLow(CRangeEnc *p)
692
+ {
693
+ UInt32 low = (UInt32)p->low;
694
+ unsigned high = (unsigned)(p->low >> 32);
695
+ {
696
+ const UInt32 low2 = low << 8;
697
+ p->low = low2;
698
+ }
699
+ if (low < (UInt32)0xFF000000 || high != 0)
700
+ {
701
+ {
702
+ Byte *buf = p->buf;
703
+ *buf++ = (Byte)(p->cache + high);
704
+ p->cache = (unsigned)(low >> 24);
705
+ p->buf = buf;
706
+ if (buf == p->bufLim)
707
+ RangeEnc_FlushStream(p);
708
+ if (p->cacheSize == 0)
709
+ return;
710
+ }
711
+ high += 0xFF;
712
+ for (;;)
713
+ {
714
+ Byte *buf = p->buf;
715
+ *buf++ = (Byte)(high);
716
+ p->buf = buf;
717
+ if (buf == p->bufLim)
718
+ RangeEnc_FlushStream(p);
719
+ if (--p->cacheSize == 0)
720
+ return;
721
+ }
722
+ }
723
+ p->cacheSize++;
724
+ }
725
+
726
+ static void RangeEnc_FlushData(CRangeEnc *p)
727
+ {
728
+ int i;
729
+ for (i = 0; i < 5; i++)
730
+ RangeEnc_ShiftLow(p);
731
+ }
732
+
733
+ #define RC_NORM(p) if (range < kTopValue) { range <<= 8; RangeEnc_ShiftLow(p); }
734
+
735
+ #define RC_BIT_PRE(p, prob) \
736
+ ttt = *(prob); \
737
+ newBound = (range >> kNumBitModelTotalBits) * ttt;
738
+
739
+ // #define Z7_LZMA_ENC_USE_BRANCH
740
+
741
+ #ifdef Z7_LZMA_ENC_USE_BRANCH
742
+
743
+ #define RC_BIT(p, prob, bit) { \
744
+ RC_BIT_PRE(p, prob) \
745
+ if (bit == 0) { range = newBound; ttt += (kBitModelTotal - ttt) >> kNumMoveBits; } \
746
+ else { (p)->low += newBound; range -= newBound; ttt -= ttt >> kNumMoveBits; } \
747
+ *(prob) = (CLzmaProb)ttt; \
748
+ RC_NORM(p) \
749
+ }
750
+
751
+ #else
752
+
753
+ #define RC_BIT(p, prob, bit) { \
754
+ UInt32 mask; \
755
+ RC_BIT_PRE(p, prob) \
756
+ mask = 0 - (UInt32)bit; \
757
+ range &= mask; \
758
+ mask &= newBound; \
759
+ range -= mask; \
760
+ (p)->low += mask; \
761
+ mask = (UInt32)bit - 1; \
762
+ range += newBound & mask; \
763
+ mask &= (kBitModelTotal - ((1 << kNumMoveBits) - 1)); \
764
+ mask += ((1 << kNumMoveBits) - 1); \
765
+ ttt += (UInt32)((Int32)(mask - ttt) >> kNumMoveBits); \
766
+ *(prob) = (CLzmaProb)ttt; \
767
+ RC_NORM(p) \
768
+ }
769
+
770
+ #endif
771
+
772
+
773
+
774
+
775
+ #define RC_BIT_0_BASE(p, prob) \
776
+ range = newBound; *(prob) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
777
+
778
+ #define RC_BIT_1_BASE(p, prob) \
779
+ range -= newBound; (p)->low += newBound; *(prob) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); \
780
+
781
+ #define RC_BIT_0(p, prob) \
782
+ RC_BIT_0_BASE(p, prob) \
783
+ RC_NORM(p)
784
+
785
+ #define RC_BIT_1(p, prob) \
786
+ RC_BIT_1_BASE(p, prob) \
787
+ RC_NORM(p)
788
+
789
+ static void RangeEnc_EncodeBit_0(CRangeEnc *p, CLzmaProb *prob)
790
+ {
791
+ UInt32 range, ttt, newBound;
792
+ range = p->range;
793
+ RC_BIT_PRE(p, prob)
794
+ RC_BIT_0(p, prob)
795
+ p->range = range;
796
+ }
797
+
798
+ static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 sym)
799
+ {
800
+ UInt32 range = p->range;
801
+ sym |= 0x100;
802
+ do
803
+ {
804
+ UInt32 ttt, newBound;
805
+ // RangeEnc_EncodeBit(p, probs + (sym >> 8), (sym >> 7) & 1);
806
+ CLzmaProb *prob = probs + (sym >> 8);
807
+ UInt32 bit = (sym >> 7) & 1;
808
+ sym <<= 1;
809
+ RC_BIT(p, prob, bit)
810
+ }
811
+ while (sym < 0x10000);
812
+ p->range = range;
813
+ }
814
+
815
+ static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 sym, UInt32 matchByte)
816
+ {
817
+ UInt32 range = p->range;
818
+ UInt32 offs = 0x100;
819
+ sym |= 0x100;
820
+ do
821
+ {
822
+ UInt32 ttt, newBound;
823
+ CLzmaProb *prob;
824
+ UInt32 bit;
825
+ matchByte <<= 1;
826
+ // RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (sym >> 8)), (sym >> 7) & 1);
827
+ prob = probs + (offs + (matchByte & offs) + (sym >> 8));
828
+ bit = (sym >> 7) & 1;
829
+ sym <<= 1;
830
+ offs &= ~(matchByte ^ sym);
831
+ RC_BIT(p, prob, bit)
832
+ }
833
+ while (sym < 0x10000);
834
+ p->range = range;
835
+ }
836
+
837
+
838
+
839
+ static void LzmaEnc_InitPriceTables(CProbPrice *ProbPrices)
840
+ {
841
+ UInt32 i;
842
+ for (i = 0; i < (kBitModelTotal >> kNumMoveReducingBits); i++)
843
+ {
844
+ const unsigned kCyclesBits = kNumBitPriceShiftBits;
845
+ UInt32 w = (i << kNumMoveReducingBits) + (1 << (kNumMoveReducingBits - 1));
846
+ unsigned bitCount = 0;
847
+ unsigned j;
848
+ for (j = 0; j < kCyclesBits; j++)
849
+ {
850
+ w = w * w;
851
+ bitCount <<= 1;
852
+ while (w >= ((UInt32)1 << 16))
853
+ {
854
+ w >>= 1;
855
+ bitCount++;
856
+ }
857
+ }
858
+ ProbPrices[i] = (CProbPrice)(((unsigned)kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
859
+ // printf("\n%3d: %5d", i, ProbPrices[i]);
860
+ }
861
+ }
862
+
863
+
864
+ #define GET_PRICE(prob, bit) \
865
+ p->ProbPrices[((prob) ^ (unsigned)(((-(int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]
866
+
867
+ #define GET_PRICEa(prob, bit) \
868
+ ProbPrices[((prob) ^ (unsigned)((-((int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]
869
+
870
+ #define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]
871
+ #define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
872
+
873
+ #define GET_PRICEa_0(prob) ProbPrices[(prob) >> kNumMoveReducingBits]
874
+ #define GET_PRICEa_1(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
875
+
876
+
877
+ static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 sym, const CProbPrice *ProbPrices)
878
+ {
879
+ UInt32 price = 0;
880
+ sym |= 0x100;
881
+ do
882
+ {
883
+ unsigned bit = sym & 1;
884
+ sym >>= 1;
885
+ price += GET_PRICEa(probs[sym], bit);
886
+ }
887
+ while (sym >= 2);
888
+ return price;
889
+ }
890
+
891
+
892
+ static UInt32 LitEnc_Matched_GetPrice(const CLzmaProb *probs, UInt32 sym, UInt32 matchByte, const CProbPrice *ProbPrices)
893
+ {
894
+ UInt32 price = 0;
895
+ UInt32 offs = 0x100;
896
+ sym |= 0x100;
897
+ do
898
+ {
899
+ matchByte <<= 1;
900
+ price += GET_PRICEa(probs[offs + (matchByte & offs) + (sym >> 8)], (sym >> 7) & 1);
901
+ sym <<= 1;
902
+ offs &= ~(matchByte ^ sym);
903
+ }
904
+ while (sym < 0x10000);
905
+ return price;
906
+ }
907
+
908
+
909
+ static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, unsigned numBits, unsigned sym)
910
+ {
911
+ UInt32 range = rc->range;
912
+ unsigned m = 1;
913
+ do
914
+ {
915
+ UInt32 ttt, newBound;
916
+ unsigned bit = sym & 1;
917
+ // RangeEnc_EncodeBit(rc, probs + m, bit);
918
+ sym >>= 1;
919
+ RC_BIT(rc, probs + m, bit)
920
+ m = (m << 1) | bit;
921
+ }
922
+ while (--numBits);
923
+ rc->range = range;
924
+ }
925
+
926
+
927
+
928
+ static void LenEnc_Init(CLenEnc *p)
929
+ {
930
+ unsigned i;
931
+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)); i++)
932
+ p->low[i] = kProbInitValue;
933
+ for (i = 0; i < kLenNumHighSymbols; i++)
934
+ p->high[i] = kProbInitValue;
935
+ }
936
+
937
+ static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, unsigned sym, unsigned posState)
938
+ {
939
+ UInt32 range, ttt, newBound;
940
+ CLzmaProb *probs = p->low;
941
+ range = rc->range;
942
+ RC_BIT_PRE(rc, probs)
943
+ if (sym >= kLenNumLowSymbols)
944
+ {
945
+ RC_BIT_1(rc, probs)
946
+ probs += kLenNumLowSymbols;
947
+ RC_BIT_PRE(rc, probs)
948
+ if (sym >= kLenNumLowSymbols * 2)
949
+ {
950
+ RC_BIT_1(rc, probs)
951
+ rc->range = range;
952
+ // RcTree_Encode(rc, p->high, kLenNumHighBits, sym - kLenNumLowSymbols * 2);
953
+ LitEnc_Encode(rc, p->high, sym - kLenNumLowSymbols * 2);
954
+ return;
955
+ }
956
+ sym -= kLenNumLowSymbols;
957
+ }
958
+
959
+ // RcTree_Encode(rc, probs + (posState << kLenNumLowBits), kLenNumLowBits, sym);
960
+ {
961
+ unsigned m;
962
+ unsigned bit;
963
+ RC_BIT_0(rc, probs)
964
+ posState <<= (1 + kLenNumLowBits);
965
+ probs += posState;
966
+ bit = (sym >> 2) ; RC_BIT(rc, probs + 1, bit) m = (1 << 1) + bit;
967
+ bit = (sym >> 1) & 1; RC_BIT(rc, probs + m, bit) m = (m << 1) + bit;
968
+ bit = sym & 1; RC_BIT(rc, probs + m, bit)
969
+ rc->range = range;
970
+ }
971
+ }
972
+
973
+ static void SetPrices_3(const CLzmaProb *probs, UInt32 startPrice, UInt32 *prices, const CProbPrice *ProbPrices)
974
+ {
975
+ unsigned i;
976
+ for (i = 0; i < 8; i += 2)
977
+ {
978
+ UInt32 price = startPrice;
979
+ UInt32 prob;
980
+ price += GET_PRICEa(probs[1 ], (i >> 2));
981
+ price += GET_PRICEa(probs[2 + (i >> 2)], (i >> 1) & 1);
982
+ prob = probs[4 + (i >> 1)];
983
+ prices[i ] = price + GET_PRICEa_0(prob);
984
+ prices[i + 1] = price + GET_PRICEa_1(prob);
985
+ }
986
+ }
987
+
988
+
989
+ Z7_NO_INLINE static void Z7_FASTCALL LenPriceEnc_UpdateTables(
990
+ CLenPriceEnc *p,
991
+ unsigned numPosStates,
992
+ const CLenEnc *enc,
993
+ const CProbPrice *ProbPrices)
994
+ {
995
+ UInt32 b;
996
+
997
+ {
998
+ unsigned prob = enc->low[0];
999
+ UInt32 a, c;
1000
+ unsigned posState;
1001
+ b = GET_PRICEa_1(prob);
1002
+ a = GET_PRICEa_0(prob);
1003
+ c = b + GET_PRICEa_0(enc->low[kLenNumLowSymbols]);
1004
+ for (posState = 0; posState < numPosStates; posState++)
1005
+ {
1006
+ UInt32 *prices = p->prices[posState];
1007
+ const unsigned posState2 = posState << (1 + kLenNumLowBits);
1008
+ const CLzmaProb *probs = enc->low + posState2;
1009
+ SetPrices_3(probs, a, prices, ProbPrices);
1010
+ SetPrices_3(probs + kLenNumLowSymbols, c, prices + kLenNumLowSymbols, ProbPrices);
1011
+ }
1012
+ }
1013
+
1014
+ /*
1015
+ {
1016
+ unsigned i;
1017
+ UInt32 b;
1018
+ a = GET_PRICEa_0(enc->low[0]);
1019
+ for (i = 0; i < kLenNumLowSymbols; i++)
1020
+ p->prices2[i] = a;
1021
+ a = GET_PRICEa_1(enc->low[0]);
1022
+ b = a + GET_PRICEa_0(enc->low[kLenNumLowSymbols]);
1023
+ for (i = kLenNumLowSymbols; i < kLenNumLowSymbols * 2; i++)
1024
+ p->prices2[i] = b;
1025
+ a += GET_PRICEa_1(enc->low[kLenNumLowSymbols]);
1026
+ }
1027
+ */
1028
+
1029
+ // p->counter = numSymbols;
1030
+ // p->counter = 64;
1031
+
1032
+ {
1033
+ unsigned i = p->tableSize;
1034
+
1035
+ if (i > kLenNumLowSymbols * 2)
1036
+ {
1037
+ const CLzmaProb *probs = enc->high;
1038
+ UInt32 *prices = p->prices[0] + kLenNumLowSymbols * 2;
1039
+ i -= kLenNumLowSymbols * 2 - 1;
1040
+ i >>= 1;
1041
+ b += GET_PRICEa_1(enc->low[kLenNumLowSymbols]);
1042
+ do
1043
+ {
1044
+ /*
1045
+ p->prices2[i] = a +
1046
+ // RcTree_GetPrice(enc->high, kLenNumHighBits, i - kLenNumLowSymbols * 2, ProbPrices);
1047
+ LitEnc_GetPrice(probs, i - kLenNumLowSymbols * 2, ProbPrices);
1048
+ */
1049
+ // UInt32 price = a + RcTree_GetPrice(probs, kLenNumHighBits - 1, sym, ProbPrices);
1050
+ unsigned sym = --i + (1 << (kLenNumHighBits - 1));
1051
+ UInt32 price = b;
1052
+ do
1053
+ {
1054
+ const unsigned bit = sym & 1;
1055
+ sym >>= 1;
1056
+ price += GET_PRICEa(probs[sym], bit);
1057
+ }
1058
+ while (sym >= 2);
1059
+
1060
+ {
1061
+ const unsigned prob = probs[(size_t)i + (1 << (kLenNumHighBits - 1))];
1062
+ prices[(size_t)i * 2 ] = price + GET_PRICEa_0(prob);
1063
+ prices[(size_t)i * 2 + 1] = price + GET_PRICEa_1(prob);
1064
+ }
1065
+ }
1066
+ while (i);
1067
+
1068
+ {
1069
+ unsigned posState;
1070
+ const size_t num = (p->tableSize - kLenNumLowSymbols * 2) * sizeof(p->prices[0][0]);
1071
+ for (posState = 1; posState < numPosStates; posState++)
1072
+ memcpy(p->prices[posState] + kLenNumLowSymbols * 2, p->prices[0] + kLenNumLowSymbols * 2, num);
1073
+ }
1074
+ }
1075
+ }
1076
+ }
1077
+
1078
+ /*
1079
+ #ifdef SHOW_STAT
1080
+ g_STAT_OFFSET += num;
1081
+ printf("\n MovePos %u", num);
1082
+ #endif
1083
+ */
1084
+
1085
+ #define MOVE_POS(p, num) { \
1086
+ p->additionalOffset += (num); \
1087
+ p->matchFinder.Skip(p->matchFinderObj, (UInt32)(num)); }
1088
+
1089
+
1090
+ static unsigned ReadMatchDistances(CLzmaEnc *p, unsigned *numPairsRes)
1091
+ {
1092
+ unsigned numPairs;
1093
+
1094
+ p->additionalOffset++;
1095
+ p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
1096
+ {
1097
+ const UInt32 *d = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
1098
+ // if (!d) { p->mf_Failure = True; *numPairsRes = 0; return 0; }
1099
+ numPairs = (unsigned)(d - p->matches);
1100
+ }
1101
+ *numPairsRes = numPairs;
1102
+
1103
+ #ifdef SHOW_STAT
1104
+ printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2);
1105
+ g_STAT_OFFSET++;
1106
+ {
1107
+ unsigned i;
1108
+ for (i = 0; i < numPairs; i += 2)
1109
+ printf("%2u %6u | ", p->matches[i], p->matches[i + 1]);
1110
+ }
1111
+ #endif
1112
+
1113
+ if (numPairs == 0)
1114
+ return 0;
1115
+ {
1116
+ const unsigned len = p->matches[(size_t)numPairs - 2];
1117
+ if (len != p->numFastBytes)
1118
+ return len;
1119
+ {
1120
+ UInt32 numAvail = p->numAvail;
1121
+ if (numAvail > LZMA_MATCH_LEN_MAX)
1122
+ numAvail = LZMA_MATCH_LEN_MAX;
1123
+ {
1124
+ const Byte *p1 = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
1125
+ const Byte *p2 = p1 + len;
1126
+ const ptrdiff_t dif = (ptrdiff_t)-1 - (ptrdiff_t)p->matches[(size_t)numPairs - 1];
1127
+ const Byte *lim = p1 + numAvail;
1128
+ for (; p2 != lim && *p2 == p2[dif]; p2++)
1129
+ {}
1130
+ return (unsigned)(p2 - p1);
1131
+ }
1132
+ }
1133
+ }
1134
+ }
1135
+
1136
+ #define MARK_LIT ((UInt32)(Int32)-1)
1137
+
1138
+ #define MakeAs_Lit(p) { (p)->dist = MARK_LIT; (p)->extra = 0; }
1139
+ #define MakeAs_ShortRep(p) { (p)->dist = 0; (p)->extra = 0; }
1140
+ #define IsShortRep(p) ((p)->dist == 0)
1141
+
1142
+
1143
+ #define GetPrice_ShortRep(p, state, posState) \
1144
+ ( GET_PRICE_0(p->isRepG0[state]) + GET_PRICE_0(p->isRep0Long[state][posState]))
1145
+
1146
+ #define GetPrice_Rep_0(p, state, posState) ( \
1147
+ GET_PRICE_1(p->isMatch[state][posState]) \
1148
+ + GET_PRICE_1(p->isRep0Long[state][posState])) \
1149
+ + GET_PRICE_1(p->isRep[state]) \
1150
+ + GET_PRICE_0(p->isRepG0[state])
1151
+
1152
+ Z7_FORCE_INLINE
1153
+ static UInt32 GetPrice_PureRep(const CLzmaEnc *p, unsigned repIndex, size_t state, size_t posState)
1154
+ {
1155
+ UInt32 price;
1156
+ UInt32 prob = p->isRepG0[state];
1157
+ if (repIndex == 0)
1158
+ {
1159
+ price = GET_PRICE_0(prob);
1160
+ price += GET_PRICE_1(p->isRep0Long[state][posState]);
1161
+ }
1162
+ else
1163
+ {
1164
+ price = GET_PRICE_1(prob);
1165
+ prob = p->isRepG1[state];
1166
+ if (repIndex == 1)
1167
+ price += GET_PRICE_0(prob);
1168
+ else
1169
+ {
1170
+ price += GET_PRICE_1(prob);
1171
+ price += GET_PRICE(p->isRepG2[state], repIndex - 2);
1172
+ }
1173
+ }
1174
+ return price;
1175
+ }
1176
+
1177
+
1178
+ static unsigned Backward(CLzmaEnc *p, unsigned cur)
1179
+ {
1180
+ unsigned wr = cur + 1;
1181
+ p->optEnd = wr;
1182
+
1183
+ for (;;)
1184
+ {
1185
+ UInt32 dist = p->opt[cur].dist;
1186
+ unsigned len = (unsigned)p->opt[cur].len;
1187
+ unsigned extra = (unsigned)p->opt[cur].extra;
1188
+ cur -= len;
1189
+
1190
+ if (extra)
1191
+ {
1192
+ wr--;
1193
+ p->opt[wr].len = (UInt32)len;
1194
+ cur -= extra;
1195
+ len = extra;
1196
+ if (extra == 1)
1197
+ {
1198
+ p->opt[wr].dist = dist;
1199
+ dist = MARK_LIT;
1200
+ }
1201
+ else
1202
+ {
1203
+ p->opt[wr].dist = 0;
1204
+ len--;
1205
+ wr--;
1206
+ p->opt[wr].dist = MARK_LIT;
1207
+ p->opt[wr].len = 1;
1208
+ }
1209
+ }
1210
+
1211
+ if (cur == 0)
1212
+ {
1213
+ p->backRes = dist;
1214
+ p->optCur = wr;
1215
+ return len;
1216
+ }
1217
+
1218
+ wr--;
1219
+ p->opt[wr].dist = dist;
1220
+ p->opt[wr].len = (UInt32)len;
1221
+ }
1222
+ }
1223
+
1224
+
1225
+
1226
+ #define LIT_PROBS(pos, prevByte) \
1227
+ (p->litProbs + (UInt32)3 * (((((pos) << 8) + (prevByte)) & p->lpMask) << p->lc))
1228
+
1229
+
1230
+ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
1231
+ {
1232
+ unsigned last, cur;
1233
+ UInt32 reps[LZMA_NUM_REPS];
1234
+ unsigned repLens[LZMA_NUM_REPS];
1235
+ UInt32 *matches;
1236
+
1237
+ {
1238
+ UInt32 numAvail;
1239
+ unsigned numPairs, mainLen, repMaxIndex, i, posState;
1240
+ UInt32 matchPrice, repMatchPrice;
1241
+ const Byte *data;
1242
+ Byte curByte, matchByte;
1243
+
1244
+ p->optCur = p->optEnd = 0;
1245
+
1246
+ if (p->additionalOffset == 0)
1247
+ mainLen = ReadMatchDistances(p, &numPairs);
1248
+ else
1249
+ {
1250
+ mainLen = p->longestMatchLen;
1251
+ numPairs = p->numPairs;
1252
+ }
1253
+
1254
+ numAvail = p->numAvail;
1255
+ if (numAvail < 2)
1256
+ {
1257
+ p->backRes = MARK_LIT;
1258
+ return 1;
1259
+ }
1260
+ if (numAvail > LZMA_MATCH_LEN_MAX)
1261
+ numAvail = LZMA_MATCH_LEN_MAX;
1262
+
1263
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
1264
+ repMaxIndex = 0;
1265
+
1266
+ for (i = 0; i < LZMA_NUM_REPS; i++)
1267
+ {
1268
+ unsigned len;
1269
+ const Byte *data2;
1270
+ reps[i] = p->reps[i];
1271
+ data2 = data - reps[i];
1272
+ if (data[0] != data2[0] || data[1] != data2[1])
1273
+ {
1274
+ repLens[i] = 0;
1275
+ continue;
1276
+ }
1277
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++)
1278
+ {}
1279
+ repLens[i] = len;
1280
+ if (len > repLens[repMaxIndex])
1281
+ repMaxIndex = i;
1282
+ if (len == LZMA_MATCH_LEN_MAX) // 21.03 : optimization
1283
+ break;
1284
+ }
1285
+
1286
+ if (repLens[repMaxIndex] >= p->numFastBytes)
1287
+ {
1288
+ unsigned len;
1289
+ p->backRes = (UInt32)repMaxIndex;
1290
+ len = repLens[repMaxIndex];
1291
+ MOVE_POS(p, len - 1)
1292
+ return len;
1293
+ }
1294
+
1295
+ matches = p->matches;
1296
+ #define MATCHES matches
1297
+ // #define MATCHES p->matches
1298
+
1299
+ if (mainLen >= p->numFastBytes)
1300
+ {
1301
+ p->backRes = MATCHES[(size_t)numPairs - 1] + LZMA_NUM_REPS;
1302
+ MOVE_POS(p, mainLen - 1)
1303
+ return mainLen;
1304
+ }
1305
+
1306
+ curByte = *data;
1307
+ matchByte = *(data - reps[0]);
1308
+
1309
+ last = repLens[repMaxIndex];
1310
+ if (last <= mainLen)
1311
+ last = mainLen;
1312
+
1313
+ if (last < 2 && curByte != matchByte)
1314
+ {
1315
+ p->backRes = MARK_LIT;
1316
+ return 1;
1317
+ }
1318
+
1319
+ p->opt[0].state = (CState)p->state;
1320
+
1321
+ posState = (position & p->pbMask);
1322
+
1323
+ {
1324
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
1325
+ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +
1326
+ (!IsLitState(p->state) ?
1327
+ LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
1328
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
1329
+ }
1330
+
1331
+ MakeAs_Lit(&p->opt[1])
1332
+
1333
+ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);
1334
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);
1335
+
1336
+ // 18.06
1337
+ if (matchByte == curByte && repLens[0] == 0)
1338
+ {
1339
+ UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, p->state, posState);
1340
+ if (shortRepPrice < p->opt[1].price)
1341
+ {
1342
+ p->opt[1].price = shortRepPrice;
1343
+ MakeAs_ShortRep(&p->opt[1])
1344
+ }
1345
+ if (last < 2)
1346
+ {
1347
+ p->backRes = p->opt[1].dist;
1348
+ return 1;
1349
+ }
1350
+ }
1351
+
1352
+ p->opt[1].len = 1;
1353
+
1354
+ p->opt[0].reps[0] = reps[0];
1355
+ p->opt[0].reps[1] = reps[1];
1356
+ p->opt[0].reps[2] = reps[2];
1357
+ p->opt[0].reps[3] = reps[3];
1358
+
1359
+ // ---------- REP ----------
1360
+
1361
+ for (i = 0; i < LZMA_NUM_REPS; i++)
1362
+ {
1363
+ unsigned repLen = repLens[i];
1364
+ UInt32 price;
1365
+ if (repLen < 2)
1366
+ continue;
1367
+ price = repMatchPrice + GetPrice_PureRep(p, i, p->state, posState);
1368
+ do
1369
+ {
1370
+ UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, repLen);
1371
+ COptimal *opt = &p->opt[repLen];
1372
+ if (price2 < opt->price)
1373
+ {
1374
+ opt->price = price2;
1375
+ opt->len = (UInt32)repLen;
1376
+ opt->dist = (UInt32)i;
1377
+ opt->extra = 0;
1378
+ }
1379
+ }
1380
+ while (--repLen >= 2);
1381
+ }
1382
+
1383
+
1384
+ // ---------- MATCH ----------
1385
+ {
1386
+ unsigned len = repLens[0] + 1;
1387
+ if (len <= mainLen)
1388
+ {
1389
+ unsigned offs = 0;
1390
+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);
1391
+
1392
+ if (len < 2)
1393
+ len = 2;
1394
+ else
1395
+ while (len > MATCHES[offs])
1396
+ offs += 2;
1397
+
1398
+ for (; ; len++)
1399
+ {
1400
+ COptimal *opt;
1401
+ UInt32 dist = MATCHES[(size_t)offs + 1];
1402
+ UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len);
1403
+ unsigned lenToPosState = GetLenToPosState(len);
1404
+
1405
+ if (dist < kNumFullDistances)
1406
+ price += p->distancesPrices[lenToPosState][dist & (kNumFullDistances - 1)];
1407
+ else
1408
+ {
1409
+ unsigned slot;
1410
+ GetPosSlot2(dist, slot)
1411
+ price += p->alignPrices[dist & kAlignMask];
1412
+ price += p->posSlotPrices[lenToPosState][slot];
1413
+ }
1414
+
1415
+ opt = &p->opt[len];
1416
+
1417
+ if (price < opt->price)
1418
+ {
1419
+ opt->price = price;
1420
+ opt->len = (UInt32)len;
1421
+ opt->dist = dist + LZMA_NUM_REPS;
1422
+ opt->extra = 0;
1423
+ }
1424
+
1425
+ if (len == MATCHES[offs])
1426
+ {
1427
+ offs += 2;
1428
+ if (offs == numPairs)
1429
+ break;
1430
+ }
1431
+ }
1432
+ }
1433
+ }
1434
+
1435
+
1436
+ cur = 0;
1437
+
1438
+ #ifdef SHOW_STAT2
1439
+ /* if (position >= 0) */
1440
+ {
1441
+ unsigned i;
1442
+ printf("\n pos = %4X", position);
1443
+ for (i = cur; i <= last; i++)
1444
+ printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price);
1445
+ }
1446
+ #endif
1447
+ }
1448
+
1449
+
1450
+
1451
+ // ---------- Optimal Parsing ----------
1452
+
1453
+ for (;;)
1454
+ {
1455
+ unsigned numAvail;
1456
+ UInt32 numAvailFull;
1457
+ unsigned newLen, numPairs, prev, state, posState, startLen;
1458
+ UInt32 litPrice, matchPrice, repMatchPrice;
1459
+ BoolInt nextIsLit;
1460
+ Byte curByte, matchByte;
1461
+ const Byte *data;
1462
+ COptimal *curOpt, *nextOpt;
1463
+
1464
+ if (++cur == last)
1465
+ break;
1466
+
1467
+ // 18.06
1468
+ if (cur >= kNumOpts - 64)
1469
+ {
1470
+ unsigned j, best;
1471
+ UInt32 price = p->opt[cur].price;
1472
+ best = cur;
1473
+ for (j = cur + 1; j <= last; j++)
1474
+ {
1475
+ UInt32 price2 = p->opt[j].price;
1476
+ if (price >= price2)
1477
+ {
1478
+ price = price2;
1479
+ best = j;
1480
+ }
1481
+ }
1482
+ {
1483
+ unsigned delta = best - cur;
1484
+ if (delta != 0)
1485
+ {
1486
+ MOVE_POS(p, delta)
1487
+ }
1488
+ }
1489
+ cur = best;
1490
+ break;
1491
+ }
1492
+
1493
+ newLen = ReadMatchDistances(p, &numPairs);
1494
+
1495
+ if (newLen >= p->numFastBytes)
1496
+ {
1497
+ p->numPairs = numPairs;
1498
+ p->longestMatchLen = newLen;
1499
+ break;
1500
+ }
1501
+
1502
+ curOpt = &p->opt[cur];
1503
+
1504
+ position++;
1505
+
1506
+ // we need that check here, if skip_items in p->opt are possible
1507
+ /*
1508
+ if (curOpt->price >= kInfinityPrice)
1509
+ continue;
1510
+ */
1511
+
1512
+ prev = cur - curOpt->len;
1513
+
1514
+ if (curOpt->len == 1)
1515
+ {
1516
+ state = (unsigned)p->opt[prev].state;
1517
+ if (IsShortRep(curOpt))
1518
+ state = kShortRepNextStates[state];
1519
+ else
1520
+ state = kLiteralNextStates[state];
1521
+ }
1522
+ else
1523
+ {
1524
+ const COptimal *prevOpt;
1525
+ UInt32 b0;
1526
+ UInt32 dist = curOpt->dist;
1527
+
1528
+ if (curOpt->extra)
1529
+ {
1530
+ prev -= (unsigned)curOpt->extra;
1531
+ state = kState_RepAfterLit;
1532
+ if (curOpt->extra == 1)
1533
+ state = (dist < LZMA_NUM_REPS ? kState_RepAfterLit : kState_MatchAfterLit);
1534
+ }
1535
+ else
1536
+ {
1537
+ state = (unsigned)p->opt[prev].state;
1538
+ if (dist < LZMA_NUM_REPS)
1539
+ state = kRepNextStates[state];
1540
+ else
1541
+ state = kMatchNextStates[state];
1542
+ }
1543
+
1544
+ prevOpt = &p->opt[prev];
1545
+ b0 = prevOpt->reps[0];
1546
+
1547
+ if (dist < LZMA_NUM_REPS)
1548
+ {
1549
+ if (dist == 0)
1550
+ {
1551
+ reps[0] = b0;
1552
+ reps[1] = prevOpt->reps[1];
1553
+ reps[2] = prevOpt->reps[2];
1554
+ reps[3] = prevOpt->reps[3];
1555
+ }
1556
+ else
1557
+ {
1558
+ reps[1] = b0;
1559
+ b0 = prevOpt->reps[1];
1560
+ if (dist == 1)
1561
+ {
1562
+ reps[0] = b0;
1563
+ reps[2] = prevOpt->reps[2];
1564
+ reps[3] = prevOpt->reps[3];
1565
+ }
1566
+ else
1567
+ {
1568
+ reps[2] = b0;
1569
+ reps[0] = prevOpt->reps[dist];
1570
+ reps[3] = prevOpt->reps[dist ^ 1];
1571
+ }
1572
+ }
1573
+ }
1574
+ else
1575
+ {
1576
+ reps[0] = (dist - LZMA_NUM_REPS + 1);
1577
+ reps[1] = b0;
1578
+ reps[2] = prevOpt->reps[1];
1579
+ reps[3] = prevOpt->reps[2];
1580
+ }
1581
+ }
1582
+
1583
+ curOpt->state = (CState)state;
1584
+ curOpt->reps[0] = reps[0];
1585
+ curOpt->reps[1] = reps[1];
1586
+ curOpt->reps[2] = reps[2];
1587
+ curOpt->reps[3] = reps[3];
1588
+
1589
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
1590
+ curByte = *data;
1591
+ matchByte = *(data - reps[0]);
1592
+
1593
+ posState = (position & p->pbMask);
1594
+
1595
+ /*
1596
+ The order of Price checks:
1597
+ < LIT
1598
+ <= SHORT_REP
1599
+ < LIT : REP_0
1600
+ < REP [ : LIT : REP_0 ]
1601
+ < MATCH [ : LIT : REP_0 ]
1602
+ */
1603
+
1604
+ {
1605
+ UInt32 curPrice = curOpt->price;
1606
+ unsigned prob = p->isMatch[state][posState];
1607
+ matchPrice = curPrice + GET_PRICE_1(prob);
1608
+ litPrice = curPrice + GET_PRICE_0(prob);
1609
+ }
1610
+
1611
+ nextOpt = &p->opt[(size_t)cur + 1];
1612
+ nextIsLit = False;
1613
+
1614
+ // here we can allow skip_items in p->opt, if we don't check (nextOpt->price < kInfinityPrice)
1615
+ // 18.new.06
1616
+ if ((nextOpt->price < kInfinityPrice
1617
+ // && !IsLitState(state)
1618
+ && matchByte == curByte)
1619
+ || litPrice > nextOpt->price
1620
+ )
1621
+ litPrice = 0;
1622
+ else
1623
+ {
1624
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
1625
+ litPrice += (!IsLitState(state) ?
1626
+ LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
1627
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
1628
+
1629
+ if (litPrice < nextOpt->price)
1630
+ {
1631
+ nextOpt->price = litPrice;
1632
+ nextOpt->len = 1;
1633
+ MakeAs_Lit(nextOpt)
1634
+ nextIsLit = True;
1635
+ }
1636
+ }
1637
+
1638
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);
1639
+
1640
+ numAvailFull = p->numAvail;
1641
+ {
1642
+ unsigned temp = kNumOpts - 1 - cur;
1643
+ if (numAvailFull > temp)
1644
+ numAvailFull = (UInt32)temp;
1645
+ }
1646
+
1647
+ // 18.06
1648
+ // ---------- SHORT_REP ----------
1649
+ if (IsLitState(state)) // 18.new
1650
+ if (matchByte == curByte)
1651
+ if (repMatchPrice < nextOpt->price) // 18.new
1652
+ // if (numAvailFull < 2 || data[1] != *(data - reps[0] + 1))
1653
+ if (
1654
+ // nextOpt->price >= kInfinityPrice ||
1655
+ nextOpt->len < 2 // we can check nextOpt->len, if skip items are not allowed in p->opt
1656
+ || (nextOpt->dist != 0
1657
+ // && nextOpt->extra <= 1 // 17.old
1658
+ )
1659
+ )
1660
+ {
1661
+ UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, state, posState);
1662
+ // if (shortRepPrice <= nextOpt->price) // 17.old
1663
+ if (shortRepPrice < nextOpt->price) // 18.new
1664
+ {
1665
+ nextOpt->price = shortRepPrice;
1666
+ nextOpt->len = 1;
1667
+ MakeAs_ShortRep(nextOpt)
1668
+ nextIsLit = False;
1669
+ }
1670
+ }
1671
+
1672
+ if (numAvailFull < 2)
1673
+ continue;
1674
+ numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);
1675
+
1676
+ // numAvail <= p->numFastBytes
1677
+
1678
+ // ---------- LIT : REP_0 ----------
1679
+
1680
+ if (!nextIsLit
1681
+ && litPrice != 0 // 18.new
1682
+ && matchByte != curByte
1683
+ && numAvailFull > 2)
1684
+ {
1685
+ const Byte *data2 = data - reps[0];
1686
+ if (data[1] == data2[1] && data[2] == data2[2])
1687
+ {
1688
+ unsigned len;
1689
+ unsigned limit = p->numFastBytes + 1;
1690
+ if (limit > numAvailFull)
1691
+ limit = numAvailFull;
1692
+ for (len = 3; len < limit && data[len] == data2[len]; len++)
1693
+ {}
1694
+
1695
+ {
1696
+ unsigned state2 = kLiteralNextStates[state];
1697
+ unsigned posState2 = (position + 1) & p->pbMask;
1698
+ UInt32 price = litPrice + GetPrice_Rep_0(p, state2, posState2);
1699
+ {
1700
+ unsigned offset = cur + len;
1701
+
1702
+ if (last < offset)
1703
+ last = offset;
1704
+
1705
+ // do
1706
+ {
1707
+ UInt32 price2;
1708
+ COptimal *opt;
1709
+ len--;
1710
+ // price2 = price + GetPrice_Len_Rep_0(p, len, state2, posState2);
1711
+ price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len);
1712
+
1713
+ opt = &p->opt[offset];
1714
+ // offset--;
1715
+ if (price2 < opt->price)
1716
+ {
1717
+ opt->price = price2;
1718
+ opt->len = (UInt32)len;
1719
+ opt->dist = 0;
1720
+ opt->extra = 1;
1721
+ }
1722
+ }
1723
+ // while (len >= 3);
1724
+ }
1725
+ }
1726
+ }
1727
+ }
1728
+
1729
+ startLen = 2; /* speed optimization */
1730
+
1731
+ {
1732
+ // ---------- REP ----------
1733
+ unsigned repIndex = 0; // 17.old
1734
+ // unsigned repIndex = IsLitState(state) ? 0 : 1; // 18.notused
1735
+ for (; repIndex < LZMA_NUM_REPS; repIndex++)
1736
+ {
1737
+ unsigned len;
1738
+ UInt32 price;
1739
+ const Byte *data2 = data - reps[repIndex];
1740
+ if (data[0] != data2[0] || data[1] != data2[1])
1741
+ continue;
1742
+
1743
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++)
1744
+ {}
1745
+
1746
+ // if (len < startLen) continue; // 18.new: speed optimization
1747
+
1748
+ {
1749
+ unsigned offset = cur + len;
1750
+ if (last < offset)
1751
+ last = offset;
1752
+ }
1753
+ {
1754
+ unsigned len2 = len;
1755
+ price = repMatchPrice + GetPrice_PureRep(p, repIndex, state, posState);
1756
+ do
1757
+ {
1758
+ UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, len2);
1759
+ COptimal *opt = &p->opt[cur + len2];
1760
+ if (price2 < opt->price)
1761
+ {
1762
+ opt->price = price2;
1763
+ opt->len = (UInt32)len2;
1764
+ opt->dist = (UInt32)repIndex;
1765
+ opt->extra = 0;
1766
+ }
1767
+ }
1768
+ while (--len2 >= 2);
1769
+ }
1770
+
1771
+ if (repIndex == 0) startLen = len + 1; // 17.old
1772
+ // startLen = len + 1; // 18.new
1773
+
1774
+ /* if (_maxMode) */
1775
+ {
1776
+ // ---------- REP : LIT : REP_0 ----------
1777
+ // numFastBytes + 1 + numFastBytes
1778
+
1779
+ unsigned len2 = len + 1;
1780
+ unsigned limit = len2 + p->numFastBytes;
1781
+ if (limit > numAvailFull)
1782
+ limit = numAvailFull;
1783
+
1784
+ len2 += 2;
1785
+ if (len2 <= limit)
1786
+ if (data[len2 - 2] == data2[len2 - 2])
1787
+ if (data[len2 - 1] == data2[len2 - 1])
1788
+ {
1789
+ unsigned state2 = kRepNextStates[state];
1790
+ unsigned posState2 = (position + len) & p->pbMask;
1791
+ price += GET_PRICE_LEN(&p->repLenEnc, posState, len)
1792
+ + GET_PRICE_0(p->isMatch[state2][posState2])
1793
+ + LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
1794
+ data[len], data2[len], p->ProbPrices);
1795
+
1796
+ // state2 = kLiteralNextStates[state2];
1797
+ state2 = kState_LitAfterRep;
1798
+ posState2 = (posState2 + 1) & p->pbMask;
1799
+
1800
+
1801
+ price += GetPrice_Rep_0(p, state2, posState2);
1802
+
1803
+ for (; len2 < limit && data[len2] == data2[len2]; len2++)
1804
+ {}
1805
+
1806
+ len2 -= len;
1807
+ // if (len2 >= 3)
1808
+ {
1809
+ {
1810
+ unsigned offset = cur + len + len2;
1811
+
1812
+ if (last < offset)
1813
+ last = offset;
1814
+ // do
1815
+ {
1816
+ UInt32 price2;
1817
+ COptimal *opt;
1818
+ len2--;
1819
+ // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
1820
+ price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2);
1821
+
1822
+ opt = &p->opt[offset];
1823
+ // offset--;
1824
+ if (price2 < opt->price)
1825
+ {
1826
+ opt->price = price2;
1827
+ opt->len = (UInt32)len2;
1828
+ opt->extra = (CExtra)(len + 1);
1829
+ opt->dist = (UInt32)repIndex;
1830
+ }
1831
+ }
1832
+ // while (len2 >= 3);
1833
+ }
1834
+ }
1835
+ }
1836
+ }
1837
+ }
1838
+ }
1839
+
1840
+
1841
+ // ---------- MATCH ----------
1842
+ /* for (unsigned len = 2; len <= newLen; len++) */
1843
+ if (newLen > numAvail)
1844
+ {
1845
+ newLen = numAvail;
1846
+ for (numPairs = 0; newLen > MATCHES[numPairs]; numPairs += 2);
1847
+ MATCHES[numPairs] = (UInt32)newLen;
1848
+ numPairs += 2;
1849
+ }
1850
+
1851
+ // startLen = 2; /* speed optimization */
1852
+
1853
+ if (newLen >= startLen)
1854
+ {
1855
+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);
1856
+ UInt32 dist;
1857
+ unsigned offs, posSlot, len;
1858
+
1859
+ {
1860
+ unsigned offset = cur + newLen;
1861
+ if (last < offset)
1862
+ last = offset;
1863
+ }
1864
+
1865
+ offs = 0;
1866
+ while (startLen > MATCHES[offs])
1867
+ offs += 2;
1868
+ dist = MATCHES[(size_t)offs + 1];
1869
+
1870
+ // if (dist >= kNumFullDistances)
1871
+ GetPosSlot2(dist, posSlot)
1872
+
1873
+ for (len = /*2*/ startLen; ; len++)
1874
+ {
1875
+ UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len);
1876
+ {
1877
+ COptimal *opt;
1878
+ unsigned lenNorm = len - 2;
1879
+ lenNorm = GetLenToPosState2(lenNorm);
1880
+ if (dist < kNumFullDistances)
1881
+ price += p->distancesPrices[lenNorm][dist & (kNumFullDistances - 1)];
1882
+ else
1883
+ price += p->posSlotPrices[lenNorm][posSlot] + p->alignPrices[dist & kAlignMask];
1884
+
1885
+ opt = &p->opt[cur + len];
1886
+ if (price < opt->price)
1887
+ {
1888
+ opt->price = price;
1889
+ opt->len = (UInt32)len;
1890
+ opt->dist = dist + LZMA_NUM_REPS;
1891
+ opt->extra = 0;
1892
+ }
1893
+ }
1894
+
1895
+ if (len == MATCHES[offs])
1896
+ {
1897
+ // if (p->_maxMode) {
1898
+ // MATCH : LIT : REP_0
1899
+
1900
+ const Byte *data2 = data - dist - 1;
1901
+ unsigned len2 = len + 1;
1902
+ unsigned limit = len2 + p->numFastBytes;
1903
+ if (limit > numAvailFull)
1904
+ limit = numAvailFull;
1905
+
1906
+ len2 += 2;
1907
+ if (len2 <= limit)
1908
+ if (data[len2 - 2] == data2[len2 - 2])
1909
+ if (data[len2 - 1] == data2[len2 - 1])
1910
+ {
1911
+ for (; len2 < limit && data[len2] == data2[len2]; len2++)
1912
+ {}
1913
+
1914
+ len2 -= len;
1915
+
1916
+ // if (len2 >= 3)
1917
+ {
1918
+ unsigned state2 = kMatchNextStates[state];
1919
+ unsigned posState2 = (position + len) & p->pbMask;
1920
+ unsigned offset;
1921
+ price += GET_PRICE_0(p->isMatch[state2][posState2]);
1922
+ price += LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
1923
+ data[len], data2[len], p->ProbPrices);
1924
+
1925
+ // state2 = kLiteralNextStates[state2];
1926
+ state2 = kState_LitAfterMatch;
1927
+
1928
+ posState2 = (posState2 + 1) & p->pbMask;
1929
+ price += GetPrice_Rep_0(p, state2, posState2);
1930
+
1931
+ offset = cur + len + len2;
1932
+
1933
+ if (last < offset)
1934
+ last = offset;
1935
+ // do
1936
+ {
1937
+ UInt32 price2;
1938
+ COptimal *opt;
1939
+ len2--;
1940
+ // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
1941
+ price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2);
1942
+ opt = &p->opt[offset];
1943
+ // offset--;
1944
+ if (price2 < opt->price)
1945
+ {
1946
+ opt->price = price2;
1947
+ opt->len = (UInt32)len2;
1948
+ opt->extra = (CExtra)(len + 1);
1949
+ opt->dist = dist + LZMA_NUM_REPS;
1950
+ }
1951
+ }
1952
+ // while (len2 >= 3);
1953
+ }
1954
+
1955
+ }
1956
+
1957
+ offs += 2;
1958
+ if (offs == numPairs)
1959
+ break;
1960
+ dist = MATCHES[(size_t)offs + 1];
1961
+ // if (dist >= kNumFullDistances)
1962
+ GetPosSlot2(dist, posSlot)
1963
+ }
1964
+ }
1965
+ }
1966
+ }
1967
+
1968
+ do
1969
+ p->opt[last].price = kInfinityPrice;
1970
+ while (--last);
1971
+
1972
+ return Backward(p, cur);
1973
+ }
1974
+
1975
+
1976
+
1977
+ #define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))
1978
+
1979
+
1980
+
1981
+ static unsigned GetOptimumFast(CLzmaEnc *p)
1982
+ {
1983
+ UInt32 numAvail, mainDist;
1984
+ unsigned mainLen, numPairs, repIndex, repLen, i;
1985
+ const Byte *data;
1986
+
1987
+ if (p->additionalOffset == 0)
1988
+ mainLen = ReadMatchDistances(p, &numPairs);
1989
+ else
1990
+ {
1991
+ mainLen = p->longestMatchLen;
1992
+ numPairs = p->numPairs;
1993
+ }
1994
+
1995
+ numAvail = p->numAvail;
1996
+ p->backRes = MARK_LIT;
1997
+ if (numAvail < 2)
1998
+ return 1;
1999
+ // if (mainLen < 2 && p->state == 0) return 1; // 18.06.notused
2000
+ if (numAvail > LZMA_MATCH_LEN_MAX)
2001
+ numAvail = LZMA_MATCH_LEN_MAX;
2002
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
2003
+ repLen = repIndex = 0;
2004
+
2005
+ for (i = 0; i < LZMA_NUM_REPS; i++)
2006
+ {
2007
+ unsigned len;
2008
+ const Byte *data2 = data - p->reps[i];
2009
+ if (data[0] != data2[0] || data[1] != data2[1])
2010
+ continue;
2011
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++)
2012
+ {}
2013
+ if (len >= p->numFastBytes)
2014
+ {
2015
+ p->backRes = (UInt32)i;
2016
+ MOVE_POS(p, len - 1)
2017
+ return len;
2018
+ }
2019
+ if (len > repLen)
2020
+ {
2021
+ repIndex = i;
2022
+ repLen = len;
2023
+ }
2024
+ }
2025
+
2026
+ if (mainLen >= p->numFastBytes)
2027
+ {
2028
+ p->backRes = p->matches[(size_t)numPairs - 1] + LZMA_NUM_REPS;
2029
+ MOVE_POS(p, mainLen - 1)
2030
+ return mainLen;
2031
+ }
2032
+
2033
+ mainDist = 0; /* for GCC */
2034
+
2035
+ if (mainLen >= 2)
2036
+ {
2037
+ mainDist = p->matches[(size_t)numPairs - 1];
2038
+ while (numPairs > 2)
2039
+ {
2040
+ UInt32 dist2;
2041
+ if (mainLen != p->matches[(size_t)numPairs - 4] + 1)
2042
+ break;
2043
+ dist2 = p->matches[(size_t)numPairs - 3];
2044
+ if (!ChangePair(dist2, mainDist))
2045
+ break;
2046
+ numPairs -= 2;
2047
+ mainLen--;
2048
+ mainDist = dist2;
2049
+ }
2050
+ if (mainLen == 2 && mainDist >= 0x80)
2051
+ mainLen = 1;
2052
+ }
2053
+
2054
+ if (repLen >= 2)
2055
+ if ( repLen + 1 >= mainLen
2056
+ || (repLen + 2 >= mainLen && mainDist >= (1 << 9))
2057
+ || (repLen + 3 >= mainLen && mainDist >= (1 << 15)))
2058
+ {
2059
+ p->backRes = (UInt32)repIndex;
2060
+ MOVE_POS(p, repLen - 1)
2061
+ return repLen;
2062
+ }
2063
+
2064
+ if (mainLen < 2 || numAvail <= 2)
2065
+ return 1;
2066
+
2067
+ {
2068
+ unsigned len1 = ReadMatchDistances(p, &p->numPairs);
2069
+ p->longestMatchLen = len1;
2070
+
2071
+ if (len1 >= 2)
2072
+ {
2073
+ UInt32 newDist = p->matches[(size_t)p->numPairs - 1];
2074
+ if ( (len1 >= mainLen && newDist < mainDist)
2075
+ || (len1 == mainLen + 1 && !ChangePair(mainDist, newDist))
2076
+ || (len1 > mainLen + 1)
2077
+ || (len1 + 1 >= mainLen && mainLen >= 3 && ChangePair(newDist, mainDist)))
2078
+ return 1;
2079
+ }
2080
+ }
2081
+
2082
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
2083
+
2084
+ for (i = 0; i < LZMA_NUM_REPS; i++)
2085
+ {
2086
+ unsigned len, limit;
2087
+ const Byte *data2 = data - p->reps[i];
2088
+ if (data[0] != data2[0] || data[1] != data2[1])
2089
+ continue;
2090
+ limit = mainLen - 1;
2091
+ for (len = 2;; len++)
2092
+ {
2093
+ if (len >= limit)
2094
+ return 1;
2095
+ if (data[len] != data2[len])
2096
+ break;
2097
+ }
2098
+ }
2099
+
2100
+ p->backRes = mainDist + LZMA_NUM_REPS;
2101
+ if (mainLen != 2)
2102
+ {
2103
+ MOVE_POS(p, mainLen - 2)
2104
+ }
2105
+ return mainLen;
2106
+ }
2107
+
2108
+
2109
+
2110
+
2111
+ static void WriteEndMarker(CLzmaEnc *p, unsigned posState)
2112
+ {
2113
+ UInt32 range;
2114
+ range = p->rc.range;
2115
+ {
2116
+ UInt32 ttt, newBound;
2117
+ CLzmaProb *prob = &p->isMatch[p->state][posState];
2118
+ RC_BIT_PRE(&p->rc, prob)
2119
+ RC_BIT_1(&p->rc, prob)
2120
+ prob = &p->isRep[p->state];
2121
+ RC_BIT_PRE(&p->rc, prob)
2122
+ RC_BIT_0(&p->rc, prob)
2123
+ }
2124
+ p->state = kMatchNextStates[p->state];
2125
+
2126
+ p->rc.range = range;
2127
+ LenEnc_Encode(&p->lenProbs, &p->rc, 0, posState);
2128
+ range = p->rc.range;
2129
+
2130
+ {
2131
+ // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[0], (1 << kNumPosSlotBits) - 1);
2132
+ CLzmaProb *probs = p->posSlotEncoder[0];
2133
+ unsigned m = 1;
2134
+ do
2135
+ {
2136
+ UInt32 ttt, newBound;
2137
+ RC_BIT_PRE(p, probs + m)
2138
+ RC_BIT_1(&p->rc, probs + m)
2139
+ m = (m << 1) + 1;
2140
+ }
2141
+ while (m < (1 << kNumPosSlotBits));
2142
+ }
2143
+ {
2144
+ // RangeEnc_EncodeDirectBits(&p->rc, ((UInt32)1 << (30 - kNumAlignBits)) - 1, 30 - kNumAlignBits); UInt32 range = p->range;
2145
+ unsigned numBits = 30 - kNumAlignBits;
2146
+ do
2147
+ {
2148
+ range >>= 1;
2149
+ p->rc.low += range;
2150
+ RC_NORM(&p->rc)
2151
+ }
2152
+ while (--numBits);
2153
+ }
2154
+
2155
+ {
2156
+ // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);
2157
+ CLzmaProb *probs = p->posAlignEncoder;
2158
+ unsigned m = 1;
2159
+ do
2160
+ {
2161
+ UInt32 ttt, newBound;
2162
+ RC_BIT_PRE(p, probs + m)
2163
+ RC_BIT_1(&p->rc, probs + m)
2164
+ m = (m << 1) + 1;
2165
+ }
2166
+ while (m < kAlignTableSize);
2167
+ }
2168
+ p->rc.range = range;
2169
+ }
2170
+
2171
+
2172
+ static SRes CheckErrors(CLzmaEnc *p)
2173
+ {
2174
+ if (p->result != SZ_OK)
2175
+ return p->result;
2176
+ if (p->rc.res != SZ_OK)
2177
+ p->result = SZ_ERROR_WRITE;
2178
+
2179
+ #ifndef Z7_ST
2180
+ if (
2181
+ // p->mf_Failure ||
2182
+ (p->mtMode &&
2183
+ ( // p->matchFinderMt.failure_LZ_LZ ||
2184
+ p->matchFinderMt.failure_LZ_BT))
2185
+ )
2186
+ {
2187
+ p->result = MY_HRES_ERROR_INTERNAL_ERROR;
2188
+ // printf("\nCheckErrors p->matchFinderMt.failureLZ\n");
2189
+ }
2190
+ #endif
2191
+
2192
+ if (MFB.result != SZ_OK)
2193
+ p->result = SZ_ERROR_READ;
2194
+
2195
+ if (p->result != SZ_OK)
2196
+ p->finished = True;
2197
+ return p->result;
2198
+ }
2199
+
2200
+
2201
+ Z7_NO_INLINE static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
2202
+ {
2203
+ /* ReleaseMFStream(); */
2204
+ p->finished = True;
2205
+ if (p->writeEndMark)
2206
+ WriteEndMarker(p, nowPos & p->pbMask);
2207
+ RangeEnc_FlushData(&p->rc);
2208
+ RangeEnc_FlushStream(&p->rc);
2209
+ return CheckErrors(p);
2210
+ }
2211
+
2212
+
2213
+ Z7_NO_INLINE static void FillAlignPrices(CLzmaEnc *p)
2214
+ {
2215
+ unsigned i;
2216
+ const CProbPrice *ProbPrices = p->ProbPrices;
2217
+ const CLzmaProb *probs = p->posAlignEncoder;
2218
+ // p->alignPriceCount = 0;
2219
+ for (i = 0; i < kAlignTableSize / 2; i++)
2220
+ {
2221
+ UInt32 price = 0;
2222
+ unsigned sym = i;
2223
+ unsigned m = 1;
2224
+ unsigned bit;
2225
+ UInt32 prob;
2226
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
2227
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
2228
+ bit = sym & 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
2229
+ prob = probs[m];
2230
+ p->alignPrices[i ] = price + GET_PRICEa_0(prob);
2231
+ p->alignPrices[i + 8] = price + GET_PRICEa_1(prob);
2232
+ // p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
2233
+ }
2234
+ }
2235
+
2236
+
2237
+ Z7_NO_INLINE static void FillDistancesPrices(CLzmaEnc *p)
2238
+ {
2239
+ // int y; for (y = 0; y < 100; y++) {
2240
+
2241
+ UInt32 tempPrices[kNumFullDistances];
2242
+ unsigned i, lps;
2243
+
2244
+ const CProbPrice *ProbPrices = p->ProbPrices;
2245
+ p->matchPriceCount = 0;
2246
+
2247
+ for (i = kStartPosModelIndex / 2; i < kNumFullDistances / 2; i++)
2248
+ {
2249
+ unsigned posSlot = GetPosSlot1(i);
2250
+ unsigned footerBits = (posSlot >> 1) - 1;
2251
+ unsigned base = ((2 | (posSlot & 1)) << footerBits);
2252
+ const CLzmaProb *probs = p->posEncoders + (size_t)base * 2;
2253
+ // tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base, footerBits, i - base, p->ProbPrices);
2254
+ UInt32 price = 0;
2255
+ unsigned m = 1;
2256
+ unsigned sym = i;
2257
+ unsigned offset = (unsigned)1 << footerBits;
2258
+ base += i;
2259
+
2260
+ if (footerBits)
2261
+ do
2262
+ {
2263
+ unsigned bit = sym & 1;
2264
+ sym >>= 1;
2265
+ price += GET_PRICEa(probs[m], bit);
2266
+ m = (m << 1) + bit;
2267
+ }
2268
+ while (--footerBits);
2269
+
2270
+ {
2271
+ unsigned prob = probs[m];
2272
+ tempPrices[base ] = price + GET_PRICEa_0(prob);
2273
+ tempPrices[base + offset] = price + GET_PRICEa_1(prob);
2274
+ }
2275
+ }
2276
+
2277
+ for (lps = 0; lps < kNumLenToPosStates; lps++)
2278
+ {
2279
+ unsigned slot;
2280
+ unsigned distTableSize2 = (p->distTableSize + 1) >> 1;
2281
+ UInt32 *posSlotPrices = p->posSlotPrices[lps];
2282
+ const CLzmaProb *probs = p->posSlotEncoder[lps];
2283
+
2284
+ for (slot = 0; slot < distTableSize2; slot++)
2285
+ {
2286
+ // posSlotPrices[slot] = RcTree_GetPrice(encoder, kNumPosSlotBits, slot, p->ProbPrices);
2287
+ UInt32 price;
2288
+ unsigned bit;
2289
+ unsigned sym = slot + (1 << (kNumPosSlotBits - 1));
2290
+ unsigned prob;
2291
+ bit = sym & 1; sym >>= 1; price = GET_PRICEa(probs[sym], bit);
2292
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
2293
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
2294
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
2295
+ bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit);
2296
+ prob = probs[(size_t)slot + (1 << (kNumPosSlotBits - 1))];
2297
+ posSlotPrices[(size_t)slot * 2 ] = price + GET_PRICEa_0(prob);
2298
+ posSlotPrices[(size_t)slot * 2 + 1] = price + GET_PRICEa_1(prob);
2299
+ }
2300
+
2301
+ {
2302
+ UInt32 delta = ((UInt32)((kEndPosModelIndex / 2 - 1) - kNumAlignBits) << kNumBitPriceShiftBits);
2303
+ for (slot = kEndPosModelIndex / 2; slot < distTableSize2; slot++)
2304
+ {
2305
+ posSlotPrices[(size_t)slot * 2 ] += delta;
2306
+ posSlotPrices[(size_t)slot * 2 + 1] += delta;
2307
+ delta += ((UInt32)1 << kNumBitPriceShiftBits);
2308
+ }
2309
+ }
2310
+
2311
+ {
2312
+ UInt32 *dp = p->distancesPrices[lps];
2313
+
2314
+ dp[0] = posSlotPrices[0];
2315
+ dp[1] = posSlotPrices[1];
2316
+ dp[2] = posSlotPrices[2];
2317
+ dp[3] = posSlotPrices[3];
2318
+
2319
+ for (i = 4; i < kNumFullDistances; i += 2)
2320
+ {
2321
+ UInt32 slotPrice = posSlotPrices[GetPosSlot1(i)];
2322
+ dp[i ] = slotPrice + tempPrices[i];
2323
+ dp[i + 1] = slotPrice + tempPrices[i + 1];
2324
+ }
2325
+ }
2326
+ }
2327
+ // }
2328
+ }
2329
+
2330
+
2331
+
2332
+ static void LzmaEnc_Construct(CLzmaEnc *p)
2333
+ {
2334
+ RangeEnc_Construct(&p->rc);
2335
+ MatchFinder_Construct(&MFB);
2336
+
2337
+ #ifndef Z7_ST
2338
+ p->matchFinderMt.MatchFinder = &MFB;
2339
+ MatchFinderMt_Construct(&p->matchFinderMt);
2340
+ #endif
2341
+
2342
+ {
2343
+ CLzmaEncProps props;
2344
+ LzmaEncProps_Init(&props);
2345
+ LzmaEnc_SetProps((CLzmaEncHandle)(void *)p, &props);
2346
+ }
2347
+
2348
+ #ifndef LZMA_LOG_BSR
2349
+ LzmaEnc_FastPosInit(p->g_FastPos);
2350
+ #endif
2351
+
2352
+ LzmaEnc_InitPriceTables(p->ProbPrices);
2353
+ p->litProbs = NULL;
2354
+ p->saveState.litProbs = NULL;
2355
+ }
2356
+
2357
+ CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc)
2358
+ {
2359
+ CLzmaEncHandle p = (CLzmaEncHandle)ISzAlloc_Alloc(alloc, sizeof(CLzmaEnc));
2360
+ if (p)
2361
+ LzmaEnc_Construct(p);
2362
+ return p;
2363
+ }
2364
+
2365
+ static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAllocPtr alloc)
2366
+ {
2367
+ ISzAlloc_Free(alloc, p->litProbs);
2368
+ ISzAlloc_Free(alloc, p->saveState.litProbs);
2369
+ p->litProbs = NULL;
2370
+ p->saveState.litProbs = NULL;
2371
+ }
2372
+
2373
+ static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
2374
+ {
2375
+ #ifndef Z7_ST
2376
+ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);
2377
+ #endif
2378
+
2379
+ MatchFinder_Free(&MFB, allocBig);
2380
+ LzmaEnc_FreeLits(p, alloc);
2381
+ RangeEnc_Free(&p->rc, alloc);
2382
+ }
2383
+
2384
+ void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
2385
+ {
2386
+ // GET_CLzmaEnc_p
2387
+ LzmaEnc_Destruct(p, alloc, allocBig);
2388
+ ISzAlloc_Free(alloc, p);
2389
+ }
2390
+
2391
+
2392
+ Z7_NO_INLINE
2393
+ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, UInt32 maxPackSize, UInt32 maxUnpackSize)
2394
+ {
2395
+ UInt32 nowPos32, startPos32;
2396
+ if (p->needInit)
2397
+ {
2398
+ #ifndef Z7_ST
2399
+ if (p->mtMode)
2400
+ {
2401
+ RINOK(MatchFinderMt_InitMt(&p->matchFinderMt))
2402
+ }
2403
+ #endif
2404
+ p->matchFinder.Init(p->matchFinderObj);
2405
+ p->needInit = 0;
2406
+ }
2407
+
2408
+ if (p->finished)
2409
+ return p->result;
2410
+ RINOK(CheckErrors(p))
2411
+
2412
+ nowPos32 = (UInt32)p->nowPos64;
2413
+ startPos32 = nowPos32;
2414
+
2415
+ if (p->nowPos64 == 0)
2416
+ {
2417
+ unsigned numPairs;
2418
+ Byte curByte;
2419
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
2420
+ return Flush(p, nowPos32);
2421
+ ReadMatchDistances(p, &numPairs);
2422
+ RangeEnc_EncodeBit_0(&p->rc, &p->isMatch[kState_Start][0]);
2423
+ // p->state = kLiteralNextStates[p->state];
2424
+ curByte = *(p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset);
2425
+ LitEnc_Encode(&p->rc, p->litProbs, curByte);
2426
+ p->additionalOffset--;
2427
+ nowPos32++;
2428
+ }
2429
+
2430
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
2431
+
2432
+ for (;;)
2433
+ {
2434
+ UInt32 dist;
2435
+ unsigned len, posState;
2436
+ UInt32 range, ttt, newBound;
2437
+ CLzmaProb *probs;
2438
+
2439
+ if (p->fastMode)
2440
+ len = GetOptimumFast(p);
2441
+ else
2442
+ {
2443
+ unsigned oci = p->optCur;
2444
+ if (p->optEnd == oci)
2445
+ len = GetOptimum(p, nowPos32);
2446
+ else
2447
+ {
2448
+ const COptimal *opt = &p->opt[oci];
2449
+ len = opt->len;
2450
+ p->backRes = opt->dist;
2451
+ p->optCur = oci + 1;
2452
+ }
2453
+ }
2454
+
2455
+ posState = (unsigned)nowPos32 & p->pbMask;
2456
+ range = p->rc.range;
2457
+ probs = &p->isMatch[p->state][posState];
2458
+
2459
+ RC_BIT_PRE(&p->rc, probs)
2460
+
2461
+ dist = p->backRes;
2462
+
2463
+ #ifdef SHOW_STAT2
2464
+ printf("\n pos = %6X, len = %3u pos = %6u", nowPos32, len, dist);
2465
+ #endif
2466
+
2467
+ if (dist == MARK_LIT)
2468
+ {
2469
+ Byte curByte;
2470
+ const Byte *data;
2471
+ unsigned state;
2472
+
2473
+ RC_BIT_0(&p->rc, probs)
2474
+ p->rc.range = range;
2475
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
2476
+ probs = LIT_PROBS(nowPos32, *(data - 1));
2477
+ curByte = *data;
2478
+ state = p->state;
2479
+ p->state = kLiteralNextStates[state];
2480
+ if (IsLitState(state))
2481
+ LitEnc_Encode(&p->rc, probs, curByte);
2482
+ else
2483
+ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0]));
2484
+ }
2485
+ else
2486
+ {
2487
+ RC_BIT_1(&p->rc, probs)
2488
+ probs = &p->isRep[p->state];
2489
+ RC_BIT_PRE(&p->rc, probs)
2490
+
2491
+ if (dist < LZMA_NUM_REPS)
2492
+ {
2493
+ RC_BIT_1(&p->rc, probs)
2494
+ probs = &p->isRepG0[p->state];
2495
+ RC_BIT_PRE(&p->rc, probs)
2496
+ if (dist == 0)
2497
+ {
2498
+ RC_BIT_0(&p->rc, probs)
2499
+ probs = &p->isRep0Long[p->state][posState];
2500
+ RC_BIT_PRE(&p->rc, probs)
2501
+ if (len != 1)
2502
+ {
2503
+ RC_BIT_1_BASE(&p->rc, probs)
2504
+ }
2505
+ else
2506
+ {
2507
+ RC_BIT_0_BASE(&p->rc, probs)
2508
+ p->state = kShortRepNextStates[p->state];
2509
+ }
2510
+ }
2511
+ else
2512
+ {
2513
+ RC_BIT_1(&p->rc, probs)
2514
+ probs = &p->isRepG1[p->state];
2515
+ RC_BIT_PRE(&p->rc, probs)
2516
+ if (dist == 1)
2517
+ {
2518
+ RC_BIT_0_BASE(&p->rc, probs)
2519
+ dist = p->reps[1];
2520
+ }
2521
+ else
2522
+ {
2523
+ RC_BIT_1(&p->rc, probs)
2524
+ probs = &p->isRepG2[p->state];
2525
+ RC_BIT_PRE(&p->rc, probs)
2526
+ if (dist == 2)
2527
+ {
2528
+ RC_BIT_0_BASE(&p->rc, probs)
2529
+ dist = p->reps[2];
2530
+ }
2531
+ else
2532
+ {
2533
+ RC_BIT_1_BASE(&p->rc, probs)
2534
+ dist = p->reps[3];
2535
+ p->reps[3] = p->reps[2];
2536
+ }
2537
+ p->reps[2] = p->reps[1];
2538
+ }
2539
+ p->reps[1] = p->reps[0];
2540
+ p->reps[0] = dist;
2541
+ }
2542
+
2543
+ RC_NORM(&p->rc)
2544
+
2545
+ p->rc.range = range;
2546
+
2547
+ if (len != 1)
2548
+ {
2549
+ LenEnc_Encode(&p->repLenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
2550
+ --p->repLenEncCounter;
2551
+ p->state = kRepNextStates[p->state];
2552
+ }
2553
+ }
2554
+ else
2555
+ {
2556
+ unsigned posSlot;
2557
+ RC_BIT_0(&p->rc, probs)
2558
+ p->rc.range = range;
2559
+ p->state = kMatchNextStates[p->state];
2560
+
2561
+ LenEnc_Encode(&p->lenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
2562
+ // --p->lenEnc.counter;
2563
+
2564
+ dist -= LZMA_NUM_REPS;
2565
+ p->reps[3] = p->reps[2];
2566
+ p->reps[2] = p->reps[1];
2567
+ p->reps[1] = p->reps[0];
2568
+ p->reps[0] = dist + 1;
2569
+
2570
+ p->matchPriceCount++;
2571
+ GetPosSlot(dist, posSlot)
2572
+ // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], posSlot);
2573
+ {
2574
+ UInt32 sym = (UInt32)posSlot + (1 << kNumPosSlotBits);
2575
+ range = p->rc.range;
2576
+ probs = p->posSlotEncoder[GetLenToPosState(len)];
2577
+ do
2578
+ {
2579
+ CLzmaProb *prob = probs + (sym >> kNumPosSlotBits);
2580
+ UInt32 bit = (sym >> (kNumPosSlotBits - 1)) & 1;
2581
+ sym <<= 1;
2582
+ RC_BIT(&p->rc, prob, bit)
2583
+ }
2584
+ while (sym < (1 << kNumPosSlotBits * 2));
2585
+ p->rc.range = range;
2586
+ }
2587
+
2588
+ if (dist >= kStartPosModelIndex)
2589
+ {
2590
+ unsigned footerBits = ((posSlot >> 1) - 1);
2591
+
2592
+ if (dist < kNumFullDistances)
2593
+ {
2594
+ unsigned base = ((2 | (posSlot & 1)) << footerBits);
2595
+ RcTree_ReverseEncode(&p->rc, p->posEncoders + base, footerBits, (unsigned)(dist /* - base */));
2596
+ }
2597
+ else
2598
+ {
2599
+ UInt32 pos2 = (dist | 0xF) << (32 - footerBits);
2600
+ range = p->rc.range;
2601
+ // RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);
2602
+ /*
2603
+ do
2604
+ {
2605
+ range >>= 1;
2606
+ p->rc.low += range & (0 - ((dist >> --footerBits) & 1));
2607
+ RC_NORM(&p->rc)
2608
+ }
2609
+ while (footerBits > kNumAlignBits);
2610
+ */
2611
+ do
2612
+ {
2613
+ range >>= 1;
2614
+ p->rc.low += range & (0 - (pos2 >> 31));
2615
+ pos2 += pos2;
2616
+ RC_NORM(&p->rc)
2617
+ }
2618
+ while (pos2 != 0xF0000000);
2619
+
2620
+
2621
+ // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);
2622
+
2623
+ {
2624
+ unsigned m = 1;
2625
+ unsigned bit;
2626
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit) m = (m << 1) + bit;
2627
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit) m = (m << 1) + bit;
2628
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit) m = (m << 1) + bit;
2629
+ bit = dist & 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit)
2630
+ p->rc.range = range;
2631
+ // p->alignPriceCount++;
2632
+ }
2633
+ }
2634
+ }
2635
+ }
2636
+ }
2637
+
2638
+ nowPos32 += (UInt32)len;
2639
+ p->additionalOffset -= len;
2640
+
2641
+ if (p->additionalOffset == 0)
2642
+ {
2643
+ UInt32 processed;
2644
+
2645
+ if (!p->fastMode)
2646
+ {
2647
+ /*
2648
+ if (p->alignPriceCount >= 16) // kAlignTableSize
2649
+ FillAlignPrices(p);
2650
+ if (p->matchPriceCount >= 128)
2651
+ FillDistancesPrices(p);
2652
+ if (p->lenEnc.counter <= 0)
2653
+ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices);
2654
+ */
2655
+ if (p->matchPriceCount >= 64)
2656
+ {
2657
+ FillAlignPrices(p);
2658
+ // { int y; for (y = 0; y < 100; y++) {
2659
+ FillDistancesPrices(p);
2660
+ // }}
2661
+ LenPriceEnc_UpdateTables(&p->lenEnc, (unsigned)1 << p->pb, &p->lenProbs, p->ProbPrices);
2662
+ }
2663
+ if (p->repLenEncCounter <= 0)
2664
+ {
2665
+ p->repLenEncCounter = REP_LEN_COUNT;
2666
+ LenPriceEnc_UpdateTables(&p->repLenEnc, (unsigned)1 << p->pb, &p->repLenProbs, p->ProbPrices);
2667
+ }
2668
+ }
2669
+
2670
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
2671
+ break;
2672
+ processed = nowPos32 - startPos32;
2673
+
2674
+ if (maxPackSize)
2675
+ {
2676
+ if (processed + kNumOpts + 300 >= maxUnpackSize
2677
+ || RangeEnc_GetProcessed_sizet(&p->rc) + kPackReserve >= maxPackSize)
2678
+ break;
2679
+ }
2680
+ else if (processed >= (1 << 17))
2681
+ {
2682
+ p->nowPos64 += nowPos32 - startPos32;
2683
+ return CheckErrors(p);
2684
+ }
2685
+ }
2686
+ }
2687
+
2688
+ p->nowPos64 += nowPos32 - startPos32;
2689
+ return Flush(p, nowPos32);
2690
+ }
2691
+
2692
+
2693
+
2694
+ #define kBigHashDicLimit ((UInt32)1 << 24)
2695
+
2696
+ static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
2697
+ {
2698
+ UInt32 beforeSize = kNumOpts;
2699
+ UInt32 dictSize;
2700
+
2701
+ if (!RangeEnc_Alloc(&p->rc, alloc))
2702
+ return SZ_ERROR_MEM;
2703
+
2704
+ #ifndef Z7_ST
2705
+ p->mtMode = (p->multiThread && !p->fastMode && (MFB.btMode != 0));
2706
+ #endif
2707
+
2708
+ {
2709
+ const unsigned lclp = p->lc + p->lp;
2710
+ if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp)
2711
+ {
2712
+ LzmaEnc_FreeLits(p, alloc);
2713
+ p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((size_t)0x300 * sizeof(CLzmaProb)) << lclp);
2714
+ p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((size_t)0x300 * sizeof(CLzmaProb)) << lclp);
2715
+ if (!p->litProbs || !p->saveState.litProbs)
2716
+ {
2717
+ LzmaEnc_FreeLits(p, alloc);
2718
+ return SZ_ERROR_MEM;
2719
+ }
2720
+ p->lclp = lclp;
2721
+ }
2722
+ }
2723
+
2724
+ MFB.bigHash = (Byte)(p->dictSize > kBigHashDicLimit ? 1 : 0);
2725
+
2726
+
2727
+ dictSize = p->dictSize;
2728
+ if (dictSize == ((UInt32)2 << 30) ||
2729
+ dictSize == ((UInt32)3 << 30))
2730
+ {
2731
+ /* 21.03 : here we reduce the dictionary for 2 reasons:
2732
+ 1) we don't want 32-bit back_distance matches in decoder for 2 GB dictionary.
2733
+ 2) we want to elimate useless last MatchFinder_Normalize3() for corner cases,
2734
+ where data size is aligned for 1 GB: 5/6/8 GB.
2735
+ That reducing must be >= 1 for such corner cases. */
2736
+ dictSize -= 1;
2737
+ }
2738
+
2739
+ if (beforeSize + dictSize < keepWindowSize)
2740
+ beforeSize = keepWindowSize - dictSize;
2741
+
2742
+ /* in worst case we can look ahead for
2743
+ max(LZMA_MATCH_LEN_MAX, numFastBytes + 1 + numFastBytes) bytes.
2744
+ we send larger value for (keepAfter) to MantchFinder_Create():
2745
+ (numFastBytes + LZMA_MATCH_LEN_MAX + 1)
2746
+ */
2747
+
2748
+ #ifndef Z7_ST
2749
+ if (p->mtMode)
2750
+ {
2751
+ RINOK(MatchFinderMt_Create(&p->matchFinderMt, dictSize, beforeSize,
2752
+ p->numFastBytes, LZMA_MATCH_LEN_MAX + 1 /* 18.04 */
2753
+ , allocBig))
2754
+ p->matchFinderObj = &p->matchFinderMt;
2755
+ MFB.bigHash = (Byte)(MFB.hashMask >= 0xFFFFFF ? 1 : 0);
2756
+ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder);
2757
+ }
2758
+ else
2759
+ #endif
2760
+ {
2761
+ if (!MatchFinder_Create(&MFB, dictSize, beforeSize,
2762
+ p->numFastBytes, LZMA_MATCH_LEN_MAX + 1 /* 21.03 */
2763
+ , allocBig))
2764
+ return SZ_ERROR_MEM;
2765
+ p->matchFinderObj = &MFB;
2766
+ MatchFinder_CreateVTable(&MFB, &p->matchFinder);
2767
+ }
2768
+
2769
+ return SZ_OK;
2770
+ }
2771
+
2772
+ static void LzmaEnc_Init(CLzmaEnc *p)
2773
+ {
2774
+ unsigned i;
2775
+ p->state = 0;
2776
+ p->reps[0] =
2777
+ p->reps[1] =
2778
+ p->reps[2] =
2779
+ p->reps[3] = 1;
2780
+
2781
+ RangeEnc_Init(&p->rc);
2782
+
2783
+ for (i = 0; i < (1 << kNumAlignBits); i++)
2784
+ p->posAlignEncoder[i] = kProbInitValue;
2785
+
2786
+ for (i = 0; i < kNumStates; i++)
2787
+ {
2788
+ unsigned j;
2789
+ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)
2790
+ {
2791
+ p->isMatch[i][j] = kProbInitValue;
2792
+ p->isRep0Long[i][j] = kProbInitValue;
2793
+ }
2794
+ p->isRep[i] = kProbInitValue;
2795
+ p->isRepG0[i] = kProbInitValue;
2796
+ p->isRepG1[i] = kProbInitValue;
2797
+ p->isRepG2[i] = kProbInitValue;
2798
+ }
2799
+
2800
+ {
2801
+ for (i = 0; i < kNumLenToPosStates; i++)
2802
+ {
2803
+ CLzmaProb *probs = p->posSlotEncoder[i];
2804
+ unsigned j;
2805
+ for (j = 0; j < (1 << kNumPosSlotBits); j++)
2806
+ probs[j] = kProbInitValue;
2807
+ }
2808
+ }
2809
+ {
2810
+ for (i = 0; i < kNumFullDistances; i++)
2811
+ p->posEncoders[i] = kProbInitValue;
2812
+ }
2813
+
2814
+ {
2815
+ const size_t num = (size_t)0x300 << (p->lp + p->lc);
2816
+ size_t k;
2817
+ CLzmaProb *probs = p->litProbs;
2818
+ for (k = 0; k < num; k++)
2819
+ probs[k] = kProbInitValue;
2820
+ }
2821
+
2822
+
2823
+ LenEnc_Init(&p->lenProbs);
2824
+ LenEnc_Init(&p->repLenProbs);
2825
+
2826
+ p->optEnd = 0;
2827
+ p->optCur = 0;
2828
+
2829
+ {
2830
+ for (i = 0; i < kNumOpts; i++)
2831
+ p->opt[i].price = kInfinityPrice;
2832
+ }
2833
+
2834
+ p->additionalOffset = 0;
2835
+
2836
+ p->pbMask = ((unsigned)1 << p->pb) - 1;
2837
+ p->lpMask = ((UInt32)0x100 << p->lp) - ((unsigned)0x100 >> p->lc);
2838
+
2839
+ // p->mf_Failure = False;
2840
+ }
2841
+
2842
+
2843
+ static void LzmaEnc_InitPrices(CLzmaEnc *p)
2844
+ {
2845
+ if (!p->fastMode)
2846
+ {
2847
+ FillDistancesPrices(p);
2848
+ FillAlignPrices(p);
2849
+ }
2850
+
2851
+ p->lenEnc.tableSize =
2852
+ p->repLenEnc.tableSize =
2853
+ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;
2854
+
2855
+ p->repLenEncCounter = REP_LEN_COUNT;
2856
+
2857
+ LenPriceEnc_UpdateTables(&p->lenEnc, (unsigned)1 << p->pb, &p->lenProbs, p->ProbPrices);
2858
+ LenPriceEnc_UpdateTables(&p->repLenEnc, (unsigned)1 << p->pb, &p->repLenProbs, p->ProbPrices);
2859
+ }
2860
+
2861
+ static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
2862
+ {
2863
+ unsigned i;
2864
+ for (i = kEndPosModelIndex / 2; i < kDicLogSizeMax; i++)
2865
+ if (p->dictSize <= ((UInt32)1 << i))
2866
+ break;
2867
+ p->distTableSize = i * 2;
2868
+
2869
+ p->finished = False;
2870
+ p->result = SZ_OK;
2871
+ p->nowPos64 = 0;
2872
+ p->needInit = 1;
2873
+ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig))
2874
+ LzmaEnc_Init(p);
2875
+ LzmaEnc_InitPrices(p);
2876
+ return SZ_OK;
2877
+ }
2878
+
2879
+ static SRes LzmaEnc_Prepare(CLzmaEncHandle p,
2880
+ ISeqOutStreamPtr outStream,
2881
+ ISeqInStreamPtr inStream,
2882
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
2883
+ {
2884
+ // GET_CLzmaEnc_p
2885
+ MatchFinder_SET_STREAM(&MFB, inStream)
2886
+ p->rc.outStream = outStream;
2887
+ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
2888
+ }
2889
+
2890
+ SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle p,
2891
+ ISeqInStreamPtr inStream, UInt32 keepWindowSize,
2892
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
2893
+ {
2894
+ // GET_CLzmaEnc_p
2895
+ MatchFinder_SET_STREAM(&MFB, inStream)
2896
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
2897
+ }
2898
+
2899
+ SRes LzmaEnc_MemPrepare(CLzmaEncHandle p,
2900
+ const Byte *src, SizeT srcLen,
2901
+ UInt32 keepWindowSize,
2902
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
2903
+ {
2904
+ // GET_CLzmaEnc_p
2905
+ MatchFinder_SET_DIRECT_INPUT_BUF(&MFB, src, srcLen)
2906
+ LzmaEnc_SetDataSize(p, srcLen);
2907
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
2908
+ }
2909
+
2910
+ void LzmaEnc_Finish(CLzmaEncHandle p)
2911
+ {
2912
+ #ifndef Z7_ST
2913
+ // GET_CLzmaEnc_p
2914
+ if (p->mtMode)
2915
+ MatchFinderMt_ReleaseStream(&p->matchFinderMt);
2916
+ #else
2917
+ UNUSED_VAR(p)
2918
+ #endif
2919
+ }
2920
+
2921
+
2922
+ typedef struct
2923
+ {
2924
+ ISeqOutStream vt;
2925
+ Byte *data;
2926
+ size_t rem;
2927
+ BoolInt overflow;
2928
+ } CLzmaEnc_SeqOutStreamBuf;
2929
+
2930
+ static size_t SeqOutStreamBuf_Write(ISeqOutStreamPtr pp, const void *data, size_t size)
2931
+ {
2932
+ Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CLzmaEnc_SeqOutStreamBuf)
2933
+ if (p->rem < size)
2934
+ {
2935
+ size = p->rem;
2936
+ p->overflow = True;
2937
+ }
2938
+ if (size != 0)
2939
+ {
2940
+ memcpy(p->data, data, size);
2941
+ p->rem -= size;
2942
+ p->data += size;
2943
+ }
2944
+ return size;
2945
+ }
2946
+
2947
+
2948
+ /*
2949
+ UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle p)
2950
+ {
2951
+ GET_const_CLzmaEnc_p
2952
+ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
2953
+ }
2954
+ */
2955
+
2956
+ const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle p)
2957
+ {
2958
+ // GET_const_CLzmaEnc_p
2959
+ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
2960
+ }
2961
+
2962
+
2963
+ // (desiredPackSize == 0) is not allowed
2964
+ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle p, BoolInt reInit,
2965
+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)
2966
+ {
2967
+ // GET_CLzmaEnc_p
2968
+ UInt64 nowPos64;
2969
+ SRes res;
2970
+ CLzmaEnc_SeqOutStreamBuf outStream;
2971
+
2972
+ outStream.vt.Write = SeqOutStreamBuf_Write;
2973
+ outStream.data = dest;
2974
+ outStream.rem = *destLen;
2975
+ outStream.overflow = False;
2976
+
2977
+ p->writeEndMark = False;
2978
+ p->finished = False;
2979
+ p->result = SZ_OK;
2980
+
2981
+ if (reInit)
2982
+ LzmaEnc_Init(p);
2983
+ LzmaEnc_InitPrices(p);
2984
+ RangeEnc_Init(&p->rc);
2985
+ p->rc.outStream = &outStream.vt;
2986
+ nowPos64 = p->nowPos64;
2987
+
2988
+ res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
2989
+
2990
+ *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
2991
+ *destLen -= outStream.rem;
2992
+ if (outStream.overflow)
2993
+ return SZ_ERROR_OUTPUT_EOF;
2994
+
2995
+ return res;
2996
+ }
2997
+
2998
+
2999
+ Z7_NO_INLINE
3000
+ static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgressPtr progress)
3001
+ {
3002
+ SRes res = SZ_OK;
3003
+
3004
+ #ifndef Z7_ST
3005
+ Byte allocaDummy[0x300];
3006
+ allocaDummy[0] = 0;
3007
+ allocaDummy[1] = allocaDummy[0];
3008
+ #endif
3009
+
3010
+ for (;;)
3011
+ {
3012
+ res = LzmaEnc_CodeOneBlock(p, 0, 0);
3013
+ if (res != SZ_OK || p->finished)
3014
+ break;
3015
+ if (progress)
3016
+ {
3017
+ res = ICompressProgress_Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));
3018
+ if (res != SZ_OK)
3019
+ {
3020
+ res = SZ_ERROR_PROGRESS;
3021
+ break;
3022
+ }
3023
+ }
3024
+ }
3025
+
3026
+ LzmaEnc_Finish((CLzmaEncHandle)(void *)p);
3027
+
3028
+ /*
3029
+ if (res == SZ_OK && !Inline_MatchFinder_IsFinishedOK(&MFB))
3030
+ res = SZ_ERROR_FAIL;
3031
+ }
3032
+ */
3033
+
3034
+ return res;
3035
+ }
3036
+
3037
+
3038
+ SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStreamPtr outStream, ISeqInStreamPtr inStream, ICompressProgressPtr progress,
3039
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
3040
+ {
3041
+ // GET_CLzmaEnc_p
3042
+ RINOK(LzmaEnc_Prepare(p, outStream, inStream, alloc, allocBig))
3043
+ return LzmaEnc_Encode2(p, progress);
3044
+ }
3045
+
3046
+
3047
+ SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *props, SizeT *size)
3048
+ {
3049
+ if (*size < LZMA_PROPS_SIZE)
3050
+ return SZ_ERROR_PARAM;
3051
+ *size = LZMA_PROPS_SIZE;
3052
+ {
3053
+ // GET_CLzmaEnc_p
3054
+ const UInt32 dictSize = p->dictSize;
3055
+ UInt32 v;
3056
+ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);
3057
+
3058
+ // we write aligned dictionary value to properties for lzma decoder
3059
+ if (dictSize >= ((UInt32)1 << 21))
3060
+ {
3061
+ const UInt32 kDictMask = ((UInt32)1 << 20) - 1;
3062
+ v = (dictSize + kDictMask) & ~kDictMask;
3063
+ if (v < dictSize)
3064
+ v = dictSize;
3065
+ }
3066
+ else
3067
+ {
3068
+ unsigned i = 11 * 2;
3069
+ do
3070
+ {
3071
+ v = (UInt32)(2 + (i & 1)) << (i >> 1);
3072
+ i++;
3073
+ }
3074
+ while (v < dictSize);
3075
+ }
3076
+
3077
+ SetUi32(props + 1, v)
3078
+ return SZ_OK;
3079
+ }
3080
+ }
3081
+
3082
+
3083
+ unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p)
3084
+ {
3085
+ // GET_CLzmaEnc_p
3086
+ return (unsigned)p->writeEndMark;
3087
+ }
3088
+
3089
+
3090
+ SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
3091
+ int writeEndMark, ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
3092
+ {
3093
+ SRes res;
3094
+ // GET_CLzmaEnc_p
3095
+
3096
+ CLzmaEnc_SeqOutStreamBuf outStream;
3097
+
3098
+ outStream.vt.Write = SeqOutStreamBuf_Write;
3099
+ outStream.data = dest;
3100
+ outStream.rem = *destLen;
3101
+ outStream.overflow = False;
3102
+
3103
+ p->writeEndMark = writeEndMark;
3104
+ p->rc.outStream = &outStream.vt;
3105
+
3106
+ res = LzmaEnc_MemPrepare(p, src, srcLen, 0, alloc, allocBig);
3107
+
3108
+ if (res == SZ_OK)
3109
+ {
3110
+ res = LzmaEnc_Encode2(p, progress);
3111
+ if (res == SZ_OK && p->nowPos64 != srcLen)
3112
+ res = SZ_ERROR_FAIL;
3113
+ }
3114
+
3115
+ *destLen -= (SizeT)outStream.rem;
3116
+ if (outStream.overflow)
3117
+ return SZ_ERROR_OUTPUT_EOF;
3118
+ return res;
3119
+ }
3120
+
3121
+
3122
+ SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
3123
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
3124
+ ICompressProgressPtr progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
3125
+ {
3126
+ CLzmaEncHandle p = LzmaEnc_Create(alloc);
3127
+ SRes res;
3128
+ if (!p)
3129
+ return SZ_ERROR_MEM;
3130
+
3131
+ res = LzmaEnc_SetProps(p, props);
3132
+ if (res == SZ_OK)
3133
+ {
3134
+ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
3135
+ if (res == SZ_OK)
3136
+ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
3137
+ writeEndMark, progress, alloc, allocBig);
3138
+ }
3139
+
3140
+ LzmaEnc_Destroy(p, alloc, allocBig);
3141
+ return res;
3142
+ }
3143
+
3144
+
3145
+ /*
3146
+ #ifndef Z7_ST
3147
+ void LzmaEnc_GetLzThreads(CLzmaEncHandle p, HANDLE lz_threads[2])
3148
+ {
3149
+ GET_const_CLzmaEnc_p
3150
+ lz_threads[0] = p->matchFinderMt.hashSync.thread;
3151
+ lz_threads[1] = p->matchFinderMt.btSync.thread;
3152
+ }
3153
+ #endif
3154
+ */