extlz4 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +21 -3
  4. data/contrib/lz4/CODING_STYLE +57 -0
  5. data/contrib/lz4/LICENSE +1 -1
  6. data/contrib/lz4/Makefile.inc +17 -15
  7. data/contrib/lz4/NEWS +25 -0
  8. data/contrib/lz4/README.md +16 -5
  9. data/contrib/lz4/SECURITY.md +17 -0
  10. data/contrib/lz4/build/README.md +4 -15
  11. data/contrib/lz4/build/VS2022/_build.bat +39 -0
  12. data/contrib/lz4/build/VS2022/_setup.bat +35 -0
  13. data/contrib/lz4/build/VS2022/_test.bat +38 -0
  14. data/contrib/lz4/build/VS2022/build-and-test-win32-debug.bat +26 -0
  15. data/contrib/lz4/build/VS2022/build-and-test-win32-release.bat +26 -0
  16. data/contrib/lz4/build/VS2022/build-and-test-x64-debug.bat +26 -0
  17. data/contrib/lz4/build/VS2022/build-and-test-x64-release.bat +26 -0
  18. data/contrib/lz4/build/VS2022/datagen/datagen.vcxproj +7 -3
  19. data/contrib/lz4/build/{VS2017 → VS2022}/lz4/lz4.vcxproj +21 -7
  20. data/contrib/lz4/build/VS2022/lz4.sln +5 -2
  21. data/contrib/lz4/build/cmake/CMakeLists.txt +95 -100
  22. data/contrib/lz4/build/meson/GetLz4LibraryVersion.py +39 -0
  23. data/contrib/lz4/build/meson/README.md +34 -0
  24. data/contrib/lz4/build/meson/meson/contrib/gen_manual/meson.build +42 -0
  25. data/contrib/lz4/build/meson/meson/contrib/meson.build +11 -0
  26. data/contrib/lz4/build/meson/meson/examples/meson.build +32 -0
  27. data/contrib/lz4/build/meson/meson/lib/meson.build +87 -0
  28. data/contrib/lz4/build/meson/meson/meson.build +135 -0
  29. data/contrib/lz4/build/meson/meson/ossfuzz/meson.build +35 -0
  30. data/contrib/lz4/build/meson/meson/programs/meson.build +91 -0
  31. data/contrib/lz4/build/meson/meson/tests/meson.build +162 -0
  32. data/contrib/lz4/build/meson/meson.build +31 -0
  33. data/contrib/lz4/build/meson/meson_options.txt +44 -0
  34. data/contrib/lz4/build/visual/README.md +5 -0
  35. data/contrib/lz4/build/visual/generate_solution.cmd +55 -0
  36. data/contrib/lz4/build/visual/generate_vs2015.cmd +3 -0
  37. data/contrib/lz4/build/visual/generate_vs2017.cmd +3 -0
  38. data/contrib/lz4/build/visual/generate_vs2019.cmd +3 -0
  39. data/contrib/lz4/build/visual/generate_vs2022.cmd +3 -0
  40. data/contrib/lz4/lib/README.md +25 -1
  41. data/contrib/lz4/lib/lz4.c +206 -99
  42. data/contrib/lz4/lib/lz4.h +111 -69
  43. data/contrib/lz4/lib/lz4file.c +111 -81
  44. data/contrib/lz4/lib/lz4file.h +2 -2
  45. data/contrib/lz4/lib/lz4frame.c +179 -121
  46. data/contrib/lz4/lib/lz4frame.h +162 -103
  47. data/contrib/lz4/lib/lz4hc.c +943 -382
  48. data/contrib/lz4/lib/lz4hc.h +43 -42
  49. data/contrib/lz4/lib/xxhash.c +21 -21
  50. data/contrib/lz4/ossfuzz/decompress_fuzzer.c +1 -1
  51. data/contrib/lz4/ossfuzz/fuzz_helpers.h +1 -1
  52. data/ext/blockapi.c +11 -11
  53. data/ext/frameapi.c +23 -23
  54. metadata +34 -28
  55. data/contrib/lz4/build/VS2010/datagen/datagen.vcxproj +0 -169
  56. data/contrib/lz4/build/VS2010/frametest/frametest.vcxproj +0 -176
  57. data/contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj +0 -176
  58. data/contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj +0 -180
  59. data/contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj +0 -173
  60. data/contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj +0 -175
  61. data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.rc +0 -51
  62. data/contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj +0 -179
  63. data/contrib/lz4/build/VS2010/lz4/lz4.vcxproj +0 -189
  64. data/contrib/lz4/build/VS2010/lz4.sln +0 -98
  65. data/contrib/lz4/build/VS2017/datagen/datagen.vcxproj +0 -173
  66. data/contrib/lz4/build/VS2017/frametest/frametest.vcxproj +0 -180
  67. data/contrib/lz4/build/VS2017/fullbench/fullbench.vcxproj +0 -180
  68. data/contrib/lz4/build/VS2017/fullbench-dll/fullbench-dll.vcxproj +0 -184
  69. data/contrib/lz4/build/VS2017/fuzzer/fuzzer.vcxproj +0 -177
  70. data/contrib/lz4/build/VS2017/liblz4/liblz4.vcxproj +0 -179
  71. data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc +0 -51
  72. data/contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.vcxproj +0 -183
  73. data/contrib/lz4/build/VS2017/lz4/lz4.rc +0 -51
  74. data/contrib/lz4/build/VS2017/lz4.sln +0 -103
  75. /data/contrib/lz4/build/{VS2010 → VS2022}/lz4/lz4.rc +0 -0
