electrobun 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (729) hide show
  1. package/.colab.json +1 -0
  2. package/.gitmodules +3 -0
  3. package/README.md +14 -12
  4. package/bun.lockb +0 -0
  5. package/dist/bsdiff +0 -0
  6. package/dist/bspatch +0 -0
  7. package/dist/webview +0 -0
  8. package/docs-old/architecture.md +46 -0
  9. package/documentation/README.md +41 -0
  10. package/documentation/babel.config.js +3 -0
  11. package/documentation/blog/2024-08-20-electrobun.md +22 -0
  12. package/documentation/blog/authors.yml +8 -0
  13. package/documentation/docs/apis/Application Icons.md +9 -0
  14. package/documentation/docs/apis/Bundled Assets.md +95 -0
  15. package/documentation/docs/apis/browser/DraggableRegions.md +36 -0
  16. package/documentation/docs/apis/browser/Electrobun Webview Tag.md +200 -0
  17. package/documentation/docs/apis/browser/Electroview Class.md +158 -0
  18. package/documentation/docs/apis/browser/GlobalProperties.md +11 -0
  19. package/documentation/docs/apis/browser/index.md +25 -0
  20. package/documentation/docs/apis/bun/ApplicationMenu.md +141 -0
  21. package/documentation/docs/apis/bun/BrowserView.md +513 -0
  22. package/documentation/docs/apis/bun/BrowserWindow.md +423 -0
  23. package/documentation/docs/apis/bun/ContextMenu.md +50 -0
  24. package/documentation/docs/apis/bun/Events.md +50 -0
  25. package/documentation/docs/apis/bun/PATHS.md +17 -0
  26. package/documentation/docs/apis/bun/Tray.md +115 -0
  27. package/documentation/docs/apis/bun/Updater.md +74 -0
  28. package/documentation/docs/apis/bun/Utils.md +51 -0
  29. package/documentation/docs/apis/bun/index.md +26 -0
  30. package/documentation/docs/apis/cli/Electrobun.config.md +97 -0
  31. package/documentation/docs/apis/cli/cli args.md +76 -0
  32. package/documentation/docs/guides/Architecture/Events.md +19 -0
  33. package/documentation/docs/guides/Architecture/IPC and Isolation.md +20 -0
  34. package/documentation/docs/guides/Architecture/Overview.md +140 -0
  35. package/documentation/docs/guides/Architecture/Updates.md +7 -0
  36. package/documentation/docs/guides/Architecture/Webview Tag.md +5 -0
  37. package/documentation/docs/guides/Compatability.md +8 -0
  38. package/documentation/docs/guides/Getting Started/Creating UI.md +147 -0
  39. package/documentation/docs/guides/Getting Started/Distributing.md +116 -0
  40. package/documentation/docs/guides/Getting Started/Getting Started.md +7 -0
  41. package/documentation/docs/guides/Getting Started/Hello World.md +93 -0
  42. package/documentation/docs/guides/Getting Started/What is Electrobun.md +39 -0
  43. package/documentation/docs/guides/Guides/Using Tailwind +0 -0
  44. package/documentation/docusaurus.config.ts +153 -0
  45. package/documentation/package-lock.json +14530 -0
  46. package/documentation/package.json +47 -0
  47. package/documentation/sidebars.ts +32 -0
  48. package/documentation/src/components/HomepageFeatures/index.tsx +70 -0
  49. package/documentation/src/components/HomepageFeatures/styles.module.css +11 -0
  50. package/documentation/src/css/custom.css +30 -0
  51. package/documentation/src/pages/index.module.css +23 -0
  52. package/documentation/src/pages/index.tsx +137 -0
  53. package/documentation/static/.nojekyll +0 -0
  54. package/{example/icon.iconset/icon_128x128@2x.png → documentation/static/img/electrobun-logo-256.png} +0 -0
  55. package/documentation/tsconfig.json +7 -0
  56. package/package.json +11 -6
  57. package/src/browser/index.ts +2 -2
  58. package/src/bun/core/BrowserView.ts +14 -1
  59. package/src/cli/build/electrobun +0 -0
  60. package/src/cli/index.ts +3 -1
  61. package/docs/architecture.md +0 -84
  62. package/example/assets/electrobun-logo-32-template.png +0 -0
  63. package/example/buildScript.ts +0 -1
  64. package/example/bun.lockb +0 -0
  65. package/example/electrobun.config +0 -48
  66. package/example/icon.iconset/icon_128x128.png +0 -0
  67. package/example/icon.iconset/icon_16x16.png +0 -0
  68. package/example/icon.iconset/icon_16x16@2x.png +0 -0
  69. package/example/icon.iconset/icon_256x256.png +0 -0
  70. package/example/icon.iconset/icon_256x256@2x.png +0 -0
  71. package/example/icon.iconset/icon_32x32.png +0 -0
  72. package/example/icon.iconset/icon_32x32@2x.png +0 -0
  73. package/example/icon.iconset/icon_512x512.png +0 -0
  74. package/example/icon.iconset/icon_512x512@2x.png +0 -0
  75. package/example/package-lock.json +0 -32
  76. package/example/package.json +0 -11
  77. package/example/src/bun/index.ts +0 -403
  78. package/example/src/mainview/index.css +0 -4
  79. package/example/src/mainview/index.html +0 -13
  80. package/example/src/mainview/index.ts +0 -45
  81. package/example/src/mainview/rpc.ts +0 -36
  82. package/example/src/myextension/preload.ts +0 -15
  83. package/example/src/myextension/rpc.ts +0 -15
  84. package/example/src/webviewtag/index.html +0 -94
  85. package/example/src/webviewtag/index.ts +0 -26
  86. package/src/bsdiff/bsdiff.zig +0 -842
  87. package/src/bsdiff/bspatch.zig +0 -253
  88. package/src/bsdiff/build.zig +0 -73
  89. package/src/bsdiff/zig-out/bin/bsdiff +0 -0
  90. package/src/bsdiff/zig-out/bin/bspatch +0 -0
  91. package/src/bsdiff/zig-out/lib/libzstd.a +0 -0
  92. package/src/bsdiff/zstd/.buckconfig +0 -9
  93. package/src/bsdiff/zstd/.buckversion +0 -1
  94. package/src/bsdiff/zstd/.circleci/config.yml +0 -123
  95. package/src/bsdiff/zstd/.circleci/images/primary/Dockerfile +0 -9
  96. package/src/bsdiff/zstd/.cirrus.yml +0 -10
  97. package/src/bsdiff/zstd/.gitattributes +0 -21
  98. package/src/bsdiff/zstd/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
  99. package/src/bsdiff/zstd/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  100. package/src/bsdiff/zstd/.github/dependabot.yml +0 -6
  101. package/src/bsdiff/zstd/.github/workflows/commit.yml +0 -89
  102. package/src/bsdiff/zstd/.github/workflows/dev-long-tests.yml +0 -297
  103. package/src/bsdiff/zstd/.github/workflows/dev-short-tests.yml +0 -633
  104. package/src/bsdiff/zstd/.github/workflows/nightly.yml +0 -65
  105. package/src/bsdiff/zstd/.github/workflows/publish-release-artifacts.yml +0 -73
  106. package/src/bsdiff/zstd/.github/workflows/scorecards.yml +0 -64
  107. package/src/bsdiff/zstd/.github/workflows/windows-artifacts.yml +0 -58
  108. package/src/bsdiff/zstd/CHANGELOG +0 -837
  109. package/src/bsdiff/zstd/CODE_OF_CONDUCT.md +0 -5
  110. package/src/bsdiff/zstd/CONTRIBUTING.md +0 -489
  111. package/src/bsdiff/zstd/COPYING +0 -339
  112. package/src/bsdiff/zstd/LICENSE +0 -30
  113. package/src/bsdiff/zstd/Makefile +0 -457
  114. package/src/bsdiff/zstd/Package.swift +0 -36
  115. package/src/bsdiff/zstd/README.md +0 -227
  116. package/src/bsdiff/zstd/SECURITY.md +0 -15
  117. package/src/bsdiff/zstd/TESTING.md +0 -43
  118. package/src/bsdiff/zstd/build/README.md +0 -56
  119. package/src/bsdiff/zstd/build/VS2008/fullbench/fullbench.vcproj +0 -549
  120. package/src/bsdiff/zstd/build/VS2008/fuzzer/fuzzer.vcproj +0 -585
  121. package/src/bsdiff/zstd/build/VS2008/zstd/zstd.vcproj +0 -677
  122. package/src/bsdiff/zstd/build/VS2008/zstd.sln +0 -56
  123. package/src/bsdiff/zstd/build/VS2008/zstdlib/zstdlib.vcproj +0 -635
  124. package/src/bsdiff/zstd/build/VS2010/CompileAsCpp.props +0 -8
  125. package/src/bsdiff/zstd/build/VS2010/datagen/datagen.vcxproj +0 -170
  126. package/src/bsdiff/zstd/build/VS2010/fullbench/fullbench.vcxproj +0 -218
  127. package/src/bsdiff/zstd/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -189
  128. package/src/bsdiff/zstd/build/VS2010/fuzzer/fuzzer.vcxproj +0 -223
  129. package/src/bsdiff/zstd/build/VS2010/libzstd/libzstd.vcxproj +0 -242
  130. package/src/bsdiff/zstd/build/VS2010/libzstd-dll/libzstd-dll.rc +0 -51
  131. package/src/bsdiff/zstd/build/VS2010/libzstd-dll/libzstd-dll.vcxproj +0 -249
  132. package/src/bsdiff/zstd/build/VS2010/zstd/zstd.rc +0 -51
  133. package/src/bsdiff/zstd/build/VS2010/zstd/zstd.vcxproj +0 -265
  134. package/src/bsdiff/zstd/build/VS2010/zstd.sln +0 -89
  135. package/src/bsdiff/zstd/build/VS_scripts/README.md +0 -64
  136. package/src/bsdiff/zstd/build/VS_scripts/build.VS2010.cmd +0 -7
  137. package/src/bsdiff/zstd/build/VS_scripts/build.VS2012.cmd +0 -6
  138. package/src/bsdiff/zstd/build/VS_scripts/build.VS2013.cmd +0 -7
  139. package/src/bsdiff/zstd/build/VS_scripts/build.VS2015.cmd +0 -7
  140. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017.cmd +0 -7
  141. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Community.cmd +0 -7
  142. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Enterprise.cmd +0 -7
  143. package/src/bsdiff/zstd/build/VS_scripts/build.VS2017Professional.cmd +0 -7
  144. package/src/bsdiff/zstd/build/VS_scripts/build.generic.cmd +0 -72
  145. package/src/bsdiff/zstd/build/cmake/CMakeLists.txt +0 -216
  146. package/src/bsdiff/zstd/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +0 -121
  147. package/src/bsdiff/zstd/build/cmake/CMakeModules/FindLibLZ4.cmake +0 -49
  148. package/src/bsdiff/zstd/build/cmake/CMakeModules/GetZstdLibraryVersion.cmake +0 -10
  149. package/src/bsdiff/zstd/build/cmake/CMakeModules/JoinPaths.cmake +0 -23
  150. package/src/bsdiff/zstd/build/cmake/README.md +0 -136
  151. package/src/bsdiff/zstd/build/cmake/contrib/CMakeLists.txt +0 -13
  152. package/src/bsdiff/zstd/build/cmake/contrib/gen_html/CMakeLists.txt +0 -30
  153. package/src/bsdiff/zstd/build/cmake/contrib/pzstd/CMakeLists.txt +0 -39
  154. package/src/bsdiff/zstd/build/cmake/lib/CMakeLists.txt +0 -253
  155. package/src/bsdiff/zstd/build/cmake/lib/cmake_uninstall.cmake.in +0 -22
  156. package/src/bsdiff/zstd/build/cmake/programs/CMakeLists.txt +0 -144
  157. package/src/bsdiff/zstd/build/cmake/tests/CMakeLists.txt +0 -118
  158. package/src/bsdiff/zstd/build/cmake/zstdConfig.cmake.in +0 -10
  159. package/src/bsdiff/zstd/build/meson/GetZstdLibraryVersion.py +0 -39
  160. package/src/bsdiff/zstd/build/meson/InstallSymlink.py +0 -55
  161. package/src/bsdiff/zstd/build/meson/README.md +0 -38
  162. package/src/bsdiff/zstd/build/meson/contrib/gen_html/meson.build +0 -30
  163. package/src/bsdiff/zstd/build/meson/contrib/meson.build +0 -12
  164. package/src/bsdiff/zstd/build/meson/contrib/pzstd/meson.build +0 -25
  165. package/src/bsdiff/zstd/build/meson/lib/meson.build +0 -167
  166. package/src/bsdiff/zstd/build/meson/meson.build +0 -145
  167. package/src/bsdiff/zstd/build/meson/meson_options.txt +0 -36
  168. package/src/bsdiff/zstd/build/meson/programs/meson.build +0 -124
  169. package/src/bsdiff/zstd/build/meson/tests/meson.build +0 -217
  170. package/src/bsdiff/zstd/build/meson/tests/valgrindTest.py +0 -90
  171. package/src/bsdiff/zstd/build/single_file_libs/README.md +0 -33
  172. package/src/bsdiff/zstd/build/single_file_libs/build_decoder_test.sh +0 -91
  173. package/src/bsdiff/zstd/build/single_file_libs/build_library_test.sh +0 -97
  174. package/src/bsdiff/zstd/build/single_file_libs/combine.py +0 -234
  175. package/src/bsdiff/zstd/build/single_file_libs/combine.sh +0 -249
  176. package/src/bsdiff/zstd/build/single_file_libs/create_single_file_decoder.sh +0 -19
  177. package/src/bsdiff/zstd/build/single_file_libs/create_single_file_library.sh +0 -19
  178. package/src/bsdiff/zstd/build/single_file_libs/examples/README.md +0 -11
  179. package/src/bsdiff/zstd/build/single_file_libs/examples/emscripten.c +0 -340
  180. package/src/bsdiff/zstd/build/single_file_libs/examples/roundtrip.c +0 -83
  181. package/src/bsdiff/zstd/build/single_file_libs/examples/shell.html +0 -31
  182. package/src/bsdiff/zstd/build/single_file_libs/examples/simple.c +0 -75
  183. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard-dxt1.inl +0 -2731
  184. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard-zstd.inl +0 -261
  185. package/src/bsdiff/zstd/build/single_file_libs/examples/testcard.png +0 -0
  186. package/src/bsdiff/zstd/build/single_file_libs/zstd-in.c +0 -90
  187. package/src/bsdiff/zstd/build/single_file_libs/zstddeclib-in.c +0 -62
  188. package/src/bsdiff/zstd/contrib/VS2005/README.md +0 -3
  189. package/src/bsdiff/zstd/contrib/VS2005/fullbench/fullbench.vcproj +0 -440
  190. package/src/bsdiff/zstd/contrib/VS2005/fuzzer/fuzzer.vcproj +0 -488
  191. package/src/bsdiff/zstd/contrib/VS2005/zstd/zstd.vcproj +0 -552
  192. package/src/bsdiff/zstd/contrib/VS2005/zstd.sln +0 -55
  193. package/src/bsdiff/zstd/contrib/VS2005/zstdlib/zstdlib.vcproj +0 -546
  194. package/src/bsdiff/zstd/contrib/cleanTabs +0 -2
  195. package/src/bsdiff/zstd/contrib/diagnose_corruption/Makefile +0 -35
  196. package/src/bsdiff/zstd/contrib/diagnose_corruption/check_flipped_bits.c +0 -400
  197. package/src/bsdiff/zstd/contrib/docker/Dockerfile +0 -20
  198. package/src/bsdiff/zstd/contrib/docker/README.md +0 -20
  199. package/src/bsdiff/zstd/contrib/externalSequenceProducer/Makefile +0 -40
  200. package/src/bsdiff/zstd/contrib/externalSequenceProducer/README.md +0 -14
  201. package/src/bsdiff/zstd/contrib/externalSequenceProducer/main.c +0 -107
  202. package/src/bsdiff/zstd/contrib/externalSequenceProducer/sequence_producer.c +0 -80
  203. package/src/bsdiff/zstd/contrib/externalSequenceProducer/sequence_producer.h +0 -26
  204. package/src/bsdiff/zstd/contrib/freestanding_lib/freestanding.py +0 -774
  205. package/src/bsdiff/zstd/contrib/gen_html/Makefile +0 -51
  206. package/src/bsdiff/zstd/contrib/gen_html/README.md +0 -31
  207. package/src/bsdiff/zstd/contrib/gen_html/gen-zstd-manual.sh +0 -9
  208. package/src/bsdiff/zstd/contrib/gen_html/gen_html.cpp +0 -224
  209. package/src/bsdiff/zstd/contrib/largeNbDicts/Makefile +0 -58
  210. package/src/bsdiff/zstd/contrib/largeNbDicts/README.md +0 -33
  211. package/src/bsdiff/zstd/contrib/largeNbDicts/largeNbDicts.c +0 -1085
  212. package/src/bsdiff/zstd/contrib/linux-kernel/Makefile +0 -108
  213. package/src/bsdiff/zstd/contrib/linux-kernel/README.md +0 -14
  214. package/src/bsdiff/zstd/contrib/linux-kernel/btrfs-benchmark.sh +0 -104
  215. package/src/bsdiff/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh +0 -99
  216. package/src/bsdiff/zstd/contrib/linux-kernel/decompress_sources.h +0 -34
  217. package/src/bsdiff/zstd/contrib/linux-kernel/linux.mk +0 -43
  218. package/src/bsdiff/zstd/contrib/linux-kernel/linux_zstd.h +0 -447
  219. package/src/bsdiff/zstd/contrib/linux-kernel/mem.h +0 -262
  220. package/src/bsdiff/zstd/contrib/linux-kernel/squashfs-benchmark.sh +0 -39
  221. package/src/bsdiff/zstd/contrib/linux-kernel/test/Makefile +0 -49
  222. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/asm/unaligned.h +0 -187
  223. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/compiler.h +0 -23
  224. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/errno.h +0 -15
  225. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/kernel.h +0 -19
  226. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/limits.h +0 -15
  227. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/math64.h +0 -15
  228. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/module.h +0 -20
  229. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/printk.h +0 -15
  230. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/stddef.h +0 -15
  231. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/swab.h +0 -16
  232. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/types.h +0 -16
  233. package/src/bsdiff/zstd/contrib/linux-kernel/test/include/linux/xxhash.h +0 -745
  234. package/src/bsdiff/zstd/contrib/linux-kernel/test/macro-test.sh +0 -44
  235. package/src/bsdiff/zstd/contrib/linux-kernel/test/static_test.c +0 -52
  236. package/src/bsdiff/zstd/contrib/linux-kernel/test/test.c +0 -229
  237. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_common_module.c +0 -29
  238. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_compress_module.c +0 -164
  239. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_decompress_module.c +0 -105
  240. package/src/bsdiff/zstd/contrib/linux-kernel/zstd_deps.h +0 -121
  241. package/src/bsdiff/zstd/contrib/match_finders/README.md +0 -42
  242. package/src/bsdiff/zstd/contrib/match_finders/zstd_edist.c +0 -558
  243. package/src/bsdiff/zstd/contrib/match_finders/zstd_edist.h +0 -70
  244. package/src/bsdiff/zstd/contrib/premake/premake4.lua +0 -6
  245. package/src/bsdiff/zstd/contrib/premake/zstd.lua +0 -80
  246. package/src/bsdiff/zstd/contrib/pzstd/BUCK +0 -72
  247. package/src/bsdiff/zstd/contrib/pzstd/ErrorHolder.h +0 -54
  248. package/src/bsdiff/zstd/contrib/pzstd/Logging.h +0 -72
  249. package/src/bsdiff/zstd/contrib/pzstd/Makefile +0 -265
  250. package/src/bsdiff/zstd/contrib/pzstd/Options.cpp +0 -424
  251. package/src/bsdiff/zstd/contrib/pzstd/Options.h +0 -71
  252. package/src/bsdiff/zstd/contrib/pzstd/Pzstd.cpp +0 -618
  253. package/src/bsdiff/zstd/contrib/pzstd/Pzstd.h +0 -153
  254. package/src/bsdiff/zstd/contrib/pzstd/README.md +0 -56
  255. package/src/bsdiff/zstd/contrib/pzstd/SkippableFrame.cpp +0 -30
  256. package/src/bsdiff/zstd/contrib/pzstd/SkippableFrame.h +0 -64
  257. package/src/bsdiff/zstd/contrib/pzstd/images/Cspeed.png +0 -0
  258. package/src/bsdiff/zstd/contrib/pzstd/images/Dspeed.png +0 -0
  259. package/src/bsdiff/zstd/contrib/pzstd/main.cpp +0 -27
  260. package/src/bsdiff/zstd/contrib/pzstd/test/BUCK +0 -37
  261. package/src/bsdiff/zstd/contrib/pzstd/test/OptionsTest.cpp +0 -536
  262. package/src/bsdiff/zstd/contrib/pzstd/test/PzstdTest.cpp +0 -149
  263. package/src/bsdiff/zstd/contrib/pzstd/test/RoundTrip.h +0 -86
  264. package/src/bsdiff/zstd/contrib/pzstd/test/RoundTripTest.cpp +0 -86
  265. package/src/bsdiff/zstd/contrib/pzstd/utils/BUCK +0 -75
  266. package/src/bsdiff/zstd/contrib/pzstd/utils/Buffer.h +0 -99
  267. package/src/bsdiff/zstd/contrib/pzstd/utils/FileSystem.h +0 -96
  268. package/src/bsdiff/zstd/contrib/pzstd/utils/Likely.h +0 -28
  269. package/src/bsdiff/zstd/contrib/pzstd/utils/Portability.h +0 -16
  270. package/src/bsdiff/zstd/contrib/pzstd/utils/Range.h +0 -133
  271. package/src/bsdiff/zstd/contrib/pzstd/utils/ResourcePool.h +0 -96
  272. package/src/bsdiff/zstd/contrib/pzstd/utils/ScopeGuard.h +0 -50
  273. package/src/bsdiff/zstd/contrib/pzstd/utils/ThreadPool.h +0 -58
  274. package/src/bsdiff/zstd/contrib/pzstd/utils/WorkQueue.h +0 -181
  275. package/src/bsdiff/zstd/contrib/pzstd/utils/test/BUCK +0 -35
  276. package/src/bsdiff/zstd/contrib/pzstd/utils/test/BufferTest.cpp +0 -89
  277. package/src/bsdiff/zstd/contrib/pzstd/utils/test/RangeTest.cpp +0 -82
  278. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp +0 -72
  279. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp +0 -28
  280. package/src/bsdiff/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp +0 -71
  281. package/src/bsdiff/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp +0 -282
  282. package/src/bsdiff/zstd/contrib/recovery/Makefile +0 -35
  283. package/src/bsdiff/zstd/contrib/recovery/recover_directory.c +0 -152
  284. package/src/bsdiff/zstd/contrib/seekable_format/README.md +0 -42
  285. package/src/bsdiff/zstd/contrib/seekable_format/examples/Makefile +0 -53
  286. package/src/bsdiff/zstd/contrib/seekable_format/examples/parallel_compression.c +0 -214
  287. package/src/bsdiff/zstd/contrib/seekable_format/examples/parallel_processing.c +0 -194
  288. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_compression.c +0 -136
  289. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_decompression.c +0 -141
  290. package/src/bsdiff/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c +0 -147
  291. package/src/bsdiff/zstd/contrib/seekable_format/tests/Makefile +0 -38
  292. package/src/bsdiff/zstd/contrib/seekable_format/tests/seekable_tests.c +0 -363
  293. package/src/bsdiff/zstd/contrib/seekable_format/zstd_seekable.h +0 -226
  294. package/src/bsdiff/zstd/contrib/seekable_format/zstd_seekable_compression_format.md +0 -116
  295. package/src/bsdiff/zstd/contrib/seekable_format/zstdseek_compress.c +0 -365
  296. package/src/bsdiff/zstd/contrib/seekable_format/zstdseek_decompress.c +0 -595
  297. package/src/bsdiff/zstd/contrib/seqBench/Makefile +0 -58
  298. package/src/bsdiff/zstd/contrib/seqBench/seqBench.c +0 -53
  299. package/src/bsdiff/zstd/contrib/snap/snapcraft.yaml +0 -28
  300. package/src/bsdiff/zstd/doc/README.md +0 -26
  301. package/src/bsdiff/zstd/doc/decompressor_errata.md +0 -148
  302. package/src/bsdiff/zstd/doc/decompressor_permissive.md +0 -60
  303. package/src/bsdiff/zstd/doc/educational_decoder/Makefile +0 -62
  304. package/src/bsdiff/zstd/doc/educational_decoder/README.md +0 -36
  305. package/src/bsdiff/zstd/doc/educational_decoder/harness.c +0 -119
  306. package/src/bsdiff/zstd/doc/educational_decoder/zstd_decompress.c +0 -2323
  307. package/src/bsdiff/zstd/doc/educational_decoder/zstd_decompress.h +0 -61
  308. package/src/bsdiff/zstd/doc/images/CSpeed2.png +0 -0
  309. package/src/bsdiff/zstd/doc/images/DCspeed5.png +0 -0
  310. package/src/bsdiff/zstd/doc/images/DSpeed3.png +0 -0
  311. package/src/bsdiff/zstd/doc/images/cdict_v136.png +0 -0
  312. package/src/bsdiff/zstd/doc/images/dict-cr.png +0 -0
  313. package/src/bsdiff/zstd/doc/images/dict-cs.png +0 -0
  314. package/src/bsdiff/zstd/doc/images/dict-ds.png +0 -0
  315. package/src/bsdiff/zstd/doc/images/zstd_cdict_v1_3_5.png +0 -0
  316. package/src/bsdiff/zstd/doc/images/zstd_logo86.png +0 -0
  317. package/src/bsdiff/zstd/doc/zstd_compression_format.md +0 -1737
  318. package/src/bsdiff/zstd/doc/zstd_manual.html +0 -2170
  319. package/src/bsdiff/zstd/examples/Makefile +0 -93
  320. package/src/bsdiff/zstd/examples/README.md +0 -46
  321. package/src/bsdiff/zstd/examples/common.h +0 -246
  322. package/src/bsdiff/zstd/examples/dictionary_compression.c +0 -107
  323. package/src/bsdiff/zstd/examples/dictionary_decompression.c +0 -99
  324. package/src/bsdiff/zstd/examples/multiple_simple_compression.c +0 -116
  325. package/src/bsdiff/zstd/examples/multiple_streaming_compression.c +0 -133
  326. package/src/bsdiff/zstd/examples/simple_compression.c +0 -68
  327. package/src/bsdiff/zstd/examples/simple_decompression.c +0 -65
  328. package/src/bsdiff/zstd/examples/streaming_compression.c +0 -146
  329. package/src/bsdiff/zstd/examples/streaming_compression_thread_pool.c +0 -180
  330. package/src/bsdiff/zstd/examples/streaming_decompression.c +0 -100
  331. package/src/bsdiff/zstd/examples/streaming_memory_usage.c +0 -137
  332. package/src/bsdiff/zstd/lib/BUCK +0 -232
  333. package/src/bsdiff/zstd/lib/Makefile +0 -369
  334. package/src/bsdiff/zstd/lib/README.md +0 -237
  335. package/src/bsdiff/zstd/lib/common/allocations.h +0 -55
  336. package/src/bsdiff/zstd/lib/common/bits.h +0 -200
  337. package/src/bsdiff/zstd/lib/common/bitstream.h +0 -457
  338. package/src/bsdiff/zstd/lib/common/compiler.h +0 -450
  339. package/src/bsdiff/zstd/lib/common/cpu.h +0 -249
  340. package/src/bsdiff/zstd/lib/common/debug.c +0 -30
  341. package/src/bsdiff/zstd/lib/common/debug.h +0 -116
  342. package/src/bsdiff/zstd/lib/common/entropy_common.c +0 -340
  343. package/src/bsdiff/zstd/lib/common/error_private.c +0 -63
  344. package/src/bsdiff/zstd/lib/common/error_private.h +0 -168
  345. package/src/bsdiff/zstd/lib/common/fse.h +0 -640
  346. package/src/bsdiff/zstd/lib/common/fse_decompress.c +0 -313
  347. package/src/bsdiff/zstd/lib/common/huf.h +0 -286
  348. package/src/bsdiff/zstd/lib/common/mem.h +0 -426
  349. package/src/bsdiff/zstd/lib/common/pool.c +0 -371
  350. package/src/bsdiff/zstd/lib/common/pool.h +0 -90
  351. package/src/bsdiff/zstd/lib/common/portability_macros.h +0 -158
  352. package/src/bsdiff/zstd/lib/common/threading.c +0 -182
  353. package/src/bsdiff/zstd/lib/common/threading.h +0 -150
  354. package/src/bsdiff/zstd/lib/common/xxhash.c +0 -18
  355. package/src/bsdiff/zstd/lib/common/xxhash.h +0 -7020
  356. package/src/bsdiff/zstd/lib/common/zstd_common.c +0 -48
  357. package/src/bsdiff/zstd/lib/common/zstd_deps.h +0 -111
  358. package/src/bsdiff/zstd/lib/common/zstd_internal.h +0 -392
  359. package/src/bsdiff/zstd/lib/common/zstd_trace.h +0 -163
  360. package/src/bsdiff/zstd/lib/compress/clevels.h +0 -134
  361. package/src/bsdiff/zstd/lib/compress/fse_compress.c +0 -625
  362. package/src/bsdiff/zstd/lib/compress/hist.c +0 -181
  363. package/src/bsdiff/zstd/lib/compress/hist.h +0 -75
  364. package/src/bsdiff/zstd/lib/compress/huf_compress.c +0 -1464
  365. package/src/bsdiff/zstd/lib/compress/zstd_compress.c +0 -7153
  366. package/src/bsdiff/zstd/lib/compress/zstd_compress_internal.h +0 -1534
  367. package/src/bsdiff/zstd/lib/compress/zstd_compress_literals.c +0 -235
  368. package/src/bsdiff/zstd/lib/compress/zstd_compress_literals.h +0 -39
  369. package/src/bsdiff/zstd/lib/compress/zstd_compress_sequences.c +0 -442
  370. package/src/bsdiff/zstd/lib/compress/zstd_compress_sequences.h +0 -54
  371. package/src/bsdiff/zstd/lib/compress/zstd_compress_superblock.c +0 -688
  372. package/src/bsdiff/zstd/lib/compress/zstd_compress_superblock.h +0 -32
  373. package/src/bsdiff/zstd/lib/compress/zstd_cwksp.h +0 -748
  374. package/src/bsdiff/zstd/lib/compress/zstd_double_fast.c +0 -770
  375. package/src/bsdiff/zstd/lib/compress/zstd_double_fast.h +0 -50
  376. package/src/bsdiff/zstd/lib/compress/zstd_fast.c +0 -968
  377. package/src/bsdiff/zstd/lib/compress/zstd_fast.h +0 -38
  378. package/src/bsdiff/zstd/lib/compress/zstd_lazy.c +0 -2199
  379. package/src/bsdiff/zstd/lib/compress/zstd_lazy.h +0 -202
  380. package/src/bsdiff/zstd/lib/compress/zstd_ldm.c +0 -730
  381. package/src/bsdiff/zstd/lib/compress/zstd_ldm.h +0 -117
  382. package/src/bsdiff/zstd/lib/compress/zstd_ldm_geartab.h +0 -106
  383. package/src/bsdiff/zstd/lib/compress/zstd_opt.c +0 -1576
  384. package/src/bsdiff/zstd/lib/compress/zstd_opt.h +0 -80
  385. package/src/bsdiff/zstd/lib/compress/zstdmt_compress.c +0 -1882
  386. package/src/bsdiff/zstd/lib/compress/zstdmt_compress.h +0 -113
  387. package/src/bsdiff/zstd/lib/decompress/huf_decompress.c +0 -1944
  388. package/src/bsdiff/zstd/lib/decompress/huf_decompress_amd64.S +0 -595
  389. package/src/bsdiff/zstd/lib/decompress/zstd_ddict.c +0 -244
  390. package/src/bsdiff/zstd/lib/decompress/zstd_ddict.h +0 -44
  391. package/src/bsdiff/zstd/lib/decompress/zstd_decompress.c +0 -2407
  392. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_block.c +0 -2215
  393. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_block.h +0 -73
  394. package/src/bsdiff/zstd/lib/decompress/zstd_decompress_internal.h +0 -240
  395. package/src/bsdiff/zstd/lib/deprecated/zbuff.h +0 -214
  396. package/src/bsdiff/zstd/lib/deprecated/zbuff_common.c +0 -26
  397. package/src/bsdiff/zstd/lib/deprecated/zbuff_compress.c +0 -167
  398. package/src/bsdiff/zstd/lib/deprecated/zbuff_decompress.c +0 -77
  399. package/src/bsdiff/zstd/lib/dictBuilder/cover.c +0 -1261
  400. package/src/bsdiff/zstd/lib/dictBuilder/cover.h +0 -152
  401. package/src/bsdiff/zstd/lib/dictBuilder/divsufsort.c +0 -1913
  402. package/src/bsdiff/zstd/lib/dictBuilder/divsufsort.h +0 -67
  403. package/src/bsdiff/zstd/lib/dictBuilder/fastcover.c +0 -766
  404. package/src/bsdiff/zstd/lib/dictBuilder/zdict.c +0 -1133
  405. package/src/bsdiff/zstd/lib/dll/example/Makefile +0 -48
  406. package/src/bsdiff/zstd/lib/dll/example/README.md +0 -63
  407. package/src/bsdiff/zstd/lib/dll/example/build_package.bat +0 -20
  408. package/src/bsdiff/zstd/lib/dll/example/fullbench-dll.sln +0 -25
  409. package/src/bsdiff/zstd/lib/dll/example/fullbench-dll.vcxproj +0 -181
  410. package/src/bsdiff/zstd/lib/legacy/zstd_legacy.h +0 -452
  411. package/src/bsdiff/zstd/lib/legacy/zstd_v01.c +0 -2127
  412. package/src/bsdiff/zstd/lib/legacy/zstd_v01.h +0 -94
  413. package/src/bsdiff/zstd/lib/legacy/zstd_v02.c +0 -3465
  414. package/src/bsdiff/zstd/lib/legacy/zstd_v02.h +0 -93
  415. package/src/bsdiff/zstd/lib/legacy/zstd_v03.c +0 -3105
  416. package/src/bsdiff/zstd/lib/legacy/zstd_v03.h +0 -93
  417. package/src/bsdiff/zstd/lib/legacy/zstd_v04.c +0 -3598
  418. package/src/bsdiff/zstd/lib/legacy/zstd_v04.h +0 -142
  419. package/src/bsdiff/zstd/lib/legacy/zstd_v05.c +0 -4005
  420. package/src/bsdiff/zstd/lib/legacy/zstd_v05.h +0 -162
  421. package/src/bsdiff/zstd/lib/legacy/zstd_v06.c +0 -4106
  422. package/src/bsdiff/zstd/lib/legacy/zstd_v06.h +0 -172
  423. package/src/bsdiff/zstd/lib/legacy/zstd_v07.c +0 -4490
  424. package/src/bsdiff/zstd/lib/legacy/zstd_v07.h +0 -187
  425. package/src/bsdiff/zstd/lib/libzstd.mk +0 -237
  426. package/src/bsdiff/zstd/lib/libzstd.pc.in +0 -16
  427. package/src/bsdiff/zstd/lib/module.modulemap +0 -35
  428. package/src/bsdiff/zstd/lib/zdict.h +0 -474
  429. package/src/bsdiff/zstd/lib/zstd.h +0 -3089
  430. package/src/bsdiff/zstd/lib/zstd_errors.h +0 -114
  431. package/src/bsdiff/zstd/programs/BUCK +0 -44
  432. package/src/bsdiff/zstd/programs/Makefile +0 -445
  433. package/src/bsdiff/zstd/programs/README.md +0 -302
  434. package/src/bsdiff/zstd/programs/benchfn.c +0 -256
  435. package/src/bsdiff/zstd/programs/benchfn.h +0 -183
  436. package/src/bsdiff/zstd/programs/benchzstd.c +0 -1264
  437. package/src/bsdiff/zstd/programs/benchzstd.h +0 -198
  438. package/src/bsdiff/zstd/programs/datagen.c +0 -186
  439. package/src/bsdiff/zstd/programs/datagen.h +0 -30
  440. package/src/bsdiff/zstd/programs/dibio.c +0 -440
  441. package/src/bsdiff/zstd/programs/dibio.h +0 -39
  442. package/src/bsdiff/zstd/programs/fileio.c +0 -3470
  443. package/src/bsdiff/zstd/programs/fileio.h +0 -181
  444. package/src/bsdiff/zstd/programs/fileio_asyncio.c +0 -663
  445. package/src/bsdiff/zstd/programs/fileio_asyncio.h +0 -203
  446. package/src/bsdiff/zstd/programs/fileio_common.h +0 -125
  447. package/src/bsdiff/zstd/programs/fileio_types.h +0 -86
  448. package/src/bsdiff/zstd/programs/lorem.c +0 -285
  449. package/src/bsdiff/zstd/programs/lorem.h +0 -32
  450. package/src/bsdiff/zstd/programs/platform.h +0 -218
  451. package/src/bsdiff/zstd/programs/timefn.c +0 -168
  452. package/src/bsdiff/zstd/programs/timefn.h +0 -70
  453. package/src/bsdiff/zstd/programs/util.c +0 -1652
  454. package/src/bsdiff/zstd/programs/util.h +0 -359
  455. package/src/bsdiff/zstd/programs/windres/verrsrc.h +0 -17
  456. package/src/bsdiff/zstd/programs/windres/zstd.rc +0 -51
  457. package/src/bsdiff/zstd/programs/windres/zstd32.res +0 -0
  458. package/src/bsdiff/zstd/programs/windres/zstd64.res +0 -0
  459. package/src/bsdiff/zstd/programs/zstd.1 +0 -566
  460. package/src/bsdiff/zstd/programs/zstd.1.md +0 -695
  461. package/src/bsdiff/zstd/programs/zstdcli.c +0 -1625
  462. package/src/bsdiff/zstd/programs/zstdcli_trace.c +0 -172
  463. package/src/bsdiff/zstd/programs/zstdcli_trace.h +0 -24
  464. package/src/bsdiff/zstd/programs/zstdgrep +0 -134
  465. package/src/bsdiff/zstd/programs/zstdgrep.1 +0 -26
  466. package/src/bsdiff/zstd/programs/zstdgrep.1.md +0 -30
  467. package/src/bsdiff/zstd/programs/zstdless +0 -8
  468. package/src/bsdiff/zstd/programs/zstdless.1 +0 -14
  469. package/src/bsdiff/zstd/programs/zstdless.1.md +0 -16
  470. package/src/bsdiff/zstd/tests/DEPRECATED-test-zstd-speed.py +0 -378
  471. package/src/bsdiff/zstd/tests/Makefile +0 -477
  472. package/src/bsdiff/zstd/tests/README.md +0 -184
  473. package/src/bsdiff/zstd/tests/automated_benchmarking.py +0 -326
  474. package/src/bsdiff/zstd/tests/bigdict.c +0 -128
  475. package/src/bsdiff/zstd/tests/checkTag.c +0 -65
  476. package/src/bsdiff/zstd/tests/check_size.py +0 -31
  477. package/src/bsdiff/zstd/tests/cli-tests/README.md +0 -258
  478. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh +0 -10
  479. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh.exit +0 -1
  480. package/src/bsdiff/zstd/tests/cli-tests/basic/args.sh.stderr.glob +0 -28
  481. package/src/bsdiff/zstd/tests/cli-tests/basic/help.sh +0 -10
  482. package/src/bsdiff/zstd/tests/cli-tests/basic/help.sh.stdout.glob +0 -34
  483. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh +0 -40
  484. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact +0 -13
  485. package/src/bsdiff/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact +0 -13
  486. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh +0 -7
  487. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact +0 -2
  488. package/src/bsdiff/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact +0 -2
  489. package/src/bsdiff/zstd/tests/cli-tests/basic/version.sh +0 -6
  490. package/src/bsdiff/zstd/tests/cli-tests/basic/version.sh.stdout.glob +0 -2
  491. package/src/bsdiff/zstd/tests/cli-tests/bin/cmp_size +0 -44
  492. package/src/bsdiff/zstd/tests/cli-tests/bin/datagen +0 -3
  493. package/src/bsdiff/zstd/tests/cli-tests/bin/die +0 -4
  494. package/src/bsdiff/zstd/tests/cli-tests/bin/println +0 -2
  495. package/src/bsdiff/zstd/tests/cli-tests/bin/zstd +0 -9
  496. package/src/bsdiff/zstd/tests/cli-tests/bin/zstdgrep +0 -2
  497. package/src/bsdiff/zstd/tests/cli-tests/bin/zstdless +0 -2
  498. package/src/bsdiff/zstd/tests/cli-tests/cltools/setup +0 -6
  499. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh +0 -8
  500. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.exit +0 -1
  501. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.stderr.exact +0 -1
  502. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdgrep.sh.stdout.glob +0 -4
  503. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh +0 -10
  504. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh.stderr.exact +0 -2
  505. package/src/bsdiff/zstd/tests/cli-tests/cltools/zstdless.sh.stdout.glob +0 -5
  506. package/src/bsdiff/zstd/tests/cli-tests/common/format.sh +0 -19
  507. package/src/bsdiff/zstd/tests/cli-tests/common/mtime.sh +0 -13
  508. package/src/bsdiff/zstd/tests/cli-tests/common/permissions.sh +0 -18
  509. package/src/bsdiff/zstd/tests/cli-tests/common/platform.sh +0 -37
  510. package/src/bsdiff/zstd/tests/cli-tests/compression/adapt.sh +0 -14
  511. package/src/bsdiff/zstd/tests/cli-tests/compression/basic.sh +0 -36
  512. package/src/bsdiff/zstd/tests/cli-tests/compression/compress-literals.sh +0 -10
  513. package/src/bsdiff/zstd/tests/cli-tests/compression/format.sh +0 -16
  514. package/src/bsdiff/zstd/tests/cli-tests/compression/golden.sh +0 -16
  515. package/src/bsdiff/zstd/tests/cli-tests/compression/gzip-compat.sh +0 -17
  516. package/src/bsdiff/zstd/tests/cli-tests/compression/levels.sh +0 -62
  517. package/src/bsdiff/zstd/tests/cli-tests/compression/levels.sh.stderr.exact +0 -69
  518. package/src/bsdiff/zstd/tests/cli-tests/compression/long-distance-matcher.sh +0 -7
  519. package/src/bsdiff/zstd/tests/cli-tests/compression/multi-threaded.sh +0 -15
  520. package/src/bsdiff/zstd/tests/cli-tests/compression/multi-threaded.sh.stderr.exact +0 -11
  521. package/src/bsdiff/zstd/tests/cli-tests/compression/multiple-files.sh +0 -21
  522. package/src/bsdiff/zstd/tests/cli-tests/compression/multiple-files.sh.stdout.exact +0 -12
  523. package/src/bsdiff/zstd/tests/cli-tests/compression/row-match-finder.sh +0 -7
  524. package/src/bsdiff/zstd/tests/cli-tests/compression/setup +0 -7
  525. package/src/bsdiff/zstd/tests/cli-tests/compression/stream-size.sh +0 -7
  526. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh +0 -11
  527. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh.stderr.glob +0 -5
  528. package/src/bsdiff/zstd/tests/cli-tests/compression/verbose-wlog.sh.stdout.glob +0 -5
  529. package/src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh +0 -9
  530. package/src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh.stdout.glob +0 -3
  531. package/src/bsdiff/zstd/tests/cli-tests/decompression/detectErrors.sh +0 -11
  532. package/src/bsdiff/zstd/tests/cli-tests/decompression/golden.sh +0 -7
  533. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh +0 -57
  534. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh.stderr.exact +0 -11
  535. package/src/bsdiff/zstd/tests/cli-tests/decompression/pass-through.sh.stdout.exact +0 -25
  536. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/empty-input.sh +0 -9
  537. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/empty-input.sh.stderr.exact +0 -1
  538. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh +0 -3
  539. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh.exit +0 -1
  540. package/src/bsdiff/zstd/tests/cli-tests/dict-builder/no-inputs.sh.stderr.exact +0 -5
  541. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh +0 -29
  542. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh.stderr.exact +0 -7
  543. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/golden.sh +0 -9
  544. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/setup +0 -6
  545. package/src/bsdiff/zstd/tests/cli-tests/dictionaries/setup_once +0 -24
  546. package/src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh +0 -49
  547. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh +0 -12
  548. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh.stderr.exact +0 -26
  549. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh +0 -9
  550. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.exact +0 -42
  551. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh +0 -8
  552. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh.stderr.exact +0 -24
  553. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh +0 -8
  554. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh.stderr.exact +0 -24
  555. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh +0 -8
  556. package/src/bsdiff/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh.stderr.exact +0 -18
  557. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh +0 -8
  558. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.exact +0 -38
  559. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh +0 -7
  560. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh.stderr.exact +0 -18
  561. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh +0 -7
  562. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh.stderr.exact +0 -20
  563. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh +0 -7
  564. package/src/bsdiff/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh.stderr.exact +0 -14
  565. package/src/bsdiff/zstd/tests/cli-tests/progress/no-progress.sh +0 -46
  566. package/src/bsdiff/zstd/tests/cli-tests/progress/no-progress.sh.stderr.glob +0 -96
  567. package/src/bsdiff/zstd/tests/cli-tests/progress/progress.sh +0 -41
  568. package/src/bsdiff/zstd/tests/cli-tests/progress/progress.sh.stderr.glob +0 -62
  569. package/src/bsdiff/zstd/tests/cli-tests/run.py +0 -731
  570. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/setup +0 -6
  571. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh +0 -12
  572. package/src/bsdiff/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh.stdout.exact +0 -8
  573. package/src/bsdiff/zstd/tests/datagencli.c +0 -149
  574. package/src/bsdiff/zstd/tests/decodecorpus.c +0 -1936
  575. package/src/bsdiff/zstd/tests/dict-files/zero-weight-dict +0 -0
  576. package/src/bsdiff/zstd/tests/external_matchfinder.c +0 -140
  577. package/src/bsdiff/zstd/tests/external_matchfinder.h +0 -39
  578. package/src/bsdiff/zstd/tests/fullbench.c +0 -980
  579. package/src/bsdiff/zstd/tests/fuzz/Makefile +0 -277
  580. package/src/bsdiff/zstd/tests/fuzz/README.md +0 -161
  581. package/src/bsdiff/zstd/tests/fuzz/block_decompress.c +0 -53
  582. package/src/bsdiff/zstd/tests/fuzz/block_round_trip.c +0 -103
  583. package/src/bsdiff/zstd/tests/fuzz/decompress_cross_format.c +0 -130
  584. package/src/bsdiff/zstd/tests/fuzz/decompress_dstSize_tooSmall.c +0 -74
  585. package/src/bsdiff/zstd/tests/fuzz/dictionary_decompress.c +0 -77
  586. package/src/bsdiff/zstd/tests/fuzz/dictionary_loader.c +0 -106
  587. package/src/bsdiff/zstd/tests/fuzz/dictionary_round_trip.c +0 -155
  588. package/src/bsdiff/zstd/tests/fuzz/dictionary_stream_round_trip.c +0 -209
  589. package/src/bsdiff/zstd/tests/fuzz/fse_read_ncount.c +0 -100
  590. package/src/bsdiff/zstd/tests/fuzz/fuzz.h +0 -57
  591. package/src/bsdiff/zstd/tests/fuzz/fuzz.py +0 -911
  592. package/src/bsdiff/zstd/tests/fuzz/fuzz_data_producer.c +0 -95
  593. package/src/bsdiff/zstd/tests/fuzz/fuzz_data_producer.h +0 -66
  594. package/src/bsdiff/zstd/tests/fuzz/fuzz_helpers.c +0 -48
  595. package/src/bsdiff/zstd/tests/fuzz/fuzz_helpers.h +0 -81
  596. package/src/bsdiff/zstd/tests/fuzz/fuzz_third_party_seq_prod.h +0 -116
  597. package/src/bsdiff/zstd/tests/fuzz/generate_sequences.c +0 -88
  598. package/src/bsdiff/zstd/tests/fuzz/huf_decompress.c +0 -68
  599. package/src/bsdiff/zstd/tests/fuzz/huf_round_trip.c +0 -137
  600. package/src/bsdiff/zstd/tests/fuzz/raw_dictionary_round_trip.c +0 -119
  601. package/src/bsdiff/zstd/tests/fuzz/regression_driver.c +0 -90
  602. package/src/bsdiff/zstd/tests/fuzz/seekable_roundtrip.c +0 -88
  603. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile +0 -16
  604. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/README.md +0 -12
  605. package/src/bsdiff/zstd/tests/fuzz/seq_prod_fuzz_example/example_seq_prod.c +0 -52
  606. package/src/bsdiff/zstd/tests/fuzz/sequence_compression_api.c +0 -381
  607. package/src/bsdiff/zstd/tests/fuzz/simple_compress.c +0 -60
  608. package/src/bsdiff/zstd/tests/fuzz/simple_decompress.c +0 -59
  609. package/src/bsdiff/zstd/tests/fuzz/simple_round_trip.c +0 -182
  610. package/src/bsdiff/zstd/tests/fuzz/stream_decompress.c +0 -119
  611. package/src/bsdiff/zstd/tests/fuzz/stream_round_trip.c +0 -218
  612. package/src/bsdiff/zstd/tests/fuzz/zstd_frame_info.c +0 -43
  613. package/src/bsdiff/zstd/tests/fuzz/zstd_helpers.c +0 -207
  614. package/src/bsdiff/zstd/tests/fuzz/zstd_helpers.h +0 -56
  615. package/src/bsdiff/zstd/tests/fuzzer.c +0 -4933
  616. package/src/bsdiff/zstd/tests/golden-compression/PR-3517-block-splitter-corruption-test +0 -1
  617. package/src/bsdiff/zstd/tests/golden-compression/http +0 -1
  618. package/src/bsdiff/zstd/tests/golden-compression/huffman-compressed-larger +0 -0
  619. package/src/bsdiff/zstd/tests/golden-compression/large-literal-and-match-lengths +0 -0
  620. package/src/bsdiff/zstd/tests/golden-decompression/block-128k.zst +0 -0
  621. package/src/bsdiff/zstd/tests/golden-decompression/empty-block.zst +0 -0
  622. package/src/bsdiff/zstd/tests/golden-decompression/rle-first-block.zst +0 -0
  623. package/src/bsdiff/zstd/tests/golden-decompression/zeroSeq_2B.zst +0 -0
  624. package/src/bsdiff/zstd/tests/golden-decompression-errors/off0.bin.zst +0 -0
  625. package/src/bsdiff/zstd/tests/golden-decompression-errors/zeroSeq_extraneous.zst +0 -0
  626. package/src/bsdiff/zstd/tests/golden-dictionaries/http-dict-missing-symbols +0 -0
  627. package/src/bsdiff/zstd/tests/gzip/Makefile +0 -45
  628. package/src/bsdiff/zstd/tests/gzip/gzip-env.sh +0 -46
  629. package/src/bsdiff/zstd/tests/gzip/helin-segv.sh +0 -31
  630. package/src/bsdiff/zstd/tests/gzip/help-version.sh +0 -270
  631. package/src/bsdiff/zstd/tests/gzip/hufts-segv.gz +0 -0
  632. package/src/bsdiff/zstd/tests/gzip/hufts.sh +0 -34
  633. package/src/bsdiff/zstd/tests/gzip/init.cfg +0 -5
  634. package/src/bsdiff/zstd/tests/gzip/init.sh +0 -616
  635. package/src/bsdiff/zstd/tests/gzip/keep.sh +0 -51
  636. package/src/bsdiff/zstd/tests/gzip/list.sh +0 -31
  637. package/src/bsdiff/zstd/tests/gzip/memcpy-abuse.sh +0 -34
  638. package/src/bsdiff/zstd/tests/gzip/mixed.sh +0 -68
  639. package/src/bsdiff/zstd/tests/gzip/null-suffix-clobber.sh +0 -35
  640. package/src/bsdiff/zstd/tests/gzip/stdin.sh +0 -31
  641. package/src/bsdiff/zstd/tests/gzip/test-driver.sh +0 -150
  642. package/src/bsdiff/zstd/tests/gzip/trailing-nul.sh +0 -37
  643. package/src/bsdiff/zstd/tests/gzip/unpack-invalid.sh +0 -36
  644. package/src/bsdiff/zstd/tests/gzip/z-suffix.sh +0 -30
  645. package/src/bsdiff/zstd/tests/gzip/zdiff.sh +0 -48
  646. package/src/bsdiff/zstd/tests/gzip/zgrep-context.sh +0 -47
  647. package/src/bsdiff/zstd/tests/gzip/zgrep-f.sh +0 -43
  648. package/src/bsdiff/zstd/tests/gzip/zgrep-signal.sh +0 -64
  649. package/src/bsdiff/zstd/tests/gzip/znew-k.sh +0 -40
  650. package/src/bsdiff/zstd/tests/invalidDictionaries.c +0 -61
  651. package/src/bsdiff/zstd/tests/legacy.c +0 -260
  652. package/src/bsdiff/zstd/tests/libzstd_builds.sh +0 -104
  653. package/src/bsdiff/zstd/tests/longmatch.c +0 -102
  654. package/src/bsdiff/zstd/tests/loremOut.c +0 -50
  655. package/src/bsdiff/zstd/tests/loremOut.h +0 -15
  656. package/src/bsdiff/zstd/tests/paramgrill.c +0 -2966
  657. package/src/bsdiff/zstd/tests/playTests.sh +0 -1928
  658. package/src/bsdiff/zstd/tests/poolTests.c +0 -271
  659. package/src/bsdiff/zstd/tests/rateLimiter.py +0 -41
  660. package/src/bsdiff/zstd/tests/regression/Makefile +0 -60
  661. package/src/bsdiff/zstd/tests/regression/README.md +0 -28
  662. package/src/bsdiff/zstd/tests/regression/config.c +0 -404
  663. package/src/bsdiff/zstd/tests/regression/config.h +0 -91
  664. package/src/bsdiff/zstd/tests/regression/data.c +0 -631
  665. package/src/bsdiff/zstd/tests/regression/data.h +0 -121
  666. package/src/bsdiff/zstd/tests/regression/levels.h +0 -59
  667. package/src/bsdiff/zstd/tests/regression/method.c +0 -701
  668. package/src/bsdiff/zstd/tests/regression/method.h +0 -65
  669. package/src/bsdiff/zstd/tests/regression/result.c +0 -28
  670. package/src/bsdiff/zstd/tests/regression/result.h +0 -103
  671. package/src/bsdiff/zstd/tests/regression/results.csv +0 -1480
  672. package/src/bsdiff/zstd/tests/regression/test.c +0 -362
  673. package/src/bsdiff/zstd/tests/roundTripCrash.c +0 -241
  674. package/src/bsdiff/zstd/tests/seqgen.c +0 -260
  675. package/src/bsdiff/zstd/tests/seqgen.h +0 -58
  676. package/src/bsdiff/zstd/tests/test-license.py +0 -156
  677. package/src/bsdiff/zstd/tests/test-variants.sh +0 -115
  678. package/src/bsdiff/zstd/tests/test-zstd-versions.py +0 -308
  679. package/src/bsdiff/zstd/tests/zstreamtest.c +0 -3407
  680. package/src/bsdiff/zstd/zlibWrapper/BUCK +0 -22
  681. package/src/bsdiff/zstd/zlibWrapper/Makefile +0 -120
  682. package/src/bsdiff/zstd/zlibWrapper/README.md +0 -163
  683. package/src/bsdiff/zstd/zlibWrapper/examples/example.c +0 -598
  684. package/src/bsdiff/zstd/zlibWrapper/examples/example_original.c +0 -599
  685. package/src/bsdiff/zstd/zlibWrapper/examples/fitblk.c +0 -254
  686. package/src/bsdiff/zstd/zlibWrapper/examples/fitblk_original.c +0 -233
  687. package/src/bsdiff/zstd/zlibWrapper/examples/minigzip.c +0 -605
  688. package/src/bsdiff/zstd/zlibWrapper/examples/zwrapbench.c +0 -1018
  689. package/src/bsdiff/zstd/zlibWrapper/gzclose.c +0 -26
  690. package/src/bsdiff/zstd/zlibWrapper/gzcompatibility.h +0 -68
  691. package/src/bsdiff/zstd/zlibWrapper/gzguts.h +0 -229
  692. package/src/bsdiff/zstd/zlibWrapper/gzlib.c +0 -587
  693. package/src/bsdiff/zstd/zlibWrapper/gzread.c +0 -637
  694. package/src/bsdiff/zstd/zlibWrapper/gzwrite.c +0 -631
  695. package/src/bsdiff/zstd/zlibWrapper/zstd_zlibwrapper.c +0 -1200
  696. package/src/bsdiff/zstd/zlibWrapper/zstd_zlibwrapper.h +0 -91
  697. package/src/objc/build/objcWrapper.o +0 -0
  698. package/src/objc/objcWrapper.m +0 -1380
  699. package/src/zig/build/index.js +0 -782
  700. package/src/zig/build/libObjcWrapper.a +0 -0
  701. package/src/zig/build.zig +0 -29
  702. package/src/zig/macos/application.zig +0 -6
  703. package/src/zig/macos/objc.zig +0 -123
  704. package/src/zig/macos/tray.zig +0 -102
  705. package/src/zig/macos/webview.zig +0 -693
  706. package/src/zig/macos/window.zig +0 -189
  707. package/src/zig/main.zig +0 -16
  708. package/src/zig/rpc/pipesin.zig +0 -202
  709. package/src/zig/rpc/rpc.zig +0 -19
  710. package/src/zig/rpc/schema/handlers.zig +0 -402
  711. package/src/zig/rpc/schema/request.zig +0 -59
  712. package/src/zig/rpc/schema/schema.zig +0 -412
  713. package/src/zig/rpc/stdin.zig +0 -112
  714. package/src/zig/rpc/stdout.zig +0 -106
  715. package/src/zig/rpc/types.zig +0 -41
  716. package/src/zig/utils.zig +0 -49
  717. package/src/zig/zig-out/bin/webview +0 -0
  718. /package/{docs → docs-old}/api/bun-api.md +0 -0
  719. /package/{docs → docs-old}/api/view-api.md +0 -0
  720. /package/{docs → docs-old}/electrobun-config.md +0 -0
  721. /package/{docs → docs-old}/getting-started.md +0 -0
  722. /package/{docs → docs-old}/node_modules/.cache/webpack/client-development-en/0.pack +0 -0
  723. /package/{docs → docs-old}/node_modules/.cache/webpack/client-development-en/index.pack +0 -0
  724. /package/{example/readme.md → documentation/blog/tags.yml} +0 -0
  725. /package/{src/bsdiff/zstd/build/LICENSE → documentation/docs/guides/Guides/Build UI with React} +0 -0
  726. /package/{src/bsdiff/zstd/tests/cli-tests/compression/window-resize.sh.stderr.ignore → documentation/docs/guides/Guides/Build UI with Solidjs} +0 -0
  727. /package/{src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stderr.exact → documentation/docs/guides/Guides/Build a Web Browser} +0 -0
  728. /package/{src/bsdiff/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stdout.exact → documentation/docs/guides/Guides/Bun <-> Browser RPC} +0 -0
  729. /package/{example/src/webviewtag/electrobun.png → documentation/static/img/electrobun-logo-32.png} +0 -0
