zstd-native-ruby 1.0.0
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.
- checksums.yaml +7 -0
- data/CLAUDE.md +101 -0
- data/LICENSE +19 -0
- data/README.md +47 -0
- data/ext/zstd_ruby/extconf.rb +35 -0
- data/ext/zstd_ruby/zstd_ruby.c +221 -0
- data/lib/zstd_ruby.rb +68 -0
- data/vendor/zstd/CHANGELOG +863 -0
- data/vendor/zstd/CMakeLists.txt +11 -0
- data/vendor/zstd/CODE_OF_CONDUCT.md +5 -0
- data/vendor/zstd/CONTRIBUTING.md +494 -0
- data/vendor/zstd/COPYING +339 -0
- data/vendor/zstd/LICENSE +30 -0
- data/vendor/zstd/Makefile +470 -0
- data/vendor/zstd/Package.swift +36 -0
- data/vendor/zstd/README.md +244 -0
- data/vendor/zstd/SECURITY.md +15 -0
- data/vendor/zstd/TESTING.md +43 -0
- data/vendor/zstd/build/LICENSE +0 -0
- data/vendor/zstd/build/README.md +56 -0
- data/vendor/zstd/build/VS2008/fullbench/fullbench.vcproj +549 -0
- data/vendor/zstd/build/VS2008/fuzzer/fuzzer.vcproj +585 -0
- data/vendor/zstd/build/VS2008/zstd/zstd.vcproj +677 -0
- data/vendor/zstd/build/VS2008/zstd.sln +56 -0
- data/vendor/zstd/build/VS2008/zstdlib/zstdlib.vcproj +635 -0
- data/vendor/zstd/build/VS2010/CompileAsCpp.props +8 -0
- data/vendor/zstd/build/VS2010/datagen/datagen.vcxproj +170 -0
- data/vendor/zstd/build/VS2010/fullbench/fullbench.vcxproj +220 -0
- data/vendor/zstd/build/VS2010/fuzzer/fuzzer.vcxproj +224 -0
- data/vendor/zstd/build/VS2010/libzstd/libzstd.vcxproj +243 -0
- data/vendor/zstd/build/VS2010/libzstd-dll/libzstd-dll.rc +51 -0
- data/vendor/zstd/build/VS2010/libzstd-dll/libzstd-dll.vcxproj +250 -0
- data/vendor/zstd/build/VS2010/zstd/zstd.rc +51 -0
- data/vendor/zstd/build/VS2010/zstd/zstd.vcxproj +266 -0
- data/vendor/zstd/build/VS2010/zstd.sln +84 -0
- data/vendor/zstd/build/VS_scripts/README.md +64 -0
- data/vendor/zstd/build/VS_scripts/build.VS2010.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2012.cmd +6 -0
- data/vendor/zstd/build/VS_scripts/build.VS2013.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2015.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2017.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2017Community.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2017Enterprise.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VS2017Professional.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.VSPreview.cmd +7 -0
- data/vendor/zstd/build/VS_scripts/build.generic.cmd +67 -0
- data/vendor/zstd/build/cmake/CMakeLists.txt +81 -0
- data/vendor/zstd/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +138 -0
- data/vendor/zstd/build/cmake/CMakeModules/FindLibLZ4.cmake +49 -0
- data/vendor/zstd/build/cmake/CMakeModules/GetZstdLibraryVersion.cmake +10 -0
- data/vendor/zstd/build/cmake/CMakeModules/JoinPaths.cmake +23 -0
- data/vendor/zstd/build/cmake/CMakeModules/ZstdBuild.cmake +42 -0
- data/vendor/zstd/build/cmake/CMakeModules/ZstdDependencies.cmake +30 -0
- data/vendor/zstd/build/cmake/CMakeModules/ZstdOptions.cmake +68 -0
- data/vendor/zstd/build/cmake/CMakeModules/ZstdPackage.cmake +42 -0
- data/vendor/zstd/build/cmake/CMakeModules/ZstdVersion.cmake +31 -0
- data/vendor/zstd/build/cmake/README.md +155 -0
- data/vendor/zstd/build/cmake/contrib/CMakeLists.txt +13 -0
- data/vendor/zstd/build/cmake/contrib/gen_html/CMakeLists.txt +30 -0
- data/vendor/zstd/build/cmake/contrib/pzstd/CMakeLists.txt +39 -0
- data/vendor/zstd/build/cmake/lib/CMakeLists.txt +298 -0
- data/vendor/zstd/build/cmake/lib/cmake_uninstall.cmake.in +22 -0
- data/vendor/zstd/build/cmake/programs/CMakeLists.txt +144 -0
- data/vendor/zstd/build/cmake/tests/CMakeLists.txt +118 -0
- data/vendor/zstd/build/cmake/zstdConfig.cmake.in +10 -0
- data/vendor/zstd/build/meson/GetZstdLibraryVersion.py +39 -0
- data/vendor/zstd/build/meson/InstallSymlink.py +55 -0
- data/vendor/zstd/build/meson/README.md +38 -0
- data/vendor/zstd/build/meson/contrib/gen_html/meson.build +30 -0
- data/vendor/zstd/build/meson/contrib/meson.build +12 -0
- data/vendor/zstd/build/meson/contrib/pzstd/meson.build +25 -0
- data/vendor/zstd/build/meson/lib/meson.build +175 -0
- data/vendor/zstd/build/meson/meson.build +155 -0
- data/vendor/zstd/build/meson/meson_options.txt +36 -0
- data/vendor/zstd/build/meson/programs/meson.build +124 -0
- data/vendor/zstd/build/meson/tests/meson.build +217 -0
- data/vendor/zstd/build/meson/tests/valgrindTest.py +90 -0
- data/vendor/zstd/build/single_file_libs/README.md +33 -0
- data/vendor/zstd/build/single_file_libs/build_decoder_test.sh +91 -0
- data/vendor/zstd/build/single_file_libs/build_library_test.sh +98 -0
- data/vendor/zstd/build/single_file_libs/combine.py +234 -0
- data/vendor/zstd/build/single_file_libs/combine.sh +249 -0
- data/vendor/zstd/build/single_file_libs/create_single_file_decoder.sh +19 -0
- data/vendor/zstd/build/single_file_libs/create_single_file_library.sh +19 -0
- data/vendor/zstd/build/single_file_libs/examples/README.md +11 -0
- data/vendor/zstd/build/single_file_libs/examples/emscripten.c +340 -0
- data/vendor/zstd/build/single_file_libs/examples/roundtrip.c +83 -0
- data/vendor/zstd/build/single_file_libs/examples/shell.html +31 -0
- data/vendor/zstd/build/single_file_libs/examples/simple.c +75 -0
- data/vendor/zstd/build/single_file_libs/examples/testcard-dxt1.inl +2731 -0
- data/vendor/zstd/build/single_file_libs/examples/testcard-zstd.inl +261 -0
- data/vendor/zstd/build/single_file_libs/examples/testcard.png +0 -0
- data/vendor/zstd/build/single_file_libs/zstd-in.c +91 -0
- data/vendor/zstd/build/single_file_libs/zstddeclib-in.c +62 -0
- data/vendor/zstd/contrib/VS2005/README.md +3 -0
- data/vendor/zstd/contrib/VS2005/fullbench/fullbench.vcproj +440 -0
- data/vendor/zstd/contrib/VS2005/fuzzer/fuzzer.vcproj +488 -0
- data/vendor/zstd/contrib/VS2005/zstd/zstd.vcproj +552 -0
- data/vendor/zstd/contrib/VS2005/zstd.sln +55 -0
- data/vendor/zstd/contrib/VS2005/zstdlib/zstdlib.vcproj +546 -0
- data/vendor/zstd/contrib/cleanTabs +2 -0
- data/vendor/zstd/contrib/diagnose_corruption/Makefile +35 -0
- data/vendor/zstd/contrib/diagnose_corruption/check_flipped_bits.c +400 -0
- data/vendor/zstd/contrib/docker/Dockerfile +20 -0
- data/vendor/zstd/contrib/docker/README.md +20 -0
- data/vendor/zstd/contrib/externalSequenceProducer/Makefile +40 -0
- data/vendor/zstd/contrib/externalSequenceProducer/README.md +14 -0
- data/vendor/zstd/contrib/externalSequenceProducer/main.c +108 -0
- data/vendor/zstd/contrib/externalSequenceProducer/sequence_producer.c +80 -0
- data/vendor/zstd/contrib/externalSequenceProducer/sequence_producer.h +26 -0
- data/vendor/zstd/contrib/freestanding_lib/freestanding.py +774 -0
- data/vendor/zstd/contrib/gen_html/Makefile +51 -0
- data/vendor/zstd/contrib/gen_html/README.md +31 -0
- data/vendor/zstd/contrib/gen_html/gen-zstd-manual.sh +9 -0
- data/vendor/zstd/contrib/gen_html/gen_html.cpp +225 -0
- data/vendor/zstd/contrib/largeNbDicts/Makefile +58 -0
- data/vendor/zstd/contrib/largeNbDicts/README.md +33 -0
- data/vendor/zstd/contrib/largeNbDicts/largeNbDicts.c +1087 -0
- data/vendor/zstd/contrib/linux-kernel/Makefile +108 -0
- data/vendor/zstd/contrib/linux-kernel/README.md +14 -0
- data/vendor/zstd/contrib/linux-kernel/btrfs-benchmark.sh +104 -0
- data/vendor/zstd/contrib/linux-kernel/btrfs-extract-benchmark.sh +99 -0
- data/vendor/zstd/contrib/linux-kernel/decompress_sources.h +34 -0
- data/vendor/zstd/contrib/linux-kernel/linux.mk +44 -0
- data/vendor/zstd/contrib/linux-kernel/linux_zstd.h +691 -0
- data/vendor/zstd/contrib/linux-kernel/mem.h +262 -0
- data/vendor/zstd/contrib/linux-kernel/squashfs-benchmark.sh +39 -0
- data/vendor/zstd/contrib/linux-kernel/test/Makefile +49 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/compiler.h +23 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/errno.h +15 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/kernel.h +19 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/limits.h +15 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/math64.h +15 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/module.h +20 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/printk.h +15 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/stddef.h +15 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/swab.h +16 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/types.h +16 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/unaligned.h +187 -0
- data/vendor/zstd/contrib/linux-kernel/test/include/linux/xxhash.h +745 -0
- data/vendor/zstd/contrib/linux-kernel/test/macro-test.sh +44 -0
- data/vendor/zstd/contrib/linux-kernel/test/static_test.c +52 -0
- data/vendor/zstd/contrib/linux-kernel/test/test.c +229 -0
- data/vendor/zstd/contrib/linux-kernel/zstd_common_module.c +29 -0
- data/vendor/zstd/contrib/linux-kernel/zstd_compress_module.c +286 -0
- data/vendor/zstd/contrib/linux-kernel/zstd_decompress_module.c +141 -0
- data/vendor/zstd/contrib/linux-kernel/zstd_deps.h +121 -0
- data/vendor/zstd/contrib/match_finders/README.md +42 -0
- data/vendor/zstd/contrib/match_finders/zstd_edist.c +558 -0
- data/vendor/zstd/contrib/match_finders/zstd_edist.h +70 -0
- data/vendor/zstd/contrib/premake/premake4.lua +6 -0
- data/vendor/zstd/contrib/premake/zstd.lua +81 -0
- data/vendor/zstd/contrib/pzstd/BUCK +72 -0
- data/vendor/zstd/contrib/pzstd/ErrorHolder.h +54 -0
- data/vendor/zstd/contrib/pzstd/Logging.h +73 -0
- data/vendor/zstd/contrib/pzstd/Makefile +265 -0
- data/vendor/zstd/contrib/pzstd/Options.cpp +424 -0
- data/vendor/zstd/contrib/pzstd/Options.h +71 -0
- data/vendor/zstd/contrib/pzstd/Pzstd.cpp +626 -0
- data/vendor/zstd/contrib/pzstd/Pzstd.h +153 -0
- data/vendor/zstd/contrib/pzstd/README.md +56 -0
- data/vendor/zstd/contrib/pzstd/SkippableFrame.cpp +30 -0
- data/vendor/zstd/contrib/pzstd/SkippableFrame.h +64 -0
- data/vendor/zstd/contrib/pzstd/images/Cspeed.png +0 -0
- data/vendor/zstd/contrib/pzstd/images/Dspeed.png +0 -0
- data/vendor/zstd/contrib/pzstd/main.cpp +27 -0
- data/vendor/zstd/contrib/pzstd/test/BUCK +37 -0
- data/vendor/zstd/contrib/pzstd/test/OptionsTest.cpp +536 -0
- data/vendor/zstd/contrib/pzstd/test/PzstdTest.cpp +147 -0
- data/vendor/zstd/contrib/pzstd/test/RoundTrip.h +86 -0
- data/vendor/zstd/contrib/pzstd/test/RoundTripTest.cpp +84 -0
- data/vendor/zstd/contrib/pzstd/utils/BUCK +75 -0
- data/vendor/zstd/contrib/pzstd/utils/Buffer.h +99 -0
- data/vendor/zstd/contrib/pzstd/utils/FileSystem.h +96 -0
- data/vendor/zstd/contrib/pzstd/utils/Likely.h +28 -0
- data/vendor/zstd/contrib/pzstd/utils/Portability.h +16 -0
- data/vendor/zstd/contrib/pzstd/utils/Range.h +133 -0
- data/vendor/zstd/contrib/pzstd/utils/ResourcePool.h +96 -0
- data/vendor/zstd/contrib/pzstd/utils/ScopeGuard.h +50 -0
- data/vendor/zstd/contrib/pzstd/utils/ThreadPool.h +58 -0
- data/vendor/zstd/contrib/pzstd/utils/WorkQueue.h +182 -0
- data/vendor/zstd/contrib/pzstd/utils/test/BUCK +35 -0
- data/vendor/zstd/contrib/pzstd/utils/test/BufferTest.cpp +89 -0
- data/vendor/zstd/contrib/pzstd/utils/test/RangeTest.cpp +82 -0
- data/vendor/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp +72 -0
- data/vendor/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp +28 -0
- data/vendor/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp +71 -0
- data/vendor/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp +282 -0
- data/vendor/zstd/contrib/recovery/Makefile +35 -0
- data/vendor/zstd/contrib/recovery/recover_directory.c +152 -0
- data/vendor/zstd/contrib/seekable_format/README.md +42 -0
- data/vendor/zstd/contrib/seekable_format/examples/Makefile +55 -0
- data/vendor/zstd/contrib/seekable_format/examples/parallel_compression.c +254 -0
- data/vendor/zstd/contrib/seekable_format/examples/parallel_processing.c +191 -0
- data/vendor/zstd/contrib/seekable_format/examples/seekable_compression.c +136 -0
- data/vendor/zstd/contrib/seekable_format/examples/seekable_decompression.c +141 -0
- data/vendor/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c +147 -0
- data/vendor/zstd/contrib/seekable_format/tests/Makefile +58 -0
- data/vendor/zstd/contrib/seekable_format/tests/seekable_tests.c +375 -0
- data/vendor/zstd/contrib/seekable_format/zstd_seekable.h +226 -0
- data/vendor/zstd/contrib/seekable_format/zstd_seekable_compression_format.md +116 -0
- data/vendor/zstd/contrib/seekable_format/zstdseek_compress.c +365 -0
- data/vendor/zstd/contrib/seekable_format/zstdseek_decompress.c +600 -0
- data/vendor/zstd/contrib/seqBench/Makefile +58 -0
- data/vendor/zstd/contrib/seqBench/seqBench.c +53 -0
- data/vendor/zstd/contrib/snap/snapcraft.yaml +28 -0
- data/vendor/zstd/doc/README.md +26 -0
- data/vendor/zstd/doc/decompressor_errata.md +148 -0
- data/vendor/zstd/doc/decompressor_permissive.md +80 -0
- data/vendor/zstd/doc/educational_decoder/Makefile +62 -0
- data/vendor/zstd/doc/educational_decoder/README.md +36 -0
- data/vendor/zstd/doc/educational_decoder/harness.c +119 -0
- data/vendor/zstd/doc/educational_decoder/zstd_decompress.c +2323 -0
- data/vendor/zstd/doc/educational_decoder/zstd_decompress.h +61 -0
- data/vendor/zstd/doc/images/CSpeed2.png +0 -0
- data/vendor/zstd/doc/images/DCspeed5.png +0 -0
- data/vendor/zstd/doc/images/DSpeed3.png +0 -0
- data/vendor/zstd/doc/images/cdict_v136.png +0 -0
- data/vendor/zstd/doc/images/dict-cr.png +0 -0
- data/vendor/zstd/doc/images/dict-cs.png +0 -0
- data/vendor/zstd/doc/images/dict-ds.png +0 -0
- data/vendor/zstd/doc/images/zstd_cdict_v1_3_5.png +0 -0
- data/vendor/zstd/doc/images/zstd_logo86.png +0 -0
- data/vendor/zstd/doc/zstd_compression_format.md +1772 -0
- data/vendor/zstd/doc/zstd_manual.html +2244 -0
- data/vendor/zstd/examples/Makefile +93 -0
- data/vendor/zstd/examples/README.md +46 -0
- data/vendor/zstd/examples/common.h +246 -0
- data/vendor/zstd/examples/dictionary_compression.c +107 -0
- data/vendor/zstd/examples/dictionary_decompression.c +99 -0
- data/vendor/zstd/examples/multiple_simple_compression.c +116 -0
- data/vendor/zstd/examples/multiple_streaming_compression.c +133 -0
- data/vendor/zstd/examples/simple_compression.c +68 -0
- data/vendor/zstd/examples/simple_decompression.c +65 -0
- data/vendor/zstd/examples/streaming_compression.c +146 -0
- data/vendor/zstd/examples/streaming_compression_thread_pool.c +180 -0
- data/vendor/zstd/examples/streaming_decompression.c +100 -0
- data/vendor/zstd/examples/streaming_memory_usage.c +137 -0
- data/vendor/zstd/lib/BUCK +232 -0
- data/vendor/zstd/lib/Makefile +389 -0
- data/vendor/zstd/lib/README.md +267 -0
- data/vendor/zstd/lib/common/allocations.h +55 -0
- data/vendor/zstd/lib/common/bits.h +205 -0
- data/vendor/zstd/lib/common/bitstream.h +454 -0
- data/vendor/zstd/lib/common/compiler.h +482 -0
- data/vendor/zstd/lib/common/cpu.h +249 -0
- data/vendor/zstd/lib/common/debug.c +30 -0
- data/vendor/zstd/lib/common/debug.h +107 -0
- data/vendor/zstd/lib/common/debug.o +0 -0
- data/vendor/zstd/lib/common/entropy_common.c +340 -0
- data/vendor/zstd/lib/common/entropy_common.o +0 -0
- data/vendor/zstd/lib/common/error_private.c +64 -0
- data/vendor/zstd/lib/common/error_private.h +158 -0
- data/vendor/zstd/lib/common/error_private.o +0 -0
- data/vendor/zstd/lib/common/fse.h +625 -0
- data/vendor/zstd/lib/common/fse_decompress.c +315 -0
- data/vendor/zstd/lib/common/fse_decompress.o +0 -0
- data/vendor/zstd/lib/common/huf.h +277 -0
- data/vendor/zstd/lib/common/mem.h +422 -0
- data/vendor/zstd/lib/common/pool.c +371 -0
- data/vendor/zstd/lib/common/pool.h +81 -0
- data/vendor/zstd/lib/common/pool.o +0 -0
- data/vendor/zstd/lib/common/portability_macros.h +190 -0
- data/vendor/zstd/lib/common/threading.c +196 -0
- data/vendor/zstd/lib/common/threading.h +142 -0
- data/vendor/zstd/lib/common/threading.o +0 -0
- data/vendor/zstd/lib/common/xxhash.c +18 -0
- data/vendor/zstd/lib/common/xxhash.h +7094 -0
- data/vendor/zstd/lib/common/xxhash.o +0 -0
- data/vendor/zstd/lib/common/zstd_common.c +57 -0
- data/vendor/zstd/lib/common/zstd_common.o +0 -0
- data/vendor/zstd/lib/common/zstd_deps.h +123 -0
- data/vendor/zstd/lib/common/zstd_internal.h +326 -0
- data/vendor/zstd/lib/common/zstd_trace.h +156 -0
- data/vendor/zstd/lib/compress/clevels.h +134 -0
- data/vendor/zstd/lib/compress/fse_compress.c +625 -0
- data/vendor/zstd/lib/compress/fse_compress.o +0 -0
- data/vendor/zstd/lib/compress/hist.c +446 -0
- data/vendor/zstd/lib/compress/hist.h +86 -0
- data/vendor/zstd/lib/compress/hist.o +0 -0
- data/vendor/zstd/lib/compress/huf_compress.c +1465 -0
- data/vendor/zstd/lib/compress/huf_compress.o +0 -0
- data/vendor/zstd/lib/compress/zstd_compress.c +8362 -0
- data/vendor/zstd/lib/compress/zstd_compress.o +0 -0
- data/vendor/zstd/lib/compress/zstd_compress_internal.h +1636 -0
- data/vendor/zstd/lib/compress/zstd_compress_literals.c +235 -0
- data/vendor/zstd/lib/compress/zstd_compress_literals.h +39 -0
- data/vendor/zstd/lib/compress/zstd_compress_literals.o +0 -0
- data/vendor/zstd/lib/compress/zstd_compress_sequences.c +442 -0
- data/vendor/zstd/lib/compress/zstd_compress_sequences.h +55 -0
- data/vendor/zstd/lib/compress/zstd_compress_sequences.o +0 -0
- data/vendor/zstd/lib/compress/zstd_compress_superblock.c +688 -0
- data/vendor/zstd/lib/compress/zstd_compress_superblock.h +32 -0
- data/vendor/zstd/lib/compress/zstd_compress_superblock.o +0 -0
- data/vendor/zstd/lib/compress/zstd_cwksp.h +765 -0
- data/vendor/zstd/lib/compress/zstd_double_fast.c +778 -0
- data/vendor/zstd/lib/compress/zstd_double_fast.h +42 -0
- data/vendor/zstd/lib/compress/zstd_double_fast.o +0 -0
- data/vendor/zstd/lib/compress/zstd_fast.c +985 -0
- data/vendor/zstd/lib/compress/zstd_fast.h +30 -0
- data/vendor/zstd/lib/compress/zstd_fast.o +0 -0
- data/vendor/zstd/lib/compress/zstd_lazy.c +2243 -0
- data/vendor/zstd/lib/compress/zstd_lazy.h +193 -0
- data/vendor/zstd/lib/compress/zstd_lazy.o +0 -0
- data/vendor/zstd/lib/compress/zstd_ldm.c +745 -0
- data/vendor/zstd/lib/compress/zstd_ldm.h +109 -0
- data/vendor/zstd/lib/compress/zstd_ldm.o +0 -0
- data/vendor/zstd/lib/compress/zstd_ldm_geartab.h +106 -0
- data/vendor/zstd/lib/compress/zstd_opt.c +1572 -0
- data/vendor/zstd/lib/compress/zstd_opt.h +72 -0
- data/vendor/zstd/lib/compress/zstd_opt.o +0 -0
- data/vendor/zstd/lib/compress/zstd_preSplit.c +238 -0
- data/vendor/zstd/lib/compress/zstd_preSplit.h +33 -0
- data/vendor/zstd/lib/compress/zstd_preSplit.o +0 -0
- data/vendor/zstd/lib/compress/zstdmt_compress.c +1924 -0
- data/vendor/zstd/lib/compress/zstdmt_compress.h +102 -0
- data/vendor/zstd/lib/compress/zstdmt_compress.o +0 -0
- data/vendor/zstd/lib/decompress/huf_decompress.c +1953 -0
- data/vendor/zstd/lib/decompress/huf_decompress.o +0 -0
- data/vendor/zstd/lib/decompress/huf_decompress_amd64.S +766 -0
- data/vendor/zstd/lib/decompress/zstd_ddict.c +244 -0
- data/vendor/zstd/lib/decompress/zstd_ddict.h +44 -0
- data/vendor/zstd/lib/decompress/zstd_ddict.o +0 -0
- data/vendor/zstd/lib/decompress/zstd_decompress.c +2410 -0
- data/vendor/zstd/lib/decompress/zstd_decompress.o +0 -0
- data/vendor/zstd/lib/decompress/zstd_decompress_block.c +2311 -0
- data/vendor/zstd/lib/decompress/zstd_decompress_block.h +73 -0
- data/vendor/zstd/lib/decompress/zstd_decompress_block.o +0 -0
- data/vendor/zstd/lib/decompress/zstd_decompress_internal.h +240 -0
- data/vendor/zstd/lib/deprecated/zbuff.h +214 -0
- data/vendor/zstd/lib/deprecated/zbuff_common.c +26 -0
- data/vendor/zstd/lib/deprecated/zbuff_compress.c +167 -0
- data/vendor/zstd/lib/deprecated/zbuff_decompress.c +77 -0
- data/vendor/zstd/lib/dictBuilder/cover.c +1333 -0
- data/vendor/zstd/lib/dictBuilder/cover.h +152 -0
- data/vendor/zstd/lib/dictBuilder/divsufsort.c +1913 -0
- data/vendor/zstd/lib/dictBuilder/divsufsort.h +57 -0
- data/vendor/zstd/lib/dictBuilder/fastcover.c +765 -0
- data/vendor/zstd/lib/dictBuilder/zdict.c +1137 -0
- data/vendor/zstd/lib/dll/example/Makefile +48 -0
- data/vendor/zstd/lib/dll/example/README.md +63 -0
- data/vendor/zstd/lib/dll/example/build_package.bat +55 -0
- data/vendor/zstd/lib/dll/example/fullbench-dll.sln +25 -0
- data/vendor/zstd/lib/dll/example/fullbench-dll.vcxproj +181 -0
- data/vendor/zstd/lib/install_oses.mk +17 -0
- data/vendor/zstd/lib/legacy/zstd_legacy.h +452 -0
- data/vendor/zstd/lib/legacy/zstd_v01.c +2128 -0
- data/vendor/zstd/lib/legacy/zstd_v01.h +94 -0
- data/vendor/zstd/lib/legacy/zstd_v02.c +3465 -0
- data/vendor/zstd/lib/legacy/zstd_v02.h +93 -0
- data/vendor/zstd/lib/legacy/zstd_v03.c +3105 -0
- data/vendor/zstd/lib/legacy/zstd_v03.h +93 -0
- data/vendor/zstd/lib/legacy/zstd_v04.c +3598 -0
- data/vendor/zstd/lib/legacy/zstd_v04.h +142 -0
- data/vendor/zstd/lib/legacy/zstd_v05.c +4005 -0
- data/vendor/zstd/lib/legacy/zstd_v05.h +162 -0
- data/vendor/zstd/lib/legacy/zstd_v06.c +4110 -0
- data/vendor/zstd/lib/legacy/zstd_v06.h +172 -0
- data/vendor/zstd/lib/legacy/zstd_v07.c +4490 -0
- data/vendor/zstd/lib/legacy/zstd_v07.h +187 -0
- data/vendor/zstd/lib/libzstd.mk +238 -0
- data/vendor/zstd/lib/libzstd.pc.in +17 -0
- data/vendor/zstd/lib/module.modulemap +35 -0
- data/vendor/zstd/lib/zdict.h +481 -0
- data/vendor/zstd/lib/zstd.h +3209 -0
- data/vendor/zstd/lib/zstd_errors.h +107 -0
- data/vendor/zstd/programs/BUCK +44 -0
- data/vendor/zstd/programs/Makefile +445 -0
- data/vendor/zstd/programs/README.md +344 -0
- data/vendor/zstd/programs/benchfn.c +256 -0
- data/vendor/zstd/programs/benchfn.h +173 -0
- data/vendor/zstd/programs/benchzstd.c +1270 -0
- data/vendor/zstd/programs/benchzstd.h +191 -0
- data/vendor/zstd/programs/datagen.c +186 -0
- data/vendor/zstd/programs/datagen.h +38 -0
- data/vendor/zstd/programs/dibio.c +447 -0
- data/vendor/zstd/programs/dibio.h +39 -0
- data/vendor/zstd/programs/fileio.c +3717 -0
- data/vendor/zstd/programs/fileio.h +171 -0
- data/vendor/zstd/programs/fileio_asyncio.c +663 -0
- data/vendor/zstd/programs/fileio_asyncio.h +195 -0
- data/vendor/zstd/programs/fileio_common.h +121 -0
- data/vendor/zstd/programs/fileio_types.h +86 -0
- data/vendor/zstd/programs/lorem.c +285 -0
- data/vendor/zstd/programs/lorem.h +32 -0
- data/vendor/zstd/programs/platform.h +217 -0
- data/vendor/zstd/programs/timefn.c +170 -0
- data/vendor/zstd/programs/timefn.h +59 -0
- data/vendor/zstd/programs/util.c +1731 -0
- data/vendor/zstd/programs/util.h +364 -0
- data/vendor/zstd/programs/windres/verrsrc.h +17 -0
- data/vendor/zstd/programs/windres/zstd.rc +51 -0
- data/vendor/zstd/programs/windres/zstd32.res +0 -0
- data/vendor/zstd/programs/windres/zstd64.res +0 -0
- data/vendor/zstd/programs/zstd.1 +580 -0
- data/vendor/zstd/programs/zstd.1.md +714 -0
- data/vendor/zstd/programs/zstdcli.c +1675 -0
- data/vendor/zstd/programs/zstdcli_trace.c +173 -0
- data/vendor/zstd/programs/zstdcli_trace.h +24 -0
- data/vendor/zstd/programs/zstdgrep +134 -0
- data/vendor/zstd/programs/zstdgrep.1 +26 -0
- data/vendor/zstd/programs/zstdgrep.1.md +30 -0
- data/vendor/zstd/programs/zstdless +8 -0
- data/vendor/zstd/programs/zstdless.1 +14 -0
- data/vendor/zstd/programs/zstdless.1.md +16 -0
- data/vendor/zstd/tests/DEPRECATED-test-zstd-speed.py +378 -0
- data/vendor/zstd/tests/Makefile +485 -0
- data/vendor/zstd/tests/README.md +184 -0
- data/vendor/zstd/tests/automated_benchmarking.py +326 -0
- data/vendor/zstd/tests/checkTag.c +65 -0
- data/vendor/zstd/tests/check_size.py +31 -0
- data/vendor/zstd/tests/cli-tests/README.md +258 -0
- data/vendor/zstd/tests/cli-tests/basic/args.sh +10 -0
- data/vendor/zstd/tests/cli-tests/basic/args.sh.exit +1 -0
- data/vendor/zstd/tests/cli-tests/basic/args.sh.stderr.glob +28 -0
- data/vendor/zstd/tests/cli-tests/basic/help.sh +10 -0
- data/vendor/zstd/tests/cli-tests/basic/help.sh.stdout.glob +34 -0
- data/vendor/zstd/tests/cli-tests/basic/memlimit.sh +40 -0
- data/vendor/zstd/tests/cli-tests/basic/memlimit.sh.stderr.exact +13 -0
- data/vendor/zstd/tests/cli-tests/basic/memlimit.sh.stdout.exact +13 -0
- data/vendor/zstd/tests/cli-tests/basic/output_dir.sh +7 -0
- data/vendor/zstd/tests/cli-tests/basic/output_dir.sh.stderr.exact +2 -0
- data/vendor/zstd/tests/cli-tests/basic/output_dir.sh.stdout.exact +2 -0
- data/vendor/zstd/tests/cli-tests/basic/version.sh +6 -0
- data/vendor/zstd/tests/cli-tests/basic/version.sh.stdout.glob +2 -0
- data/vendor/zstd/tests/cli-tests/bin/cmp_size +44 -0
- data/vendor/zstd/tests/cli-tests/bin/datagen +3 -0
- data/vendor/zstd/tests/cli-tests/bin/die +4 -0
- data/vendor/zstd/tests/cli-tests/bin/println +2 -0
- data/vendor/zstd/tests/cli-tests/bin/unzstd +1 -0
- data/vendor/zstd/tests/cli-tests/bin/zstd +9 -0
- data/vendor/zstd/tests/cli-tests/bin/zstdcat +1 -0
- data/vendor/zstd/tests/cli-tests/bin/zstdgrep +2 -0
- data/vendor/zstd/tests/cli-tests/bin/zstdless +2 -0
- data/vendor/zstd/tests/cli-tests/cltools/setup +6 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdgrep.sh +8 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdgrep.sh.exit +1 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdgrep.sh.stderr.exact +1 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdgrep.sh.stdout.glob +4 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdless.sh +10 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdless.sh.stderr.exact +2 -0
- data/vendor/zstd/tests/cli-tests/cltools/zstdless.sh.stdout.glob +5 -0
- data/vendor/zstd/tests/cli-tests/common/format.sh +19 -0
- data/vendor/zstd/tests/cli-tests/common/mtime.sh +13 -0
- data/vendor/zstd/tests/cli-tests/common/permissions.sh +18 -0
- data/vendor/zstd/tests/cli-tests/common/platform.sh +47 -0
- data/vendor/zstd/tests/cli-tests/compression/adapt.sh +14 -0
- data/vendor/zstd/tests/cli-tests/compression/basic.sh +36 -0
- data/vendor/zstd/tests/cli-tests/compression/compress-literals.sh +10 -0
- data/vendor/zstd/tests/cli-tests/compression/format.sh +16 -0
- data/vendor/zstd/tests/cli-tests/compression/golden.sh +16 -0
- data/vendor/zstd/tests/cli-tests/compression/gzip-compat.sh +17 -0
- data/vendor/zstd/tests/cli-tests/compression/levels.sh +75 -0
- data/vendor/zstd/tests/cli-tests/compression/levels.sh.stderr.exact +80 -0
- data/vendor/zstd/tests/cli-tests/compression/long-distance-matcher.sh +7 -0
- data/vendor/zstd/tests/cli-tests/compression/multi-threaded.sh +22 -0
- data/vendor/zstd/tests/cli-tests/compression/multi-threaded.sh.stderr.exact +21 -0
- data/vendor/zstd/tests/cli-tests/compression/multiple-files.sh +21 -0
- data/vendor/zstd/tests/cli-tests/compression/multiple-files.sh.stdout.exact +12 -0
- data/vendor/zstd/tests/cli-tests/compression/row-match-finder.sh +7 -0
- data/vendor/zstd/tests/cli-tests/compression/setup +7 -0
- data/vendor/zstd/tests/cli-tests/compression/stream-size.sh +7 -0
- data/vendor/zstd/tests/cli-tests/compression/verbose-wlog.sh +11 -0
- data/vendor/zstd/tests/cli-tests/compression/verbose-wlog.sh.stderr.glob +5 -0
- data/vendor/zstd/tests/cli-tests/compression/verbose-wlog.sh.stdout.glob +5 -0
- data/vendor/zstd/tests/cli-tests/compression/window-resize.sh +9 -0
- data/vendor/zstd/tests/cli-tests/compression/window-resize.sh.stderr.ignore +0 -0
- data/vendor/zstd/tests/cli-tests/compression/window-resize.sh.stdout.glob +3 -0
- data/vendor/zstd/tests/cli-tests/decompression/detectErrors.sh +11 -0
- data/vendor/zstd/tests/cli-tests/decompression/golden.sh +7 -0
- data/vendor/zstd/tests/cli-tests/decompression/pass-through.sh +57 -0
- data/vendor/zstd/tests/cli-tests/decompression/pass-through.sh.stderr.exact +11 -0
- data/vendor/zstd/tests/cli-tests/decompression/pass-through.sh.stdout.exact +25 -0
- data/vendor/zstd/tests/cli-tests/determinism/basic.sh +36 -0
- data/vendor/zstd/tests/cli-tests/determinism/basic.sh.stderr.exact +0 -0
- data/vendor/zstd/tests/cli-tests/determinism/basic.sh.stdout.exact +880 -0
- data/vendor/zstd/tests/cli-tests/determinism/multithread.sh +45 -0
- data/vendor/zstd/tests/cli-tests/determinism/multithread.sh.stderr.exact +0 -0
- data/vendor/zstd/tests/cli-tests/determinism/multithread.sh.stdout.exact +260 -0
- data/vendor/zstd/tests/cli-tests/determinism/reuse.sh +44 -0
- data/vendor/zstd/tests/cli-tests/determinism/reuse.sh.stderr.exact +0 -0
- data/vendor/zstd/tests/cli-tests/determinism/reuse.sh.stdout.exact +19 -0
- data/vendor/zstd/tests/cli-tests/determinism/setup +5 -0
- data/vendor/zstd/tests/cli-tests/determinism/setup_once +30 -0
- data/vendor/zstd/tests/cli-tests/dict-builder/empty-input.sh +9 -0
- data/vendor/zstd/tests/cli-tests/dict-builder/empty-input.sh.stderr.exact +1 -0
- data/vendor/zstd/tests/cli-tests/dict-builder/no-inputs.sh +3 -0
- data/vendor/zstd/tests/cli-tests/dict-builder/no-inputs.sh.exit +1 -0
- data/vendor/zstd/tests/cli-tests/dict-builder/no-inputs.sh.stderr.exact +5 -0
- data/vendor/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh +29 -0
- data/vendor/zstd/tests/cli-tests/dictionaries/dictionary-mismatch.sh.stderr.exact +7 -0
- data/vendor/zstd/tests/cli-tests/dictionaries/golden.sh +9 -0
- data/vendor/zstd/tests/cli-tests/dictionaries/setup +6 -0
- data/vendor/zstd/tests/cli-tests/dictionaries/setup_once +24 -0
- data/vendor/zstd/tests/cli-tests/file-handling/directory-mirror.sh +49 -0
- data/vendor/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stderr.exact +0 -0
- data/vendor/zstd/tests/cli-tests/file-handling/directory-mirror.sh.stdout.exact +0 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh +12 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh.stderr.exact +30 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh +9 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.glob +46 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh +8 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-file-to-stdout.sh.stderr.exact +24 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh +8 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-stdin-to-file.sh.stderr.glob +28 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh +8 -0
- data/vendor/zstd/tests/cli-tests/file-stat/compress-stdin-to-stdout.sh.stderr.exact +18 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh +8 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.glob +42 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh +7 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-file-to-stdout.sh.stderr.exact +18 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh +7 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-stdin-to-file.sh.stderr.glob +24 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh +7 -0
- data/vendor/zstd/tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh.stderr.exact +14 -0
- data/vendor/zstd/tests/cli-tests/progress/no-progress.sh +46 -0
- data/vendor/zstd/tests/cli-tests/progress/no-progress.sh.stderr.glob +96 -0
- data/vendor/zstd/tests/cli-tests/progress/progress.sh +41 -0
- data/vendor/zstd/tests/cli-tests/progress/progress.sh.stderr.glob +62 -0
- data/vendor/zstd/tests/cli-tests/run.py +732 -0
- data/vendor/zstd/tests/cli-tests/zstd-symlinks/setup +6 -0
- data/vendor/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh +12 -0
- data/vendor/zstd/tests/cli-tests/zstd-symlinks/zstdcat.sh.stdout.exact +8 -0
- data/vendor/zstd/tests/datagencli.c +149 -0
- data/vendor/zstd/tests/decodecorpus.c +1998 -0
- data/vendor/zstd/tests/dict-files/zero-weight-dict +0 -0
- data/vendor/zstd/tests/external_matchfinder.c +140 -0
- data/vendor/zstd/tests/external_matchfinder.h +39 -0
- data/vendor/zstd/tests/fullbench.c +1210 -0
- data/vendor/zstd/tests/fuzz/Makefile +278 -0
- data/vendor/zstd/tests/fuzz/README.md +161 -0
- data/vendor/zstd/tests/fuzz/block_decompress.c +53 -0
- data/vendor/zstd/tests/fuzz/block_round_trip.c +103 -0
- data/vendor/zstd/tests/fuzz/decompress_cross_format.c +130 -0
- data/vendor/zstd/tests/fuzz/decompress_dstSize_tooSmall.c +74 -0
- data/vendor/zstd/tests/fuzz/dictionary_decompress.c +77 -0
- data/vendor/zstd/tests/fuzz/dictionary_loader.c +106 -0
- data/vendor/zstd/tests/fuzz/dictionary_round_trip.c +155 -0
- data/vendor/zstd/tests/fuzz/dictionary_stream_round_trip.c +209 -0
- data/vendor/zstd/tests/fuzz/fse_read_ncount.c +100 -0
- data/vendor/zstd/tests/fuzz/fuzz.h +57 -0
- data/vendor/zstd/tests/fuzz/fuzz.py +910 -0
- data/vendor/zstd/tests/fuzz/fuzz_data_producer.c +95 -0
- data/vendor/zstd/tests/fuzz/fuzz_data_producer.h +66 -0
- data/vendor/zstd/tests/fuzz/fuzz_helpers.c +47 -0
- data/vendor/zstd/tests/fuzz/fuzz_helpers.h +82 -0
- data/vendor/zstd/tests/fuzz/fuzz_third_party_seq_prod.h +116 -0
- data/vendor/zstd/tests/fuzz/generate_sequences.c +88 -0
- data/vendor/zstd/tests/fuzz/huf_decompress.c +68 -0
- data/vendor/zstd/tests/fuzz/huf_round_trip.c +137 -0
- data/vendor/zstd/tests/fuzz/raw_dictionary_round_trip.c +119 -0
- data/vendor/zstd/tests/fuzz/regression_driver.c +90 -0
- data/vendor/zstd/tests/fuzz/seekable_roundtrip.c +88 -0
- data/vendor/zstd/tests/fuzz/seq_prod_fuzz_example/Makefile +16 -0
- data/vendor/zstd/tests/fuzz/seq_prod_fuzz_example/README.md +12 -0
- data/vendor/zstd/tests/fuzz/seq_prod_fuzz_example/example_seq_prod.c +52 -0
- data/vendor/zstd/tests/fuzz/sequence_compression_api.c +452 -0
- data/vendor/zstd/tests/fuzz/simple_compress.c +60 -0
- data/vendor/zstd/tests/fuzz/simple_decompress.c +59 -0
- data/vendor/zstd/tests/fuzz/simple_round_trip.c +182 -0
- data/vendor/zstd/tests/fuzz/stream_decompress.c +119 -0
- data/vendor/zstd/tests/fuzz/stream_round_trip.c +218 -0
- data/vendor/zstd/tests/fuzz/zstd_frame_info.c +43 -0
- data/vendor/zstd/tests/fuzz/zstd_helpers.c +208 -0
- data/vendor/zstd/tests/fuzz/zstd_helpers.h +56 -0
- data/vendor/zstd/tests/fuzzer.c +5482 -0
- data/vendor/zstd/tests/golden-compression/PR-3517-block-splitter-corruption-test +1 -0
- data/vendor/zstd/tests/golden-compression/http +1 -0
- data/vendor/zstd/tests/golden-compression/huffman-compressed-larger +0 -0
- data/vendor/zstd/tests/golden-compression/large-literal-and-match-lengths +0 -0
- data/vendor/zstd/tests/golden-decompression/block-128k.zst +0 -0
- data/vendor/zstd/tests/golden-decompression/empty-block.zst +0 -0
- data/vendor/zstd/tests/golden-decompression/rle-first-block.zst +0 -0
- data/vendor/zstd/tests/golden-decompression/zeroSeq_2B.zst +0 -0
- data/vendor/zstd/tests/golden-decompression-errors/off0.bin.zst +0 -0
- data/vendor/zstd/tests/golden-decompression-errors/truncated_huff_state.zst +0 -0
- data/vendor/zstd/tests/golden-decompression-errors/zeroSeq_extraneous.zst +0 -0
- data/vendor/zstd/tests/golden-dictionaries/http-dict-missing-symbols +0 -0
- data/vendor/zstd/tests/gzip/Makefile +45 -0
- data/vendor/zstd/tests/gzip/gzip-env.sh +46 -0
- data/vendor/zstd/tests/gzip/helin-segv.sh +31 -0
- data/vendor/zstd/tests/gzip/help-version.sh +270 -0
- data/vendor/zstd/tests/gzip/hufts-segv.gz +0 -0
- data/vendor/zstd/tests/gzip/hufts.sh +34 -0
- data/vendor/zstd/tests/gzip/init.cfg +5 -0
- data/vendor/zstd/tests/gzip/init.sh +616 -0
- data/vendor/zstd/tests/gzip/keep.sh +51 -0
- data/vendor/zstd/tests/gzip/list.sh +31 -0
- data/vendor/zstd/tests/gzip/memcpy-abuse.sh +34 -0
- data/vendor/zstd/tests/gzip/mixed.sh +68 -0
- data/vendor/zstd/tests/gzip/null-suffix-clobber.sh +35 -0
- data/vendor/zstd/tests/gzip/stdin.sh +31 -0
- data/vendor/zstd/tests/gzip/test-driver.sh +150 -0
- data/vendor/zstd/tests/gzip/trailing-nul.sh +37 -0
- data/vendor/zstd/tests/gzip/unpack-invalid.sh +36 -0
- data/vendor/zstd/tests/gzip/z-suffix.sh +30 -0
- data/vendor/zstd/tests/gzip/zdiff.sh +48 -0
- data/vendor/zstd/tests/gzip/zgrep-context.sh +47 -0
- data/vendor/zstd/tests/gzip/zgrep-f.sh +43 -0
- data/vendor/zstd/tests/gzip/zgrep-signal.sh +64 -0
- data/vendor/zstd/tests/gzip/znew-k.sh +40 -0
- data/vendor/zstd/tests/invalidDictionaries.c +61 -0
- data/vendor/zstd/tests/largeDictionary.c +131 -0
- data/vendor/zstd/tests/legacy.c +262 -0
- data/vendor/zstd/tests/libzstd_builds.sh +104 -0
- data/vendor/zstd/tests/longmatch.c +123 -0
- data/vendor/zstd/tests/loremOut.c +50 -0
- data/vendor/zstd/tests/loremOut.h +15 -0
- data/vendor/zstd/tests/paramgrill.c +2965 -0
- data/vendor/zstd/tests/playTests.sh +1926 -0
- data/vendor/zstd/tests/poolTests.c +271 -0
- data/vendor/zstd/tests/rateLimiter.py +41 -0
- data/vendor/zstd/tests/regression/Makefile +60 -0
- data/vendor/zstd/tests/regression/README.md +28 -0
- data/vendor/zstd/tests/regression/config.c +404 -0
- data/vendor/zstd/tests/regression/config.h +91 -0
- data/vendor/zstd/tests/regression/data.c +631 -0
- data/vendor/zstd/tests/regression/data.h +121 -0
- data/vendor/zstd/tests/regression/levels.h +59 -0
- data/vendor/zstd/tests/regression/method.c +701 -0
- data/vendor/zstd/tests/regression/method.h +65 -0
- data/vendor/zstd/tests/regression/result.c +30 -0
- data/vendor/zstd/tests/regression/result.h +103 -0
- data/vendor/zstd/tests/regression/results.csv +1480 -0
- data/vendor/zstd/tests/regression/test.c +362 -0
- data/vendor/zstd/tests/roundTripCrash.c +241 -0
- data/vendor/zstd/tests/seqgen.c +260 -0
- data/vendor/zstd/tests/seqgen.h +58 -0
- data/vendor/zstd/tests/test-license.py +156 -0
- data/vendor/zstd/tests/test-variants.sh +115 -0
- data/vendor/zstd/tests/test-zstd-versions.py +308 -0
- data/vendor/zstd/tests/test_process_substitution.bash +92 -0
- data/vendor/zstd/tests/zstreamtest.c +3467 -0
- data/vendor/zstd/zlibWrapper/BUCK +22 -0
- data/vendor/zstd/zlibWrapper/Makefile +120 -0
- data/vendor/zstd/zlibWrapper/README.md +163 -0
- data/vendor/zstd/zlibWrapper/examples/example.c +598 -0
- data/vendor/zstd/zlibWrapper/examples/example_original.c +599 -0
- data/vendor/zstd/zlibWrapper/examples/fitblk.c +254 -0
- data/vendor/zstd/zlibWrapper/examples/fitblk_original.c +233 -0
- data/vendor/zstd/zlibWrapper/examples/minigzip.c +605 -0
- data/vendor/zstd/zlibWrapper/examples/zwrapbench.c +1018 -0
- data/vendor/zstd/zlibWrapper/gzclose.c +26 -0
- data/vendor/zstd/zlibWrapper/gzcompatibility.h +68 -0
- data/vendor/zstd/zlibWrapper/gzguts.h +229 -0
- data/vendor/zstd/zlibWrapper/gzlib.c +587 -0
- data/vendor/zstd/zlibWrapper/gzread.c +637 -0
- data/vendor/zstd/zlibWrapper/gzwrite.c +632 -0
- data/vendor/zstd/zlibWrapper/zstd_zlibwrapper.c +1200 -0
- data/vendor/zstd/zlibWrapper/zstd_zlibwrapper.h +91 -0
- metadata +738 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
#include <stddef.h>
|
|
2
|
+
#include <stdint.h>
|
|
3
|
+
#include <stdlib.h> // malloc
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
#include <assert.h>
|
|
6
|
+
#include <string.h>
|
|
7
|
+
|
|
8
|
+
#include "../zstd_seekable.h"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/* ZSTD_seekable_customFile implementation that reads/seeks a buffer while keeping track of total bytes read */
|
|
12
|
+
typedef struct {
|
|
13
|
+
const void *ptr;
|
|
14
|
+
size_t size;
|
|
15
|
+
size_t pos;
|
|
16
|
+
size_t totalRead;
|
|
17
|
+
} buffWrapperWithTotal_t;
|
|
18
|
+
|
|
19
|
+
static int readBuffWithTotal(void* opaque, void* buffer, size_t n)
|
|
20
|
+
{
|
|
21
|
+
buffWrapperWithTotal_t* const buff = (buffWrapperWithTotal_t*)opaque;
|
|
22
|
+
assert(buff != NULL);
|
|
23
|
+
if (buff->pos + n > buff->size) return -1;
|
|
24
|
+
memcpy(buffer, (const char*)buff->ptr + buff->pos, n);
|
|
25
|
+
buff->pos += n;
|
|
26
|
+
buff->totalRead += n;
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static int seekBuffWithTotal(void* opaque, long long offset, int origin)
|
|
31
|
+
{
|
|
32
|
+
buffWrapperWithTotal_t* const buff = (buffWrapperWithTotal_t*) opaque;
|
|
33
|
+
unsigned long long newOffset;
|
|
34
|
+
assert(buff != NULL);
|
|
35
|
+
switch (origin) {
|
|
36
|
+
case SEEK_SET:
|
|
37
|
+
assert(offset >= 0);
|
|
38
|
+
newOffset = (unsigned long long)offset;
|
|
39
|
+
break;
|
|
40
|
+
case SEEK_CUR:
|
|
41
|
+
newOffset = (unsigned long long)((long long)buff->pos + offset);
|
|
42
|
+
break;
|
|
43
|
+
case SEEK_END:
|
|
44
|
+
newOffset = (unsigned long long)((long long)buff->size + offset);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
assert(0); /* not possible */
|
|
48
|
+
}
|
|
49
|
+
if (newOffset > buff->size) {
|
|
50
|
+
return -1;
|
|
51
|
+
}
|
|
52
|
+
buff->pos = newOffset;
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Basic unit tests for zstd seekable format */
|
|
57
|
+
int main(int argc, const char** argv)
|
|
58
|
+
{
|
|
59
|
+
unsigned testNb = 1;
|
|
60
|
+
(void)argc; (void)argv;
|
|
61
|
+
printf("Beginning zstd seekable format tests...\n");
|
|
62
|
+
|
|
63
|
+
printf("Test %u - simple round trip: ", testNb++);
|
|
64
|
+
{ size_t const inSize = 4000;
|
|
65
|
+
void* const inBuffer = malloc(inSize);
|
|
66
|
+
assert(inBuffer != NULL);
|
|
67
|
+
|
|
68
|
+
size_t const seekCapacity = 5000;
|
|
69
|
+
void* const seekBuffer = malloc(seekCapacity);
|
|
70
|
+
assert(seekBuffer != NULL);
|
|
71
|
+
size_t seekSize;
|
|
72
|
+
|
|
73
|
+
size_t const outCapacity = inSize;
|
|
74
|
+
void* const outBuffer = malloc(outCapacity);
|
|
75
|
+
assert(outBuffer != NULL);
|
|
76
|
+
|
|
77
|
+
ZSTD_seekable_CStream* const zscs = ZSTD_seekable_createCStream();
|
|
78
|
+
assert(zscs != NULL);
|
|
79
|
+
|
|
80
|
+
{ size_t const initStatus = ZSTD_seekable_initCStream(zscs, 9, 0 /* checksumFlag */, (unsigned)inSize /* maxFrameSize */);
|
|
81
|
+
assert(!ZSTD_isError(initStatus));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
{ ZSTD_outBuffer outb = { .dst=seekBuffer, .pos=0, .size=seekCapacity };
|
|
85
|
+
ZSTD_inBuffer inb = { .src=inBuffer, .pos=0, .size=inSize };
|
|
86
|
+
|
|
87
|
+
size_t const cStatus = ZSTD_seekable_compressStream(zscs, &outb, &inb);
|
|
88
|
+
assert(!ZSTD_isError(cStatus));
|
|
89
|
+
assert(inb.pos == inb.size);
|
|
90
|
+
|
|
91
|
+
size_t const endStatus = ZSTD_seekable_endStream(zscs, &outb);
|
|
92
|
+
assert(!ZSTD_isError(endStatus));
|
|
93
|
+
seekSize = outb.pos;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
ZSTD_seekable* const stream = ZSTD_seekable_create();
|
|
97
|
+
assert(stream != NULL);
|
|
98
|
+
{ size_t const initStatus = ZSTD_seekable_initBuff(stream, seekBuffer, seekSize);
|
|
99
|
+
assert(!ZSTD_isError(initStatus)); }
|
|
100
|
+
|
|
101
|
+
{ size_t const decStatus = ZSTD_seekable_decompress(stream, outBuffer, outCapacity, 0);
|
|
102
|
+
assert(decStatus == inSize); }
|
|
103
|
+
|
|
104
|
+
/* unit test ZSTD_seekTable functions */
|
|
105
|
+
ZSTD_seekTable* const zst = ZSTD_seekTable_create_fromSeekable(stream);
|
|
106
|
+
assert(zst != NULL);
|
|
107
|
+
|
|
108
|
+
unsigned const nbFrames = ZSTD_seekTable_getNumFrames(zst);
|
|
109
|
+
assert(nbFrames > 0);
|
|
110
|
+
|
|
111
|
+
unsigned long long const frame0Offset = ZSTD_seekTable_getFrameCompressedOffset(zst, 0);
|
|
112
|
+
assert(frame0Offset == 0);
|
|
113
|
+
|
|
114
|
+
unsigned long long const content0Offset = ZSTD_seekTable_getFrameDecompressedOffset(zst, 0);
|
|
115
|
+
assert(content0Offset == 0);
|
|
116
|
+
|
|
117
|
+
size_t const cSize = ZSTD_seekTable_getFrameCompressedSize(zst, 0);
|
|
118
|
+
assert(!ZSTD_isError(cSize));
|
|
119
|
+
assert(cSize <= seekCapacity);
|
|
120
|
+
|
|
121
|
+
size_t const origSize = ZSTD_seekTable_getFrameDecompressedSize(zst, 0);
|
|
122
|
+
assert(origSize == inSize);
|
|
123
|
+
|
|
124
|
+
unsigned const fo1idx = ZSTD_seekTable_offsetToFrameIndex(zst, 1);
|
|
125
|
+
assert(fo1idx == 0);
|
|
126
|
+
|
|
127
|
+
free(inBuffer);
|
|
128
|
+
free(seekBuffer);
|
|
129
|
+
free(outBuffer);
|
|
130
|
+
ZSTD_seekable_freeCStream(zscs);
|
|
131
|
+
ZSTD_seekTable_free(zst);
|
|
132
|
+
ZSTD_seekable_free(stream);
|
|
133
|
+
}
|
|
134
|
+
printf("Success!\n");
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
printf("Test %u - check that seekable decompress does not hang: ", testNb++);
|
|
138
|
+
{ /* Github issue #2335 */
|
|
139
|
+
const size_t compressed_size = 17;
|
|
140
|
+
const uint8_t compressed_data[17] = {
|
|
141
|
+
'^',
|
|
142
|
+
'*',
|
|
143
|
+
'M',
|
|
144
|
+
'\x18',
|
|
145
|
+
'\t',
|
|
146
|
+
'\x00',
|
|
147
|
+
'\x00',
|
|
148
|
+
'\x00',
|
|
149
|
+
'\x00',
|
|
150
|
+
'\x00',
|
|
151
|
+
'\x00',
|
|
152
|
+
'\x00',
|
|
153
|
+
(uint8_t)('\x03'),
|
|
154
|
+
(uint8_t)('\xb1'),
|
|
155
|
+
(uint8_t)('\xea'),
|
|
156
|
+
(uint8_t)('\x92'),
|
|
157
|
+
(uint8_t)('\x8f'),
|
|
158
|
+
};
|
|
159
|
+
const size_t uncompressed_size = 32;
|
|
160
|
+
uint8_t uncompressed_data[32];
|
|
161
|
+
|
|
162
|
+
ZSTD_seekable* const stream = ZSTD_seekable_create();
|
|
163
|
+
assert(stream != NULL);
|
|
164
|
+
{ size_t const status = ZSTD_seekable_initBuff(stream, compressed_data, compressed_size);
|
|
165
|
+
if (ZSTD_isError(status)) {
|
|
166
|
+
ZSTD_seekable_free(stream);
|
|
167
|
+
goto _test_error;
|
|
168
|
+
} }
|
|
169
|
+
|
|
170
|
+
/* Should return an error, but not hang */
|
|
171
|
+
{ const size_t offset = 2;
|
|
172
|
+
size_t const status = ZSTD_seekable_decompress(stream, uncompressed_data, uncompressed_size, offset);
|
|
173
|
+
if (!ZSTD_isError(status)) {
|
|
174
|
+
ZSTD_seekable_free(stream);
|
|
175
|
+
goto _test_error;
|
|
176
|
+
} }
|
|
177
|
+
|
|
178
|
+
ZSTD_seekable_free(stream);
|
|
179
|
+
}
|
|
180
|
+
printf("Success!\n");
|
|
181
|
+
|
|
182
|
+
printf("Test %u - check #2 that seekable decompress does not hang: ", testNb++);
|
|
183
|
+
{ /* Github issue #FIXME */
|
|
184
|
+
const size_t compressed_size = 27;
|
|
185
|
+
const uint8_t compressed_data[27] = {
|
|
186
|
+
(uint8_t)'\x28',
|
|
187
|
+
(uint8_t)'\xb5',
|
|
188
|
+
(uint8_t)'\x2f',
|
|
189
|
+
(uint8_t)'\xfd',
|
|
190
|
+
(uint8_t)'\x00',
|
|
191
|
+
(uint8_t)'\x32',
|
|
192
|
+
(uint8_t)'\x91',
|
|
193
|
+
(uint8_t)'\x00',
|
|
194
|
+
(uint8_t)'\x00',
|
|
195
|
+
(uint8_t)'\x00',
|
|
196
|
+
(uint8_t)'\x5e',
|
|
197
|
+
(uint8_t)'\x2a',
|
|
198
|
+
(uint8_t)'\x4d',
|
|
199
|
+
(uint8_t)'\x18',
|
|
200
|
+
(uint8_t)'\x09',
|
|
201
|
+
(uint8_t)'\x00',
|
|
202
|
+
(uint8_t)'\x00',
|
|
203
|
+
(uint8_t)'\x00',
|
|
204
|
+
(uint8_t)'\x00',
|
|
205
|
+
(uint8_t)'\x00',
|
|
206
|
+
(uint8_t)'\x00',
|
|
207
|
+
(uint8_t)'\x00',
|
|
208
|
+
(uint8_t)'\x00',
|
|
209
|
+
(uint8_t)'\xb1',
|
|
210
|
+
(uint8_t)'\xea',
|
|
211
|
+
(uint8_t)'\x92',
|
|
212
|
+
(uint8_t)'\x8f',
|
|
213
|
+
};
|
|
214
|
+
const size_t uncompressed_size = 400;
|
|
215
|
+
uint8_t uncompressed_data[400];
|
|
216
|
+
|
|
217
|
+
ZSTD_seekable* stream = ZSTD_seekable_create();
|
|
218
|
+
size_t status = ZSTD_seekable_initBuff(stream, compressed_data, compressed_size);
|
|
219
|
+
if (ZSTD_isError(status)) {
|
|
220
|
+
ZSTD_seekable_free(stream);
|
|
221
|
+
goto _test_error;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const size_t offset = 2;
|
|
225
|
+
/* Should return an error, but not hang */
|
|
226
|
+
status = ZSTD_seekable_decompress(stream, uncompressed_data, uncompressed_size, offset);
|
|
227
|
+
if (!ZSTD_isError(status)) {
|
|
228
|
+
ZSTD_seekable_free(stream);
|
|
229
|
+
goto _test_error;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
ZSTD_seekable_free(stream);
|
|
233
|
+
}
|
|
234
|
+
printf("Success!\n");
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
printf("Test %u - check ZSTD magic in compressing empty string: ", testNb++);
|
|
238
|
+
{ // compressing empty string should return a zstd header
|
|
239
|
+
size_t const capacity = 255;
|
|
240
|
+
char* inBuffer = malloc(capacity);
|
|
241
|
+
assert(inBuffer != NULL);
|
|
242
|
+
inBuffer[0] = '\0';
|
|
243
|
+
void* const outBuffer = malloc(capacity);
|
|
244
|
+
assert(outBuffer != NULL);
|
|
245
|
+
|
|
246
|
+
ZSTD_seekable_CStream *s = ZSTD_seekable_createCStream();
|
|
247
|
+
ZSTD_seekable_initCStream(s, 1, 1, 255);
|
|
248
|
+
|
|
249
|
+
ZSTD_inBuffer input = { .src=inBuffer, .pos=0, .size=0 };
|
|
250
|
+
ZSTD_outBuffer output = { .dst=outBuffer, .pos=0, .size=capacity };
|
|
251
|
+
|
|
252
|
+
ZSTD_seekable_compressStream(s, &output, &input);
|
|
253
|
+
ZSTD_seekable_endStream(s, &output);
|
|
254
|
+
|
|
255
|
+
if((((char*)output.dst)[0] != '\x28') | (((char*)output.dst)[1] != '\xb5') | (((char*)output.dst)[2] != '\x2f') | (((char*)output.dst)[3] != '\xfd')) {
|
|
256
|
+
printf("%#02x %#02x %#02x %#02x\n", ((char*)output.dst)[0], ((char*)output.dst)[1] , ((char*)output.dst)[2] , ((char*)output.dst)[3] );
|
|
257
|
+
|
|
258
|
+
free(inBuffer);
|
|
259
|
+
free(outBuffer);
|
|
260
|
+
ZSTD_seekable_freeCStream(s);
|
|
261
|
+
goto _test_error;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
free(inBuffer);
|
|
265
|
+
free(outBuffer);
|
|
266
|
+
ZSTD_seekable_freeCStream(s);
|
|
267
|
+
}
|
|
268
|
+
printf("Success!\n");
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
printf("Test %u - multiple decompress calls: ", testNb++);
|
|
272
|
+
{ char const inBuffer[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt";
|
|
273
|
+
size_t const inSize = sizeof(inBuffer);
|
|
274
|
+
|
|
275
|
+
size_t const seekCapacity = 5000;
|
|
276
|
+
void* const seekBuffer = malloc(seekCapacity);
|
|
277
|
+
assert(seekBuffer != NULL);
|
|
278
|
+
size_t seekSize;
|
|
279
|
+
|
|
280
|
+
size_t const outCapacity = inSize;
|
|
281
|
+
char* const outBuffer = malloc(outCapacity);
|
|
282
|
+
assert(outBuffer != NULL);
|
|
283
|
+
|
|
284
|
+
ZSTD_seekable_CStream* const zscs = ZSTD_seekable_createCStream();
|
|
285
|
+
assert(zscs != NULL);
|
|
286
|
+
|
|
287
|
+
/* compress test data with a small frame size to ensure multiple frames in the output */
|
|
288
|
+
unsigned const maxFrameSize = 40;
|
|
289
|
+
{ size_t const initStatus = ZSTD_seekable_initCStream(zscs, 9, 0 /* checksumFlag */, maxFrameSize);
|
|
290
|
+
assert(!ZSTD_isError(initStatus));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
{ ZSTD_outBuffer outb = { .dst=seekBuffer, .pos=0, .size=seekCapacity };
|
|
294
|
+
ZSTD_inBuffer inb = { .src=inBuffer, .pos=0, .size=inSize };
|
|
295
|
+
|
|
296
|
+
while (inb.pos < inb.size) {
|
|
297
|
+
size_t const cStatus = ZSTD_seekable_compressStream(zscs, &outb, &inb);
|
|
298
|
+
assert(!ZSTD_isError(cStatus));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
size_t const endStatus = ZSTD_seekable_endStream(zscs, &outb);
|
|
302
|
+
assert(!ZSTD_isError(endStatus));
|
|
303
|
+
seekSize = outb.pos;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
ZSTD_seekable* const stream = ZSTD_seekable_create();
|
|
307
|
+
assert(stream != NULL);
|
|
308
|
+
buffWrapperWithTotal_t buffWrapper = {seekBuffer, seekSize, 0, 0};
|
|
309
|
+
{ ZSTD_seekable_customFile srcFile = {&buffWrapper, &readBuffWithTotal, &seekBuffWithTotal};
|
|
310
|
+
size_t const initStatus = ZSTD_seekable_initAdvanced(stream, srcFile);
|
|
311
|
+
assert(!ZSTD_isError(initStatus)); }
|
|
312
|
+
|
|
313
|
+
/* Perform a series of small reads and seeks (repeatedly read 1 byte and skip 1 byte)
|
|
314
|
+
and check that we didn't reread input data unnecessarily */
|
|
315
|
+
size_t pos;
|
|
316
|
+
for (pos = 0; pos < inSize; pos += 2) {
|
|
317
|
+
size_t const decStatus = ZSTD_seekable_decompress(stream, outBuffer, 1, pos);
|
|
318
|
+
if (decStatus != 1 || outBuffer[0] != inBuffer[pos]) {
|
|
319
|
+
free(seekBuffer);
|
|
320
|
+
free(outBuffer);
|
|
321
|
+
ZSTD_seekable_freeCStream(zscs);
|
|
322
|
+
ZSTD_seekable_free(stream);
|
|
323
|
+
goto _test_error;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (buffWrapper.totalRead > seekSize) {
|
|
327
|
+
/* We read more than the compressed size, meaning there were some rereads.
|
|
328
|
+
This is unneeded because we only seeked forward. */
|
|
329
|
+
printf("Too much data read: %zu read, with compressed size %zu\n", buffWrapper.totalRead, seekSize);
|
|
330
|
+
free(seekBuffer);
|
|
331
|
+
free(outBuffer);
|
|
332
|
+
ZSTD_seekable_freeCStream(zscs);
|
|
333
|
+
ZSTD_seekable_free(stream);
|
|
334
|
+
goto _test_error;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* Perform some reads and seeks to ensure correctness */
|
|
338
|
+
struct {
|
|
339
|
+
size_t offset;
|
|
340
|
+
size_t size;
|
|
341
|
+
} const tests[] = { /* Assume the frame size is 40 */
|
|
342
|
+
{20, 40}, /* read partial data from two frames */
|
|
343
|
+
{60, 10}, /* continue reading from the same offset */
|
|
344
|
+
{50, 20}, /* seek backward within the same frame */
|
|
345
|
+
{10, 10}, /* seek backward to a different frame */
|
|
346
|
+
{25, 10}, /* seek forward within the same frame */
|
|
347
|
+
{60, 10}, /* seek forward to a different frame */
|
|
348
|
+
};
|
|
349
|
+
size_t idx;
|
|
350
|
+
for (idx = 0; idx < sizeof(tests) / sizeof(tests[0]); idx++) {
|
|
351
|
+
size_t const decStatus = ZSTD_seekable_decompress(stream, outBuffer, tests[idx].size, tests[idx].offset);
|
|
352
|
+
if (decStatus != tests[idx].size || memcmp(outBuffer, inBuffer + tests[idx].offset, tests[idx].size) != 0) {
|
|
353
|
+
free(seekBuffer);
|
|
354
|
+
free(outBuffer);
|
|
355
|
+
ZSTD_seekable_freeCStream(zscs);
|
|
356
|
+
ZSTD_seekable_free(stream);
|
|
357
|
+
goto _test_error;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
free(seekBuffer);
|
|
362
|
+
free(outBuffer);
|
|
363
|
+
ZSTD_seekable_freeCStream(zscs);
|
|
364
|
+
ZSTD_seekable_free(stream);
|
|
365
|
+
}
|
|
366
|
+
printf("Success!\n");
|
|
367
|
+
|
|
368
|
+
/* TODO: Add more tests */
|
|
369
|
+
printf("Finished tests\n");
|
|
370
|
+
return 0;
|
|
371
|
+
|
|
372
|
+
_test_error:
|
|
373
|
+
printf("test failed! Exiting..\n");
|
|
374
|
+
return 1;
|
|
375
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#ifndef SEEKABLE_H
|
|
2
|
+
#define SEEKABLE_H
|
|
3
|
+
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
#include "zstd.h" /* ZSTDLIB_API */
|
|
6
|
+
|
|
7
|
+
#if defined (__cplusplus)
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#define ZSTD_seekTableFooterSize 9
|
|
13
|
+
|
|
14
|
+
#define ZSTD_SEEKABLE_MAGICNUMBER 0x8F92EAB1
|
|
15
|
+
|
|
16
|
+
#define ZSTD_SEEKABLE_MAXFRAMES 0x8000000U
|
|
17
|
+
|
|
18
|
+
/* Limit maximum size to avoid potential issues storing the compressed size */
|
|
19
|
+
#define ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE 0x40000000U
|
|
20
|
+
|
|
21
|
+
/*-****************************************************************************
|
|
22
|
+
* Seekable Format
|
|
23
|
+
*
|
|
24
|
+
* The seekable format splits the compressed data into a series of "frames",
|
|
25
|
+
* each compressed individually so that decompression of a section in the
|
|
26
|
+
* middle of an archive only requires zstd to decompress at most a frame's
|
|
27
|
+
* worth of extra data, instead of the entire archive.
|
|
28
|
+
******************************************************************************/
|
|
29
|
+
|
|
30
|
+
typedef struct ZSTD_seekable_CStream_s ZSTD_seekable_CStream;
|
|
31
|
+
typedef struct ZSTD_seekable_s ZSTD_seekable;
|
|
32
|
+
typedef struct ZSTD_seekTable_s ZSTD_seekTable;
|
|
33
|
+
|
|
34
|
+
/*-****************************************************************************
|
|
35
|
+
* Seekable compression - HowTo
|
|
36
|
+
* A ZSTD_seekable_CStream object is required to tracking streaming operation.
|
|
37
|
+
* Use ZSTD_seekable_createCStream() and ZSTD_seekable_freeCStream() to create/
|
|
38
|
+
* release resources.
|
|
39
|
+
*
|
|
40
|
+
* Streaming objects are reusable to avoid allocation and deallocation,
|
|
41
|
+
* to start a new compression operation call ZSTD_seekable_initCStream() on the
|
|
42
|
+
* compressor.
|
|
43
|
+
*
|
|
44
|
+
* Data streamed to the seekable compressor will automatically be split into
|
|
45
|
+
* frames of size `maxFrameSize` (provided in ZSTD_seekable_initCStream()),
|
|
46
|
+
* or if none is provided, will be cut off whenever ZSTD_seekable_endFrame() is
|
|
47
|
+
* called or when the default maximum frame size (2GB) is reached.
|
|
48
|
+
*
|
|
49
|
+
* Use ZSTD_seekable_initCStream() to initialize a ZSTD_seekable_CStream object
|
|
50
|
+
* for a new compression operation.
|
|
51
|
+
* - `maxFrameSize` indicates the size at which to automatically start a new
|
|
52
|
+
* seekable frame.
|
|
53
|
+
* `maxFrameSize == 0` implies the default maximum size.
|
|
54
|
+
* Smaller frame sizes allow faster decompression of small segments,
|
|
55
|
+
* since retrieving a single byte requires decompression of
|
|
56
|
+
* the full frame where the byte belongs.
|
|
57
|
+
* In general, size the frames to roughly correspond to
|
|
58
|
+
* the access granularity (when it's known).
|
|
59
|
+
* But small sizes also reduce compression ratio.
|
|
60
|
+
* Avoid really tiny frame sizes (< 1 KB),
|
|
61
|
+
* that would hurt compression ratio considerably.
|
|
62
|
+
* - `checksumFlag` indicates whether or not the seek table should include frame
|
|
63
|
+
* checksums on the uncompressed data for verification.
|
|
64
|
+
* @return : a size hint for input to provide for compression, or an error code
|
|
65
|
+
* checkable with ZSTD_isError()
|
|
66
|
+
*
|
|
67
|
+
* Use ZSTD_seekable_compressStream() repetitively to consume input stream.
|
|
68
|
+
* The function will automatically update both `pos` fields.
|
|
69
|
+
* Note that it may not consume the entire input, in which case `pos < size`,
|
|
70
|
+
* and it's up to the caller to present again remaining data.
|
|
71
|
+
* @return : a size hint, preferred nb of bytes to use as input for next
|
|
72
|
+
* function call or an error code, which can be tested using
|
|
73
|
+
* ZSTD_isError().
|
|
74
|
+
* Note 1 : it's just a hint, to help latency a little, any other
|
|
75
|
+
* value will work fine.
|
|
76
|
+
*
|
|
77
|
+
* At any time, call ZSTD_seekable_endFrame() to end the current frame and
|
|
78
|
+
* start a new one.
|
|
79
|
+
*
|
|
80
|
+
* ZSTD_seekable_endStream() will end the current frame, and then write the seek
|
|
81
|
+
* table so that decompressors can efficiently find compressed frames.
|
|
82
|
+
* ZSTD_seekable_endStream() may return a number > 0 if it was unable to flush
|
|
83
|
+
* all the necessary data to `output`. In this case, it should be called again
|
|
84
|
+
* until all remaining data is flushed out and 0 is returned.
|
|
85
|
+
******************************************************************************/
|
|
86
|
+
|
|
87
|
+
/*===== Seekable compressor management =====*/
|
|
88
|
+
ZSTDLIB_API ZSTD_seekable_CStream* ZSTD_seekable_createCStream(void);
|
|
89
|
+
ZSTDLIB_API size_t ZSTD_seekable_freeCStream(ZSTD_seekable_CStream* zcs);
|
|
90
|
+
|
|
91
|
+
/*===== Seekable compression functions =====*/
|
|
92
|
+
ZSTDLIB_API size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream* zcs, int compressionLevel, int checksumFlag, unsigned maxFrameSize);
|
|
93
|
+
ZSTDLIB_API size_t ZSTD_seekable_compressStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
|
94
|
+
ZSTDLIB_API size_t ZSTD_seekable_endFrame(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output);
|
|
95
|
+
ZSTDLIB_API size_t ZSTD_seekable_endStream(ZSTD_seekable_CStream* zcs, ZSTD_outBuffer* output);
|
|
96
|
+
|
|
97
|
+
/*= Raw seek table API
|
|
98
|
+
* These functions allow for the seek table to be constructed directly.
|
|
99
|
+
* This table can then be appended to a file of concatenated frames.
|
|
100
|
+
* This allows the frames to be compressed independently, even in parallel,
|
|
101
|
+
* and compiled together afterward into a seekable archive.
|
|
102
|
+
*
|
|
103
|
+
* Use ZSTD_seekable_createFrameLog() to allocate and initialize a tracking
|
|
104
|
+
* structure.
|
|
105
|
+
*
|
|
106
|
+
* Call ZSTD_seekable_logFrame() once for each frame in the archive.
|
|
107
|
+
* checksum is optional, and will not be used if checksumFlag was 0 when the
|
|
108
|
+
* frame log was created. If present, it should be the least significant 32
|
|
109
|
+
* bits of the XXH64 hash of the uncompressed data.
|
|
110
|
+
*
|
|
111
|
+
* Call ZSTD_seekable_writeSeekTable to serialize the data into a seek table.
|
|
112
|
+
* If the entire table was written, the return value will be 0. Otherwise,
|
|
113
|
+
* it will be equal to the number of bytes left to write. */
|
|
114
|
+
typedef struct ZSTD_frameLog_s ZSTD_frameLog;
|
|
115
|
+
ZSTDLIB_API ZSTD_frameLog* ZSTD_seekable_createFrameLog(int checksumFlag);
|
|
116
|
+
ZSTDLIB_API size_t ZSTD_seekable_freeFrameLog(ZSTD_frameLog* fl);
|
|
117
|
+
ZSTDLIB_API size_t ZSTD_seekable_logFrame(ZSTD_frameLog* fl, unsigned compressedSize, unsigned decompressedSize, unsigned checksum);
|
|
118
|
+
ZSTDLIB_API size_t ZSTD_seekable_writeSeekTable(ZSTD_frameLog* fl, ZSTD_outBuffer* output);
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
/*-****************************************************************************
|
|
122
|
+
* Seekable decompression - HowTo
|
|
123
|
+
* A ZSTD_seekable object is required to tracking the seekTable.
|
|
124
|
+
*
|
|
125
|
+
* Call ZSTD_seekable_init* to initialize a ZSTD_seekable object with the
|
|
126
|
+
* the seek table provided in the input.
|
|
127
|
+
* There are three modes for ZSTD_seekable_init:
|
|
128
|
+
* - ZSTD_seekable_initBuff() : An in-memory API. The data contained in
|
|
129
|
+
* `src` should be the entire seekable file, including the seek table.
|
|
130
|
+
* `src` should be kept alive and unmodified until the ZSTD_seekable object
|
|
131
|
+
* is freed or reset.
|
|
132
|
+
* - ZSTD_seekable_initFile() : A simplified file API using stdio. fread and
|
|
133
|
+
* fseek will be used to access the required data for building the seek
|
|
134
|
+
* table and doing decompression operations. `src` should not be closed
|
|
135
|
+
* or modified until the ZSTD_seekable object is freed or reset.
|
|
136
|
+
* - ZSTD_seekable_initAdvanced() : A general API allowing the client to
|
|
137
|
+
* provide its own read and seek callbacks.
|
|
138
|
+
* + ZSTD_seekable_read() : read exactly `n` bytes into `buffer`.
|
|
139
|
+
* Premature EOF should be treated as an error.
|
|
140
|
+
* + ZSTD_seekable_seek() : seek the read head to `offset` from `origin`,
|
|
141
|
+
* where origin is either SEEK_SET (beginning of
|
|
142
|
+
* file), or SEEK_END (end of file).
|
|
143
|
+
* Both functions should return a non-negative value in case of success, and a
|
|
144
|
+
* negative value in case of failure. If implementing using this API and
|
|
145
|
+
* stdio, be careful with files larger than 4GB and fseek. All of these
|
|
146
|
+
* functions return an error code checkable with ZSTD_isError().
|
|
147
|
+
*
|
|
148
|
+
* Call ZSTD_seekable_decompress to decompress `dstSize` bytes at decompressed
|
|
149
|
+
* offset `offset`. ZSTD_seekable_decompress may have to decompress the entire
|
|
150
|
+
* prefix of the frame before the desired data if it has not already processed
|
|
151
|
+
* this section. If ZSTD_seekable_decompress is called multiple times for a
|
|
152
|
+
* consecutive range of data, it will efficiently retain the decompressor object
|
|
153
|
+
* and avoid redecompressing frame prefixes. The return value is the number of
|
|
154
|
+
* bytes decompressed, or an error code checkable with ZSTD_isError().
|
|
155
|
+
*
|
|
156
|
+
* The seek table access functions can be used to obtain the data contained
|
|
157
|
+
* in the seek table. If frameIndex is larger than the value returned by
|
|
158
|
+
* ZSTD_seekable_getNumFrames(), they will return error codes checkable with
|
|
159
|
+
* ZSTD_isError(). Note that since the offset access functions return
|
|
160
|
+
* unsigned long long instead of size_t, in this case they will instead return
|
|
161
|
+
* the value ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE.
|
|
162
|
+
******************************************************************************/
|
|
163
|
+
|
|
164
|
+
/*===== Seekable decompressor management =====*/
|
|
165
|
+
ZSTDLIB_API ZSTD_seekable* ZSTD_seekable_create(void);
|
|
166
|
+
ZSTDLIB_API size_t ZSTD_seekable_free(ZSTD_seekable* zs);
|
|
167
|
+
|
|
168
|
+
/*===== Seekable decompression functions =====*/
|
|
169
|
+
ZSTDLIB_API size_t ZSTD_seekable_initBuff(ZSTD_seekable* zs, const void* src, size_t srcSize);
|
|
170
|
+
ZSTDLIB_API size_t ZSTD_seekable_initFile(ZSTD_seekable* zs, FILE* src);
|
|
171
|
+
ZSTDLIB_API size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, void* dst, size_t dstSize, unsigned long long offset);
|
|
172
|
+
ZSTDLIB_API size_t ZSTD_seekable_decompressFrame(ZSTD_seekable* zs, void* dst, size_t dstSize, unsigned frameIndex);
|
|
173
|
+
|
|
174
|
+
#define ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE (0ULL-2)
|
|
175
|
+
/*===== Seekable seek table access functions =====*/
|
|
176
|
+
ZSTDLIB_API unsigned ZSTD_seekable_getNumFrames(const ZSTD_seekable* zs);
|
|
177
|
+
ZSTDLIB_API unsigned long long ZSTD_seekable_getFrameCompressedOffset(const ZSTD_seekable* zs, unsigned frameIndex);
|
|
178
|
+
ZSTDLIB_API unsigned long long ZSTD_seekable_getFrameDecompressedOffset(const ZSTD_seekable* zs, unsigned frameIndex);
|
|
179
|
+
ZSTDLIB_API size_t ZSTD_seekable_getFrameCompressedSize(const ZSTD_seekable* zs, unsigned frameIndex);
|
|
180
|
+
ZSTDLIB_API size_t ZSTD_seekable_getFrameDecompressedSize(const ZSTD_seekable* zs, unsigned frameIndex);
|
|
181
|
+
ZSTDLIB_API unsigned ZSTD_seekable_offsetToFrameIndex(const ZSTD_seekable* zs, unsigned long long offset);
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
/*-****************************************************************************
|
|
185
|
+
* Direct exploitation of the seekTable
|
|
186
|
+
*
|
|
187
|
+
* Memory constrained use cases that manage multiple archives
|
|
188
|
+
* benefit from retaining multiple archive seek tables
|
|
189
|
+
* without retaining a ZSTD_seekable instance for each.
|
|
190
|
+
*
|
|
191
|
+
* Below API allow the above-mentioned use cases
|
|
192
|
+
* to initialize a ZSTD_seekable, extract its (smaller) ZSTD_seekTable,
|
|
193
|
+
* then throw the ZSTD_seekable away to save memory.
|
|
194
|
+
*
|
|
195
|
+
* Standard ZSTD operations can then be used
|
|
196
|
+
* to decompress frames based on seek table offsets.
|
|
197
|
+
******************************************************************************/
|
|
198
|
+
|
|
199
|
+
/*===== Independent seek table management =====*/
|
|
200
|
+
ZSTDLIB_API ZSTD_seekTable* ZSTD_seekTable_create_fromSeekable(const ZSTD_seekable* zs);
|
|
201
|
+
ZSTDLIB_API size_t ZSTD_seekTable_free(ZSTD_seekTable* st);
|
|
202
|
+
|
|
203
|
+
/*===== Direct seek table access functions =====*/
|
|
204
|
+
ZSTDLIB_API unsigned ZSTD_seekTable_getNumFrames(const ZSTD_seekTable* st);
|
|
205
|
+
ZSTDLIB_API unsigned long long ZSTD_seekTable_getFrameCompressedOffset(const ZSTD_seekTable* st, unsigned frameIndex);
|
|
206
|
+
ZSTDLIB_API unsigned long long ZSTD_seekTable_getFrameDecompressedOffset(const ZSTD_seekTable* st, unsigned frameIndex);
|
|
207
|
+
ZSTDLIB_API size_t ZSTD_seekTable_getFrameCompressedSize(const ZSTD_seekTable* st, unsigned frameIndex);
|
|
208
|
+
ZSTDLIB_API size_t ZSTD_seekTable_getFrameDecompressedSize(const ZSTD_seekTable* st, unsigned frameIndex);
|
|
209
|
+
ZSTDLIB_API unsigned ZSTD_seekTable_offsetToFrameIndex(const ZSTD_seekTable* st, unsigned long long offset);
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
/*===== Seekable advanced I/O API =====*/
|
|
213
|
+
typedef int(ZSTD_seekable_read)(void* opaque, void* buffer, size_t n);
|
|
214
|
+
typedef int(ZSTD_seekable_seek)(void* opaque, long long offset, int origin);
|
|
215
|
+
typedef struct {
|
|
216
|
+
void* opaque;
|
|
217
|
+
ZSTD_seekable_read* read;
|
|
218
|
+
ZSTD_seekable_seek* seek;
|
|
219
|
+
} ZSTD_seekable_customFile;
|
|
220
|
+
ZSTDLIB_API size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, ZSTD_seekable_customFile src);
|
|
221
|
+
|
|
222
|
+
#if defined (__cplusplus)
|
|
223
|
+
}
|
|
224
|
+
#endif
|
|
225
|
+
|
|
226
|
+
#endif
|