@@ -44,7 +44,7 @@ extern "C" {
44
44
 
45
45
 
46
46
  /* --- Useful constants --- */
47
- #define LZ4HC_CLEVEL_MIN 3
47
+ #define LZ4HC_CLEVEL_MIN 2
48
48
  #define LZ4HC_CLEVEL_DEFAULT 9
49
49
  #define LZ4HC_CLEVEL_OPT_MIN 10
50
50
  #define LZ4HC_CLEVEL_MAX 12
@@ -126,6 +126,8 @@ LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t* streamHCPtr);
126
126
 
127
127
  After reset, a first "fictional block" can be designated as initial dictionary,
128
128
  using LZ4_loadDictHC() (Optional).
129
+ Note: In order for LZ4_loadDictHC() to create the correct data structure,
130
+ it is essential to set the compression level _before_ loading the dictionary.
129
131
 
130
132
  Invoke LZ4_compress_HC_continue() to compress each successive block.
131
133
  The number of blocks is unlimited.
@@ -135,12 +137,12 @@ LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t* streamHCPtr);
135
137
  It's allowed to update compression level anytime between blocks,
136
138
  using LZ4_setCompressionLevel() (experimental).
137
139
 
138
- 'dst' buffer should be sized to handle worst case scenarios
140
+ @dst buffer should be sized to handle worst case scenarios
139
141
  (see LZ4_compressBound(), it ensures compression success).
140
142
  In case of failure, the API does not guarantee recovery,
141
143
  so the state _must_ be reset.
142
144
  To ensure compression success
143
- whenever `dst` buffer size cannot be made >= LZ4_compressBound(),
145
+ whenever @dst buffer size cannot be made >= LZ4_compressBound(),
144
146
  consider using LZ4_compress_HC_continue_destSize().
145
147
 
146
148
  Whenever previous input blocks can't be preserved unmodified in-place during compression of next blocks,
@@ -176,6 +178,34 @@ LZ4LIB_API int LZ4_compress_HC_continue_destSize(LZ4_streamHC_t* LZ4_streamHCPtr
176
178
  LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSize);
177
179
 
178
180
 
181
+ /*! LZ4_attach_HC_dictionary() : stable since v1.10.0
182
+ * This API allows for the efficient re-use of a static dictionary many times.
183
+ *
184
+ * Rather than re-loading the dictionary buffer into a working context before
185
+ * each compression, or copying a pre-loaded dictionary's LZ4_streamHC_t into a
186
+ * working LZ4_streamHC_t, this function introduces a no-copy setup mechanism,
187
+ * in which the working stream references the dictionary stream in-place.
188
+ *
189
+ * Several assumptions are made about the state of the dictionary stream.
190
+ * Currently, only streams which have been prepared by LZ4_loadDictHC() should
191
+ * be expected to work.
192
+ *
193
+ * Alternatively, the provided dictionary stream pointer may be NULL, in which
194
+ * case any existing dictionary stream is unset.
195
+ *
196
+ * A dictionary should only be attached to a stream without any history (i.e.,
197
+ * a stream that has just been reset).
198
+ *
199
+ * The dictionary will remain attached to the working stream only for the
200
+ * current stream session. Calls to LZ4_resetStreamHC(_fast) will remove the
201
+ * dictionary context association from the working stream. The dictionary
202
+ * stream (and source buffer) must remain in-place / accessible / unchanged
203
+ * through the lifetime of the stream session.
204
+ */
205
+ LZ4LIB_API void
206
+ LZ4_attach_HC_dictionary(LZ4_streamHC_t* working_stream,
207
+ const LZ4_streamHC_t* dictionary_stream);
208
+
179
209
 
