koffi 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/package.json +44 -68
  2. package/{LICENSE.txt → src/cnoke/LICENSE.txt} +0 -0
  3. package/src/cnoke/README.md +97 -0
  4. package/src/cnoke/assets/FindCNoke.cmake +71 -0
  5. package/src/cnoke/assets/win_delay_hook.c +34 -0
  6. package/src/cnoke/cnoke.js +968 -0
  7. package/src/cnoke/package.json +25 -0
  8. package/{vendor → src/core}/libcc/libcc.cc +38 -11
  9. package/{vendor → src/core}/libcc/libcc.hh +4 -2
  10. package/{CMakeLists.txt → src/koffi/CMakeLists.txt} +3 -3
  11. package/{ChangeLog.md → src/koffi/ChangeLog.md} +11 -0
  12. package/src/koffi/LICENSE.txt +661 -0
  13. package/{README.md → src/koffi/README.md} +0 -0
  14. package/{benchmark → src/koffi/benchmark}/CMakeLists.txt +9 -6
  15. package/{benchmark → src/koffi/benchmark}/atoi_koffi.js +0 -0
  16. package/{benchmark → src/koffi/benchmark}/atoi_napi.cc +1 -1
  17. package/{benchmark → src/koffi/benchmark}/atoi_napi.js +0 -0
  18. package/{benchmark → src/koffi/benchmark}/atoi_node_ffi.js +0 -0
  19. package/src/koffi/benchmark/benchmark.js +118 -0
  20. package/src/koffi/benchmark/rand_koffi.js +52 -0
  21. package/src/koffi/benchmark/rand_napi.cc +69 -0
  22. package/src/koffi/benchmark/rand_napi.js +47 -0
  23. package/src/koffi/benchmark/rand_node_ffi.js +55 -0
  24. package/{benchmark → src/koffi/benchmark}/raylib_cc.cc +2 -2
  25. package/{benchmark → src/koffi/benchmark}/raylib_cc.js +0 -0
  26. package/{benchmark → src/koffi/benchmark}/raylib_koffi.js +0 -0
  27. package/{benchmark → src/koffi/benchmark}/raylib_node_ffi.js +0 -0
  28. package/{benchmark → src/koffi/benchmark}/raylib_node_raylib.js +0 -0
  29. package/src/koffi/build/2.1.4/koffi_darwin_arm64.tar.gz +0 -0
  30. package/src/koffi/build/2.1.4/koffi_darwin_x64.tar.gz +0 -0
  31. package/src/koffi/build/2.1.4/koffi_freebsd_arm64.tar.gz +0 -0
  32. package/src/koffi/build/2.1.4/koffi_freebsd_ia32.tar.gz +0 -0
  33. package/src/koffi/build/2.1.4/koffi_freebsd_x64.tar.gz +0 -0
  34. package/src/koffi/build/2.1.4/koffi_linux_arm32hf.tar.gz +0 -0
  35. package/src/koffi/build/2.1.4/koffi_linux_arm64.tar.gz +0 -0
  36. package/src/koffi/build/2.1.4/koffi_linux_ia32.tar.gz +0 -0
  37. package/src/koffi/build/2.1.4/koffi_linux_riscv64hf64.tar.gz +0 -0
  38. package/src/koffi/build/2.1.4/koffi_linux_x64.tar.gz +0 -0
  39. package/src/koffi/build/2.1.4/koffi_openbsd_ia32.tar.gz +0 -0
  40. package/src/koffi/build/2.1.4/koffi_openbsd_x64.tar.gz +0 -0
  41. package/src/koffi/build/2.1.4/koffi_win32_arm64.tar.gz +0 -0
  42. package/src/koffi/build/2.1.4/koffi_win32_ia32.tar.gz +0 -0
  43. package/src/koffi/build/2.1.4/koffi_win32_x64.tar.gz +0 -0
  44. package/{doc → src/koffi/doc}/Makefile +0 -0
  45. package/{doc → src/koffi/doc}/benchmarks.md +0 -0
  46. package/{doc → src/koffi/doc}/benchmarks.xlsx +0 -0
  47. package/{doc → src/koffi/doc}/changes.md +0 -0
  48. package/{doc → src/koffi/doc}/conf.py +0 -0
  49. package/{doc → src/koffi/doc}/contribute.md +5 -5
  50. package/{doc → src/koffi/doc}/functions.md +0 -0
  51. package/{doc → src/koffi/doc}/index.rst +1 -1
  52. package/{doc → src/koffi/doc}/make.bat +0 -0
  53. package/{doc → src/koffi/doc}/memory.md +1 -0
  54. package/{doc → src/koffi/doc}/platforms.md +0 -0
  55. package/{doc → src/koffi/doc}/poetry.lock +0 -0
  56. package/{doc → src/koffi/doc}/pyproject.toml +0 -0
  57. package/{doc → src/koffi/doc}/start.md +0 -0
  58. package/{doc → src/koffi/doc}/static/bench_linux.png +0 -0
  59. package/{doc → src/koffi/doc}/static/bench_windows.png +0 -0
  60. package/{doc → src/koffi/doc}/static/custom.css +0 -0
  61. package/{doc → src/koffi/doc}/static/perf_linux_20220623.png +0 -0
  62. package/{doc → src/koffi/doc}/static/perf_linux_20220623_2.png +0 -0
  63. package/{doc → src/koffi/doc}/static/perf_linux_20220627.png +0 -0
  64. package/{doc → src/koffi/doc}/static/perf_linux_20220628.png +0 -0
  65. package/{doc → src/koffi/doc}/static/perf_linux_20220812.png +0 -0
  66. package/{doc → src/koffi/doc}/static/perf_windows_20220623.png +0 -0
  67. package/{doc → src/koffi/doc}/static/perf_windows_20220623_2.png +0 -0
  68. package/{doc → src/koffi/doc}/static/perf_windows_20220627.png +0 -0
  69. package/{doc → src/koffi/doc}/static/perf_windows_20220628.png +0 -0
  70. package/{doc → src/koffi/doc}/static/perf_windows_20220812.png +0 -0
  71. package/{doc → src/koffi/doc}/templates/badges.html +1 -1
  72. package/{doc → src/koffi/doc}/types.md +0 -0
  73. package/src/koffi/qemu/qemu/.gitkeep +0 -0
  74. package/{qemu → src/koffi/qemu}/qemu.js +217 -131
  75. package/{qemu → src/koffi/qemu}/registry/machines.json +24 -0
  76. package/{qemu → src/koffi/qemu}/registry/sha256sum.txt +0 -0
  77. package/src/{abi_arm32.cc → koffi/src/abi_arm32.cc} +1 -1
  78. package/src/{abi_arm32_fwd.S → koffi/src/abi_arm32_fwd.S} +0 -0
  79. package/src/{abi_arm64.cc → koffi/src/abi_arm64.cc} +1 -1
  80. package/src/{abi_arm64_fwd.S → koffi/src/abi_arm64_fwd.S} +0 -0
  81. package/src/{abi_arm64_fwd.asm → koffi/src/abi_arm64_fwd.asm} +0 -0
  82. package/src/{abi_riscv64.cc → koffi/src/abi_riscv64.cc} +1 -1
  83. package/src/{abi_riscv64_fwd.S → koffi/src/abi_riscv64_fwd.S} +0 -0
  84. package/src/{abi_x64_sysv.cc → koffi/src/abi_x64_sysv.cc} +1 -1
  85. package/src/{abi_x64_sysv_fwd.S → koffi/src/abi_x64_sysv_fwd.S} +0 -0
  86. package/src/{abi_x64_win.cc → koffi/src/abi_x64_win.cc} +1 -1
  87. package/src/{abi_x64_win_fwd.asm → koffi/src/abi_x64_win_fwd.asm} +0 -0
  88. package/src/{abi_x86.cc → koffi/src/abi_x86.cc} +1 -1
  89. package/src/{abi_x86_fwd.S → koffi/src/abi_x86_fwd.S} +0 -0
  90. package/src/{abi_x86_fwd.asm → koffi/src/abi_x86_fwd.asm} +0 -0
  91. package/src/{call.cc → koffi/src/call.cc} +1 -1
  92. package/src/{call.hh → koffi/src/call.hh} +2 -2
  93. package/src/{ffi.cc → koffi/src/ffi.cc} +34 -18
  94. package/src/{ffi.hh → koffi/src/ffi.hh} +5 -3
  95. package/src/{index.js → koffi/src/index.js} +0 -0
  96. package/src/{parser.cc → koffi/src/parser.cc} +1 -1
  97. package/src/{parser.hh → koffi/src/parser.hh} +1 -1
  98. package/src/{util.cc → koffi/src/util.cc} +1 -1
  99. package/src/{util.hh → koffi/src/util.hh} +1 -1
  100. package/{test → src/koffi/test}/CMakeLists.txt +14 -15
  101. package/{test → src/koffi/test}/async.js +0 -0
  102. package/{test → src/koffi/test}/callbacks.js +0 -0
  103. package/{test → src/koffi/test}/misc.c +13 -0
  104. package/{test → src/koffi/test}/misc.def +0 -0
  105. package/{test → src/koffi/test}/raylib.js +0 -0
  106. package/{test → src/koffi/test}/sqlite.js +1 -1
  107. package/{test → src/koffi/test}/sync.js +17 -0
  108. package/vendor/brotli/BUILD +144 -0
  109. package/vendor/brotli/CMakeLists.txt +421 -0
  110. package/vendor/brotli/CONTRIBUTING.md +27 -0
  111. package/vendor/brotli/LICENSE +19 -0
  112. package/vendor/brotli/MANIFEST.in +17 -0
  113. package/vendor/brotli/Makefile +55 -0
  114. package/vendor/brotli/Makefile.am +38 -0
  115. package/vendor/brotli/README +15 -0
  116. package/vendor/brotli/README.md +104 -0
  117. package/vendor/brotli/WORKSPACE +21 -0
  118. package/vendor/brotli/bootstrap +35 -0
  119. package/vendor/brotli/c/common/constants.c +15 -0
  120. package/vendor/brotli/c/common/constants.h +200 -0
  121. package/vendor/brotli/c/common/context.c +156 -0
  122. package/vendor/brotli/c/common/context.h +113 -0
  123. package/vendor/brotli/c/common/dictionary.c +5914 -0
  124. package/vendor/brotli/c/common/dictionary.h +64 -0
  125. package/vendor/brotli/c/common/platform.c +22 -0
  126. package/vendor/brotli/c/common/platform.h +594 -0
  127. package/vendor/brotli/c/common/transform.c +291 -0
  128. package/vendor/brotli/c/common/transform.h +85 -0
  129. package/vendor/brotli/c/common/version.h +26 -0
  130. package/vendor/brotli/c/dec/bit_reader.c +76 -0
  131. package/vendor/brotli/c/dec/bit_reader.h +351 -0
  132. package/vendor/brotli/c/dec/decode.c +2608 -0
  133. package/vendor/brotli/c/dec/huffman.c +339 -0
  134. package/vendor/brotli/c/dec/huffman.h +121 -0
  135. package/vendor/brotli/c/dec/prefix.h +732 -0
  136. package/vendor/brotli/c/dec/state.c +159 -0
  137. package/vendor/brotli/c/dec/state.h +365 -0
  138. package/vendor/brotli/c/enc/backward_references.c +145 -0
  139. package/vendor/brotli/c/enc/backward_references.h +39 -0
  140. package/vendor/brotli/c/enc/backward_references_hq.c +843 -0
  141. package/vendor/brotli/c/enc/backward_references_hq.h +95 -0
  142. package/vendor/brotli/c/enc/backward_references_inc.h +163 -0
  143. package/vendor/brotli/c/enc/bit_cost.c +35 -0
  144. package/vendor/brotli/c/enc/bit_cost.h +63 -0
  145. package/vendor/brotli/c/enc/bit_cost_inc.h +127 -0
  146. package/vendor/brotli/c/enc/block_encoder_inc.h +34 -0
  147. package/vendor/brotli/c/enc/block_splitter.c +194 -0
  148. package/vendor/brotli/c/enc/block_splitter.h +51 -0
  149. package/vendor/brotli/c/enc/block_splitter_inc.h +440 -0
  150. package/vendor/brotli/c/enc/brotli_bit_stream.c +1314 -0
  151. package/vendor/brotli/c/enc/brotli_bit_stream.h +84 -0
  152. package/vendor/brotli/c/enc/cluster.c +56 -0
  153. package/vendor/brotli/c/enc/cluster.h +48 -0
  154. package/vendor/brotli/c/enc/cluster_inc.h +320 -0
  155. package/vendor/brotli/c/enc/command.c +28 -0
  156. package/vendor/brotli/c/enc/command.h +190 -0
  157. package/vendor/brotli/c/enc/compress_fragment.c +790 -0
  158. package/vendor/brotli/c/enc/compress_fragment.h +61 -0
  159. package/vendor/brotli/c/enc/compress_fragment_two_pass.c +645 -0
  160. package/vendor/brotli/c/enc/compress_fragment_two_pass.h +54 -0
  161. package/vendor/brotli/c/enc/dictionary_hash.c +1846 -0
  162. package/vendor/brotli/c/enc/dictionary_hash.h +25 -0
  163. package/vendor/brotli/c/enc/encode.c +1927 -0
  164. package/vendor/brotli/c/enc/encoder_dict.c +33 -0
  165. package/vendor/brotli/c/enc/encoder_dict.h +43 -0
  166. package/vendor/brotli/c/enc/entropy_encode.c +503 -0
  167. package/vendor/brotli/c/enc/entropy_encode.h +122 -0
  168. package/vendor/brotli/c/enc/entropy_encode_static.h +539 -0
  169. package/vendor/brotli/c/enc/fast_log.c +105 -0
  170. package/vendor/brotli/c/enc/fast_log.h +66 -0
  171. package/vendor/brotli/c/enc/find_match_length.h +79 -0
  172. package/vendor/brotli/c/enc/hash.h +488 -0
  173. package/vendor/brotli/c/enc/hash_composite_inc.h +125 -0
  174. package/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +293 -0
  175. package/vendor/brotli/c/enc/hash_longest_match64_inc.h +267 -0
  176. package/vendor/brotli/c/enc/hash_longest_match_inc.h +262 -0
  177. package/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +266 -0
  178. package/vendor/brotli/c/enc/hash_rolling_inc.h +212 -0
  179. package/vendor/brotli/c/enc/hash_to_binary_tree_inc.h +329 -0
  180. package/vendor/brotli/c/enc/histogram.c +100 -0
  181. package/vendor/brotli/c/enc/histogram.h +63 -0
  182. package/vendor/brotli/c/enc/histogram_inc.h +51 -0
  183. package/vendor/brotli/c/enc/literal_cost.c +175 -0
  184. package/vendor/brotli/c/enc/literal_cost.h +30 -0
  185. package/vendor/brotli/c/enc/memory.c +170 -0
  186. package/vendor/brotli/c/enc/memory.h +114 -0
  187. package/vendor/brotli/c/enc/metablock.c +663 -0
  188. package/vendor/brotli/c/enc/metablock.h +105 -0
  189. package/vendor/brotli/c/enc/metablock_inc.h +183 -0
  190. package/vendor/brotli/c/enc/params.h +46 -0
  191. package/vendor/brotli/c/enc/prefix.h +53 -0
  192. package/vendor/brotli/c/enc/quality.h +165 -0
  193. package/vendor/brotli/c/enc/ringbuffer.h +167 -0
  194. package/vendor/brotli/c/enc/static_dict.c +486 -0
  195. package/vendor/brotli/c/enc/static_dict.h +40 -0
  196. package/vendor/brotli/c/enc/static_dict_lut.h +5864 -0
  197. package/vendor/brotli/c/enc/utf8_util.c +85 -0
  198. package/vendor/brotli/c/enc/utf8_util.h +32 -0
  199. package/vendor/brotli/c/enc/write_bits.h +87 -0
  200. package/vendor/brotli/c/include/brotli/decode.h +344 -0
  201. package/vendor/brotli/c/include/brotli/encode.h +448 -0
  202. package/vendor/brotli/c/include/brotli/port.h +288 -0
  203. package/vendor/brotli/c/include/brotli/types.h +83 -0
  204. package/vendor/brotli/c/tools/brotli.c +1116 -0
  205. package/vendor/brotli/c/tools/brotli.md +107 -0
  206. package/vendor/brotli/compiler_config_setting.bzl +28 -0
  207. package/vendor/brotli/configure +8 -0
  208. package/vendor/brotli/configure-cmake +318 -0
  209. package/vendor/brotli/configure.ac +14 -0
  210. package/vendor/brotli/docs/brotli.1 +132 -0
  211. package/vendor/brotli/docs/constants.h.3 +47 -0
  212. package/vendor/brotli/docs/decode.h.3 +415 -0
  213. package/vendor/brotli/docs/encode.h.3 +586 -0
  214. package/vendor/brotli/docs/types.h.3 +117 -0
  215. package/vendor/brotli/premake5.lua +78 -0
  216. package/vendor/brotli/python/Makefile +57 -0
  217. package/vendor/brotli/python/README.md +54 -0
  218. package/vendor/brotli/python/_brotli.cc +753 -0
  219. package/vendor/brotli/python/bro.py +160 -0
  220. package/vendor/brotli/python/brotli.py +56 -0
  221. package/vendor/brotli/python/tests/__init__.py +0 -0
  222. package/vendor/brotli/python/tests/_test_utils.py +112 -0
  223. package/vendor/brotli/python/tests/bro_test.py +102 -0
  224. package/vendor/brotli/python/tests/compress_test.py +41 -0
  225. package/vendor/brotli/python/tests/compressor_test.py +94 -0
  226. package/vendor/brotli/python/tests/decompress_test.py +42 -0
  227. package/vendor/brotli/python/tests/decompressor_test.py +59 -0
  228. package/vendor/brotli/scripts/libbrotlicommon.pc.in +11 -0
  229. package/vendor/brotli/scripts/libbrotlidec.pc.in +12 -0
  230. package/vendor/brotli/scripts/libbrotlienc.pc.in +12 -0
  231. package/vendor/brotli/scripts/sources.lst +104 -0
  232. package/vendor/brotli/setup.cfg +5 -0
  233. package/vendor/brotli/setup.py +293 -0
  234. package/vendor/brotli/tests/Makefile +17 -0
  235. package/vendor/brotli/tests/compatibility_test.sh +25 -0
  236. package/vendor/brotli/tests/roundtrip_test.sh +36 -0
  237. package/vendor/brotli/tests/run-compatibility-test.cmake +31 -0
  238. package/vendor/brotli/tests/run-roundtrip-test.cmake +36 -0
  239. package/vendor/brotli/tests/testdata/empty +0 -0
  240. package/vendor/brotli/tests/testdata/empty.compressed +1 -0
  241. package/vendor/brotli/tests/testdata/ukkonooa +1 -0
  242. package/vendor/brotli/tests/testdata/ukkonooa.compressed +0 -0
  243. package/vendor/miniz/ChangeLog.md +235 -0
  244. package/vendor/miniz/LICENSE +22 -0
  245. package/vendor/miniz/examples/example1.c +105 -0
  246. package/vendor/miniz/examples/example2.c +164 -0
  247. package/vendor/miniz/examples/example3.c +269 -0
  248. package/vendor/miniz/examples/example4.c +102 -0
  249. package/vendor/miniz/examples/example5.c +327 -0
  250. package/vendor/miniz/examples/example6.c +166 -0
  251. package/vendor/miniz/miniz.c +7835 -0
  252. package/vendor/miniz/miniz.h +1422 -0
  253. package/vendor/miniz/readme.md +46 -0
  254. package/vendor/{sqlite3 → sqlite3mc}/sqlite3ext.h +18 -2
  255. package/vendor/{sqlite3/sqlite3.c → sqlite3mc/sqlite3mc.c} +60872 -4890
  256. package/vendor/sqlite3mc/sqlite3mc.def +312 -0
  257. package/vendor/{sqlite3/sqlite3.h → sqlite3mc/sqlite3mc.h} +480 -36
  258. package/build/qemu/2.1.3/koffi_darwin_arm64.tar.gz +0 -0
  259. package/build/qemu/2.1.3/koffi_darwin_x64.tar.gz +0 -0
  260. package/build/qemu/2.1.3/koffi_freebsd_arm64.tar.gz +0 -0
  261. package/build/qemu/2.1.3/koffi_freebsd_ia32.tar.gz +0 -0
  262. package/build/qemu/2.1.3/koffi_freebsd_x64.tar.gz +0 -0
  263. package/build/qemu/2.1.3/koffi_linux_arm32hf.tar.gz +0 -0
  264. package/build/qemu/2.1.3/koffi_linux_arm64.tar.gz +0 -0
  265. package/build/qemu/2.1.3/koffi_linux_ia32.tar.gz +0 -0
  266. package/build/qemu/2.1.3/koffi_linux_riscv64hf64.tar.gz +0 -0
  267. package/build/qemu/2.1.3/koffi_linux_x64.tar.gz +0 -0
  268. package/build/qemu/2.1.3/koffi_openbsd_ia32.tar.gz +0 -0
  269. package/build/qemu/2.1.3/koffi_openbsd_x64.tar.gz +0 -0
  270. package/build/qemu/2.1.3/koffi_win32_arm64.tar.gz +0 -0
  271. package/build/qemu/2.1.3/koffi_win32_ia32.tar.gz +0 -0
  272. package/build/qemu/2.1.3/koffi_win32_x64.tar.gz +0 -0
  273. package/vendor/_patches/glfw_001_fix_openbsd_xlib_soname.patch +0 -145
  274. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +0 -226
  275. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +0 -10
  276. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +0 -4
  277. package/vendor/raylib/projects/VS2019-Android/raylib_android.sln +0 -75
  278. package/vendor/raylib/projects/VS2022/examples/audio_module_playing.vcxproj +0 -390
  279. package/vendor/raylib/projects/VS2022/examples/audio_multichannel_sound.vcxproj +0 -390
  280. package/vendor/raylib/projects/VS2022/examples/audio_music_stream.vcxproj +0 -390
  281. package/vendor/raylib/projects/VS2022/examples/audio_raw_stream.vcxproj +0 -390
  282. package/vendor/raylib/projects/VS2022/examples/audio_sound_loading.vcxproj +0 -390
  283. package/vendor/raylib/projects/VS2022/examples/audio_stream_effects.vcxproj +0 -390
  284. package/vendor/raylib/projects/VS2022/examples/core_2d_camera.vcxproj +0 -390
  285. package/vendor/raylib/projects/VS2022/examples/core_2d_camera_mouse_zoom.vcxproj +0 -390
  286. package/vendor/raylib/projects/VS2022/examples/core_2d_camera_platformer.vcxproj +0 -390
  287. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_first_person.vcxproj +0 -390
  288. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_free.vcxproj +0 -390
  289. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_mode.vcxproj +0 -390
  290. package/vendor/raylib/projects/VS2022/examples/core_3d_picking.vcxproj +0 -390
  291. package/vendor/raylib/projects/VS2022/examples/core_basic_screen_manager.vcxproj +0 -390
  292. package/vendor/raylib/projects/VS2022/examples/core_basic_window.vcxproj +0 -390
  293. package/vendor/raylib/projects/VS2022/examples/core_custom_frame_control.vcxproj +0 -390
  294. package/vendor/raylib/projects/VS2022/examples/core_custom_logging.vcxproj +0 -390
  295. package/vendor/raylib/projects/VS2022/examples/core_drop_files.vcxproj +0 -390
  296. package/vendor/raylib/projects/VS2022/examples/core_input_gamepad.vcxproj +0 -387
  297. package/vendor/raylib/projects/VS2022/examples/core_input_gestures.vcxproj +0 -387
  298. package/vendor/raylib/projects/VS2022/examples/core_input_keys.vcxproj +0 -387
  299. package/vendor/raylib/projects/VS2022/examples/core_input_mouse.vcxproj +0 -387
  300. package/vendor/raylib/projects/VS2022/examples/core_input_mouse_wheel.vcxproj +0 -387
  301. package/vendor/raylib/projects/VS2022/examples/core_input_multitouch.vcxproj +0 -387
  302. package/vendor/raylib/projects/VS2022/examples/core_loading_thread.vcxproj +0 -387
  303. package/vendor/raylib/projects/VS2022/examples/core_random_values.vcxproj +0 -387
  304. package/vendor/raylib/projects/VS2022/examples/core_scissor_test.vcxproj +0 -387
  305. package/vendor/raylib/projects/VS2022/examples/core_split_screen.vcxproj +0 -387
  306. package/vendor/raylib/projects/VS2022/examples/core_storage_values.vcxproj +0 -387
  307. package/vendor/raylib/projects/VS2022/examples/core_vr_simulator.vcxproj +0 -387
  308. package/vendor/raylib/projects/VS2022/examples/core_window_flags.vcxproj +0 -387
  309. package/vendor/raylib/projects/VS2022/examples/core_window_letterbox.vcxproj +0 -387
  310. package/vendor/raylib/projects/VS2022/examples/core_window_should_close.vcxproj +0 -390
  311. package/vendor/raylib/projects/VS2022/examples/core_world_screen.vcxproj +0 -387
  312. package/vendor/raylib/projects/VS2022/examples/easings_testbed.vcxproj +0 -387
  313. package/vendor/raylib/projects/VS2022/examples/embedded_files_loading.vcxproj +0 -387
  314. package/vendor/raylib/projects/VS2022/examples/models_animation.vcxproj +0 -387
  315. package/vendor/raylib/projects/VS2022/examples/models_billboard.vcxproj +0 -387
  316. package/vendor/raylib/projects/VS2022/examples/models_box_collisions.vcxproj +0 -387
  317. package/vendor/raylib/projects/VS2022/examples/models_cubicmap.vcxproj +0 -387
  318. package/vendor/raylib/projects/VS2022/examples/models_first_person_maze.vcxproj +0 -387
  319. package/vendor/raylib/projects/VS2022/examples/models_geometric_shapes.vcxproj +0 -387
  320. package/vendor/raylib/projects/VS2022/examples/models_heightmap.vcxproj +0 -387
  321. package/vendor/raylib/projects/VS2022/examples/models_loading.vcxproj +0 -387
  322. package/vendor/raylib/projects/VS2022/examples/models_loading_gltf.vcxproj +0 -387
  323. package/vendor/raylib/projects/VS2022/examples/models_loading_vox.vcxproj +0 -387
  324. package/vendor/raylib/projects/VS2022/examples/models_mesh_generation.vcxproj +0 -387
  325. package/vendor/raylib/projects/VS2022/examples/models_mesh_picking.vcxproj +0 -387
  326. package/vendor/raylib/projects/VS2022/examples/models_orthographic_projection.vcxproj +0 -387
  327. package/vendor/raylib/projects/VS2022/examples/models_rlgl_solar_system.vcxproj +0 -387
  328. package/vendor/raylib/projects/VS2022/examples/models_skybox.vcxproj +0 -387
  329. package/vendor/raylib/projects/VS2022/examples/models_waving_cubes.vcxproj +0 -387
  330. package/vendor/raylib/projects/VS2022/examples/models_yaw_pitch_roll.vcxproj +0 -387
  331. package/vendor/raylib/projects/VS2022/examples/rlgl_compute_shaders.vcxproj +0 -391
  332. package/vendor/raylib/projects/VS2022/examples/rlgl_standalone.vcxproj +0 -391
  333. package/vendor/raylib/projects/VS2022/examples/shaders_basic_lighting.vcxproj +0 -387
  334. package/vendor/raylib/projects/VS2022/examples/shaders_custom_uniform.vcxproj +0 -387
  335. package/vendor/raylib/projects/VS2022/examples/shaders_eratosthenes.vcxproj +0 -387
  336. package/vendor/raylib/projects/VS2022/examples/shaders_fog.vcxproj +0 -387
  337. package/vendor/raylib/projects/VS2022/examples/shaders_hot_reloading.vcxproj +0 -387
  338. package/vendor/raylib/projects/VS2022/examples/shaders_julia_set.vcxproj +0 -387
  339. package/vendor/raylib/projects/VS2022/examples/shaders_mesh_instancing.vcxproj +0 -387
  340. package/vendor/raylib/projects/VS2022/examples/shaders_model_shader.vcxproj +0 -387
  341. package/vendor/raylib/projects/VS2022/examples/shaders_multi_sample2d.vcxproj +0 -387
  342. package/vendor/raylib/projects/VS2022/examples/shaders_palette_switch.vcxproj +0 -387
  343. package/vendor/raylib/projects/VS2022/examples/shaders_postprocessing.vcxproj +0 -387
  344. package/vendor/raylib/projects/VS2022/examples/shaders_raymarching.vcxproj +0 -387
  345. package/vendor/raylib/projects/VS2022/examples/shaders_shapes_textures.vcxproj +0 -387
  346. package/vendor/raylib/projects/VS2022/examples/shaders_simple_mask.vcxproj +0 -387
  347. package/vendor/raylib/projects/VS2022/examples/shaders_spotlight.vcxproj +0 -387
  348. package/vendor/raylib/projects/VS2022/examples/shaders_texture_drawing.vcxproj +0 -387
  349. package/vendor/raylib/projects/VS2022/examples/shaders_texture_waves.vcxproj +0 -387
  350. package/vendor/raylib/projects/VS2022/examples/shapes_basic_shapes.vcxproj +0 -387
  351. package/vendor/raylib/projects/VS2022/examples/shapes_bouncing_ball.vcxproj +0 -387
  352. package/vendor/raylib/projects/VS2022/examples/shapes_collision_area.vcxproj +0 -387
  353. package/vendor/raylib/projects/VS2022/examples/shapes_colors_palette.vcxproj +0 -387
  354. package/vendor/raylib/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj +0 -387
  355. package/vendor/raylib/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj +0 -387
  356. package/vendor/raylib/projects/VS2022/examples/shapes_draw_ring.vcxproj +0 -387
  357. package/vendor/raylib/projects/VS2022/examples/shapes_easings_ball_anim.vcxproj +0 -387
  358. package/vendor/raylib/projects/VS2022/examples/shapes_easings_box_anim.vcxproj +0 -387
  359. package/vendor/raylib/projects/VS2022/examples/shapes_easings_rectangle_array.vcxproj +0 -387
  360. package/vendor/raylib/projects/VS2022/examples/shapes_following_eyes.vcxproj +0 -387
  361. package/vendor/raylib/projects/VS2022/examples/shapes_lines_bezier.vcxproj +0 -387
  362. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib.vcxproj +0 -387
  363. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib_anim.vcxproj +0 -387
  364. package/vendor/raylib/projects/VS2022/examples/shapes_rectangle_scaling.vcxproj +0 -387
  365. package/vendor/raylib/projects/VS2022/examples/text_codepoints_loading.vcxproj +0 -387
  366. package/vendor/raylib/projects/VS2022/examples/text_draw_3d.vcxproj +0 -387
  367. package/vendor/raylib/projects/VS2022/examples/text_font_filters.vcxproj +0 -387
  368. package/vendor/raylib/projects/VS2022/examples/text_font_loading.vcxproj +0 -387
  369. package/vendor/raylib/projects/VS2022/examples/text_font_sdf.vcxproj +0 -387
  370. package/vendor/raylib/projects/VS2022/examples/text_font_spritefont.vcxproj +0 -387
  371. package/vendor/raylib/projects/VS2022/examples/text_format_text.vcxproj +0 -387
  372. package/vendor/raylib/projects/VS2022/examples/text_input_box.vcxproj +0 -387
  373. package/vendor/raylib/projects/VS2022/examples/text_raylib_fonts.vcxproj +0 -387
  374. package/vendor/raylib/projects/VS2022/examples/text_rectangle_bounds.vcxproj +0 -387
  375. package/vendor/raylib/projects/VS2022/examples/text_unicode.vcxproj +0 -387
  376. package/vendor/raylib/projects/VS2022/examples/text_writing_anim.vcxproj +0 -387
  377. package/vendor/raylib/projects/VS2022/examples/textures_background_scrolling.vcxproj +0 -387
  378. package/vendor/raylib/projects/VS2022/examples/textures_blend_modes.vcxproj +0 -387
  379. package/vendor/raylib/projects/VS2022/examples/textures_bunnymark.vcxproj +0 -387
  380. package/vendor/raylib/projects/VS2022/examples/textures_draw_tiled.vcxproj +0 -387
  381. package/vendor/raylib/projects/VS2022/examples/textures_fog_of_war.vcxproj +0 -387
  382. package/vendor/raylib/projects/VS2022/examples/textures_gif_player.vcxproj +0 -387
  383. package/vendor/raylib/projects/VS2022/examples/textures_image_drawing.vcxproj +0 -387
  384. package/vendor/raylib/projects/VS2022/examples/textures_image_generation.vcxproj +0 -387
  385. package/vendor/raylib/projects/VS2022/examples/textures_image_loading.vcxproj +0 -387
  386. package/vendor/raylib/projects/VS2022/examples/textures_image_processing.vcxproj +0 -387
  387. package/vendor/raylib/projects/VS2022/examples/textures_image_text.vcxproj +0 -387
  388. package/vendor/raylib/projects/VS2022/examples/textures_logo_raylib.vcxproj +0 -387
  389. package/vendor/raylib/projects/VS2022/examples/textures_mouse_painting.vcxproj +0 -387
  390. package/vendor/raylib/projects/VS2022/examples/textures_npatch_drawing.vcxproj +0 -387
  391. package/vendor/raylib/projects/VS2022/examples/textures_particles_blending.vcxproj +0 -387
  392. package/vendor/raylib/projects/VS2022/examples/textures_polygon.vcxproj +0 -387
  393. package/vendor/raylib/projects/VS2022/examples/textures_raw_data.vcxproj +0 -387
  394. package/vendor/raylib/projects/VS2022/examples/textures_sprite_anim.vcxproj +0 -387
  395. package/vendor/raylib/projects/VS2022/examples/textures_sprite_button.vcxproj +0 -387
  396. package/vendor/raylib/projects/VS2022/examples/textures_sprite_explosion.vcxproj +0 -387
  397. package/vendor/raylib/projects/VS2022/examples/textures_srcrec_dstrec.vcxproj +0 -387
  398. package/vendor/raylib/projects/VS2022/examples/textures_to_image.vcxproj +0 -387
  399. package/vendor/raylib/projects/VS2022/raylib/raylib.vcxproj +0 -340
  400. package/vendor/raylib/projects/VS2022/raylib.sln +0 -2347
  401. package/vendor/sqlite3/shell.c +0 -23496