@@ -1,640 +0,0 @@
1
- /* ******************************************************************
2
- * FSE : Finite State Entropy codec
3
- * Public Prototypes declaration
4
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5
- *
6
- * You can contact the author at :
7
- * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
8
- *
9
- * This source code is licensed under both the BSD-style license (found in the
10
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
11
- * in the COPYING file in the root directory of this source tree).
12
- * You may select, at your option, one of the above-listed licenses.
13
- ****************************************************************** */
14
-
15
- #if defined (__cplusplus)
16
- extern "C" {
17
- #endif
18
-
19
- #ifndef FSE_H
20
- #define FSE_H
21
-
22
-
23
- /*-*****************************************
24
- * Dependencies
25
- ******************************************/
26
- #include "zstd_deps.h" /* size_t, ptrdiff_t */
27
-
28
-
29
- /*-*****************************************
30
- * FSE_PUBLIC_API : control library symbols visibility
31
- ******************************************/
32
- #if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)
33
- # define FSE_PUBLIC_API __attribute__ ((visibility ("default")))
34
- #elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) /* Visual expected */
35
- # define FSE_PUBLIC_API __declspec(dllexport)
36
- #elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)
37
- # define FSE_PUBLIC_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
38
- #else
39
- # define FSE_PUBLIC_API
40
- #endif
41
-
42
- /*------ Version ------*/
43
- #define FSE_VERSION_MAJOR 0
44
- #define FSE_VERSION_MINOR 9
45
- #define FSE_VERSION_RELEASE 0
46
-
47
- #define FSE_LIB_VERSION FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE
48
- #define FSE_QUOTE(str) #str
49
- #define FSE_EXPAND_AND_QUOTE(str) FSE_QUOTE(str)
50
- #define FSE_VERSION_STRING FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)
51
-
52
- #define FSE_VERSION_NUMBER (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)
53
- FSE_PUBLIC_API unsigned FSE_versionNumber(void); /**< library version number; to be used when checking dll version */
54
-
55
-
56
- /*-*****************************************
57
- * Tool functions
58
- ******************************************/
59
- FSE_PUBLIC_API size_t FSE_compressBound(size_t size); /* maximum compressed size */
60
-
61
- /* Error Management */
62
- FSE_PUBLIC_API unsigned FSE_isError(size_t code); /* tells if a return value is an error code */
63
- FSE_PUBLIC_API const char* FSE_getErrorName(size_t code); /* provides error code string (useful for debugging) */
64
-
65
-
66
- /*-*****************************************
67
- * FSE detailed API
68
- ******************************************/
69
- /*!
70
- FSE_compress() does the following:
71
- 1. count symbol occurrence from source[] into table count[] (see hist.h)
72
- 2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog)
73
- 3. save normalized counters to memory buffer using writeNCount()
74
- 4. build encoding table 'CTable' from normalized counters
75
- 5. encode the data stream using encoding table 'CTable'
76
-
77
- FSE_decompress() does the following:
78
- 1. read normalized counters with readNCount()
79
- 2. build decoding table 'DTable' from normalized counters
80
- 3. decode the data stream using decoding table 'DTable'
81
-
82
- The following API allows targeting specific sub-functions for advanced tasks.
83
- For example, it's possible to compress several blocks using the same 'CTable',
84
- or to save and provide normalized distribution using external method.
85
- */
86
-
87
- /* *** COMPRESSION *** */
88
-
89
- /*! FSE_optimalTableLog():
90
- dynamically downsize 'tableLog' when conditions are met.
91
- It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.
92
- @return : recommended tableLog (necessarily <= 'maxTableLog') */
93
- FSE_PUBLIC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);
94
-
95
- /*! FSE_normalizeCount():
96
- normalize counts so that sum(count[]) == Power_of_2 (2^tableLog)
97
- 'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1).
98
- useLowProbCount is a boolean parameter which trades off compressed size for
99
- faster header decoding. When it is set to 1, the compressed data will be slightly
100
- smaller. And when it is set to 0, FSE_readNCount() and FSE_buildDTable() will be
101
- faster. If you are compressing a small amount of data (< 2 KB) then useLowProbCount=0
102
- is a good default, since header deserialization makes a big speed difference.
103
- Otherwise, useLowProbCount=1 is a good default, since the speed difference is small.
104
- @return : tableLog,
105
- or an errorCode, which can be tested using FSE_isError() */
106
- FSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,
107
- const unsigned* count, size_t srcSize, unsigned maxSymbolValue, unsigned useLowProbCount);
108
-
109
- /*! FSE_NCountWriteBound():
110
- Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'.
111
- Typically useful for allocation purpose. */
112
- FSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);
113
-
114
- /*! FSE_writeNCount():
115
- Compactly save 'normalizedCounter' into 'buffer'.
116
- @return : size of the compressed table,
117
- or an errorCode, which can be tested using FSE_isError(). */
118
- FSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize,
119
- const short* normalizedCounter,
120
- unsigned maxSymbolValue, unsigned tableLog);
121
-
122
- /*! Constructor and Destructor of FSE_CTable.
123
- Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */
124
- typedef unsigned FSE_CTable; /* don't allocate that. It's only meant to be more restrictive than void* */
125
-
126
- /*! FSE_buildCTable():
127
- Builds `ct`, which must be already allocated, using FSE_createCTable().
128
- @return : 0, or an errorCode, which can be tested using FSE_isError() */
129
- FSE_PUBLIC_API size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);
130
-
131
- /*! FSE_compress_usingCTable():
132
- Compress `src` using `ct` into `dst` which must be already allocated.
133
- @return : size of compressed data (<= `dstCapacity`),
134
- or 0 if compressed data could not fit into `dst`,
135
- or an errorCode, which can be tested using FSE_isError() */
136
- FSE_PUBLIC_API size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);
137
-
138
- /*!
139
- Tutorial :
140
- ----------
141
- The first step is to count all symbols. FSE_count() does this job very fast.
142
- Result will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells.
143
- 'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0]
144
- maxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value)
145
- FSE_count() will return the number of occurrence of the most frequent symbol.
146
- This can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility.
147
- If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
148
-
149
- The next step is to normalize the frequencies.
150
- FSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'.
151
- It also guarantees a minimum of 1 to any Symbol with frequency >= 1.
152
- You can use 'tableLog'==0 to mean "use default tableLog value".
153
- If you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(),
154
- which will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means "default").
155
-
156
- The result of FSE_normalizeCount() will be saved into a table,
157
- called 'normalizedCounter', which is a table of signed short.
158
- 'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells.
159
- The return value is tableLog if everything proceeded as expected.
160
- It is 0 if there is a single symbol within distribution.
161
- If there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()).
162
-
163
- 'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount().
164
- 'buffer' must be already allocated.
165
- For guaranteed success, buffer size must be at least FSE_headerBound().
166
- The result of the function is the number of bytes written into 'buffer'.
167
- If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small).
168
-
169
- 'normalizedCounter' can then be used to create the compression table 'CTable'.
170
- The space required by 'CTable' must be already allocated, using FSE_createCTable().
171
- You can then use FSE_buildCTable() to fill 'CTable'.
172
- If there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()).
173
-
174
- 'CTable' can then be used to compress 'src', with FSE_compress_usingCTable().
175
- Similar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize'
176
- The function returns the size of compressed data (without header), necessarily <= `dstCapacity`.
177
- If it returns '0', compressed data could not fit into 'dst'.
178
- If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).
179
- */
180
-
181
-
182
- /* *** DECOMPRESSION *** */
183
-
184
- /*! FSE_readNCount():
185
- Read compactly saved 'normalizedCounter' from 'rBuffer'.
186
- @return : size read from 'rBuffer',
187
- or an errorCode, which can be tested using FSE_isError().
188
- maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */
189
- FSE_PUBLIC_API size_t FSE_readNCount (short* normalizedCounter,
190
- unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
191
- const void* rBuffer, size_t rBuffSize);
192
-
193
- /*! FSE_readNCount_bmi2():
194
- * Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise.
195
- */
196
- FSE_PUBLIC_API size_t FSE_readNCount_bmi2(short* normalizedCounter,
197
- unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,
198
- const void* rBuffer, size_t rBuffSize, int bmi2);
199
-
200
- typedef unsigned FSE_DTable; /* don't allocate that. It's just a way to be more restrictive than void* */
201
-
202
- /*!
203
- Tutorial :
204
- ----------
205
- (Note : these functions only decompress FSE-compressed blocks.
206
- If block is uncompressed, use memcpy() instead
207
- If block is a single repeated byte, use memset() instead )
208
-
209
- The first step is to obtain the normalized frequencies of symbols.
210
- This can be performed by FSE_readNCount() if it was saved using FSE_writeNCount().
211
- 'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short.
212
- In practice, that means it's necessary to know 'maxSymbolValue' beforehand,
213
- or size the table to handle worst case situations (typically 256).
214
- FSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'.
215
- The result of FSE_readNCount() is the number of bytes read from 'rBuffer'.
216
- Note that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that.
217
- If there is an error, the function will return an error code, which can be tested using FSE_isError().
218
-
219
- The next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'.
220
- This is performed by the function FSE_buildDTable().
221
- The space required by 'FSE_DTable' must be already allocated using FSE_createDTable().
222
- If there is an error, the function will return an error code, which can be tested using FSE_isError().
223
-
224
- `FSE_DTable` can then be used to decompress `cSrc`, with FSE_decompress_usingDTable().
225
- `cSrcSize` must be strictly correct, otherwise decompression will fail.
226
- FSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=`dstCapacity`).
227
- If there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small)
228
- */
229
-
230
- #endif /* FSE_H */
231
-
232
-
233
- #if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY)
234
- #define FSE_H_FSE_STATIC_LINKING_ONLY
235
-
236
- /* *** Dependency *** */
237
- #include "bitstream.h"
238
-
239
-
240
- /* *****************************************
241
- * Static allocation
242
- *******************************************/
243
- /* FSE buffer bounds */
244
- #define FSE_NCOUNTBOUND 512
245
- #define FSE_BLOCKBOUND(size) ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */)
246
- #define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */
247
-
248
- /* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */
249
- #define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2))
250
- #define FSE_DTABLE_SIZE_U32(maxTableLog) (1 + (1<<(maxTableLog)))
251
-
252
- /* or use the size to malloc() space directly. Pay attention to alignment restrictions though */
253
- #define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue) (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))
254
- #define FSE_DTABLE_SIZE(maxTableLog) (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
255
-
256
-
257
- /* *****************************************
258
- * FSE advanced API
259
- ***************************************** */
260
-
261
- unsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);
262
- /**< same as FSE_optimalTableLog(), which used `minus==2` */
263
-
264
- size_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);
265
- /**< build a fake FSE_CTable, designed to compress always the same symbolValue */
266
-
267
- /* FSE_buildCTable_wksp() :
268
- * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`).
269
- * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)` of `unsigned`.
270
- * See FSE_buildCTable_wksp() for breakdown of workspace usage.
271
- */
272
- #define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */)
273
- #define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog))
274
- size_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
275
-
276
- #define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)
277
- #define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))
278
- FSE_PUBLIC_API size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);
279
- /**< Same as FSE_buildDTable(), using an externally allocated `workspace` produced with `FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)` */
280
-
281
- #define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)
282
- #define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))
283
- size_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2);
284
- /**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)`.
285
- * Set bmi2 to 1 if your CPU supports BMI2 or 0 if it doesn't */
286
-
287
- typedef enum {
288
- FSE_repeat_none, /**< Cannot use the previous table */
289
- FSE_repeat_check, /**< Can use the previous table but it must be checked */
290
- FSE_repeat_valid /**< Can use the previous table and it is assumed to be valid */
291
- } FSE_repeat;
292
-
293
- /* *****************************************
294
- * FSE symbol compression API
295
- *******************************************/
296
- /*!
297
- This API consists of small unitary functions, which highly benefit from being inlined.
298
- Hence their body are included in next section.
299
- */
300
- typedef struct {
301
- ptrdiff_t value;
302
- const void* stateTable;
303
- const void* symbolTT;
304
- unsigned stateLog;
305
- } FSE_CState_t;
306
-
307
- static void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);
308
-
309
- static void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);
310
-
311
- static void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);
312
-
313
- /**<
314
- These functions are inner components of FSE_compress_usingCTable().
315
- They allow the creation of custom streams, mixing multiple tables and bit sources.
316
-
317
- A key property to keep in mind is that encoding and decoding are done **in reverse direction**.
318
- So the first symbol you will encode is the last you will decode, like a LIFO stack.
319
-
320
- You will need a few variables to track your CStream. They are :
321
-
322
- FSE_CTable ct; // Provided by FSE_buildCTable()
323
- BIT_CStream_t bitStream; // bitStream tracking structure
324
- FSE_CState_t state; // State tracking structure (can have several)
325
-
326
-
327
- The first thing to do is to init bitStream and state.
328
- size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);
329
- FSE_initCState(&state, ct);
330
-
331
- Note that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError();
332
- You can then encode your input data, byte after byte.
333
- FSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time.
334
- Remember decoding will be done in reverse direction.
335
- FSE_encodeByte(&bitStream, &state, symbol);
336
-
337
- At any time, you can also add any bit sequence.
338
- Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders
339
- BIT_addBits(&bitStream, bitField, nbBits);
340
-
341
- The above methods don't commit data to memory, they just store it into local register, for speed.
342
- Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).
343
- Writing data to memory is a manual operation, performed by the flushBits function.
344
- BIT_flushBits(&bitStream);
345
-
346
- Your last FSE encoding operation shall be to flush your last state value(s).
347
- FSE_flushState(&bitStream, &state);
348
-
349
- Finally, you must close the bitStream.
350
- The function returns the size of CStream in bytes.
351
- If data couldn't fit into dstBuffer, it will return a 0 ( == not compressible)
352
- If there is an error, it returns an errorCode (which can be tested using FSE_isError()).
353
- size_t size = BIT_closeCStream(&bitStream);
354
- */
355
-
356
-
357
- /* *****************************************
358
- * FSE symbol decompression API
359
- *******************************************/
360
- typedef struct {
361
- size_t state;
362
- const void* table; /* precise table may vary, depending on U16 */
363
- } FSE_DState_t;
364
-
365
-
366
- static void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);
367
-
368
- static unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
369
-
370
- static unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);
371
-
372
- /**<
373
- Let's now decompose FSE_decompress_usingDTable() into its unitary components.
374
- You will decode FSE-encoded symbols from the bitStream,
375
- and also any other bitFields you put in, **in reverse order**.
376
-
377
- You will need a few variables to track your bitStream. They are :
378
-
379
- BIT_DStream_t DStream; // Stream context
380
- FSE_DState_t DState; // State context. Multiple ones are possible
381
- FSE_DTable* DTablePtr; // Decoding table, provided by FSE_buildDTable()
382
-
383
- The first thing to do is to init the bitStream.
384
- errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize);
385
-
386
- You should then retrieve your initial state(s)
387
- (in reverse flushing order if you have several ones) :
388
- errorCode = FSE_initDState(&DState, &DStream, DTablePtr);
389
-
390
- You can then decode your data, symbol after symbol.
391
- For information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'.
392
- Keep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out).
393
- unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);
394
-
395
- You can retrieve any bitfield you eventually stored into the bitStream (in reverse order)
396
- Note : maximum allowed nbBits is 25, for 32-bits compatibility
397
- size_t bitField = BIT_readBits(&DStream, nbBits);
398
-
399
- All above operations only read from local register (which size depends on size_t).
400
- Refueling the register from memory is manually performed by the reload method.
401
- endSignal = FSE_reloadDStream(&DStream);
402
-
403
- BIT_reloadDStream() result tells if there is still some more data to read from DStream.
404
- BIT_DStream_unfinished : there is still some data left into the DStream.
405
- BIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled.
406
- BIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed.
407
- BIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted.
408
-
409
- When reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop,
410
- to properly detect the exact end of stream.
411
- After each decoded symbol, check if DStream is fully consumed using this simple test :
412
- BIT_reloadDStream(&DStream) >= BIT_DStream_completed
413
-
414
- When it's done, verify decompression is fully completed, by checking both DStream and the relevant states.
415
- Checking if DStream has reached its end is performed by :
416
- BIT_endOfDStream(&DStream);
417
- Check also the states. There might be some symbols left there, if some high probability ones (>50%) are possible.
418
- FSE_endOfDState(&DState);
419
- */
420
-
421
-
422
- /* *****************************************
423
- * FSE unsafe API
424
- *******************************************/
425
- static unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);
426
- /* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */
427
-
428
-
429
- /* *****************************************
430
- * Implementation of inlined functions
431
- *******************************************/
432
- typedef struct {
433
- int deltaFindState;
434
- U32 deltaNbBits;
435
- } FSE_symbolCompressionTransform; /* total 8 bytes */
436
-
437
- MEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)
438
- {
439
- const void* ptr = ct;
440
- const U16* u16ptr = (const U16*) ptr;
441
- const U32 tableLog = MEM_read16(ptr);
442
- statePtr->value = (ptrdiff_t)1<<tableLog;
443
- statePtr->stateTable = u16ptr+2;
444
- statePtr->symbolTT = ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1);
445
- statePtr->stateLog = tableLog;
446
- }
447
-
448
-
449
- /*! FSE_initCState2() :
450
- * Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)
451
- * uses the smallest state value possible, saving the cost of this symbol */
452
- MEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)
453
- {
454
- FSE_initCState(statePtr, ct);
455
- { const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
456
- const U16* stateTable = (const U16*)(statePtr->stateTable);
457
- U32 nbBitsOut = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);
458
- statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;
459
- statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
460
- }
461
- }
462
-
463
- MEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol)
464
- {
465
- FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];
466
- const U16* const stateTable = (const U16*)(statePtr->stateTable);
467
- U32 const nbBitsOut = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);
468
- BIT_addBits(bitC, (size_t)statePtr->value, nbBitsOut);
469
- statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];
470
- }
471
-
472
- MEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)
473
- {
474
- BIT_addBits(bitC, (size_t)statePtr->value, statePtr->stateLog);
475
- BIT_flushBits(bitC);
476
- }
477
-
478
-
479
- /* FSE_getMaxNbBits() :
480
- * Approximate maximum cost of a symbol, in bits.
481
- * Fractional get rounded up (i.e. a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)
482
- * note 1 : assume symbolValue is valid (<= maxSymbolValue)
483
- * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */
484
- MEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)
485
- {
486
- const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
487
- return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;
488
- }
489
-
490
- /* FSE_bitCost() :
491
- * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits)
492
- * note 1 : assume symbolValue is valid (<= maxSymbolValue)
493
- * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */
494
- MEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
495
- {
496
- const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;
497
- U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;
498
- U32 const threshold = (minNbBits+1) << 16;
499
- assert(tableLog < 16);
500
- assert(accuracyLog < 31-tableLog); /* ensure enough room for renormalization double shift */
501
- { U32 const tableSize = 1 << tableLog;
502
- U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);
503
- U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog; /* linear interpolation (very approximate) */
504
- U32 const bitMultiplier = 1 << accuracyLog;
505
- assert(symbolTT[symbolValue].deltaNbBits + tableSize <= threshold);
506
- assert(normalizedDeltaFromThreshold <= bitMultiplier);
507
- return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;
508
- }
509
- }
510
-
511
-
512
- /* ====== Decompression ====== */
513
-
514
- typedef struct {
515
- U16 tableLog;
516
- U16 fastMode;
517
- } FSE_DTableHeader; /* sizeof U32 */
518
-
519
- typedef struct
520
- {
521
- unsigned short newState;
522
- unsigned char symbol;
523
- unsigned char nbBits;
524
- } FSE_decode_t; /* size == U32 */
525
-
526
- MEM_STATIC void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)
527
- {
528
- const void* ptr = dt;
529
- const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
530
- DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
531
- BIT_reloadDStream(bitD);
532
- DStatePtr->table = dt + 1;
533
- }
534
-
535
- MEM_STATIC BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)
536
- {
537
- FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
538
- return DInfo.symbol;
539
- }
540
-
541
- MEM_STATIC void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
542
- {
543
- FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
544
- U32 const nbBits = DInfo.nbBits;
545
- size_t const lowBits = BIT_readBits(bitD, nbBits);
546
- DStatePtr->state = DInfo.newState + lowBits;
547
- }
548
-
549
- MEM_STATIC BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
550
- {
551
- FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
552
- U32 const nbBits = DInfo.nbBits;
553
- BYTE const symbol = DInfo.symbol;
554
- size_t const lowBits = BIT_readBits(bitD, nbBits);
555
-
556
- DStatePtr->state = DInfo.newState + lowBits;
557
- return symbol;
558
- }
559
-
560
- /*! FSE_decodeSymbolFast() :
561
- unsafe, only works if no symbol has a probability > 50% */
562
- MEM_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)
563
- {
564
- FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
565
- U32 const nbBits = DInfo.nbBits;
566
- BYTE const symbol = DInfo.symbol;
567
- size_t const lowBits = BIT_readBitsFast(bitD, nbBits);
568
-
569
- DStatePtr->state = DInfo.newState + lowBits;
570
- return symbol;
571
- }
572
-
573
- MEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)
574
- {
575
- return DStatePtr->state == 0;
576
- }
577
-
578
-
579
-
580
- #ifndef FSE_COMMONDEFS_ONLY
581
-
582
- /* **************************************************************
583
- * Tuning parameters
584
- ****************************************************************/
585
- /*!MEMORY_USAGE :
586
- * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
587
- * Increasing memory usage improves compression ratio
588
- * Reduced memory usage can improve speed, due to cache effect
589
- * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */
590
- #ifndef FSE_MAX_MEMORY_USAGE
591
- # define FSE_MAX_MEMORY_USAGE 14
592
- #endif
593
- #ifndef FSE_DEFAULT_MEMORY_USAGE
594
- # define FSE_DEFAULT_MEMORY_USAGE 13
595
- #endif
596
- #if (FSE_DEFAULT_MEMORY_USAGE > FSE_MAX_MEMORY_USAGE)
597
- # error "FSE_DEFAULT_MEMORY_USAGE must be <= FSE_MAX_MEMORY_USAGE"
598
- #endif
599
-
600
- /*!FSE_MAX_SYMBOL_VALUE :
601
- * Maximum symbol value authorized.
602
- * Required for proper stack allocation */
603
- #ifndef FSE_MAX_SYMBOL_VALUE
604
- # define FSE_MAX_SYMBOL_VALUE 255
605
- #endif
606
-
607
- /* **************************************************************
608
- * template functions type & suffix
609
- ****************************************************************/
610
- #define FSE_FUNCTION_TYPE BYTE
611
- #define FSE_FUNCTION_EXTENSION
612
- #define FSE_DECODE_TYPE FSE_decode_t
613
-
614
-
615
- #endif /* !FSE_COMMONDEFS_ONLY */
616
-
617
-
618
- /* ***************************************************************
619
- * Constants
620
- *****************************************************************/
621
- #define FSE_MAX_TABLELOG (FSE_MAX_MEMORY_USAGE-2)
622
- #define FSE_MAX_TABLESIZE (1U<<FSE_MAX_TABLELOG)
623
- #define FSE_MAXTABLESIZE_MASK (FSE_MAX_TABLESIZE-1)
624
- #define FSE_DEFAULT_TABLELOG (FSE_DEFAULT_MEMORY_USAGE-2)
625
- #define FSE_MIN_TABLELOG 5
626
-
627
- #define FSE_TABLELOG_ABSOLUTE_MAX 15
628
- #if FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX
629
- # error "FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX is not supported"
630
- #endif
631
-
632
- #define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
633
-
634
-
635
- #endif /* FSE_STATIC_LINKING_ONLY */
636
-
637
-
638
- #if defined (__cplusplus)
639
- }
640
- #endif