180
210
  /*^**********************************************
181
211
  * !!!!!! STATIC LINKING ONLY !!!!!!
@@ -204,18 +234,18 @@ LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, in
204
234
  typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal;
205
235
  struct LZ4HC_CCtx_internal
206
236
  {
207
- LZ4_u32 hashTable[LZ4HC_HASHTABLESIZE];
208
- LZ4_u16 chainTable[LZ4HC_MAXD];
209
- const LZ4_byte* end; /* next block here to continue on current prefix */
237
+ LZ4_u32 hashTable[LZ4HC_HASHTABLESIZE];
238
+ LZ4_u16 chainTable[LZ4HC_MAXD];
239
+ const LZ4_byte* end; /* next block here to continue on current prefix */
210
240
  const LZ4_byte* prefixStart; /* Indexes relative to this position */
211
241
  const LZ4_byte* dictStart; /* alternate reference for extDict */
212
- LZ4_u32 dictLimit; /* below that point, need extDict */
213
- LZ4_u32 lowLimit; /* below that point, no more dict */
214
- LZ4_u32 nextToUpdate; /* index from which to continue dictionary update */
215
- short compressionLevel;
216
- LZ4_i8 favorDecSpeed; /* favor decompression speed if this flag set,
217
- otherwise, favor compression ratio */
218
- LZ4_i8 dirty; /* stream has to be fully reset if this flag is set */
242
+ LZ4_u32 dictLimit; /* below that point, need extDict */
243
+ LZ4_u32 lowLimit; /* below that point, no more history */
244
+ LZ4_u32 nextToUpdate; /* index from which to continue dictionary update */
245
+ short compressionLevel;
246
+ LZ4_i8 favorDecSpeed; /* favor decompression speed if this flag set,
247
+ otherwise, favor compression ratio */
248
+ LZ4_i8 dirty; /* stream has to be fully reset if this flag is set */
219
249
  const LZ4HC_CCtx_internal* dictCtx;
220
250
  };
221
251
 
@@ -376,35 +406,6 @@ LZ4LIB_STATIC_API int LZ4_compress_HC_extStateHC_fastReset (
376
406
  int srcSize, int dstCapacity,
377
407
  int compressionLevel);
378
408
 
379
- /*! LZ4_attach_HC_dictionary() :
380
- * This is an experimental API that allows for the efficient use of a
381
- * static dictionary many times.
382
- *
383
- * Rather than re-loading the dictionary buffer into a working context before
384
- * each compression, or copying a pre-loaded dictionary's LZ4_streamHC_t into a
385
- * working LZ4_streamHC_t, this function introduces a no-copy setup mechanism,
386
- * in which the working stream references the dictionary stream in-place.
387
- *
388
- * Several assumptions are made about the state of the dictionary stream.
389
- * Currently, only streams which have been prepared by LZ4_loadDictHC() should
390
- * be expected to work.
391
- *
392
- * Alternatively, the provided dictionary stream pointer may be NULL, in which
393
- * case any existing dictionary stream is unset.
394
- *
395
- * A dictionary should only be attached to a stream without any history (i.e.,
396
- * a stream that has just been reset).
397
- *
398
- * The dictionary will remain attached to the working stream only for the
399
- * current stream session. Calls to LZ4_resetStreamHC(_fast) will remove the
400
- * dictionary context association from the working stream. The dictionary
401
- * stream (and source buffer) must remain in-place / accessible / unchanged
402
- * through the lifetime of the stream session.
403
- */
404
- LZ4LIB_STATIC_API void LZ4_attach_HC_dictionary(
405
- LZ4_streamHC_t *working_stream,
406
- const LZ4_streamHC_t *dictionary_stream);
407
-
408
409
  #if defined (__cplusplus)
409
410
  }
410
411
  #endif
@@ -120,12 +120,12 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcp
120
120
  /* *************************************
121
121
  * Compiler Specific Options
122
122
  ***************************************/
123
- #ifdef _MSC_VER /* Visual Studio */
123
+ #if defined (_MSC_VER) && !defined (__clang__) /* MSVC */
124
124
  # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
125
125
  # define FORCE_INLINE static __forceinline
126
126
  #else
127
127
  # if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
128
- # ifdef __GNUC__
128
+ # if defined (__GNUC__) || defined (__clang__)
129
129
  # define FORCE_INLINE static inline __attribute__((always_inline))
130
130
  # else
131
131
  # define FORCE_INLINE static inline
@@ -213,7 +213,7 @@ static U32 XXH_swap32 (U32 x)
213
213
  /* *************************************
214
214
  * Architecture Macros
215
215
  ***************************************/
216
- typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
216
+ typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianness;
217
217
 
218
218
  /* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */
219
219
  #ifndef XXH_CPU_LITTLE_ENDIAN
