multi_compress 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -3
- data/GET_STARTED.md +3 -3
- data/README.md +75 -66
- data/THIRD_PARTY_NOTICES.md +24 -0
- data/ext/multi_compress/brotli_dec_static_init.c +3 -0
- data/ext/multi_compress/brotli_enc_static_init.c +3 -0
- data/ext/multi_compress/extconf.rb +79 -3
- data/ext/multi_compress/multi_compress.c +199 -120
- data/ext/multi_compress/vendor/.vendored +2 -2
- data/ext/multi_compress/vendor/brotli/LICENSE +19 -0
- data/ext/multi_compress/vendor/brotli/c/common/constants.c +7 -7
- data/ext/multi_compress/vendor/brotli/c/common/constants.h +2 -5
- data/ext/multi_compress/vendor/brotli/c/common/context.c +2 -2
- data/ext/multi_compress/vendor/brotli/c/common/context.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/dictionary.c +4 -5856
- data/ext/multi_compress/vendor/brotli/c/common/dictionary.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/dictionary_inc.h +5847 -0
- data/ext/multi_compress/vendor/brotli/c/common/platform.c +0 -4
- data/ext/multi_compress/vendor/brotli/c/common/platform.h +182 -43
- data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary.c +3 -7
- data/ext/multi_compress/vendor/brotli/c/common/shared_dictionary_internal.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/common/static_init.h +56 -0
- data/ext/multi_compress/vendor/brotli/c/common/transform.c +6 -4
- data/ext/multi_compress/vendor/brotli/c/common/transform.h +1 -2
- data/ext/multi_compress/vendor/brotli/c/common/version.h +3 -3
- data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.c +2 -3
- data/ext/multi_compress/vendor/brotli/c/dec/bit_reader.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/dec/decode.c +128 -39
- data/ext/multi_compress/vendor/brotli/c/dec/huffman.c +2 -5
- data/ext/multi_compress/vendor/brotli/c/dec/huffman.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/dec/prefix.c +67 -0
- data/ext/multi_compress/vendor/brotli/c/dec/prefix.h +18 -708
- data/ext/multi_compress/vendor/brotli/c/dec/prefix_inc.h +707 -0
- data/ext/multi_compress/vendor/brotli/c/dec/state.c +18 -15
- data/ext/multi_compress/vendor/brotli/c/dec/state.h +2 -6
- data/ext/multi_compress/vendor/brotli/c/dec/static_init.c +53 -0
- data/ext/multi_compress/vendor/brotli/c/dec/static_init.h +30 -0
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references.c +32 -8
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references.h +1 -5
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.c +15 -15
- data/ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.h +1 -5
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.c +28 -4
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost.h +8 -40
- data/ext/multi_compress/vendor/brotli/c/enc/bit_cost_inc.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.c +9 -12
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter.h +0 -3
- data/ext/multi_compress/vendor/brotli/c/enc/block_splitter_inc.h +14 -8
- data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.c +10 -9
- data/ext/multi_compress/vendor/brotli/c/enc/brotli_bit_stream.h +0 -6
- data/ext/multi_compress/vendor/brotli/c/enc/cluster.c +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/cluster.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/command.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/command.h +8 -10
- data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.c +3 -5
- data/ext/multi_compress/vendor/brotli/c/enc/compound_dictionary.h +1 -4
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.c +3 -13
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.c +5 -15
- data/ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.c +127 -1830
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.h +23 -3
- data/ext/multi_compress/vendor/brotli/c/enc/dictionary_hash_inc.h +1829 -0
- data/ext/multi_compress/vendor/brotli/c/enc/encode.c +77 -52
- data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.c +9 -7
- data/ext/multi_compress/vendor/brotli/c/enc/encoder_dict.h +2 -4
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.c +3 -6
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode.h +2 -4
- data/ext/multi_compress/vendor/brotli/c/enc/entropy_encode_static.h +18 -12
- data/ext/multi_compress/vendor/brotli/c/enc/fast_log.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/fast_log.h +2 -3
- data/ext/multi_compress/vendor/brotli/c/enc/find_match_length.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/hash.h +38 -31
- data/ext/multi_compress/vendor/brotli/c/enc/hash_base.h +38 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_forgetful_chain_inc.h +11 -1
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_inc.h +24 -7
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h +304 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_inc.h +30 -11
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h +4 -0
- data/ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_simd_inc.h +278 -0
- data/ext/multi_compress/vendor/brotli/c/enc/histogram.c +1 -0
- data/ext/multi_compress/vendor/brotli/c/enc/histogram.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.c +4 -6
- data/ext/multi_compress/vendor/brotli/c/enc/literal_cost.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/matching_tag_mask.h +69 -0
- data/ext/multi_compress/vendor/brotli/c/enc/memory.c +0 -5
- data/ext/multi_compress/vendor/brotli/c/enc/memory.h +0 -4
- data/ext/multi_compress/vendor/brotli/c/enc/metablock.c +7 -9
- data/ext/multi_compress/vendor/brotli/c/enc/metablock.h +3 -3
- data/ext/multi_compress/vendor/brotli/c/enc/metablock_inc.h +4 -4
- data/ext/multi_compress/vendor/brotli/c/enc/params.h +0 -1
- data/ext/multi_compress/vendor/brotli/c/enc/prefix.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/quality.h +17 -10
- data/ext/multi_compress/vendor/brotli/c/enc/ringbuffer.h +1 -4
- data/ext/multi_compress/vendor/brotli/c/enc/state.h +2 -2
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict.c +5 -11
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict.h +1 -3
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.c +224 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.h +20 -5837
- data/ext/multi_compress/vendor/brotli/c/enc/static_dict_lut_inc.h +5830 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init.c +59 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init.h +30 -0
- data/ext/multi_compress/vendor/brotli/c/enc/static_init_lazy.cc +26 -0
- data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.c +1 -1
- data/ext/multi_compress/vendor/brotli/c/enc/utf8_util.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/enc/write_bits.h +0 -2
- data/ext/multi_compress/vendor/brotli/c/include/brotli/decode.h +1 -1
- data/ext/multi_compress/vendor/brotli/c/include/brotli/encode.h +5 -1
- data/ext/multi_compress/vendor/brotli/c/include/brotli/port.h +4 -7
- data/ext/multi_compress/vendor/brotli/c/include/brotli/types.h +2 -2
- data/ext/multi_compress/vendor/lz4/LICENSE +12 -0
- data/ext/multi_compress/vendor/zstd/COPYING +339 -0
- data/ext/multi_compress/vendor/zstd/LICENSE +30 -0
- data/ext/multi_compress/vendor/zstd/lib/Makefile +67 -35
- data/ext/multi_compress/vendor/zstd/lib/README.md +33 -2
- data/ext/multi_compress/vendor/zstd/lib/common/allocations.h +55 -0
- data/ext/multi_compress/vendor/zstd/lib/common/bits.h +205 -0
- data/ext/multi_compress/vendor/zstd/lib/common/bitstream.h +84 -108
- data/ext/multi_compress/vendor/zstd/lib/common/compiler.h +170 -41
- data/ext/multi_compress/vendor/zstd/lib/common/cpu.h +37 -1
- data/ext/multi_compress/vendor/zstd/lib/common/debug.c +7 -1
- data/ext/multi_compress/vendor/zstd/lib/common/debug.h +21 -21
- data/ext/multi_compress/vendor/zstd/lib/common/entropy_common.c +12 -40
- data/ext/multi_compress/vendor/zstd/lib/common/error_private.c +10 -2
- data/ext/multi_compress/vendor/zstd/lib/common/error_private.h +46 -47
- data/ext/multi_compress/vendor/zstd/lib/common/fse.h +8 -100
- data/ext/multi_compress/vendor/zstd/lib/common/fse_decompress.c +28 -116
- data/ext/multi_compress/vendor/zstd/lib/common/huf.h +79 -166
- data/ext/multi_compress/vendor/zstd/lib/common/mem.h +46 -66
- data/ext/multi_compress/vendor/zstd/lib/common/pool.c +27 -11
- data/ext/multi_compress/vendor/zstd/lib/common/pool.h +8 -11
- data/ext/multi_compress/vendor/zstd/lib/common/portability_macros.h +45 -11
- data/ext/multi_compress/vendor/zstd/lib/common/threading.c +74 -14
- data/ext/multi_compress/vendor/zstd/lib/common/threading.h +5 -18
- data/ext/multi_compress/vendor/zstd/lib/common/xxhash.c +5 -11
- data/ext/multi_compress/vendor/zstd/lib/common/xxhash.h +2411 -1003
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_common.c +1 -36
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_deps.h +13 -1
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_internal.h +13 -182
- data/ext/multi_compress/vendor/zstd/lib/common/zstd_trace.h +6 -13
- data/ext/multi_compress/vendor/zstd/lib/compress/clevels.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/fse_compress.c +15 -131
- data/ext/multi_compress/vendor/zstd/lib/compress/hist.c +11 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/hist.h +8 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/huf_compress.c +283 -189
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress.c +2419 -903
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_internal.h +423 -245
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.c +116 -40
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_literals.h +16 -8
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.c +10 -10
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_sequences.h +8 -7
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.c +254 -139
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_compress_superblock.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_cwksp.h +184 -95
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.c +163 -81
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_double_fast.h +18 -14
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.c +507 -197
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_fast.h +7 -14
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.c +579 -484
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_lazy.h +133 -65
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.c +61 -40
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm.h +7 -15
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm_geartab.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.c +352 -218
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.h +37 -21
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.c +238 -0
- data/ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.h +33 -0
- data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.c +239 -175
- data/ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.h +5 -16
- data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress.c +543 -488
- data/ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress_amd64.S +78 -61
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.c +4 -4
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_ddict.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress.c +295 -115
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.c +430 -293
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_block.h +7 -2
- data/ext/multi_compress/vendor/zstd/lib/decompress/zstd_decompress_internal.h +11 -7
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_common.c +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_compress.c +1 -1
- data/ext/multi_compress/vendor/zstd/lib/deprecated/zbuff_decompress.c +3 -1
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.c +95 -46
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/cover.h +3 -9
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/divsufsort.h +0 -10
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/fastcover.c +4 -4
- data/ext/multi_compress/vendor/zstd/lib/dictBuilder/zdict.c +25 -97
- data/ext/multi_compress/vendor/zstd/lib/dll/example/Makefile +1 -1
- data/ext/multi_compress/vendor/zstd/lib/dll/example/README.md +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_legacy.h +38 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.c +19 -50
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v01.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.c +27 -80
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v02.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.c +28 -83
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v03.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.c +25 -74
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v04.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.c +31 -76
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v05.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.c +44 -88
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v06.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.c +33 -84
- data/ext/multi_compress/vendor/zstd/lib/legacy/zstd_v07.h +1 -1
- data/ext/multi_compress/vendor/zstd/lib/libzstd.mk +65 -33
- data/ext/multi_compress/vendor/zstd/lib/libzstd.pc.in +5 -5
- data/ext/multi_compress/vendor/zstd/lib/module.modulemap +13 -3
- data/ext/multi_compress/vendor/zstd/lib/zdict.h +65 -36
- data/ext/multi_compress/vendor/zstd/lib/zstd.h +890 -267
- data/ext/multi_compress/vendor/zstd/lib/zstd_errors.h +28 -16
- data/lib/multi_compress/version.rb +1 -1
- data/lib/multi_compress.rb +80 -41
- metadata +29 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under both the BSD-style license (found in the
|
|
@@ -15,24 +15,32 @@
|
|
|
15
15
|
extern "C" {
|
|
16
16
|
#endif
|
|
17
17
|
|
|
18
|
-
/*===== dependency =====*/
|
|
19
|
-
#include <stddef.h> /* size_t */
|
|
20
|
-
|
|
21
|
-
|
|
22
18
|
/* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */
|
|
23
|
-
#ifndef
|
|
24
|
-
|
|
25
|
-
#
|
|
19
|
+
#ifndef ZSTDERRORLIB_VISIBLE
|
|
20
|
+
/* Backwards compatibility with old macro name */
|
|
21
|
+
# ifdef ZSTDERRORLIB_VISIBILITY
|
|
22
|
+
# define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY
|
|
23
|
+
# elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
|
24
|
+
# define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility ("default")))
|
|
26
25
|
# else
|
|
27
|
-
# define
|
|
26
|
+
# define ZSTDERRORLIB_VISIBLE
|
|
28
27
|
# endif
|
|
29
28
|
#endif
|
|
29
|
+
|
|
30
|
+
#ifndef ZSTDERRORLIB_HIDDEN
|
|
31
|
+
# if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
|
|
32
|
+
# define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility ("hidden")))
|
|
33
|
+
# else
|
|
34
|
+
# define ZSTDERRORLIB_HIDDEN
|
|
35
|
+
# endif
|
|
36
|
+
#endif
|
|
37
|
+
|
|
30
38
|
#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)
|
|
31
|
-
# define ZSTDERRORLIB_API __declspec(dllexport)
|
|
39
|
+
# define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE
|
|
32
40
|
#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)
|
|
33
|
-
# define ZSTDERRORLIB_API __declspec(dllimport)
|
|
41
|
+
# define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
|
|
34
42
|
#else
|
|
35
|
-
# define ZSTDERRORLIB_API
|
|
43
|
+
# define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE
|
|
36
44
|
#endif
|
|
37
45
|
|
|
38
46
|
/*-*********************************************
|
|
@@ -58,14 +66,18 @@ typedef enum {
|
|
|
58
66
|
ZSTD_error_frameParameter_windowTooLarge = 16,
|
|
59
67
|
ZSTD_error_corruption_detected = 20,
|
|
60
68
|
ZSTD_error_checksum_wrong = 22,
|
|
69
|
+
ZSTD_error_literals_headerWrong = 24,
|
|
61
70
|
ZSTD_error_dictionary_corrupted = 30,
|
|
62
71
|
ZSTD_error_dictionary_wrong = 32,
|
|
63
72
|
ZSTD_error_dictionaryCreation_failed = 34,
|
|
64
73
|
ZSTD_error_parameter_unsupported = 40,
|
|
74
|
+
ZSTD_error_parameter_combination_unsupported = 41,
|
|
65
75
|
ZSTD_error_parameter_outOfBound = 42,
|
|
66
76
|
ZSTD_error_tableLog_tooLarge = 44,
|
|
67
77
|
ZSTD_error_maxSymbolValue_tooLarge = 46,
|
|
68
78
|
ZSTD_error_maxSymbolValue_tooSmall = 48,
|
|
79
|
+
ZSTD_error_cannotProduce_uncompressedBlock = 49,
|
|
80
|
+
ZSTD_error_stabilityCondition_notRespected = 50,
|
|
69
81
|
ZSTD_error_stage_wrong = 60,
|
|
70
82
|
ZSTD_error_init_missing = 62,
|
|
71
83
|
ZSTD_error_memory_allocation = 64,
|
|
@@ -73,18 +85,18 @@ typedef enum {
|
|
|
73
85
|
ZSTD_error_dstSize_tooSmall = 70,
|
|
74
86
|
ZSTD_error_srcSize_wrong = 72,
|
|
75
87
|
ZSTD_error_dstBuffer_null = 74,
|
|
88
|
+
ZSTD_error_noForwardProgress_destFull = 80,
|
|
89
|
+
ZSTD_error_noForwardProgress_inputEmpty = 82,
|
|
76
90
|
/* following error codes are __NOT STABLE__, they can be removed or changed in future versions */
|
|
77
91
|
ZSTD_error_frameIndex_tooLarge = 100,
|
|
78
92
|
ZSTD_error_seekableIO = 102,
|
|
79
93
|
ZSTD_error_dstBuffer_wrong = 104,
|
|
80
94
|
ZSTD_error_srcBuffer_wrong = 105,
|
|
95
|
+
ZSTD_error_sequenceProducer_failed = 106,
|
|
96
|
+
ZSTD_error_externalSequences_invalid = 107,
|
|
81
97
|
ZSTD_error_maxCode = 120 /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */
|
|
82
98
|
} ZSTD_ErrorCode;
|
|
83
99
|
|
|
84
|
-
/*! ZSTD_getErrorCode() :
|
|
85
|
-
convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
|
|
86
|
-
which can be used to compare with enum list published above */
|
|
87
|
-
ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
|
|
88
100
|
ZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code); /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */
|
|
89
101
|
|
|
90
102
|
|
data/lib/multi_compress.rb
CHANGED
|
@@ -97,17 +97,19 @@ module MultiCompress
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def self.zstd(data, level: nil)
|
|
100
|
-
compress(data, algo: :zstd,
|
|
100
|
+
compress(data, algo: :zstd, level: level)
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
def self.lz4(data, level: nil, format: nil)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
if format
|
|
105
|
+
compress(data, algo: :lz4, level: level, format: format)
|
|
106
|
+
else
|
|
107
|
+
compress(data, algo: :lz4, level: level)
|
|
108
|
+
end
|
|
107
109
|
end
|
|
108
110
|
|
|
109
111
|
def self.brotli(data, level: nil)
|
|
110
|
-
compress(data, algo: :brotli,
|
|
112
|
+
compress(data, algo: :brotli, level: level)
|
|
111
113
|
end
|
|
112
114
|
|
|
113
115
|
def self.decompress(data, **opts)
|
|
@@ -119,9 +121,11 @@ module MultiCompress
|
|
|
119
121
|
end
|
|
120
122
|
|
|
121
123
|
def self.lz4_decompress(data, format: nil)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
if format
|
|
125
|
+
decompress(data, algo: :lz4, format: format)
|
|
126
|
+
else
|
|
127
|
+
decompress(data, algo: :lz4)
|
|
128
|
+
end
|
|
125
129
|
end
|
|
126
130
|
|
|
127
131
|
def self.brotli_decompress(data)
|
|
@@ -132,17 +136,13 @@ module MultiCompress
|
|
|
132
136
|
EXTENSION_MAP[File.extname(path).downcase]
|
|
133
137
|
end
|
|
134
138
|
|
|
135
|
-
def self.level_opts(level)
|
|
136
|
-
level ? { level: level } : {}
|
|
137
|
-
end
|
|
138
|
-
|
|
139
139
|
def self.resolved_one_shot_options(opts)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
return opts.merge(max_output_size: config.max_output_size) unless opts.key?(:max_output_size)
|
|
141
|
+
|
|
142
|
+
opts
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
-
private_class_method :
|
|
145
|
+
private_class_method :resolved_one_shot_options
|
|
146
146
|
|
|
147
147
|
module InflaterDefaults
|
|
148
148
|
def initialize(*args, **opts)
|
|
@@ -248,6 +248,7 @@ module MultiCompress
|
|
|
248
248
|
|
|
249
249
|
class Reader
|
|
250
250
|
CHUNK_SIZE = 8192
|
|
251
|
+
BUFFER_COMPACT_THRESHOLD = 64 * 1024
|
|
251
252
|
|
|
252
253
|
def self.open(path_or_io, algo: nil, dictionary: nil, **opts, &block)
|
|
253
254
|
io, algo, owned = resolve_io(path_or_io, algo, mode: "rb")
|
|
@@ -264,12 +265,13 @@ module MultiCompress
|
|
|
264
265
|
end
|
|
265
266
|
|
|
266
267
|
def initialize(io, algo: nil, dictionary: nil, **opts)
|
|
267
|
-
@io
|
|
268
|
-
@inflater
|
|
269
|
-
@closed
|
|
270
|
-
@owned_io
|
|
271
|
-
@buffer
|
|
272
|
-
@
|
|
268
|
+
@io = io
|
|
269
|
+
@inflater = Inflater.new(algo: algo, dictionary: dictionary, **opts)
|
|
270
|
+
@closed = false
|
|
271
|
+
@owned_io = false
|
|
272
|
+
@buffer = +"".b
|
|
273
|
+
@buffer_pos = 0
|
|
274
|
+
@eof = false
|
|
273
275
|
end
|
|
274
276
|
|
|
275
277
|
def read(length = nil)
|
|
@@ -281,12 +283,12 @@ module MultiCompress
|
|
|
281
283
|
|
|
282
284
|
def gets(separator = "\n")
|
|
283
285
|
ensure_open!
|
|
284
|
-
return nil if @eof &&
|
|
286
|
+
return nil if @eof && buffer_empty?
|
|
285
287
|
|
|
286
|
-
fill_buffer_until {
|
|
288
|
+
fill_buffer_until { buffer_includes?(separator) }
|
|
287
289
|
|
|
288
|
-
return extract_line(separator) if
|
|
289
|
-
return consume_buffer unless
|
|
290
|
+
return extract_line(separator) if buffer_includes?(separator)
|
|
291
|
+
return consume_buffer unless buffer_empty?
|
|
290
292
|
|
|
291
293
|
nil
|
|
292
294
|
end
|
|
@@ -305,7 +307,7 @@ module MultiCompress
|
|
|
305
307
|
end
|
|
306
308
|
|
|
307
309
|
def eof?
|
|
308
|
-
@eof &&
|
|
310
|
+
@eof && buffer_empty?
|
|
309
311
|
end
|
|
310
312
|
|
|
311
313
|
def each_line
|
|
@@ -334,11 +336,44 @@ module MultiCompress
|
|
|
334
336
|
raise StreamError, "reader is closed" if @closed
|
|
335
337
|
end
|
|
336
338
|
|
|
339
|
+
def buffer_size
|
|
340
|
+
@buffer.bytesize - @buffer_pos
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
def buffer_empty?
|
|
344
|
+
@buffer_pos >= @buffer.bytesize
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def buffer_append(data)
|
|
348
|
+
compact_buffer_if_needed
|
|
349
|
+
@buffer << data
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
def compact_buffer_if_needed
|
|
353
|
+
return if @buffer_pos == 0
|
|
354
|
+
|
|
355
|
+
total = @buffer.bytesize
|
|
356
|
+
return unless @buffer_pos >= BUFFER_COMPACT_THRESHOLD && @buffer_pos * 2 >= total
|
|
357
|
+
|
|
358
|
+
@buffer = @buffer.byteslice(@buffer_pos, total - @buffer_pos)
|
|
359
|
+
@buffer_pos = 0
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
def buffer_includes?(separator)
|
|
363
|
+
idx = @buffer.index(separator, @buffer_pos)
|
|
364
|
+
!idx.nil?
|
|
365
|
+
end
|
|
366
|
+
|
|
337
367
|
def read_all
|
|
338
|
-
return nil if @eof &&
|
|
368
|
+
return nil if @eof && buffer_empty?
|
|
339
369
|
|
|
340
|
-
result =
|
|
370
|
+
result = if buffer_empty?
|
|
371
|
+
+"".b
|
|
372
|
+
else
|
|
373
|
+
@buffer.byteslice(@buffer_pos, @buffer.bytesize - @buffer_pos) || +"".b
|
|
374
|
+
end
|
|
341
375
|
@buffer.clear
|
|
376
|
+
@buffer_pos = 0
|
|
342
377
|
|
|
343
378
|
until @eof
|
|
344
379
|
chunk = read_compressed_chunk
|
|
@@ -355,15 +390,16 @@ module MultiCompress
|
|
|
355
390
|
end
|
|
356
391
|
|
|
357
392
|
def read_exactly(length)
|
|
358
|
-
return nil if @eof &&
|
|
393
|
+
return nil if @eof && buffer_empty?
|
|
359
394
|
|
|
360
|
-
fill_buffer_until {
|
|
395
|
+
fill_buffer_until { buffer_size >= length }
|
|
361
396
|
|
|
362
|
-
if
|
|
363
|
-
result
|
|
364
|
-
@
|
|
397
|
+
if buffer_size >= length
|
|
398
|
+
result = @buffer.byteslice(@buffer_pos, length)
|
|
399
|
+
@buffer_pos += length
|
|
400
|
+
compact_buffer_if_needed
|
|
365
401
|
result
|
|
366
|
-
elsif
|
|
402
|
+
elsif !buffer_empty?
|
|
367
403
|
consume_buffer
|
|
368
404
|
end
|
|
369
405
|
end
|
|
@@ -376,20 +412,23 @@ module MultiCompress
|
|
|
376
412
|
break
|
|
377
413
|
end
|
|
378
414
|
decompressed = @inflater.write(chunk)
|
|
379
|
-
|
|
415
|
+
buffer_append(decompressed) if decompressed
|
|
380
416
|
end
|
|
381
417
|
end
|
|
382
418
|
|
|
383
419
|
def extract_line(separator)
|
|
384
|
-
idx = @buffer.index(separator)
|
|
385
|
-
|
|
386
|
-
|
|
420
|
+
idx = @buffer.index(separator, @buffer_pos)
|
|
421
|
+
end_pos = idx + separator.bytesize
|
|
422
|
+
result = @buffer.byteslice(@buffer_pos, end_pos - @buffer_pos)
|
|
423
|
+
@buffer_pos = end_pos
|
|
424
|
+
compact_buffer_if_needed
|
|
387
425
|
result
|
|
388
426
|
end
|
|
389
427
|
|
|
390
428
|
def consume_buffer
|
|
391
|
-
result
|
|
392
|
-
@buffer
|
|
429
|
+
result = @buffer.byteslice(@buffer_pos, @buffer.bytesize - @buffer_pos) || +"".b
|
|
430
|
+
@buffer.clear
|
|
431
|
+
@buffer_pos = 0
|
|
393
432
|
result
|
|
394
433
|
end
|
|
395
434
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multi_compress
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roman Haydarov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -81,19 +81,25 @@ files:
|
|
|
81
81
|
- GET_STARTED.md
|
|
82
82
|
- LICENSE.txt
|
|
83
83
|
- README.md
|
|
84
|
+
- THIRD_PARTY_NOTICES.md
|
|
85
|
+
- ext/multi_compress/brotli_dec_static_init.c
|
|
86
|
+
- ext/multi_compress/brotli_enc_static_init.c
|
|
84
87
|
- ext/multi_compress/extconf.rb
|
|
85
88
|
- ext/multi_compress/multi_compress.c
|
|
86
89
|
- ext/multi_compress/vendor/.vendored
|
|
90
|
+
- ext/multi_compress/vendor/brotli/LICENSE
|
|
87
91
|
- ext/multi_compress/vendor/brotli/c/common/constants.c
|
|
88
92
|
- ext/multi_compress/vendor/brotli/c/common/constants.h
|
|
89
93
|
- ext/multi_compress/vendor/brotli/c/common/context.c
|
|
90
94
|
- ext/multi_compress/vendor/brotli/c/common/context.h
|
|
91
95
|
- ext/multi_compress/vendor/brotli/c/common/dictionary.c
|
|
92
96
|
- ext/multi_compress/vendor/brotli/c/common/dictionary.h
|
|
97
|
+
- ext/multi_compress/vendor/brotli/c/common/dictionary_inc.h
|
|
93
98
|
- ext/multi_compress/vendor/brotli/c/common/platform.c
|
|
94
99
|
- ext/multi_compress/vendor/brotli/c/common/platform.h
|
|
95
100
|
- ext/multi_compress/vendor/brotli/c/common/shared_dictionary.c
|
|
96
101
|
- ext/multi_compress/vendor/brotli/c/common/shared_dictionary_internal.h
|
|
102
|
+
- ext/multi_compress/vendor/brotli/c/common/static_init.h
|
|
97
103
|
- ext/multi_compress/vendor/brotli/c/common/transform.c
|
|
98
104
|
- ext/multi_compress/vendor/brotli/c/common/transform.h
|
|
99
105
|
- ext/multi_compress/vendor/brotli/c/common/version.h
|
|
@@ -102,9 +108,13 @@ files:
|
|
|
102
108
|
- ext/multi_compress/vendor/brotli/c/dec/decode.c
|
|
103
109
|
- ext/multi_compress/vendor/brotli/c/dec/huffman.c
|
|
104
110
|
- ext/multi_compress/vendor/brotli/c/dec/huffman.h
|
|
111
|
+
- ext/multi_compress/vendor/brotli/c/dec/prefix.c
|
|
105
112
|
- ext/multi_compress/vendor/brotli/c/dec/prefix.h
|
|
113
|
+
- ext/multi_compress/vendor/brotli/c/dec/prefix_inc.h
|
|
106
114
|
- ext/multi_compress/vendor/brotli/c/dec/state.c
|
|
107
115
|
- ext/multi_compress/vendor/brotli/c/dec/state.h
|
|
116
|
+
- ext/multi_compress/vendor/brotli/c/dec/static_init.c
|
|
117
|
+
- ext/multi_compress/vendor/brotli/c/dec/static_init.h
|
|
108
118
|
- ext/multi_compress/vendor/brotli/c/enc/backward_references.c
|
|
109
119
|
- ext/multi_compress/vendor/brotli/c/enc/backward_references.h
|
|
110
120
|
- ext/multi_compress/vendor/brotli/c/enc/backward_references_hq.c
|
|
@@ -132,6 +142,7 @@ files:
|
|
|
132
142
|
- ext/multi_compress/vendor/brotli/c/enc/compress_fragment_two_pass.h
|
|
133
143
|
- ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.c
|
|
134
144
|
- ext/multi_compress/vendor/brotli/c/enc/dictionary_hash.h
|
|
145
|
+
- ext/multi_compress/vendor/brotli/c/enc/dictionary_hash_inc.h
|
|
135
146
|
- ext/multi_compress/vendor/brotli/c/enc/encode.c
|
|
136
147
|
- ext/multi_compress/vendor/brotli/c/enc/encoder_dict.c
|
|
137
148
|
- ext/multi_compress/vendor/brotli/c/enc/encoder_dict.h
|
|
@@ -142,11 +153,14 @@ files:
|
|
|
142
153
|
- ext/multi_compress/vendor/brotli/c/enc/fast_log.h
|
|
143
154
|
- ext/multi_compress/vendor/brotli/c/enc/find_match_length.h
|
|
144
155
|
- ext/multi_compress/vendor/brotli/c/enc/hash.h
|
|
156
|
+
- ext/multi_compress/vendor/brotli/c/enc/hash_base.h
|
|
145
157
|
- ext/multi_compress/vendor/brotli/c/enc/hash_composite_inc.h
|
|
146
158
|
- ext/multi_compress/vendor/brotli/c/enc/hash_forgetful_chain_inc.h
|
|
147
159
|
- ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_inc.h
|
|
160
|
+
- ext/multi_compress/vendor/brotli/c/enc/hash_longest_match64_simd_inc.h
|
|
148
161
|
- ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_inc.h
|
|
149
162
|
- ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_quickly_inc.h
|
|
163
|
+
- ext/multi_compress/vendor/brotli/c/enc/hash_longest_match_simd_inc.h
|
|
150
164
|
- ext/multi_compress/vendor/brotli/c/enc/hash_rolling_inc.h
|
|
151
165
|
- ext/multi_compress/vendor/brotli/c/enc/hash_to_binary_tree_inc.h
|
|
152
166
|
- ext/multi_compress/vendor/brotli/c/enc/histogram.c
|
|
@@ -154,6 +168,7 @@ files:
|
|
|
154
168
|
- ext/multi_compress/vendor/brotli/c/enc/histogram_inc.h
|
|
155
169
|
- ext/multi_compress/vendor/brotli/c/enc/literal_cost.c
|
|
156
170
|
- ext/multi_compress/vendor/brotli/c/enc/literal_cost.h
|
|
171
|
+
- ext/multi_compress/vendor/brotli/c/enc/matching_tag_mask.h
|
|
157
172
|
- ext/multi_compress/vendor/brotli/c/enc/memory.c
|
|
158
173
|
- ext/multi_compress/vendor/brotli/c/enc/memory.h
|
|
159
174
|
- ext/multi_compress/vendor/brotli/c/enc/metablock.c
|
|
@@ -166,7 +181,12 @@ files:
|
|
|
166
181
|
- ext/multi_compress/vendor/brotli/c/enc/state.h
|
|
167
182
|
- ext/multi_compress/vendor/brotli/c/enc/static_dict.c
|
|
168
183
|
- ext/multi_compress/vendor/brotli/c/enc/static_dict.h
|
|
184
|
+
- ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.c
|
|
169
185
|
- ext/multi_compress/vendor/brotli/c/enc/static_dict_lut.h
|
|
186
|
+
- ext/multi_compress/vendor/brotli/c/enc/static_dict_lut_inc.h
|
|
187
|
+
- ext/multi_compress/vendor/brotli/c/enc/static_init.c
|
|
188
|
+
- ext/multi_compress/vendor/brotli/c/enc/static_init.h
|
|
189
|
+
- ext/multi_compress/vendor/brotli/c/enc/static_init_lazy.cc
|
|
170
190
|
- ext/multi_compress/vendor/brotli/c/enc/utf8_util.c
|
|
171
191
|
- ext/multi_compress/vendor/brotli/c/enc/utf8_util.h
|
|
172
192
|
- ext/multi_compress/vendor/brotli/c/enc/write_bits.h
|
|
@@ -175,6 +195,7 @@ files:
|
|
|
175
195
|
- ext/multi_compress/vendor/brotli/c/include/brotli/port.h
|
|
176
196
|
- ext/multi_compress/vendor/brotli/c/include/brotli/shared_dictionary.h
|
|
177
197
|
- ext/multi_compress/vendor/brotli/c/include/brotli/types.h
|
|
198
|
+
- ext/multi_compress/vendor/lz4/LICENSE
|
|
178
199
|
- ext/multi_compress/vendor/lz4/lib/LICENSE
|
|
179
200
|
- ext/multi_compress/vendor/lz4/lib/Makefile
|
|
180
201
|
- ext/multi_compress/vendor/lz4/lib/README.md
|
|
@@ -195,9 +216,13 @@ files:
|
|
|
195
216
|
- ext/multi_compress/vendor/lz4/lib/lz4hc.h
|
|
196
217
|
- ext/multi_compress/vendor/lz4/lib/xxhash.c
|
|
197
218
|
- ext/multi_compress/vendor/lz4/lib/xxhash.h
|
|
219
|
+
- ext/multi_compress/vendor/zstd/COPYING
|
|
220
|
+
- ext/multi_compress/vendor/zstd/LICENSE
|
|
198
221
|
- ext/multi_compress/vendor/zstd/lib/BUCK
|
|
199
222
|
- ext/multi_compress/vendor/zstd/lib/Makefile
|
|
200
223
|
- ext/multi_compress/vendor/zstd/lib/README.md
|
|
224
|
+
- ext/multi_compress/vendor/zstd/lib/common/allocations.h
|
|
225
|
+
- ext/multi_compress/vendor/zstd/lib/common/bits.h
|
|
201
226
|
- ext/multi_compress/vendor/zstd/lib/common/bitstream.h
|
|
202
227
|
- ext/multi_compress/vendor/zstd/lib/common/compiler.h
|
|
203
228
|
- ext/multi_compress/vendor/zstd/lib/common/cpu.h
|
|
@@ -246,6 +271,8 @@ files:
|
|
|
246
271
|
- ext/multi_compress/vendor/zstd/lib/compress/zstd_ldm_geartab.h
|
|
247
272
|
- ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.c
|
|
248
273
|
- ext/multi_compress/vendor/zstd/lib/compress/zstd_opt.h
|
|
274
|
+
- ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.c
|
|
275
|
+
- ext/multi_compress/vendor/zstd/lib/compress/zstd_preSplit.h
|
|
249
276
|
- ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.c
|
|
250
277
|
- ext/multi_compress/vendor/zstd/lib/compress/zstdmt_compress.h
|
|
251
278
|
- ext/multi_compress/vendor/zstd/lib/decompress/huf_decompress.c
|