zstdlib 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +9 -0
  3. data/ext/zstdlib_c/extconf.rb +8 -3
  4. data/ext/zstdlib_c/ruby/zlib-3.3/zstdlib.c +5090 -0
  5. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/adler32.c +5 -27
  6. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/compress.c +5 -16
  7. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/crc32.c +94 -161
  8. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/deflate.c +362 -434
  9. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/deflate.h +43 -12
  10. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/gzclose.c +1 -3
  11. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/gzguts.h +13 -18
  12. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/gzlib.c +28 -85
  13. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/gzread.c +23 -73
  14. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/gzwrite.c +19 -65
  15. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/infback.c +17 -30
  16. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inffast.c +1 -4
  17. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inffast.h +1 -1
  18. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inflate.c +36 -102
  19. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inftrees.c +6 -11
  20. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inftrees.h +6 -6
  21. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/trees.c +290 -355
  22. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/uncompr.c +4 -12
  23. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/zconf.h +23 -14
  24. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/zlib.h +202 -199
  25. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/zutil.c +18 -44
  26. data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/zutil.h +13 -33
  27. metadata +33 -32
  28. /data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/crc32.h +0 -0
  29. /data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inffixed.h +0 -0
  30. /data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/inflate.h +0 -0
  31. /data/ext/zstdlib_c/{zlib-1.2.12 → zlib-1.3.1}/trees.h +0 -0
@@ -24,13 +24,11 @@ z_const char * const z_errmsg[10] = {
24
24
  };
25
25
 
26
26
 