@@ -231,7 +231,7 @@ static int XXH_isLittleEndian(void)
231
231
  *****************************/
232
232
  typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;
233
233
 
234
- FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
234
+ FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianness endian, XXH_alignment align)
235
235
  {
236
236
  if (align==XXH_unaligned)
237
237
  return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr));
@@ -239,7 +239,7 @@ FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_a
239
239
  return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr);
240
240
  }
241
241
 
242
- FORCE_INLINE U32 XXH_readLE32(const void* ptr, XXH_endianess endian)
242
+ FORCE_INLINE U32 XXH_readLE32(const void* ptr, XXH_endianness endian)
243
243
  {
244
244
  return XXH_readLE32_align(ptr, endian, XXH_unaligned);
245
245
  }
@@ -289,7 +289,7 @@ static U32 XXH32_avalanche(U32 h32)
289
289
 
290
290
  static U32
291
291
  XXH32_finalize(U32 h32, const void* ptr, size_t len,
292
- XXH_endianess endian, XXH_alignment align)
292
+ XXH_endianness endian, XXH_alignment align)
293
293
 
294
294
  {
295
295
  const BYTE* p = (const BYTE*)ptr;
@@ -350,7 +350,7 @@ XXH32_finalize(U32 h32, const void* ptr, size_t len,
350
350
 
351
351
  FORCE_INLINE U32
352
352
  XXH32_endian_align(const void* input, size_t len, U32 seed,
353
- XXH_endianess endian, XXH_alignment align)
353
+ XXH_endianness endian, XXH_alignment align)
354
354
  {
355
355
  const BYTE* p = (const BYTE*)input;
356
356
  const BYTE* bEnd = p + len;
@@ -398,7 +398,7 @@ XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int s
398
398
  XXH32_update(&state, input, len);
399
399
  return XXH32_digest(&state);
400
400
  #else
401
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
401
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
402
402
 
403
403
  if (XXH_FORCE_ALIGN_CHECK) {
404
404
  if ((((size_t)input) & 3) == 0) { /* Input is 4-bytes aligned, leverage the speed benefit */
@@ -449,7 +449,7 @@ XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, unsigned int s
449
449
 
450
450
 
451
451
  FORCE_INLINE XXH_errorcode
452
- XXH32_update_endian(XXH32_state_t* state, const void* input, size_t len, XXH_endianess endian)
452
+ XXH32_update_endian(XXH32_state_t* state, const void* input, size_t len, XXH_endianness endian)
453
453
  {
454
454
  if (input==NULL)
455
455
  #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
@@ -514,7 +514,7 @@ XXH32_update_endian(XXH32_state_t* state, const void* input, size_t len, XXH_end
514
514
 
515
515
  XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len)
516
516
  {
517
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
517
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
518
518
 
519
519
  if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
520
520
  return XXH32_update_endian(state_in, input, len, XXH_littleEndian);
@@ -524,7 +524,7 @@ XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void*
524
524
 
525
525
 
526
526
  FORCE_INLINE U32
527
- XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)
527
+ XXH32_digest_endian (const XXH32_state_t* state, XXH_endianness endian)
528
528
  {
529
529
  U32 h32;
530
530
 
@@ -545,7 +545,7 @@ XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess endian)
545
545
 
546
546
  XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in)
547
547
  {
548
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
548
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
549
549
 
550
550
  if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
551
551
  return XXH32_digest_endian(state_in, XXH_littleEndian);
@@ -642,7 +642,7 @@ static U64 XXH_swap64 (U64 x)
642
642
  }
643
643
  #endif
644
644
 
645
- FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align)
645
+ FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianness endian, XXH_alignment align)
646
646
  {
647
647
  if (align==XXH_unaligned)
648
648
  return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));
@@ -650,7 +650,7 @@ FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_a
650
650
  return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr);
651
651
  }
652
652
 
653
- FORCE_INLINE U64 XXH_readLE64(const void* ptr, XXH_endianess endian)
653
+ FORCE_INLINE U64 XXH_readLE64(const void* ptr, XXH_endianness endian)
654
654
  {
655
655
  return XXH_readLE64_align(ptr, endian, XXH_unaligned);
656
656
  }
@@ -700,7 +700,7 @@ static U64 XXH64_avalanche(U64 h64)
700
700
 
701
701
  static U64