@@ -0,0 +1,167 @@
1
+ /* Copyright 2013 Google Inc. All Rights Reserved.
2
+
3
+ Distributed under MIT license.
4
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5
+ */
6
+
7
+ /* Sliding window over the input data. */
8
+
9
+ #ifndef BROTLI_ENC_RINGBUFFER_H_
10
+ #define BROTLI_ENC_RINGBUFFER_H_
11
+
12
+ #include <string.h> /* memcpy */
13
+
14
+ #include "../common/platform.h"
15
+ #include <brotli/types.h>
16
+ #include "./memory.h"
17
+ #include "./quality.h"
18
+
19
+ #if defined(__cplusplus) || defined(c_plusplus)
20
+ extern "C" {
21
+ #endif
22
+
23
+ /* A RingBuffer(window_bits, tail_bits) contains `1 << window_bits' bytes of
24
+ data in a circular manner: writing a byte writes it to:
25
+ `position() % (1 << window_bits)'.
26
+ For convenience, the RingBuffer array contains another copy of the
27
+ first `1 << tail_bits' bytes:
28
+ buffer_[i] == buffer_[i + (1 << window_bits)], if i < (1 << tail_bits),
29
+ and another copy of the last two bytes:
30
+ buffer_[-1] == buffer_[(1 << window_bits) - 1] and
31
+ buffer_[-2] == buffer_[(1 << window_bits) - 2]. */
32
+ typedef struct RingBuffer {
33
+ /* Size of the ring-buffer is (1 << window_bits) + tail_size_. */
34
+ const uint32_t size_;
35
+ const uint32_t mask_;
36
+ const uint32_t tail_size_;
37
+ const uint32_t total_size_;
38
+
39
+ uint32_t cur_size_;
40
+ /* Position to write in the ring buffer. */
41
+ uint32_t pos_;
42
+ /* The actual ring buffer containing the copy of the last two bytes, the data,
43
+ and the copy of the beginning as a tail. */
44
+ uint8_t* data_;
45
+ /* The start of the ring-buffer. */
46
+ uint8_t* buffer_;
47
+ } RingBuffer;
48
+
49
+ static BROTLI_INLINE void RingBufferInit(RingBuffer* rb) {
50
+ rb->cur_size_ = 0;
51
+ rb->pos_ = 0;
52
+ rb->data_ = 0;
53
+ rb->buffer_ = 0;
54
+ }
55
+
56
+ static BROTLI_INLINE void RingBufferSetup(
57
+ const BrotliEncoderParams* params, RingBuffer* rb) {
58
+ int window_bits = ComputeRbBits(params);
59
+ int tail_bits = params->lgblock;
60
+ *(uint32_t*)&rb->size_ = 1u << window_bits;
61
+ *(uint32_t*)&rb->mask_ = (1u << window_bits) - 1;
62
+ *(uint32_t*)&rb->tail_size_ = 1u << tail_bits;
63
+ *(uint32_t*)&rb->total_size_ = rb->size_ + rb->tail_size_;
64
+ }
65
+
66
+ static BROTLI_INLINE void RingBufferFree(MemoryManager* m, RingBuffer* rb) {
67
+ BROTLI_FREE(m, rb->data_);
68
+ }
69
+
70
+ /* Allocates or re-allocates data_ to the given length + plus some slack
71
+ region before and after. Fills the slack regions with zeros. */
72
+ static BROTLI_INLINE void RingBufferInitBuffer(
73
+ MemoryManager* m, const uint32_t buflen, RingBuffer* rb) {
74
+ static const size_t kSlackForEightByteHashingEverywhere = 7;
75
+ uint8_t* new_data = BROTLI_ALLOC(
76
+ m, uint8_t, 2 + buflen + kSlackForEightByteHashingEverywhere);
77
+ size_t i;
78
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_data)) return;
79
+ if (rb->data_) {
80
+ memcpy(new_data, rb->data_,
81
+ 2 + rb->cur_size_ + kSlackForEightByteHashingEverywhere);
82
+ BROTLI_FREE(m, rb->data_);
83
+ }
84
+ rb->data_ = new_data;
85
+ rb->cur_size_ = buflen;
86
+ rb->buffer_ = rb->data_ + 2;
87
+ rb->buffer_[-2] = rb->buffer_[-1] = 0;
88
+ for (i = 0; i < kSlackForEightByteHashingEverywhere; ++i) {
89
+ rb->buffer_[rb->cur_size_ + i] = 0;
90
+ }
91
+ }
92
+
93
+ static BROTLI_INLINE void RingBufferWriteTail(
94
+ const uint8_t* bytes, size_t n, RingBuffer* rb) {
95
+ const size_t masked_pos = rb->pos_ & rb->mask_;
96
+ if (BROTLI_PREDICT_FALSE(masked_pos < rb->tail_size_)) {
97
+ /* Just fill the tail buffer with the beginning data. */
98
+ const size_t p = rb->size_ + masked_pos;
99
+ memcpy(&rb->buffer_[p], bytes,
100
+ BROTLI_MIN(size_t, n, rb->tail_size_ - masked_pos));
101
+ }
102
+ }
103
+
104
+ /* Push bytes into the ring buffer. */
105
+ static BROTLI_INLINE void RingBufferWrite(
106
+ MemoryManager* m, const uint8_t* bytes, size_t n, RingBuffer* rb) {
107
+ if (rb->pos_ == 0 && n < rb->tail_size_) {
108
+ /* Special case for the first write: to process the first block, we don't
109
+ need to allocate the whole ring-buffer and we don't need the tail
110
+ either. However, we do this memory usage optimization only if the
111
+ first write is less than the tail size, which is also the input block
112
+ size, otherwise it is likely that other blocks will follow and we
113
+ will need to reallocate to the full size anyway. */
114
+ rb->pos_ = (uint32_t)n;
115
+ RingBufferInitBuffer(m, rb->pos_, rb);
116
+ if (BROTLI_IS_OOM(m)) return;
117
+ memcpy(rb->buffer_, bytes, n);
118
+ return;
119
+ }
120
+ if (rb->cur_size_ < rb->total_size_) {
121
+ /* Lazily allocate the full buffer. */
122
+ RingBufferInitBuffer(m, rb->total_size_, rb);
123
+ if (BROTLI_IS_OOM(m)) return;
124
+ /* Initialize the last two bytes to zero, so that we don't have to worry
125
+ later when we copy the last two bytes to the first two positions. */
126
+ rb->buffer_[rb->size_ - 2] = 0;
127
+ rb->buffer_[rb->size_ - 1] = 0;
128
+ /* Initialize tail; might be touched by "best_len++" optimization when
129
+ ring buffer is "full". */
130
+ rb->buffer_[rb->size_] = 241;
131
+ }
132
+ {
133
+ const size_t masked_pos = rb->pos_ & rb->mask_;
134
+ /* The length of the writes is limited so that we do not need to worry
135
+ about a write */
136
+ RingBufferWriteTail(bytes, n, rb);
137
+ if (BROTLI_PREDICT_TRUE(masked_pos + n <= rb->size_)) {
138
+ /* A single write fits. */
139
+ memcpy(&rb->buffer_[masked_pos], bytes, n);
140
+ } else {
141
+ /* Split into two writes.
142
+ Copy into the end of the buffer, including the tail buffer. */
143
+ memcpy(&rb->buffer_[masked_pos], bytes,
144
+ BROTLI_MIN(size_t, n, rb->total_size_ - masked_pos));
145
+ /* Copy into the beginning of the buffer */
146
+ memcpy(&rb->buffer_[0], bytes + (rb->size_ - masked_pos),
147
+ n - (rb->size_ - masked_pos));
148
+ }
149
+ }
150
+ {
151
+ BROTLI_BOOL not_first_lap = (rb->pos_ & (1u << 31)) != 0;
152
+ uint32_t rb_pos_mask = (1u << 31) - 1;
153
+ rb->buffer_[-2] = rb->buffer_[rb->size_ - 2];
154
+ rb->buffer_[-1] = rb->buffer_[rb->size_ - 1];
155
+ rb->pos_ = (rb->pos_ & rb_pos_mask) + (uint32_t)(n & rb_pos_mask);
156
+ if (not_first_lap) {
157
+ /* Wrap, but preserve not-a-first-lap feature. */
158
+ rb->pos_ |= 1u << 31;
159
+ }
160
+ }
161
+ }
162
+
163
+ #if defined(__cplusplus) || defined(c_plusplus)
164
+ } /* extern "C" */
165
+ #endif
166
+
167
+ #endif /* BROTLI_ENC_RINGBUFFER_H_ */
@@ -0,0 +1,486 @@
1
+ /* Copyright 2013 Google Inc. All Rights Reserved.
2
+
3
+ Distributed under MIT license.
4
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5
+ */
6
+
7
+ #include "./static_dict.h"
8
+
9
+ #include "../common/dictionary.h"
10
+ #include "../common/platform.h"
11
+ #include "../common/transform.h"
12
+ #include "./encoder_dict.h"
13
+ #include "./find_match_length.h"
14
+
15
+ #if defined(__cplusplus) || defined(c_plusplus)
16
+ extern "C" {
17
+ #endif
18
+
19
+ static BROTLI_INLINE uint32_t Hash(const uint8_t* data) {
20
+ uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kDictHashMul32;
21
+ /* The higher bits contain more mixture from the multiplication,
22
+ so we take our results from there. */
23
+ return h >> (32 - kDictNumBits);
24
+ }
25
+
26
+ static BROTLI_INLINE void AddMatch(size_t distance, size_t len, size_t len_code,
27
+ uint32_t* matches) {
28
+ uint32_t match = (uint32_t)((distance << 5) + len_code);
29
+ matches[len] = BROTLI_MIN(uint32_t, matches[len], match);
30
+ }
31
+
32
+ static BROTLI_INLINE size_t DictMatchLength(const BrotliDictionary* dictionary,
33
+ const uint8_t* data,
34
+ size_t id,
35
+ size_t len,
36
+ size_t maxlen) {
37
+ const size_t offset = dictionary->offsets_by_length[len] + len * id;
38
+ return FindMatchLengthWithLimit(&dictionary->data[offset], data,
39
+ BROTLI_MIN(size_t, len, maxlen));
40
+ }
41
+
42
+ static BROTLI_INLINE BROTLI_BOOL IsMatch(const BrotliDictionary* dictionary,
43
+ DictWord w, const uint8_t* data, size_t max_length) {
44
+ if (w.len > max_length) {
45
+ return BROTLI_FALSE;
46
+ } else {
47
+ const size_t offset = dictionary->offsets_by_length[w.len] +
48
+ (size_t)w.len * (size_t)w.idx;
49
+ const uint8_t* dict = &dictionary->data[offset];
50
+ if (w.transform == 0) {
51
+ /* Match against base dictionary word. */
52
+ return
53
+ TO_BROTLI_BOOL(FindMatchLengthWithLimit(dict, data, w.len) == w.len);
54
+ } else if (w.transform == 10) {
55
+ /* Match against uppercase first transform.
56
+ Note that there are only ASCII uppercase words in the lookup table. */
57
+ return TO_BROTLI_BOOL(dict[0] >= 'a' && dict[0] <= 'z' &&
58
+ (dict[0] ^ 32) == data[0] &&
59
+ FindMatchLengthWithLimit(&dict[1], &data[1], w.len - 1u) ==
60
+ w.len - 1u);
61
+ } else {
62
+ /* Match against uppercase all transform.
63
+ Note that there are only ASCII uppercase words in the lookup table. */
64
+ size_t i;
65
+ for (i = 0; i < w.len; ++i) {
66
+ if (dict[i] >= 'a' && dict[i] <= 'z') {
67
+ if ((dict[i] ^ 32) != data[i]) return BROTLI_FALSE;
68
+ } else {
69
+ if (dict[i] != data[i]) return BROTLI_FALSE;
70
+ }
71
+ }
72
+ return BROTLI_TRUE;
73
+ }
74
+ }
75
+ }
76
+
77
+ BROTLI_BOOL BrotliFindAllStaticDictionaryMatches(
78
+ const BrotliEncoderDictionary* dictionary, const uint8_t* data,
79
+ size_t min_length, size_t max_length, uint32_t* matches) {
80
+ BROTLI_BOOL has_found_match = BROTLI_FALSE;
81
+ {
82
+ size_t offset = dictionary->buckets[Hash(data)];
83
+ BROTLI_BOOL end = !offset;
84
+ while (!end) {
85
+ DictWord w = dictionary->dict_words[offset++];
86
+ const size_t l = w.len & 0x1F;
87
+ const size_t n = (size_t)1 << dictionary->words->size_bits_by_length[l];
88
+ const size_t id = w.idx;
89
+ end = !!(w.len & 0x80);
90
+ w.len = (uint8_t)l;
91
+ if (w.transform == 0) {
92
+ const size_t matchlen =
93
+ DictMatchLength(dictionary->words, data, id, l, max_length);
94
+ const uint8_t* s;
95
+ size_t minlen;
96
+ size_t maxlen;
97
+ size_t len;
98
+ /* Transform "" + BROTLI_TRANSFORM_IDENTITY + "" */
99
+ if (matchlen == l) {
100
+ AddMatch(id, l, l, matches);
101
+ has_found_match = BROTLI_TRUE;
102
+ }
103
+ /* Transforms "" + BROTLI_TRANSFORM_OMIT_LAST_1 + "" and
104
+ "" + BROTLI_TRANSFORM_OMIT_LAST_1 + "ing " */
105
+ if (matchlen >= l - 1) {
106
+ AddMatch(id + 12 * n, l - 1, l, matches);
107
+ if (l + 2 < max_length &&
108
+ data[l - 1] == 'i' && data[l] == 'n' && data[l + 1] == 'g' &&
109
+ data[l + 2] == ' ') {
110
+ AddMatch(id + 49 * n, l + 3, l, matches);
111
+ }
112
+ has_found_match = BROTLI_TRUE;
113
+ }
114
+ /* Transform "" + BROTLI_TRANSFORM_OMIT_LAST_# + "" (# = 2 .. 9) */
115
+ minlen = min_length;
116
+ if (l > 9) minlen = BROTLI_MAX(size_t, minlen, l - 9);
117
+ maxlen = BROTLI_MIN(size_t, matchlen, l - 2);
118
+ for (len = minlen; len <= maxlen; ++len) {
119
+ size_t cut = l - len;
120
+ size_t transform_id = (cut << 2) +
121
+ (size_t)((dictionary->cutoffTransforms >> (cut * 6)) & 0x3F);
122
+ AddMatch(id + transform_id * n, len, l, matches);
123
+ has_found_match = BROTLI_TRUE;
124
+ }
125
+ if (matchlen < l || l + 6 >= max_length) {
126
+ continue;
127
+ }
128
+ s = &data[l];
129
+ /* Transforms "" + BROTLI_TRANSFORM_IDENTITY + <suffix> */
130
+ if (s[0] == ' ') {
131
+ AddMatch(id + n, l + 1, l, matches);
132
+ if (s[1] == 'a') {
133
+ if (s[2] == ' ') {
134
+ AddMatch(id + 28 * n, l + 3, l, matches);
135
+ } else if (s[2] == 's') {
136
+ if (s[3] == ' ') AddMatch(id + 46 * n, l + 4, l, matches);
137
+ } else if (s[2] == 't') {
138
+ if (s[3] == ' ') AddMatch(id + 60 * n, l + 4, l, matches);
139
+ } else if (s[2] == 'n') {
140
+ if (s[3] == 'd' && s[4] == ' ') {
141
+ AddMatch(id + 10 * n, l + 5, l, matches);
142
+ }
143
+ }
144
+ } else if (s[1] == 'b') {
145
+ if (s[2] == 'y' && s[3] == ' ') {
146
+ AddMatch(id + 38 * n, l + 4, l, matches);
147
+ }
148
+ } else if (s[1] == 'i') {
149
+ if (s[2] == 'n') {
150
+ if (s[3] == ' ') AddMatch(id + 16 * n, l + 4, l, matches);
151
+ } else if (s[2] == 's') {
152
+ if (s[3] == ' ') AddMatch(id + 47 * n, l + 4, l, matches);
153
+ }
154
+ } else if (s[1] == 'f') {
155
+ if (s[2] == 'o') {
156
+ if (s[3] == 'r' && s[4] == ' ') {
157
+ AddMatch(id + 25 * n, l + 5, l, matches);
158
+ }
159
+ } else if (s[2] == 'r') {
160
+ if (s[3] == 'o' && s[4] == 'm' && s[5] == ' ') {
161
+ AddMatch(id + 37 * n, l + 6, l, matches);
162
+ }
163
+ }
164
+ } else if (s[1] == 'o') {
165
+ if (s[2] == 'f') {
166
+ if (s[3] == ' ') AddMatch(id + 8 * n, l + 4, l, matches);
167
+ } else if (s[2] == 'n') {
168
+ if (s[3] == ' ') AddMatch(id + 45 * n, l + 4, l, matches);
169
+ }
170
+ } else if (s[1] == 'n') {
171
+ if (s[2] == 'o' && s[3] == 't' && s[4] == ' ') {
172
+ AddMatch(id + 80 * n, l + 5, l, matches);
173
+ }
174
+ } else if (s[1] == 't') {
175
+ if (s[2] == 'h') {
176
+ if (s[3] == 'e') {
177
+ if (s[4] == ' ') AddMatch(id + 5 * n, l + 5, l, matches);
178
+ } else if (s[3] == 'a') {
179
+ if (s[4] == 't' && s[5] == ' ') {
180
+ AddMatch(id + 29 * n, l + 6, l, matches);
181
+ }
182
+ }
183
+ } else if (s[2] == 'o') {
184
+ if (s[3] == ' ') AddMatch(id + 17 * n, l + 4, l, matches);
185
+ }
186
+ } else if (s[1] == 'w') {
187
+ if (s[2] == 'i' && s[3] == 't' && s[4] == 'h' && s[5] == ' ') {
188
+ AddMatch(id + 35 * n, l + 6, l, matches);
189
+ }
190
+ }
191
+ } else if (s[0] == '"') {
192
+ AddMatch(id + 19 * n, l + 1, l, matches);
193
+ if (s[1] == '>') {
194
+ AddMatch(id + 21 * n, l + 2, l, matches);
195
+ }
196
+ } else if (s[0] == '.') {
197
+ AddMatch(id + 20 * n, l + 1, l, matches);
198
+ if (s[1] == ' ') {
199
+ AddMatch(id + 31 * n, l + 2, l, matches);
200
+ if (s[2] == 'T' && s[3] == 'h') {
201
+ if (s[4] == 'e') {
202
+ if (s[5] == ' ') AddMatch(id + 43 * n, l + 6, l, matches);
203
+ } else if (s[4] == 'i') {
204
+ if (s[5] == 's' && s[6] == ' ') {
205
+ AddMatch(id + 75 * n, l + 7, l, matches);
206
+ }
207
+ }
208
+ }
209
+ }
210
+ } else if (s[0] == ',') {
211
+ AddMatch(id + 76 * n, l + 1, l, matches);
212
+ if (s[1] == ' ') {
213
+ AddMatch(id + 14 * n, l + 2, l, matches);
214
+ }
215
+ } else if (s[0] == '\n') {
216
+ AddMatch(id + 22 * n, l + 1, l, matches);
217
+ if (s[1] == '\t') {
218
+ AddMatch(id + 50 * n, l + 2, l, matches);
219
+ }
220
+ } else if (s[0] == ']') {
221
+ AddMatch(id + 24 * n, l + 1, l, matches);
222
+ } else if (s[0] == '\'') {
223
+ AddMatch(id + 36 * n, l + 1, l, matches);
224
+ } else if (s[0] == ':') {
225
+ AddMatch(id + 51 * n, l + 1, l, matches);
226
+ } else if (s[0] == '(') {
227
+ AddMatch(id + 57 * n, l + 1, l, matches);
228
+ } else if (s[0] == '=') {
229
+ if (s[1] == '"') {
230
+ AddMatch(id + 70 * n, l + 2, l, matches);
231
+ } else if (s[1] == '\'') {
232
+ AddMatch(id + 86 * n, l + 2, l, matches);
233
+ }
234
+ } else if (s[0] == 'a') {
235
+ if (s[1] == 'l' && s[2] == ' ') {
236
+ AddMatch(id + 84 * n, l + 3, l, matches);
237
+ }
238
+ } else if (s[0] == 'e') {
239
+ if (s[1] == 'd') {
240
+ if (s[2] == ' ') AddMatch(id + 53 * n, l + 3, l, matches);
241
+ } else if (s[1] == 'r') {
242
+ if (s[2] == ' ') AddMatch(id + 82 * n, l + 3, l, matches);
243
+ } else if (s[1] == 's') {
244
+ if (s[2] == 't' && s[3] == ' ') {
245
+ AddMatch(id + 95 * n, l + 4, l, matches);
246
+ }
247
+ }
248
+ } else if (s[0] == 'f') {
249
+ if (s[1] == 'u' && s[2] == 'l' && s[3] == ' ') {
250
+ AddMatch(id + 90 * n, l + 4, l, matches);
251
+ }
252
+ } else if (s[0] == 'i') {
253
+ if (s[1] == 'v') {
254
+ if (s[2] == 'e' && s[3] == ' ') {
255
+ AddMatch(id + 92 * n, l + 4, l, matches);
256
+ }
257
+ } else if (s[1] == 'z') {
258
+ if (s[2] == 'e' && s[3] == ' ') {
259
+ AddMatch(id + 100 * n, l + 4, l, matches);
260
+ }
261
+ }
262
+ } else if (s[0] == 'l') {
263
+ if (s[1] == 'e') {
264
+ if (s[2] == 's' && s[3] == 's' && s[4] == ' ') {
265
+ AddMatch(id + 93 * n, l + 5, l, matches);
266
+ }
267
+ } else if (s[1] == 'y') {
268
+ if (s[2] == ' ') AddMatch(id + 61 * n, l + 3, l, matches);
269
+ }
270
+ } else if (s[0] == 'o') {
271
+ if (s[1] == 'u' && s[2] == 's' && s[3] == ' ') {
272
+ AddMatch(id + 106 * n, l + 4, l, matches);
273
+ }
274
+ }
275
+ } else {
276
+ /* Set is_all_caps=0 for BROTLI_TRANSFORM_UPPERCASE_FIRST and
277
+ is_all_caps=1 otherwise (BROTLI_TRANSFORM_UPPERCASE_ALL)
278
+ transform. */
279
+ const BROTLI_BOOL is_all_caps =
280
+ TO_BROTLI_BOOL(w.transform != BROTLI_TRANSFORM_UPPERCASE_FIRST);
281
+ const uint8_t* s;
282
+ if (!IsMatch(dictionary->words, w, data, max_length)) {
283
+ continue;
284
+ }
285
+ /* Transform "" + kUppercase{First,All} + "" */
286
+ AddMatch(id + (is_all_caps ? 44 : 9) * n, l, l, matches);
287
+ has_found_match = BROTLI_TRUE;
288
+ if (l + 1 >= max_length) {
289
+ continue;
290
+ }
291
+ /* Transforms "" + kUppercase{First,All} + <suffix> */
292
+ s = &data[l];
293
+ if (s[0] == ' ') {
294
+ AddMatch(id + (is_all_caps ? 68 : 4) * n, l + 1, l, matches);
295
+ } else if (s[0] == '"') {
296
+ AddMatch(id + (is_all_caps ? 87 : 66) * n, l + 1, l, matches);
297
+ if (s[1] == '>') {
298
+ AddMatch(id + (is_all_caps ? 97 : 69) * n, l + 2, l, matches);
299
+ }
300
+ } else if (s[0] == '.') {
301
+ AddMatch(id + (is_all_caps ? 101 : 79) * n, l + 1, l, matches);
302
+ if (s[1] == ' ') {
303
+ AddMatch(id + (is_all_caps ? 114 : 88) * n, l + 2, l, matches);
304
+ }
305
+ } else if (s[0] == ',') {
306
+ AddMatch(id + (is_all_caps ? 112 : 99) * n, l + 1, l, matches);
307
+ if (s[1] == ' ') {
308
+ AddMatch(id + (is_all_caps ? 107 : 58) * n, l + 2, l, matches);
309
+ }
310
+ } else if (s[0] == '\'') {
311
+ AddMatch(id + (is_all_caps ? 94 : 74) * n, l + 1, l, matches);
312
+ } else if (s[0] == '(') {
313
+ AddMatch(id + (is_all_caps ? 113 : 78) * n, l + 1, l, matches);
314
+ } else if (s[0] == '=') {
315
+ if (s[1] == '"') {
316
+ AddMatch(id + (is_all_caps ? 105 : 104) * n, l + 2, l, matches);
317
+ } else if (s[1] == '\'') {
318
+ AddMatch(id + (is_all_caps ? 116 : 108) * n, l + 2, l, matches);
319
+ }
320
+ }
321
+ }
322
+ }
323
+ }
324
+ /* Transforms with prefixes " " and "." */
325
+ if (max_length >= 5 && (data[0] == ' ' || data[0] == '.')) {
326
+ BROTLI_BOOL is_space = TO_BROTLI_BOOL(data[0] == ' ');
327
+ size_t offset = dictionary->buckets[Hash(&data[1])];
328
+ BROTLI_BOOL end = !offset;
329
+ while (!end) {
330
+ DictWord w = dictionary->dict_words[offset++];
331
+ const size_t l = w.len & 0x1F;
332
+ const size_t n = (size_t)1 << dictionary->words->size_bits_by_length[l];
333
+ const size_t id = w.idx;
334
+ end = !!(w.len & 0x80);
335
+ w.len = (uint8_t)l;
336
+ if (w.transform == 0) {
337
+ const uint8_t* s;
338
+ if (!IsMatch(dictionary->words, w, &data[1], max_length - 1)) {
339
+ continue;
340
+ }
341
+ /* Transforms " " + BROTLI_TRANSFORM_IDENTITY + "" and
342
+ "." + BROTLI_TRANSFORM_IDENTITY + "" */
343
+ AddMatch(id + (is_space ? 6 : 32) * n, l + 1, l, matches);
344
+ has_found_match = BROTLI_TRUE;
345
+ if (l + 2 >= max_length) {
346
+ continue;
347
+ }
348
+ /* Transforms " " + BROTLI_TRANSFORM_IDENTITY + <suffix> and
349
+ "." + BROTLI_TRANSFORM_IDENTITY + <suffix>
350
+ */
351
+ s = &data[l + 1];
352
+ if (s[0] == ' ') {
353
+ AddMatch(id + (is_space ? 2 : 77) * n, l + 2, l, matches);
354
+ } else if (s[0] == '(') {
355
+ AddMatch(id + (is_space ? 89 : 67) * n, l + 2, l, matches);
356
+ } else if (is_space) {
357
+ if (s[0] == ',') {
358
+ AddMatch(id + 103 * n, l + 2, l, matches);
359
+ if (s[1] == ' ') {
360
+ AddMatch(id + 33 * n, l + 3, l, matches);
361
+ }
362
+ } else if (s[0] == '.') {
363
+ AddMatch(id + 71 * n, l + 2, l, matches);
364
+ if (s[1] == ' ') {
365
+ AddMatch(id + 52 * n, l + 3, l, matches);
366
+ }
367
+ } else if (s[0] == '=') {
368
+ if (s[1] == '"') {
369
+ AddMatch(id + 81 * n, l + 3, l, matches);
370
+ } else if (s[1] == '\'') {
371
+ AddMatch(id + 98 * n, l + 3, l, matches);
372
+ }
373
+ }
374
+ }
375
+ } else if (is_space) {
376
+ /* Set is_all_caps=0 for BROTLI_TRANSFORM_UPPERCASE_FIRST and
377
+ is_all_caps=1 otherwise (BROTLI_TRANSFORM_UPPERCASE_ALL)
378
+ transform. */
379
+ const BROTLI_BOOL is_all_caps =
380
+ TO_BROTLI_BOOL(w.transform != BROTLI_TRANSFORM_UPPERCASE_FIRST);
381
+ const uint8_t* s;
382
+ if (!IsMatch(dictionary->words, w, &data[1], max_length - 1)) {
383
+ continue;
384
+ }
385
+ /* Transforms " " + kUppercase{First,All} + "" */
386
+ AddMatch(id + (is_all_caps ? 85 : 30) * n, l + 1, l, matches);
387
+ has_found_match = BROTLI_TRUE;
388
+ if (l + 2 >= max_length) {
389
+ continue;
390
+ }
391
+ /* Transforms " " + kUppercase{First,All} + <suffix> */
392
+ s = &data[l + 1];
393
+ if (s[0] == ' ') {
394
+ AddMatch(id + (is_all_caps ? 83 : 15) * n, l + 2, l, matches);
395
+ } else if (s[0] == ',') {
396
+ if (!is_all_caps) {
397
+ AddMatch(id + 109 * n, l + 2, l, matches);
398
+ }
399
+ if (s[1] == ' ') {
400
+ AddMatch(id + (is_all_caps ? 111 : 65) * n, l + 3, l, matches);
401
+ }
402
+ } else if (s[0] == '.') {
403
+ AddMatch(id + (is_all_caps ? 115 : 96) * n, l + 2, l, matches);
404
+ if (s[1] == ' ') {
405
+ AddMatch(id + (is_all_caps ? 117 : 91) * n, l + 3, l, matches);
406
+ }
407
+ } else if (s[0] == '=') {
408
+ if (s[1] == '"') {
409
+ AddMatch(id + (is_all_caps ? 110 : 118) * n, l + 3, l, matches);
410
+ } else if (s[1] == '\'') {
411
+ AddMatch(id + (is_all_caps ? 119 : 120) * n, l + 3, l, matches);
412
+ }
413
+ }
414
+ }
415
+ }
416
+ }
417
+ if (max_length >= 6) {
418
+ /* Transforms with prefixes "e ", "s ", ", " and "\xC2\xA0" */
419
+ if ((data[1] == ' ' &&
420
+ (data[0] == 'e' || data[0] == 's' || data[0] == ',')) ||
421
+ (data[0] == 0xC2 && data[1] == 0xA0)) {
422
+ size_t offset = dictionary->buckets[Hash(&data[2])];
423
+ BROTLI_BOOL end = !offset;
424
+ while (!end) {
425
+ DictWord w = dictionary->dict_words[offset++];
426
+ const size_t l = w.len & 0x1F;
427
+ const size_t n = (size_t)1 << dictionary->words->size_bits_by_length[l];
428
+ const size_t id = w.idx;
429
+ end = !!(w.len & 0x80);
430
+ w.len = (uint8_t)l;
431
+ if (w.transform == 0 &&
432
+ IsMatch(dictionary->words, w, &data[2], max_length - 2)) {
433
+ if (data[0] == 0xC2) {
434
+ AddMatch(id + 102 * n, l + 2, l, matches);
435
+ has_found_match = BROTLI_TRUE;
436
+ } else if (l + 2 < max_length && data[l + 2] == ' ') {
437
+ size_t t = data[0] == 'e' ? 18 : (data[0] == 's' ? 7 : 13);
438
+ AddMatch(id + t * n, l + 3, l, matches);
439
+ has_found_match = BROTLI_TRUE;
440
+ }
441
+ }
442
+ }
443
+ }
444
+ }
445
+ if (max_length >= 9) {
446
+ /* Transforms with prefixes " the " and ".com/" */
447
+ if ((data[0] == ' ' && data[1] == 't' && data[2] == 'h' &&
448
+ data[3] == 'e' && data[4] == ' ') ||
449
+ (data[0] == '.' && data[1] == 'c' && data[2] == 'o' &&
450
+ data[3] == 'm' && data[4] == '/')) {
451
+ size_t offset = dictionary->buckets[Hash(&data[5])];
452
+ BROTLI_BOOL end = !offset;
453
+ while (!end) {
454
+ DictWord w = dictionary->dict_words[offset++];
455
+ const size_t l = w.len & 0x1F;
456
+ const size_t n = (size_t)1 << dictionary->words->size_bits_by_length[l];
457
+ const size_t id = w.idx;
458
+ end = !!(w.len & 0x80);
459
+ w.len = (uint8_t)l;
460
+ if (w.transform == 0 &&
461
+ IsMatch(dictionary->words, w, &data[5], max_length - 5)) {
462
+ AddMatch(id + (data[0] == ' ' ? 41 : 72) * n, l + 5, l, matches);
463
+ has_found_match = BROTLI_TRUE;
464
+ if (l + 5 < max_length) {
465
+ const uint8_t* s = &data[l + 5];
466
+ if (data[0] == ' ') {
467
+ if (l + 8 < max_length &&
468
+ s[0] == ' ' && s[1] == 'o' && s[2] == 'f' && s[3] == ' ') {
469
+ AddMatch(id + 62 * n, l + 9, l, matches);
470
+ if (l + 12 < max_length &&
471
+ s[4] == 't' && s[5] == 'h' && s[6] == 'e' && s[7] == ' ') {
472
+ AddMatch(id + 73 * n, l + 13, l, matches);
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ return has_found_match;
482
+ }
483
+
484
+ #if defined(__cplusplus) || defined(c_plusplus)
485
+ } /* extern "C" */
486
+ #endif
@@ -0,0 +1,40 @@
1
+ /* Copyright 2013 Google Inc. All Rights Reserved.
2
+
3
+ Distributed under MIT license.
4
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5
+ */
6
+
7
+ /* Class to model the static dictionary. */
8
+
9
+ #ifndef BROTLI_ENC_STATIC_DICT_H_
10
+ #define BROTLI_ENC_STATIC_DICT_H_
11
+
12
+ #include "../common/dictionary.h"
13
+ #include "../common/platform.h"
14
+ #include <brotli/types.h>
15
+ #include "./encoder_dict.h"
16
+
17
+ #if defined(__cplusplus) || defined(c_plusplus)
18
+ extern "C" {
19
+ #endif
20
+
21
+ #define BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN 37
22
+ static const uint32_t kInvalidMatch = 0xFFFFFFF;
23
+
24
+ /* Matches data against static dictionary words, and for each length l,
25
+ for which a match is found, updates matches[l] to be the minimum possible
26
+ (distance << 5) + len_code.
27
+ Returns 1 if matches have been found, otherwise 0.
28
+ Prerequisites:
29
+ matches array is at least BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN + 1 long
30
+ all elements are initialized to kInvalidMatch */
31
+ BROTLI_INTERNAL BROTLI_BOOL BrotliFindAllStaticDictionaryMatches(
32
+ const BrotliEncoderDictionary* dictionary,
33
+ const uint8_t* data, size_t min_length, size_t max_length,
34
+ uint32_t* matches);
35
+
36
+ #if defined(__cplusplus) || defined(c_plusplus)
37
+ } /* extern "C" */
38
+ #endif
39
+
40
+ #endif /* BROTLI_ENC_STATIC_DICT_H_ */