27
- const char * ZEXPORT zlibVersion()
28
- {
27
+ const char * ZEXPORT zlibVersion(void) {
29
28
  return ZLIB_VERSION;
30
29
  }
31
30
 
32
- uLong ZEXPORT zlibCompileFlags()
33
- {
31
+ uLong ZEXPORT zlibCompileFlags(void) {
34
32
  uLong flags;
35
33
 
36
34
  flags = 0;
@@ -61,9 +59,11 @@ uLong ZEXPORT zlibCompileFlags()
61
59
  #ifdef ZLIB_DEBUG
62
60
  flags += 1 << 8;
63
61
  #endif
62
+ /*
64
63
  #if defined(ASMV) || defined(ASMINF)
65
64
  flags += 1 << 9;
66
65
  #endif
66
+ */
67
67
  #ifdef ZLIB_WINAPI
68
68
  flags += 1 << 10;
69
69
  #endif
@@ -119,9 +119,7 @@ uLong ZEXPORT zlibCompileFlags()
119
119
  # endif
120
120
  int ZLIB_INTERNAL z_verbose = verbose;
121
121
 
122
- void ZLIB_INTERNAL z_error (m)
123
- char *m;
124
- {
122
+ void ZLIB_INTERNAL z_error(char *m) {
125
123
  fprintf(stderr, "%s\n", m);
126
124
  exit(1);
127
125
  }
@@ -130,9 +128,7 @@ void ZLIB_INTERNAL z_error (m)
130
128
  /* exported to allow conversion of error code to string for compress() and
131
129
  * uncompress()
132
130
  */
133
- const char * ZEXPORT zError(err)
134
- int err;
135
- {
131
+ const char * ZEXPORT zError(int err) {
136
132
  return ERR_MSG(err);
137
133
  }
138
134
 
@@ -146,22 +142,14 @@ const char * ZEXPORT zError(err)
146
142
 
147
143
  #ifndef HAVE_MEMCPY
148
144
 
149
- void ZLIB_INTERNAL zmemcpy(dest, source, len)
150
- Bytef* dest;
151
- const Bytef* source;
152
- uInt len;
153
- {
145
+ void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) {
154
146
  if (len == 0) return;
155
147
  do {
156
148
  *dest++ = *source++; /* ??? to be unrolled */
157
149
  } while (--len != 0);
158
150
  }
159
151
 
160
- int ZLIB_INTERNAL zmemcmp(s1, s2, len)
161
- const Bytef* s1;
162
- const Bytef* s2;
163
- uInt len;
164
- {
152
+ int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) {
165
153
  uInt j;
166
154
 
167
155
  for (j = 0; j < len; j++) {
@@ -170,10 +158,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len)
170
158
  return 0;
171
159
  }
172
160
 
173
- void ZLIB_INTERNAL zmemzero(dest, len)
174
- Bytef* dest;
175
- uInt len;
176
- {
161
+ void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) {
177
162
  if (len == 0) return;
178
163
  do {
179
164
  *dest++ = 0; /* ??? to be unrolled */
@@ -214,8 +199,7 @@ local ptr_table table[MAX_PTR];
214
199
  * a protected system like OS/2. Use Microsoft C instead.
215
200
  */
216
201
 
217
- voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
218
- {
202
+ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
219
203
  voidpf buf;
220
204
  ulg bsize = (ulg)items*size;
221
205
 
@@ -240,8 +224,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
240
224
  return buf;
241
225
  }
242
226
 
243
- void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
244
- {
227
+ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
245
228
  int n;
246
229
 
247
230
  (void)opaque;
@@ -277,14 +260,12 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
277
260
  # define _hfree hfree
278
261
  #endif
279
262
 
280
- voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
281
- {
263
+ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
282
264
  (void)opaque;
283
265
  return _halloc((long)items, size);
284
266
  }
285
267
 
286
- void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
287
- {
268
+ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
288
269
  (void)opaque;
289
270
  _hfree(ptr);
290
271
  }
@@ -297,25 +278,18 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
297
278
  #ifndef MY_ZCALLOC /* Any system without a special alloc function */
298
279
 
299
280
  #ifndef STDC
300
- extern voidp malloc OF((uInt size));
301
- extern voidp calloc OF((uInt items, uInt size));
302
- extern void free OF((voidpf ptr));
281
+ extern voidp malloc(uInt size);
282
+ extern voidp calloc(uInt items, uInt size);
283
+ extern void free(voidpf ptr);
303
284
  #endif
304
285
 
305
- voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
306
- voidpf opaque;
307
- unsigned items;
308
- unsigned size;
309
- {
286
+ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
310
287
  (void)opaque;
311
288
  return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
312
289
  (voidpf)calloc(items, size);
313
290
  }
314
291
 
315
- void ZLIB_INTERNAL zcfree (opaque, ptr)
316
- voidpf opaque;
317
- voidpf ptr;
318
- {
292
+ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
319
293
  (void)opaque;
320
294
  free(ptr);
321
295
  }
@@ -1,5 +1,5 @@
1
1
  /* zutil.h -- internal interface and configuration of the compression library
2
- * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
2
+ * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
3
3
  * For conditions of distribution and use, see copyright notice in zlib.h
4
4
  */
5
5
 
@@ -56,7 +56,7 @@ typedef unsigned long ulg;
56
56
  extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
57
57
  /* (size given to avoid silly warnings with Visual C++) */
58
58
 
59
- #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
59
+ #define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
60
60
 
61
61
  #define ERR_RETURN(strm,err) \
62
62
  return (strm->msg = ERR_MSG(err), (err))
@@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
137
137
  # endif
138
138
  #endif
139
139
 
140
- #if defined(MACOS) || defined(TARGET_OS_MAC)
140
+ #if defined(MACOS)
141
141
  # define OS_CODE 7
142
- # ifndef Z_SOLO
143
- # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
144
- # include <unix.h> /* for fdopen */
145
- # else
146
- # ifndef fdopen
147
- # define fdopen(fd,mode) NULL /* No fdopen() */
148
- # endif
149
- # endif
150
- # endif
151
142
  #endif
152
143
 
153
144
  #ifdef __acorn
@@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
170
161
  # define OS_CODE 19
171
162
  #endif
172
163
 
173
- #if defined(_BEOS_) || defined(RISCOS)
174
- # define fdopen(fd,mode) NULL /* No fdopen() */
175
- #endif
176
-
177
- #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
178
- # if defined(_WIN32_WCE)
179
- # define fdopen(fd,mode) NULL /* No fdopen() */
180
- # else
181
- # define fdopen(fd,type) _fdopen(fd,type)
182
- # endif
183
- #endif
184
-
185
164
  #if defined(__BORLANDC__) && !defined(MSDOS)
186
165
  #pragma warn -8004
187
166
  #pragma warn -8008
@@ -191,8 +170,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
191
170
  /* provide prototypes for these when building zlib without LFS */
192
171
  #if !defined(_WIN32) && \
193
172
  (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
194
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
195
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
173
+ ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
174
+ ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
175
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
196
176
  #endif
197
177
 
198
178
  /* common defaults */
@@ -231,16 +211,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
231
211
  # define zmemzero(dest, len) memset(dest, 0, len)
232
212
  # endif
233
213
  #else
234
- void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
235
- int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
236
- void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
214
+ void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len);
215
+ int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len);
216
+ void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);
237
217
  #endif
238
218
 
239
219
  /* Diagnostic functions */
240
220
  #ifdef ZLIB_DEBUG
241
221
  # include <stdio.h>
242
222
  extern int ZLIB_INTERNAL z_verbose;
243
- extern void ZLIB_INTERNAL z_error OF((char *m));
223
+ extern void ZLIB_INTERNAL z_error(char *m);
244
224
  # define Assert(cond,msg) {if(!(cond)) z_error(msg);}
245
225
  # define Trace(x) {if (z_verbose>=0) fprintf x ;}
246
226
  # define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -257,9 +237,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
257
237
  #endif
258
238
 
259
239
  #ifndef Z_SOLO
260
- voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
261
- unsigned size));
262
- void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
240
+ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items,
241
+ unsigned size);
242
+ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr);
263
243
  #endif
264
244
 
265
245
  #define ZALLOC(strm, items, size) \
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zstdlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg A. Khlybov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3.0
61
+ version: 1.4.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3.0
68
+ version: 1.4.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: test-unit
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -103,32 +103,33 @@ files:
103
103
  - ext/zstdlib_c/ruby/zlib-3.0/zstdlib.c
104
104
  - ext/zstdlib_c/ruby/zlib-3.1/zstdlib.c
105
105
  - ext/zstdlib_c/ruby/zlib-3.2/zstdlib.c
106
- - ext/zstdlib_c/zlib-1.2.12/adler32.c
107
- - ext/zstdlib_c/zlib-1.2.12/compress.c
108
- - ext/zstdlib_c/zlib-1.2.12/crc32.c
109
- - ext/zstdlib_c/zlib-1.2.12/crc32.h
110
- - ext/zstdlib_c/zlib-1.2.12/deflate.c
111
- - ext/zstdlib_c/zlib-1.2.12/deflate.h
112
- - ext/zstdlib_c/zlib-1.2.12/gzclose.c
113
- - ext/zstdlib_c/zlib-1.2.12/gzguts.h
114
- - ext/zstdlib_c/zlib-1.2.12/gzlib.c
115
- - ext/zstdlib_c/zlib-1.2.12/gzread.c
116
- - ext/zstdlib_c/zlib-1.2.12/gzwrite.c
117
- - ext/zstdlib_c/zlib-1.2.12/infback.c
118
- - ext/zstdlib_c/zlib-1.2.12/inffast.c
119
- - ext/zstdlib_c/zlib-1.2.12/inffast.h
120
- - ext/zstdlib_c/zlib-1.2.12/inffixed.h
121
- - ext/zstdlib_c/zlib-1.2.12/inflate.c
122
- - ext/zstdlib_c/zlib-1.2.12/inflate.h
123
- - ext/zstdlib_c/zlib-1.2.12/inftrees.c
124
- - ext/zstdlib_c/zlib-1.2.12/inftrees.h
125
- - ext/zstdlib_c/zlib-1.2.12/trees.c
126
- - ext/zstdlib_c/zlib-1.2.12/trees.h
127
- - ext/zstdlib_c/zlib-1.2.12/uncompr.c
128
- - ext/zstdlib_c/zlib-1.2.12/zconf.h
129
- - ext/zstdlib_c/zlib-1.2.12/zlib.h
130
- - ext/zstdlib_c/zlib-1.2.12/zutil.c
131
- - ext/zstdlib_c/zlib-1.2.12/zutil.h
106
+ - ext/zstdlib_c/ruby/zlib-3.3/zstdlib.c
107
+ - ext/zstdlib_c/zlib-1.3.1/adler32.c
108
+ - ext/zstdlib_c/zlib-1.3.1/compress.c
109
+ - ext/zstdlib_c/zlib-1.3.1/crc32.c
110
+ - ext/zstdlib_c/zlib-1.3.1/crc32.h
111
+ - ext/zstdlib_c/zlib-1.3.1/deflate.c
112
+ - ext/zstdlib_c/zlib-1.3.1/deflate.h
113
+ - ext/zstdlib_c/zlib-1.3.1/gzclose.c
114
+ - ext/zstdlib_c/zlib-1.3.1/gzguts.h
115
+ - ext/zstdlib_c/zlib-1.3.1/gzlib.c
116
+ - ext/zstdlib_c/zlib-1.3.1/gzread.c
117
+ - ext/zstdlib_c/zlib-1.3.1/gzwrite.c
118
+ - ext/zstdlib_c/zlib-1.3.1/infback.c
119
+ - ext/zstdlib_c/zlib-1.3.1/inffast.c
120
+ - ext/zstdlib_c/zlib-1.3.1/inffast.h
121
+ - ext/zstdlib_c/zlib-1.3.1/inffixed.h
122
+ - ext/zstdlib_c/zlib-1.3.1/inflate.c
123
+ - ext/zstdlib_c/zlib-1.3.1/inflate.h
124
+ - ext/zstdlib_c/zlib-1.3.1/inftrees.c
125
+ - ext/zstdlib_c/zlib-1.3.1/inftrees.h
126
+ - ext/zstdlib_c/zlib-1.3.1/trees.c
127
+ - ext/zstdlib_c/zlib-1.3.1/trees.h
128
+ - ext/zstdlib_c/zlib-1.3.1/uncompr.c
129
+ - ext/zstdlib_c/zlib-1.3.1/zconf.h
130
+ - ext/zstdlib_c/zlib-1.3.1/zlib.h
131
+ - ext/zstdlib_c/zlib-1.3.1/zutil.c
132
+ - ext/zstdlib_c/zlib-1.3.1/zutil.h
132
133
  - ext/zstdlib_c/zlib.mk
133
134
  - ext/zstdlib_c/zlibwrapper.mk
134
135
  - ext/zstdlib_c/zlibwrapper/zlibwrapper.c
@@ -225,8 +226,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  - !ruby/object:Gem::Version
226
227
  version: '0'
227
228
  requirements: []
228
- rubygems_version: 3.4.6
229
+ rubygems_version: 3.4.10
229
230
  signing_key:
230
231
  specification_version: 4
231
- summary: Ruby interface for the Zstdandard data compression library
232
+ summary: Ruby interface for the Zstandard data compression library
232
233
  test_files: []
File without changes
File without changes