702
702
  XXH64_finalize(U64 h64, const void* ptr, size_t len,
703
- XXH_endianess endian, XXH_alignment align)
703
+ XXH_endianness endian, XXH_alignment align)
704
704
  {
705
705
  const BYTE* p = (const BYTE*)ptr;
706
706
 
@@ -809,7 +809,7 @@ XXH64_finalize(U64 h64, const void* ptr, size_t len,
809
809
 
810
810
  FORCE_INLINE U64
811
811
  XXH64_endian_align(const void* input, size_t len, U64 seed,
812
- XXH_endianess endian, XXH_alignment align)
812
+ XXH_endianness endian, XXH_alignment align)
813
813
  {
814
814
  const BYTE* p = (const BYTE*)input;
815
815
  const BYTE* bEnd = p + len;
@@ -861,7 +861,7 @@ XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned
861
861
  XXH64_update(&state, input, len);
862
862
  return XXH64_digest(&state);
863
863
  #else
864
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
864
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
865
865
 
866
866
  if (XXH_FORCE_ALIGN_CHECK) {
867
867
  if ((((size_t)input) & 7)==0) { /* Input is aligned, let's leverage the speed advantage */
@@ -909,7 +909,7 @@ XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, unsigned long
909
909
  }
910
910
 
911
911
  FORCE_INLINE XXH_errorcode
912
- XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianess endian)
912
+ XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_endianness endian)
913
913
  {
914
914
  if (input==NULL)
915
915
  #if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
@@ -970,7 +970,7 @@ XXH64_update_endian (XXH64_state_t* state, const void* input, size_t len, XXH_en
970
970
 
971
971
  XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len)
972
972
  {
973
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
973
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
974
974
 
975
975
  if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
976
976
  return XXH64_update_endian(state_in, input, len, XXH_littleEndian);
@@ -978,7 +978,7 @@ XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void*
978
978
  return XXH64_update_endian(state_in, input, len, XXH_bigEndian);
979
979
  }
980
980
 
981
- FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess endian)
981
+ FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianness endian)
982
982
  {
983
983
  U64 h64;
984
984
 
@@ -1004,7 +1004,7 @@ FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess
1004
1004
 
1005
1005
  XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in)
1006
1006
  {
1007
- XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
1007
+ XXH_endianness endian_detected = (XXH_endianness)XXH_CPU_LITTLE_ENDIAN;
1008
1008
 
1009
1009
  if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT)
1010
1010
  return XXH64_digest_endian(state_in, XXH_littleEndian);
@@ -67,7 +67,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
67
67
  /* Partial decompression with small prefix. */
68
68
  LZ4_decompress_safe_partial_usingDict((char const*)dataAfterDict, dst, size,
69
69
  dstCapacity, dstCapacity, smallDict, smallDictSize);
70
- /* Partial decompression wtih large prefix. */
70
+ /* Partial decompression with large prefix. */
71
71
  LZ4_decompress_safe_partial_usingDict((char const*)dataAfterDict, dst, size,
72
72
  dstCapacity, dstCapacity, largeDict, largeDictSize);
73
73
  free(dst);
@@ -44,7 +44,7 @@ extern "C" {
44
44
  : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
45
45
  __LINE__, FUZZ_QUOTE(cond), (msg)), \
46
46
  abort()))
47
- #define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "");
47
+ #define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
48
48
 
49
49
  #if defined(__GNUC__)
50
50
  #define FUZZ_STATIC static __inline __attribute__((unused))
