koffi 2.3.6-beta.6 → 2.3.7

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 (276) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +2 -2
  3. package/src/cnoke/cnoke.js +3 -7
  4. package/src/cnoke/src/builder.js +9 -6
  5. package/src/cnoke/src/index.js +2 -2
  6. package/src/koffi/build/2.3.7/koffi_darwin_arm64/koffi.node +0 -0
  7. package/src/koffi/build/2.3.7/koffi_darwin_x64/koffi.node +0 -0
  8. package/src/koffi/build/2.3.7/koffi_freebsd_arm64/koffi.node +0 -0
  9. package/src/koffi/build/2.3.7/koffi_freebsd_ia32/koffi.node +0 -0
  10. package/src/koffi/build/2.3.7/koffi_freebsd_x64/koffi.node +0 -0
  11. package/src/koffi/build/2.3.7/koffi_linux_arm32hf/koffi.node +0 -0
  12. package/src/koffi/build/2.3.7/koffi_linux_arm64/koffi.node +0 -0
  13. package/src/koffi/build/2.3.7/koffi_linux_ia32/koffi.node +0 -0
  14. package/src/koffi/build/2.3.7/koffi_linux_riscv64hf64/koffi.node +0 -0
  15. package/src/koffi/build/2.3.7/koffi_linux_x64/koffi.node +0 -0
  16. package/src/koffi/build/2.3.7/koffi_openbsd_ia32/koffi.node +0 -0
  17. package/src/koffi/build/2.3.7/koffi_openbsd_x64/koffi.node +0 -0
  18. package/src/koffi/build/2.3.7/koffi_win32_arm64/koffi.node +0 -0
  19. package/src/koffi/build/2.3.7/koffi_win32_ia32/koffi.node +0 -0
  20. package/src/koffi/build/2.3.7/koffi_win32_x64/koffi.node +0 -0
  21. package/src/koffi/src/ffi.cc +2 -2
  22. package/src/koffi/src/index.d.ts +2 -2
  23. package/src/koffi/src/index.js +1 -0
  24. package/src/koffi/build/2.3.6-beta.6/koffi_darwin_arm64/koffi.node +0 -0
  25. package/src/koffi/build/2.3.6-beta.6/koffi_darwin_x64/koffi.node +0 -0
  26. package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_arm64/koffi.node +0 -0
  27. package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_ia32/koffi.node +0 -0
  28. package/src/koffi/build/2.3.6-beta.6/koffi_freebsd_x64/koffi.node +0 -0
  29. package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm32hf/koffi.node +0 -0
  30. package/src/koffi/build/2.3.6-beta.6/koffi_linux_arm64/koffi.node +0 -0
  31. package/src/koffi/build/2.3.6-beta.6/koffi_linux_ia32/koffi.node +0 -0
  32. package/src/koffi/build/2.3.6-beta.6/koffi_linux_riscv64hf64/koffi.node +0 -0
  33. package/src/koffi/build/2.3.6-beta.6/koffi_linux_x64/koffi.node +0 -0
  34. package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_ia32/koffi.node +0 -0
  35. package/src/koffi/build/2.3.6-beta.6/koffi_openbsd_x64/koffi.node +0 -0
  36. package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.node +0 -0
  37. package/src/koffi/build/2.3.6-beta.6/koffi_win32_arm64/koffi.pdb +0 -0
  38. package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.node +0 -0
  39. package/src/koffi/build/2.3.6-beta.6/koffi_win32_ia32/koffi.pdb +0 -0
  40. package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.node +0 -0
  41. package/src/koffi/build/2.3.6-beta.6/koffi_win32_x64/koffi.pdb +0 -0
  42. package/vendor/brotli/BUILD +0 -144
  43. package/vendor/brotli/CMakeLists.txt +0 -421
  44. package/vendor/brotli/CONTRIBUTING.md +0 -27
  45. package/vendor/brotli/LICENSE +0 -19
  46. package/vendor/brotli/MANIFEST.in +0 -17
  47. package/vendor/brotli/Makefile +0 -55
  48. package/vendor/brotli/Makefile.am +0 -38
  49. package/vendor/brotli/README +0 -15
  50. package/vendor/brotli/README.md +0 -104
  51. package/vendor/brotli/WORKSPACE +0 -21
  52. package/vendor/brotli/bootstrap +0 -35
  53. package/vendor/brotli/c/common/constants.c +0 -15
  54. package/vendor/brotli/c/common/constants.h +0 -200
  55. package/vendor/brotli/c/common/context.c +0 -156
  56. package/vendor/brotli/c/common/context.h +0 -113
  57. package/vendor/brotli/c/common/dictionary.c +0 -5914
  58. package/vendor/brotli/c/common/dictionary.h +0 -64
  59. package/vendor/brotli/c/common/platform.c +0 -22
  60. package/vendor/brotli/c/common/platform.h +0 -596
  61. package/vendor/brotli/c/common/transform.c +0 -291
  62. package/vendor/brotli/c/common/transform.h +0 -85
  63. package/vendor/brotli/c/common/version.h +0 -26
  64. package/vendor/brotli/c/dec/bit_reader.c +0 -76
  65. package/vendor/brotli/c/dec/bit_reader.h +0 -351
  66. package/vendor/brotli/c/dec/decode.c +0 -2608
  67. package/vendor/brotli/c/dec/huffman.c +0 -339
  68. package/vendor/brotli/c/dec/huffman.h +0 -121
  69. package/vendor/brotli/c/dec/prefix.h +0 -732
  70. package/vendor/brotli/c/dec/state.c +0 -159
  71. package/vendor/brotli/c/dec/state.h +0 -365
  72. package/vendor/brotli/c/enc/backward_references.c +0 -145
  73. package/vendor/brotli/c/enc/backward_references.h +0 -39
  74. package/vendor/brotli/c/enc/backward_references_hq.c +0 -843
  75. package/vendor/brotli/c/enc/backward_references_hq.h +0 -95
  76. package/vendor/brotli/c/enc/backward_references_inc.h +0 -163
  77. package/vendor/brotli/c/enc/bit_cost.c +0 -35
  78. package/vendor/brotli/c/enc/bit_cost.h +0 -63
  79. package/vendor/brotli/c/enc/bit_cost_inc.h +0 -127
  80. package/vendor/brotli/c/enc/block_encoder_inc.h +0 -34
  81. package/vendor/brotli/c/enc/block_splitter.c +0 -194
  82. package/vendor/brotli/c/enc/block_splitter.h +0 -51
  83. package/vendor/brotli/c/enc/block_splitter_inc.h +0 -440
  84. package/vendor/brotli/c/enc/brotli_bit_stream.c +0 -1314
  85. package/vendor/brotli/c/enc/brotli_bit_stream.h +0 -84
  86. package/vendor/brotli/c/enc/cluster.c +0 -56
  87. package/vendor/brotli/c/enc/cluster.h +0 -48
  88. package/vendor/brotli/c/enc/cluster_inc.h +0 -320
  89. package/vendor/brotli/c/enc/command.c +0 -28
  90. package/vendor/brotli/c/enc/command.h +0 -190
  91. package/vendor/brotli/c/enc/compress_fragment.c +0 -790
  92. package/vendor/brotli/c/enc/compress_fragment.h +0 -61
  93. package/vendor/brotli/c/enc/compress_fragment_two_pass.c +0 -645
  94. package/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -54
  95. package/vendor/brotli/c/enc/dictionary_hash.c +0 -1846
  96. package/vendor/brotli/c/enc/dictionary_hash.h +0 -25
  97. package/vendor/brotli/c/enc/encode.c +0 -1927
  98. package/vendor/brotli/c/enc/encoder_dict.c +0 -33
  99. package/vendor/brotli/c/enc/encoder_dict.h +0 -43
  100. package/vendor/brotli/c/enc/entropy_encode.c +0 -503
  101. package/vendor/brotli/c/enc/entropy_encode.h +0 -122
  102. package/vendor/brotli/c/enc/entropy_encode_static.h +0 -539
  103. package/vendor/brotli/c/enc/fast_log.c +0 -105
  104. package/vendor/brotli/c/enc/fast_log.h +0 -66
  105. package/vendor/brotli/c/enc/find_match_length.h +0 -79
  106. package/vendor/brotli/c/enc/hash.h +0 -488
  107. package/vendor/brotli/c/enc/hash_composite_inc.h +0 -125
  108. package/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +0 -293
  109. package/vendor/brotli/c/enc/hash_longest_match64_inc.h +0 -267
  110. package/vendor/brotli/c/enc/hash_longest_match_inc.h +0 -262
  111. package/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +0 -266
  112. package/vendor/brotli/c/enc/hash_rolling_inc.h +0 -212
  113. package/vendor/brotli/c/enc/hash_to_binary_tree_inc.h +0 -329
  114. package/vendor/brotli/c/enc/histogram.c +0 -100
  115. package/vendor/brotli/c/enc/histogram.h +0 -63
  116. package/vendor/brotli/c/enc/histogram_inc.h +0 -51
  117. package/vendor/brotli/c/enc/literal_cost.c +0 -175
  118. package/vendor/brotli/c/enc/literal_cost.h +0 -30
  119. package/vendor/brotli/c/enc/memory.c +0 -170
  120. package/vendor/brotli/c/enc/memory.h +0 -114
  121. package/vendor/brotli/c/enc/metablock.c +0 -663
  122. package/vendor/brotli/c/enc/metablock.h +0 -105
  123. package/vendor/brotli/c/enc/metablock_inc.h +0 -183
  124. package/vendor/brotli/c/enc/params.h +0 -46
  125. package/vendor/brotli/c/enc/prefix.h +0 -53
  126. package/vendor/brotli/c/enc/quality.h +0 -165
  127. package/vendor/brotli/c/enc/ringbuffer.h +0 -167
  128. package/vendor/brotli/c/enc/static_dict.c +0 -486
  129. package/vendor/brotli/c/enc/static_dict.h +0 -40
  130. package/vendor/brotli/c/enc/static_dict_lut.h +0 -5864
  131. package/vendor/brotli/c/enc/utf8_util.c +0 -85
  132. package/vendor/brotli/c/enc/utf8_util.h +0 -32
  133. package/vendor/brotli/c/enc/write_bits.h +0 -87
  134. package/vendor/brotli/c/include/brotli/decode.h +0 -344
  135. package/vendor/brotli/c/include/brotli/encode.h +0 -448
  136. package/vendor/brotli/c/include/brotli/port.h +0 -288
  137. package/vendor/brotli/c/include/brotli/types.h +0 -83
  138. package/vendor/brotli/c/tools/brotli.c +0 -1116
  139. package/vendor/brotli/c/tools/brotli.md +0 -107
  140. package/vendor/brotli/compiler_config_setting.bzl +0 -28
  141. package/vendor/brotli/configure +0 -8
  142. package/vendor/brotli/configure-cmake +0 -318
  143. package/vendor/brotli/configure.ac +0 -14
  144. package/vendor/brotli/docs/brotli.1 +0 -132
  145. package/vendor/brotli/docs/constants.h.3 +0 -47
  146. package/vendor/brotli/docs/decode.h.3 +0 -415
  147. package/vendor/brotli/docs/encode.h.3 +0 -586
  148. package/vendor/brotli/docs/types.h.3 +0 -117
  149. package/vendor/brotli/premake5.lua +0 -78
  150. package/vendor/brotli/python/Makefile +0 -57
  151. package/vendor/brotli/python/README.md +0 -54
  152. package/vendor/brotli/python/_brotli.cc +0 -753
  153. package/vendor/brotli/python/bro.py +0 -160
  154. package/vendor/brotli/python/brotli.py +0 -56
  155. package/vendor/brotli/python/tests/__init__.py +0 -0
  156. package/vendor/brotli/python/tests/_test_utils.py +0 -112
  157. package/vendor/brotli/python/tests/bro_test.py +0 -102
  158. package/vendor/brotli/python/tests/compress_test.py +0 -41
  159. package/vendor/brotli/python/tests/compressor_test.py +0 -94
  160. package/vendor/brotli/python/tests/decompress_test.py +0 -42
  161. package/vendor/brotli/python/tests/decompressor_test.py +0 -59
  162. package/vendor/brotli/scripts/libbrotlicommon.pc.in +0 -11
  163. package/vendor/brotli/scripts/libbrotlidec.pc.in +0 -12
  164. package/vendor/brotli/scripts/libbrotlienc.pc.in +0 -12
  165. package/vendor/brotli/scripts/sources.lst +0 -104
  166. package/vendor/brotli/setup.cfg +0 -5
  167. package/vendor/brotli/setup.py +0 -293
  168. package/vendor/brotli/tests/Makefile +0 -17
  169. package/vendor/brotli/tests/compatibility_test.sh +0 -25
  170. package/vendor/brotli/tests/roundtrip_test.sh +0 -36
  171. package/vendor/brotli/tests/run-compatibility-test.cmake +0 -31
  172. package/vendor/brotli/tests/run-roundtrip-test.cmake +0 -36
  173. package/vendor/brotli/tests/testdata/empty +0 -0
  174. package/vendor/brotli/tests/testdata/empty.compressed +0 -1
  175. package/vendor/brotli/tests/testdata/ukkonooa +0 -1
  176. package/vendor/brotli/tests/testdata/ukkonooa.compressed +0 -0
  177. package/vendor/dragonbox/CMakeLists.txt +0 -123
  178. package/vendor/dragonbox/LICENSE-Apache2-LLVM +0 -218
  179. package/vendor/dragonbox/LICENSE-Boost +0 -23
  180. package/vendor/dragonbox/README.md +0 -277
  181. package/vendor/dragonbox/cmake/dragonboxConfig.cmake +0 -1
  182. package/vendor/dragonbox/include/dragonbox/dragonbox.h +0 -2674
  183. package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +0 -108
  184. package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
  185. package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
  186. package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
  187. package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +0 -540
  188. package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
  189. package/vendor/dragonbox/source/dragonbox_to_chars.cpp +0 -303
  190. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +0 -24
  191. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +0 -238
  192. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +0 -95
  193. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +0 -2666
  194. package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +0 -16
  195. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +0 -114
  196. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +0 -509
  197. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +0 -367
  198. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +0 -357
  199. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +0 -35
  200. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +0 -345
  201. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +0 -55
  202. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +0 -128
  203. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +0 -46
  204. package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +0 -22
  205. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +0 -699
  206. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +0 -31
  207. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +0 -1354
  208. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +0 -31
  209. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +0 -68
  210. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +0 -25
  211. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +0 -92
  212. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +0 -121
  213. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +0 -99
  214. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +0 -93
  215. package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +0 -65
  216. package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +0 -40
  217. package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +0 -22
  218. package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +0 -78
  219. package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +0 -95
  220. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
  221. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
  222. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
  223. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
  224. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
  225. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
  226. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
  227. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
  228. package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +0 -238
  229. package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +0 -30
  230. package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +0 -36
  231. package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +0 -27
  232. package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +0 -31
  233. package/vendor/dragonbox/subproject/common/CMakeLists.txt +0 -42
  234. package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +0 -97
  235. package/vendor/dragonbox/subproject/common/include/big_uint.h +0 -218
  236. package/vendor/dragonbox/subproject/common/include/continued_fractions.h +0 -174
  237. package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +0 -267
  238. package/vendor/dragonbox/subproject/common/include/random_float.h +0 -182
  239. package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +0 -57
  240. package/vendor/dragonbox/subproject/common/source/big_uint.cpp +0 -602
  241. package/vendor/dragonbox/subproject/meta/CMakeLists.txt +0 -41
  242. package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +0 -82
  243. package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +0 -10
  244. package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +0 -623
  245. package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +0 -126
  246. package/vendor/dragonbox/subproject/meta/source/live_test.cpp +0 -81
  247. package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +0 -104
  248. package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +0 -20
  249. package/vendor/dragonbox/subproject/test/CMakeLists.txt +0 -70
  250. package/vendor/dragonbox/subproject/test/results/binary32.csv +0 -255
  251. package/vendor/dragonbox/subproject/test/results/binary64.csv +0 -2047
  252. package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +0 -18
  253. package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +0 -88
  254. package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +0 -95
  255. package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +0 -338
  256. package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +0 -154
  257. package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +0 -168
  258. package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +0 -251
  259. package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +0 -113
  260. package/vendor/miniz/ChangeLog.md +0 -239
  261. package/vendor/miniz/LICENSE +0 -22
  262. package/vendor/miniz/examples/example1.c +0 -105
  263. package/vendor/miniz/examples/example2.c +0 -164
  264. package/vendor/miniz/examples/example3.c +0 -269
  265. package/vendor/miniz/examples/example4.c +0 -102
  266. package/vendor/miniz/examples/example5.c +0 -327
  267. package/vendor/miniz/examples/example6.c +0 -166
  268. package/vendor/miniz/miniz.c +0 -7835
  269. package/vendor/miniz/miniz.h +0 -1422
  270. package/vendor/miniz/readme.md +0 -46
  271. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.exp +0 -0
  272. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_arm64/koffi.lib +0 -0
  273. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.exp +0 -0
  274. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_ia32/koffi.lib +0 -0
  275. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.exp +0 -0
  276. /package/src/koffi/build/{2.3.6-beta.6 → 2.3.7}/koffi_win32_x64/koffi.lib +0 -0
@@ -1,85 +0,0 @@
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
- /* Heuristics for deciding about the UTF8-ness of strings. */
8
-
9
- #include "./utf8_util.h"
10
-
11
- #include <brotli/types.h>
12
-
13
- #if defined(__cplusplus) || defined(c_plusplus)
14
- extern "C" {
15
- #endif
16
-
17
- static size_t BrotliParseAsUTF8(
18
- int* symbol, const uint8_t* input, size_t size) {
19
- /* ASCII */
20
- if ((input[0] & 0x80) == 0) {
21
- *symbol = input[0];
22
- if (*symbol > 0) {
23
- return 1;
24
- }
25
- }
26
- /* 2-byte UTF8 */
27
- if (size > 1u &&
28
- (input[0] & 0xE0) == 0xC0 &&
29
- (input[1] & 0xC0) == 0x80) {
30
- *symbol = (((input[0] & 0x1F) << 6) |
31
- (input[1] & 0x3F));
32
- if (*symbol > 0x7F) {
33
- return 2;
34
- }
35
- }
36
- /* 3-byte UFT8 */
37
- if (size > 2u &&
38
- (input[0] & 0xF0) == 0xE0 &&
39
- (input[1] & 0xC0) == 0x80 &&
40
- (input[2] & 0xC0) == 0x80) {
41
- *symbol = (((input[0] & 0x0F) << 12) |
42
- ((input[1] & 0x3F) << 6) |
43
- (input[2] & 0x3F));
44
- if (*symbol > 0x7FF) {
45
- return 3;
46
- }
47
- }
48
- /* 4-byte UFT8 */
49
- if (size > 3u &&
50
- (input[0] & 0xF8) == 0xF0 &&
51
- (input[1] & 0xC0) == 0x80 &&
52
- (input[2] & 0xC0) == 0x80 &&
53
- (input[3] & 0xC0) == 0x80) {
54
- *symbol = (((input[0] & 0x07) << 18) |
55
- ((input[1] & 0x3F) << 12) |
56
- ((input[2] & 0x3F) << 6) |
57
- (input[3] & 0x3F));
58
- if (*symbol > 0xFFFF && *symbol <= 0x10FFFF) {
59
- return 4;
60
- }
61
- }
62
- /* Not UTF8, emit a special symbol above the UTF8-code space */
63
- *symbol = 0x110000 | input[0];
64
- return 1;
65
- }
66
-
67
- /* Returns 1 if at least min_fraction of the data is UTF8-encoded.*/
68
- BROTLI_BOOL BrotliIsMostlyUTF8(
69
- const uint8_t* data, const size_t pos, const size_t mask,
70
- const size_t length, const double min_fraction) {
71
- size_t size_utf8 = 0;
72
- size_t i = 0;
73
- while (i < length) {
74
- int symbol;
75
- size_t bytes_read =
76
- BrotliParseAsUTF8(&symbol, &data[(pos + i) & mask], length - i);
77
- i += bytes_read;
78
- if (symbol < 0x110000) size_utf8 += bytes_read;
79
- }
80
- return TO_BROTLI_BOOL((double)size_utf8 > min_fraction * (double)length);
81
- }
82
-
83
- #if defined(__cplusplus) || defined(c_plusplus)
84
- } /* extern "C" */
85
- #endif
@@ -1,32 +0,0 @@
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
- /* Heuristics for deciding about the UTF8-ness of strings. */
8
-
9
- #ifndef BROTLI_ENC_UTF8_UTIL_H_
10
- #define BROTLI_ENC_UTF8_UTIL_H_
11
-
12
- #include "../common/platform.h"
13
- #include <brotli/types.h>
14
-
15
- #if defined(__cplusplus) || defined(c_plusplus)
16
- extern "C" {
17
- #endif
18
-
19
- static const double kMinUTF8Ratio = 0.75;
20
-
21
- /* Returns 1 if at least min_fraction of the bytes between pos and
22
- pos + length in the (data, mask) ring-buffer is UTF8-encoded, otherwise
23
- returns 0. */
24
- BROTLI_INTERNAL BROTLI_BOOL BrotliIsMostlyUTF8(
25
- const uint8_t* data, const size_t pos, const size_t mask,
26
- const size_t length, const double min_fraction);
27
-
28
- #if defined(__cplusplus) || defined(c_plusplus)
29
- } /* extern "C" */
30
- #endif
31
-
32
- #endif /* BROTLI_ENC_UTF8_UTIL_H_ */
@@ -1,87 +0,0 @@
1
- /* Copyright 2010 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
- /* Write bits into a byte array. */
8
-
9
- #ifndef BROTLI_ENC_WRITE_BITS_H_
10
- #define BROTLI_ENC_WRITE_BITS_H_
11
-
12
- #include "../common/platform.h"
13
- #include <brotli/types.h>
14
-
15
- #if defined(__cplusplus) || defined(c_plusplus)
16
- extern "C" {
17
- #endif
18
-
19
- /* This function writes bits into bytes in increasing addresses, and within
20
- a byte least-significant-bit first.
21
-
22
- The function can write up to 56 bits in one go with WriteBits
23
- Example: let's assume that 3 bits (Rs below) have been written already:
24
-
25
- BYTE-0 BYTE+1 BYTE+2
26
-
27
- 0000 0RRR 0000 0000 0000 0000
28
-
29
- Now, we could write 5 or less bits in MSB by just shifting by 3
30
- and OR'ing to BYTE-0.
31
-
32
- For n bits, we take the last 5 bits, OR that with high bits in BYTE-0,
33
- and locate the rest in BYTE+1, BYTE+2, etc. */
34
- static BROTLI_INLINE void BrotliWriteBits(size_t n_bits,
35
- uint64_t bits,
36
- size_t* BROTLI_RESTRICT pos,
37
- uint8_t* BROTLI_RESTRICT array) {
38
- BROTLI_LOG(("WriteBits %2d 0x%08x%08x %10d\n", (int)n_bits,
39
- (uint32_t)(bits >> 32), (uint32_t)(bits & 0xFFFFFFFF),
40
- (int)*pos));
41
- BROTLI_DCHECK((bits >> n_bits) == 0);
42
- BROTLI_DCHECK(n_bits <= 56);
43
- #if defined(BROTLI_LITTLE_ENDIAN)
44
- /* This branch of the code can write up to 56 bits at a time,
45
- 7 bits are lost by being perhaps already in *p and at least
46
- 1 bit is needed to initialize the bit-stream ahead (i.e. if 7
47
- bits are in *p and we write 57 bits, then the next write will
48
- access a byte that was never initialized). */
49
- {
50
- uint8_t* p = &array[*pos >> 3];
51
- uint64_t v = (uint64_t)(*p); /* Zero-extend 8 to 64 bits. */
52
- v |= bits << (*pos & 7);
53
- BROTLI_UNALIGNED_STORE64LE(p, v); /* Set some bits. */
54
- *pos += n_bits;
55
- }
56
- #else
57
- /* implicit & 0xFF is assumed for uint8_t arithmetics */
58
- {
59
- uint8_t* array_pos = &array[*pos >> 3];
60
- const size_t bits_reserved_in_first_byte = (*pos & 7);
61
- size_t bits_left_to_write;
62
- bits <<= bits_reserved_in_first_byte;
63
- *array_pos++ |= (uint8_t)bits;
64
- for (bits_left_to_write = n_bits + bits_reserved_in_first_byte;
65
- bits_left_to_write >= 9;
66
- bits_left_to_write -= 8) {
67
- bits >>= 8;
68
- *array_pos++ = (uint8_t)bits;
69
- }
70
- *array_pos = 0;
71
- *pos += n_bits;
72
- }
73
- #endif
74
- }
75
-
76
- static BROTLI_INLINE void BrotliWriteBitsPrepareStorage(
77
- size_t pos, uint8_t* array) {
78
- BROTLI_LOG(("WriteBitsPrepareStorage %10d\n", (int)pos));
79
- BROTLI_DCHECK((pos & 7) == 0);
80
- array[pos >> 3] = 0;
81
- }
82
-
83
- #if defined(__cplusplus) || defined(c_plusplus)
84
- } /* extern "C" */
85
- #endif
86
-
87
- #endif /* BROTLI_ENC_WRITE_BITS_H_ */
@@ -1,344 +0,0 @@
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
- /**
8
- * @file
9
- * API for Brotli decompression.
10
- */
11
-
12
- #ifndef BROTLI_DEC_DECODE_H_
13
- #define BROTLI_DEC_DECODE_H_
14
-
15
- #include "port.h"
16
- #include "types.h"
17
-
18
- #if defined(__cplusplus) || defined(c_plusplus)
19
- extern "C" {
20
- #endif
21
-
22
- /**
23
- * Opaque structure that holds decoder state.
24
- *
25
- * Allocated and initialized with ::BrotliDecoderCreateInstance.
26
- * Cleaned up and deallocated with ::BrotliDecoderDestroyInstance.
27
- */
28
- typedef struct BrotliDecoderStateStruct BrotliDecoderState;
29
-
30
- /**
31
- * Result type for ::BrotliDecoderDecompress and
32
- * ::BrotliDecoderDecompressStream functions.
33
- */
34
- typedef enum {
35
- /** Decoding error, e.g. corrupted input or memory allocation problem. */
36
- BROTLI_DECODER_RESULT_ERROR = 0,
37
- /** Decoding successfully completed. */
38
- BROTLI_DECODER_RESULT_SUCCESS = 1,
39
- /** Partially done; should be called again with more input. */
40
- BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT = 2,
41
- /** Partially done; should be called again with more output. */
42
- BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT = 3
43
- } BrotliDecoderResult;
44
-
45
- /**
46
- * Template that evaluates items of ::BrotliDecoderErrorCode.
47
- *
48
- * Example: @code {.cpp}
49
- * // Log Brotli error code.
50
- * switch (brotliDecoderErrorCode) {
51
- * #define CASE_(PREFIX, NAME, CODE) \
52
- * case BROTLI_DECODER ## PREFIX ## NAME: \
53
- * LOG(INFO) << "error code:" << #NAME; \
54
- * break;
55
- * #define NEWLINE_
56
- * BROTLI_DECODER_ERROR_CODES_LIST(CASE_, NEWLINE_)
57
- * #undef CASE_
58
- * #undef NEWLINE_
59
- * default: LOG(FATAL) << "unknown brotli error code";
60
- * }
61
- * @endcode
62
- */
63
- #define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR) \
64
- BROTLI_ERROR_CODE(_, NO_ERROR, 0) SEPARATOR \
65
- /* Same as BrotliDecoderResult values */ \
66
- BROTLI_ERROR_CODE(_, SUCCESS, 1) SEPARATOR \
67
- BROTLI_ERROR_CODE(_, NEEDS_MORE_INPUT, 2) SEPARATOR \
68
- BROTLI_ERROR_CODE(_, NEEDS_MORE_OUTPUT, 3) SEPARATOR \
69
- \
70
- /* Errors caused by invalid input */ \
71
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_NIBBLE, -1) SEPARATOR \
72
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, RESERVED, -2) SEPARATOR \
73
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_META_NIBBLE, -3) SEPARATOR \
74
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_ALPHABET, -4) SEPARATOR \
75
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_SAME, -5) SEPARATOR \
76
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, CL_SPACE, -6) SEPARATOR \
77
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, HUFFMAN_SPACE, -7) SEPARATOR \
78
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, CONTEXT_MAP_REPEAT, -8) SEPARATOR \
79
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_1, -9) SEPARATOR \
80
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_2, -10) SEPARATOR \
81
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, TRANSFORM, -11) SEPARATOR \
82
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, DICTIONARY, -12) SEPARATOR \
83
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, WINDOW_BITS, -13) SEPARATOR \
84
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR \
85
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR \
86
- BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR \
87
- \
88
- /* -17..-18 codes are reserved */ \
89
- \
90
- BROTLI_ERROR_CODE(_ERROR_, DICTIONARY_NOT_SET, -19) SEPARATOR \
91
- BROTLI_ERROR_CODE(_ERROR_, INVALID_ARGUMENTS, -20) SEPARATOR \
92
- \
93
- /* Memory allocation problems */ \
94
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MODES, -21) SEPARATOR \
95
- /* Literal, insert and distance trees together */ \
96
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, TREE_GROUPS, -22) SEPARATOR \
97
- /* -23..-24 codes are reserved for distinct tree groups */ \
98
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MAP, -25) SEPARATOR \
99
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_1, -26) SEPARATOR \
100
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_2, -27) SEPARATOR \
101
- /* -28..-29 codes are reserved for dynamic ring-buffer allocation */ \
102
- BROTLI_ERROR_CODE(_ERROR_ALLOC_, BLOCK_TYPE_TREES, -30) SEPARATOR \
103
- \
104
- /* "Impossible" states */ \
105
- BROTLI_ERROR_CODE(_ERROR_, UNREACHABLE, -31)
106
-
107
- /**
108
- * Error code for detailed logging / production debugging.
109
- *
110
- * See ::BrotliDecoderGetErrorCode and ::BROTLI_LAST_ERROR_CODE.
111
- */
112
- typedef enum {
113
- #define BROTLI_COMMA_ ,
114
- #define BROTLI_ERROR_CODE_ENUM_ITEM_(PREFIX, NAME, CODE) \
115
- BROTLI_DECODER ## PREFIX ## NAME = CODE
116
- BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE_ENUM_ITEM_, BROTLI_COMMA_)
117
- } BrotliDecoderErrorCode;
118
- #undef BROTLI_ERROR_CODE_ENUM_ITEM_
119
- #undef BROTLI_COMMA_
120
-
121
- /**
122
- * The value of the last error code, negative integer.
123
- *
124
- * All other error code values are in the range from ::BROTLI_LAST_ERROR_CODE
125
- * to @c -1. There are also 4 other possible non-error codes @c 0 .. @c 3 in
126
- * ::BrotliDecoderErrorCode enumeration.
127
- */
128
- #define BROTLI_LAST_ERROR_CODE BROTLI_DECODER_ERROR_UNREACHABLE
129
-
130
- /** Options to be used with ::BrotliDecoderSetParameter. */
131
- typedef enum BrotliDecoderParameter {
132
- /**
133
- * Disable "canny" ring buffer allocation strategy.
134
- *
135
- * Ring buffer is allocated according to window size, despite the real size of
136
- * the content.
137
- */
138
- BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION = 0,
139
- /**
140
- * Flag that determines if "Large Window Brotli" is used.
141
- */
142
- BROTLI_DECODER_PARAM_LARGE_WINDOW = 1
143
- } BrotliDecoderParameter;
144
-
145
- /**
146
- * Sets the specified parameter to the given decoder instance.
147
- *
148
- * @param state decoder instance
149
- * @param param parameter to set
150
- * @param value new parameter value
151
- * @returns ::BROTLI_FALSE if parameter is unrecognized, or value is invalid
152
- * @returns ::BROTLI_TRUE if value is accepted
153
- */
154
- BROTLI_DEC_API BROTLI_BOOL BrotliDecoderSetParameter(
155
- BrotliDecoderState* state, BrotliDecoderParameter param, uint32_t value);
156
-
157
- /**
158
- * Creates an instance of ::BrotliDecoderState and initializes it.
159
- *
160
- * The instance can be used once for decoding and should then be destroyed with
161
- * ::BrotliDecoderDestroyInstance, it cannot be reused for a new decoding
162
- * session.
163
- *
164
- * @p alloc_func and @p free_func @b MUST be both zero or both non-zero. In the
165
- * case they are both zero, default memory allocators are used. @p opaque is
166
- * passed to @p alloc_func and @p free_func when they are called. @p free_func
167
- * has to return without doing anything when asked to free a NULL pointer.
168
- *
169
- * @param alloc_func custom memory allocation function
170
- * @param free_func custom memory free function
171
- * @param opaque custom memory manager handle
172
- * @returns @c 0 if instance can not be allocated or initialized
173
- * @returns pointer to initialized ::BrotliDecoderState otherwise
174
- */
175
- BROTLI_DEC_API BrotliDecoderState* BrotliDecoderCreateInstance(
176
- brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque);
177
-
178
- /**
179
- * Deinitializes and frees ::BrotliDecoderState instance.
180
- *
181
- * @param state decoder instance to be cleaned up and deallocated
182
- */
183
- BROTLI_DEC_API void BrotliDecoderDestroyInstance(BrotliDecoderState* state);
184
-
185
- /**
186
- * Performs one-shot memory-to-memory decompression.
187
- *
188
- * Decompresses the data in @p encoded_buffer into @p decoded_buffer, and sets
189
- * @p *decoded_size to the decompressed length.
190
- *
191
- * @param encoded_size size of @p encoded_buffer
192
- * @param encoded_buffer compressed data buffer with at least @p encoded_size
193
- * addressable bytes
194
- * @param[in, out] decoded_size @b in: size of @p decoded_buffer; \n
195
- * @b out: length of decompressed data written to
196
- * @p decoded_buffer
197
- * @param decoded_buffer decompressed data destination buffer
198
- * @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory
199
- * allocation failed, or @p decoded_buffer is not large enough;
200
- * @returns ::BROTLI_DECODER_RESULT_SUCCESS otherwise
201
- */
202
- BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompress(
203
- size_t encoded_size,
204
- const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
205
- size_t* decoded_size,
206
- uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
207
-
208
- /**
209
- * Decompresses the input stream to the output stream.
210
- *
211
- * The values @p *available_in and @p *available_out must specify the number of
212
- * bytes addressable at @p *next_in and @p *next_out respectively.
213
- * When @p *available_out is @c 0, @p next_out is allowed to be @c NULL.
214
- *
215
- * After each call, @p *available_in will be decremented by the amount of input
216
- * bytes consumed, and the @p *next_in pointer will be incremented by that
217
- * amount. Similarly, @p *available_out will be decremented by the amount of
218
- * output bytes written, and the @p *next_out pointer will be incremented by
219
- * that amount.
220
- *
221
- * @p total_out, if it is not a null-pointer, will be set to the number
222
- * of bytes decompressed since the last @p state initialization.
223
- *
224
- * @note Input is never overconsumed, so @p next_in and @p available_in could be
225
- * passed to the next consumer after decoding is complete.
226
- *
227
- * @param state decoder instance
228
- * @param[in, out] available_in @b in: amount of available input; \n
229
- * @b out: amount of unused input
230
- * @param[in, out] next_in pointer to the next compressed byte
231
- * @param[in, out] available_out @b in: length of output buffer; \n
232
- * @b out: remaining size of output buffer
233
- * @param[in, out] next_out output buffer cursor;
234
- * can be @c NULL if @p available_out is @c 0
235
- * @param[out] total_out number of bytes decompressed so far; can be @c NULL
236
- * @returns ::BROTLI_DECODER_RESULT_ERROR if input is corrupted, memory
237
- * allocation failed, arguments were invalid, etc.;
238
- * use ::BrotliDecoderGetErrorCode to get detailed error code
239
- * @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT decoding is blocked until
240
- * more input data is provided
241
- * @returns ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT decoding is blocked until
242
- * more output space is provided
243
- * @returns ::BROTLI_DECODER_RESULT_SUCCESS decoding is finished, no more
244
- * input might be consumed and no more output will be produced
245
- */
246
- BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompressStream(
247
- BrotliDecoderState* state, size_t* available_in, const uint8_t** next_in,
248
- size_t* available_out, uint8_t** next_out, size_t* total_out);
249
-
250
- /**
251
- * Checks if decoder has more output.
252
- *
253
- * @param state decoder instance
254
- * @returns ::BROTLI_TRUE, if decoder has some unconsumed output
255
- * @returns ::BROTLI_FALSE otherwise
256
- */
257
- BROTLI_DEC_API BROTLI_BOOL BrotliDecoderHasMoreOutput(
258
- const BrotliDecoderState* state);
259
-
260
- /**
261
- * Acquires pointer to internal output buffer.
262
- *
263
- * This method is used to make language bindings easier and more efficient:
264
- * -# push data to ::BrotliDecoderDecompressStream,
265
- * until ::BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT is reported
266
- * -# use ::BrotliDecoderTakeOutput to peek bytes and copy to language-specific
267
- * entity
268
- *
269
- * Also this could be useful if there is an output stream that is able to
270
- * consume all the provided data (e.g. when data is saved to file system).
271
- *
272
- * @attention After every call to ::BrotliDecoderTakeOutput @p *size bytes of
273
- * output are considered consumed for all consecutive calls to the
274
- * instance methods; returned pointer becomes invalidated as well.
275
- *
276
- * @note Decoder output is not guaranteed to be contiguous. This means that
277
- * after the size-unrestricted call to ::BrotliDecoderTakeOutput,
278
- * immediate next call to ::BrotliDecoderTakeOutput may return more data.
279
- *
280
- * @param state decoder instance
281
- * @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if
282
- * any amount could be handled; \n
283
- * @b out: amount of data pointed by returned pointer and
284
- * considered consumed; \n
285
- * out value is never greater than in value, unless it is @c 0
286
- * @returns pointer to output data
287
- */
288
- BROTLI_DEC_API const uint8_t* BrotliDecoderTakeOutput(
289
- BrotliDecoderState* state, size_t* size);
290
-
291
- /**
292
- * Checks if instance has already consumed input.
293
- *
294
- * Instance that returns ::BROTLI_FALSE is considered "fresh" and could be
295
- * reused.
296
- *
297
- * @param state decoder instance
298
- * @returns ::BROTLI_TRUE if decoder has already used some input bytes
299
- * @returns ::BROTLI_FALSE otherwise
300
- */
301
- BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsUsed(const BrotliDecoderState* state);
302
-
303
- /**
304
- * Checks if decoder instance reached the final state.
305
- *
306
- * @param state decoder instance
307
- * @returns ::BROTLI_TRUE if decoder is in a state where it reached the end of
308
- * the input and produced all of the output
309
- * @returns ::BROTLI_FALSE otherwise
310
- */
311
- BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsFinished(
312
- const BrotliDecoderState* state);
313
-
314
- /**
315
- * Acquires a detailed error code.
316
- *
317
- * Should be used only after ::BrotliDecoderDecompressStream returns
318
- * ::BROTLI_DECODER_RESULT_ERROR.
319
- *
320
- * See also ::BrotliDecoderErrorString
321
- *
322
- * @param state decoder instance
323
- * @returns last saved error code
324
- */
325
- BROTLI_DEC_API BrotliDecoderErrorCode BrotliDecoderGetErrorCode(
326
- const BrotliDecoderState* state);
327
-
328
- /**
329
- * Converts error code to a c-string.
330
- */
331
- BROTLI_DEC_API const char* BrotliDecoderErrorString(BrotliDecoderErrorCode c);
332
-
333
- /**
334
- * Gets a decoder library version.
335
- *
336
- * Look at BROTLI_VERSION for more information.
337
- */
338
- BROTLI_DEC_API uint32_t BrotliDecoderVersion(void);
339
-
340
- #if defined(__cplusplus) || defined(c_plusplus)
341
- } /* extern "C" */
342
- #endif
343
-
344
- #endif /* BROTLI_DEC_DECODE_H_ */