data/ext/blockapi.c CHANGED
@@ -689,13 +689,13 @@ init_blockencoder(void)
689
689
  {
690
690
  VALUE cBlockEncoder = rb_define_class_under(extlz4_mLZ4, "BlockEncoder", rb_cObject);
691
691
  rb_define_alloc_func(cBlockEncoder, blkenc_alloc);
692
- rb_define_method(cBlockEncoder, "initialize", RUBY_METHOD_FUNC(blkenc_init), -1);
693
- rb_define_method(cBlockEncoder, "reset", RUBY_METHOD_FUNC(blkenc_reset), -1);
694
- rb_define_method(cBlockEncoder, "update", RUBY_METHOD_FUNC(blkenc_update), -1);
695
- rb_define_method(cBlockEncoder, "release", RUBY_METHOD_FUNC(blkenc_release), 0);
696
- rb_define_method(cBlockEncoder, "predict", RUBY_METHOD_FUNC(blkenc_predict), 0);
697
- rb_define_method(cBlockEncoder, "savedict", RUBY_METHOD_FUNC(blkenc_savedict), -1);
698
- rb_define_method(cBlockEncoder, "inspect", RUBY_METHOD_FUNC(blkenc_inspect), 0);
692
+ rb_define_method(cBlockEncoder, "initialize", blkenc_init, -1);
693
+ rb_define_method(cBlockEncoder, "reset", blkenc_reset, -1);
694
+ rb_define_method(cBlockEncoder, "update", blkenc_update, -1);
695
+ rb_define_method(cBlockEncoder, "release", blkenc_release, 0);
696
+ rb_define_method(cBlockEncoder, "predict", blkenc_predict, 0);
697
+ rb_define_method(cBlockEncoder, "savedict", blkenc_savedict, -1);
698
+ rb_define_method(cBlockEncoder, "inspect", blkenc_inspect, 0);
699
699
  rb_define_alias(cBlockEncoder, "encode", "update");
700
700
  rb_define_alias(cBlockEncoder, "compress", "update");
701
701
  rb_define_alias(cBlockEncoder, "free", "release");
@@ -983,10 +983,10 @@ init_blockdecoder(void)
983
983
  {
984
984
  VALUE cBlockDecoder = rb_define_class_under(extlz4_mLZ4, "BlockDecoder", rb_cObject);
985
985
  rb_define_alloc_func(cBlockDecoder, blkdec_alloc);
986
- rb_define_method(cBlockDecoder, "initialize", RUBY_METHOD_FUNC(blkdec_init), -1);
987
- rb_define_method(cBlockDecoder, "reset", RUBY_METHOD_FUNC(blkdec_reset), -1);
988
- rb_define_method(cBlockDecoder, "update", RUBY_METHOD_FUNC(blkdec_update), -1);
989
- rb_define_method(cBlockDecoder, "release", RUBY_METHOD_FUNC(blkdec_release), 0);
986
+ rb_define_method(cBlockDecoder, "initialize", blkdec_init, -1);
987
+ rb_define_method(cBlockDecoder, "reset", blkdec_reset, -1);
988
+ rb_define_method(cBlockDecoder, "update", blkdec_update, -1);
989
+ rb_define_method(cBlockDecoder, "release", blkdec_release, 0);
990
990
  rb_define_alias(cBlockDecoder, "decode", "update");
991
991
  rb_define_alias(cBlockDecoder, "decompress", "update");
992
992
  rb_define_alias(cBlockDecoder, "uncompress", "update");
data/ext/frameapi.c CHANGED
@@ -737,33 +737,33 @@ extlz4_init_frameapi(void)
737
737
 
738
738
  VALUE cEncoder = rb_define_class_under(extlz4_mLZ4, "Encoder", rb_cObject);
739
739
  rb_define_alloc_func(cEncoder, fenc_alloc);
740
- rb_define_method(cEncoder, "initialize", RUBY_METHOD_FUNC(fenc_init), -1);
741
- rb_define_method(cEncoder, "write", RUBY_METHOD_FUNC(fenc_write), -1);
742
- rb_define_method(cEncoder, "<<", RUBY_METHOD_FUNC(fenc_push), 1);
743
- rb_define_method(cEncoder, "flush", RUBY_METHOD_FUNC(fenc_flush), 0);
744
- rb_define_method(cEncoder, "close", RUBY_METHOD_FUNC(fenc_close), 0);
740
+ rb_define_method(cEncoder, "initialize", fenc_init, -1);
741
+ rb_define_method(cEncoder, "write", fenc_write, -1);
742
+ rb_define_method(cEncoder, "<<", fenc_push, 1);
743
+ rb_define_method(cEncoder, "flush", fenc_flush, 0);
744
+ rb_define_method(cEncoder, "close", fenc_close, 0);
745
745
  rb_define_alias(cEncoder, "finish", "close");
746
- rb_define_method(cEncoder, "outport", RUBY_METHOD_FUNC(fenc_getoutport), 0);
747
- rb_define_method(cEncoder, "outport=", RUBY_METHOD_FUNC(fenc_setoutport), 1);
748
- rb_define_method(cEncoder, "prefs_level", RUBY_METHOD_FUNC(fenc_prefs_level), 0);
749
- rb_define_method(cEncoder, "prefs_blocksize", RUBY_METHOD_FUNC(fenc_prefs_blocksize), 0);
750
- rb_define_method(cEncoder, "prefs_blocklink", RUBY_METHOD_FUNC(fenc_prefs_blocklink), 0);
751
- rb_define_method(cEncoder, "prefs_checksum", RUBY_METHOD_FUNC(fenc_prefs_checksum), 0);
752
- rb_define_method(cEncoder, "inspect", RUBY_METHOD_FUNC(fenc_inspect), 0);
746
+ rb_define_method(cEncoder, "outport", fenc_getoutport, 0);
747
+ rb_define_method(cEncoder, "outport=", fenc_setoutport, 1);
748
+ rb_define_method(cEncoder, "prefs_level", fenc_prefs_level, 0);
749
+ rb_define_method(cEncoder, "prefs_blocksize", fenc_prefs_blocksize, 0);
750
+ rb_define_method(cEncoder, "prefs_blocklink", fenc_prefs_blocklink, 0);
751
+ rb_define_method(cEncoder, "prefs_checksum", fenc_prefs_checksum, 0);
752
+ rb_define_method(cEncoder, "inspect", fenc_inspect, 0);
753
753
 
754
754
  VALUE cDecoder = rb_define_class_under(extlz4_mLZ4, "Decoder", rb_cObject);
755
755
  rb_define_alloc_func(cDecoder, fdec_alloc);
756
- rb_define_method(cDecoder, "initialize", RUBY_METHOD_FUNC(fdec_init), -1);
757
- rb_define_method(cDecoder, "read", RUBY_METHOD_FUNC(fdec_read), -1);
758
- rb_define_method(cDecoder, "getc", RUBY_METHOD_FUNC(fdec_getc), 0);
759
- rb_define_method(cDecoder, "getbyte", RUBY_METHOD_FUNC(fdec_getbyte), 0);
760
- rb_define_method(cDecoder, "close", RUBY_METHOD_FUNC(fdec_close), 0);
756
+ rb_define_method(cDecoder, "initialize", fdec_init, -1);
757
+ rb_define_method(cDecoder, "read", fdec_read, -1);
758
+ rb_define_method(cDecoder, "getc", fdec_getc, 0);
759
+ rb_define_method(cDecoder, "getbyte", fdec_getbyte, 0);
760
+ rb_define_method(cDecoder, "close", fdec_close, 0);
761
761
  rb_define_alias(cDecoder, "finish", "close");
762
- rb_define_method(cDecoder, "eof", RUBY_METHOD_FUNC(fdec_eof), 0);
763
- rb_define_method(cDecoder, "inport", RUBY_METHOD_FUNC(fdec_inport), 0);
762
+ rb_define_method(cDecoder, "eof", fdec_eof, 0);
763
+ rb_define_method(cDecoder, "inport", fdec_inport, 0);
764
764
  rb_define_alias(cDecoder, "eof?", "eof");
765
- rb_define_method(cDecoder, "prefs_blocksize", RUBY_METHOD_FUNC(fdec_prefs_blocksize), 0);
766
- rb_define_method(cDecoder, "prefs_blocklink", RUBY_METHOD_FUNC(fdec_prefs_blocklink), 0);
767
- rb_define_method(cDecoder, "prefs_checksum", RUBY_METHOD_FUNC(fdec_prefs_checksum), 0);
768
- rb_define_method(cDecoder, "inspect", RUBY_METHOD_FUNC(fdec_inspect), 0);
765
+ rb_define_method(cDecoder, "prefs_blocksize", fdec_prefs_blocksize, 0);
766
+ rb_define_method(cDecoder, "prefs_blocklink", fdec_prefs_blocklink, 0);
767
+ rb_define_method(cDecoder, "prefs_checksum", fdec_prefs_checksum, 0);
768
+ rb_define_method(cDecoder, "inspect", fdec_inspect, 0);
769
769
  }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extlz4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dearblue
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-06-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -53,6 +52,8 @@ extra_rdoc_files:
53
52
  - contrib/lz4/LICENSE
54
53
  - contrib/lz4/README.md
55
54
  - contrib/lz4/build/README.md
55
+ - contrib/lz4/build/meson/README.md
56
+ - contrib/lz4/build/visual/README.md
56
57
  - contrib/lz4/lib/LICENSE
57
58
  - contrib/lz4/lib/README.md
58
59
  - ext/blockapi.c
@@ -72,34 +73,21 @@ files:
72
73
  - README.md
73
74
  - Rakefile
74
75
  - bin/extlz4
76
+ - contrib/lz4/CODING_STYLE
75
77
  - contrib/lz4/INSTALL
76
78
  - contrib/lz4/LICENSE
77
79
  - contrib/lz4/Makefile.inc
78
80
  - contrib/lz4/NEWS
79
81
  - contrib/lz4/README.md
82
+ - contrib/lz4/SECURITY.md
80
83
  - contrib/lz4/build/README.md
81
- - contrib/lz4/build/VS2010/datagen/datagen.vcxproj
82
- - contrib/lz4/build/VS2010/frametest/frametest.vcxproj
83
- - contrib/lz4/build/VS2010/fullbench-dll/fullbench-dll.vcxproj
84
- - contrib/lz4/build/VS2010/fullbench/fullbench.vcxproj
85
- - contrib/lz4/build/VS2010/fuzzer/fuzzer.vcxproj
86
- - contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.rc
87
- - contrib/lz4/build/VS2010/liblz4-dll/liblz4-dll.vcxproj
88
- - contrib/lz4/build/VS2010/liblz4/liblz4.vcxproj
89
- - contrib/lz4/build/VS2010/lz4.sln
90
- - contrib/lz4/build/VS2010/lz4/lz4.rc
91
- - contrib/lz4/build/VS2010/lz4/lz4.vcxproj
92
- - contrib/lz4/build/VS2017/datagen/datagen.vcxproj
93
- - contrib/lz4/build/VS2017/frametest/frametest.vcxproj
94
- - contrib/lz4/build/VS2017/fullbench-dll/fullbench-dll.vcxproj
95
- - contrib/lz4/build/VS2017/fullbench/fullbench.vcxproj
96
- - contrib/lz4/build/VS2017/fuzzer/fuzzer.vcxproj
97
- - contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.rc
98
- - contrib/lz4/build/VS2017/liblz4-dll/liblz4-dll.vcxproj
99
- - contrib/lz4/build/VS2017/liblz4/liblz4.vcxproj
100
- - contrib/lz4/build/VS2017/lz4.sln
101
- - contrib/lz4/build/VS2017/lz4/lz4.rc
102
- - contrib/lz4/build/VS2017/lz4/lz4.vcxproj
84
+ - contrib/lz4/build/VS2022/_build.bat
85
+ - contrib/lz4/build/VS2022/_setup.bat
86
+ - contrib/lz4/build/VS2022/_test.bat
87
+ - contrib/lz4/build/VS2022/build-and-test-win32-debug.bat
88
+ - contrib/lz4/build/VS2022/build-and-test-win32-release.bat
89
+ - contrib/lz4/build/VS2022/build-and-test-x64-debug.bat
90
+ - contrib/lz4/build/VS2022/build-and-test-x64-release.bat
103
91
  - contrib/lz4/build/VS2022/datagen/datagen.vcxproj
104
92
  - contrib/lz4/build/VS2022/frametest/frametest.vcxproj
105
93
  - contrib/lz4/build/VS2022/fullbench-dll/fullbench-dll.vcxproj
@@ -109,8 +97,28 @@ files:
109
97
  - contrib/lz4/build/VS2022/liblz4-dll/liblz4-dll.vcxproj
110
98
  - contrib/lz4/build/VS2022/liblz4/liblz4.vcxproj
111
99
  - contrib/lz4/build/VS2022/lz4.sln
100
+ - contrib/lz4/build/VS2022/lz4/lz4.rc
101
+ - contrib/lz4/build/VS2022/lz4/lz4.vcxproj
112
102
  - contrib/lz4/build/cmake/CMakeLists.txt
113
103
  - contrib/lz4/build/cmake/lz4Config.cmake.in
104
+ - contrib/lz4/build/meson/GetLz4LibraryVersion.py
105
+ - contrib/lz4/build/meson/README.md
106
+ - contrib/lz4/build/meson/meson.build
107
+ - contrib/lz4/build/meson/meson/contrib/gen_manual/meson.build
108
+ - contrib/lz4/build/meson/meson/contrib/meson.build
109
+ - contrib/lz4/build/meson/meson/examples/meson.build
110
+ - contrib/lz4/build/meson/meson/lib/meson.build
111
+ - contrib/lz4/build/meson/meson/meson.build
112
+ - contrib/lz4/build/meson/meson/ossfuzz/meson.build
113
+ - contrib/lz4/build/meson/meson/programs/meson.build
114
+ - contrib/lz4/build/meson/meson/tests/meson.build
115
+ - contrib/lz4/build/meson/meson_options.txt
116
+ - contrib/lz4/build/visual/README.md
117
+ - contrib/lz4/build/visual/generate_solution.cmd
118
+ - contrib/lz4/build/visual/generate_vs2015.cmd
119
+ - contrib/lz4/build/visual/generate_vs2017.cmd
120
+ - contrib/lz4/build/visual/generate_vs2019.cmd
121
+ - contrib/lz4/build/visual/generate_vs2022.cmd
114
122
  - contrib/lz4/lib/LICENSE
115
123
  - contrib/lz4/lib/README.md
116
124
  - contrib/lz4/lib/liblz4-dll.rc.in
@@ -168,7 +176,6 @@ homepage: https://github.com/dearblue/ruby-extlz4
168
176
  licenses:
169
177
  - BSD-2-Clause
170
178
  metadata: {}
171
- post_install_message:
172
179
  rdoc_options:
173
180
  - "--charset"
174
181
  - UTF-8
@@ -187,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
194
  - !ruby/object:Gem::Version
188
195
  version: '0'
189
196
  requirements: []
190
- rubygems_version: 3.4.13
191
- signing_key:
197
+ rubygems_version: 3.6.8
192
198
  specification_version: 4
193
199
  summary: ruby bindings for LZ4
194
200
  test_files: []