extzstd 0.0.3.CONCEPT-x86-mingw32 → 0.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.ja +5 -0
- data/LICENSE +6 -6
- data/README.md +35 -22
- data/contrib/zstd/LICENSE +13 -9
- data/contrib/zstd/README.md +37 -44
- data/contrib/zstd/common/entropy_common.c +33 -39
- data/contrib/zstd/common/error_private.c +43 -0
- data/contrib/zstd/common/error_private.h +11 -60
- data/contrib/zstd/common/fse.h +11 -5
- data/contrib/zstd/common/fse_decompress.c +14 -16
- data/contrib/zstd/common/huf.h +1 -1
- data/contrib/zstd/common/mem.h +36 -43
- data/contrib/zstd/common/xxhash.c +31 -18
- data/contrib/zstd/common/xxhash.h +71 -35
- data/contrib/zstd/common/zbuff.h +29 -35
- data/contrib/zstd/common/zstd_common.c +24 -32
- data/contrib/zstd/common/zstd_errors.h +60 -0
- data/contrib/zstd/common/zstd_internal.h +109 -80
- data/contrib/zstd/compress/fse_compress.c +9 -6
- data/contrib/zstd/compress/huf_compress.c +30 -74
- data/contrib/zstd/compress/zbuff_compress.c +43 -51
- data/contrib/zstd/compress/zstd_compress.c +953 -763
- data/contrib/zstd/compress/zstd_opt.h +115 -261
- data/contrib/zstd/decompress/huf_decompress.c +29 -40
- data/contrib/zstd/decompress/zbuff_decompress.c +36 -78
- data/contrib/zstd/decompress/zstd_decompress.c +976 -496
- data/contrib/zstd/dictBuilder/divsufsort.h +5 -5
- data/contrib/zstd/dictBuilder/zdict.c +194 -229
- data/contrib/zstd/dictBuilder/zdict.h +66 -68
- data/contrib/zstd/legacy/zstd_legacy.h +168 -49
- data/contrib/zstd/legacy/zstd_v01.c +95 -178
- data/contrib/zstd/legacy/zstd_v01.h +12 -32
- data/contrib/zstd/legacy/zstd_v02.c +48 -274
- data/contrib/zstd/legacy/zstd_v02.h +12 -32
- data/contrib/zstd/legacy/zstd_v03.c +48 -274
- data/contrib/zstd/legacy/zstd_v03.h +12 -32
- data/contrib/zstd/legacy/zstd_v04.c +63 -320
- data/contrib/zstd/legacy/zstd_v04.h +13 -33
- data/contrib/zstd/legacy/zstd_v05.c +80 -345
- data/contrib/zstd/legacy/zstd_v05.h +9 -31
- data/contrib/zstd/legacy/zstd_v06.c +48 -458
- data/contrib/zstd/legacy/zstd_v06.h +41 -67
- data/contrib/zstd/legacy/zstd_v07.c +4544 -0
- data/contrib/zstd/legacy/zstd_v07.h +173 -0
- data/contrib/zstd/zstd.h +640 -0
- data/ext/extconf.rb +7 -3
- data/ext/extzstd.c +263 -106
- data/ext/extzstd.h +8 -6
- data/ext/extzstd_nogvls.h +0 -117
- data/ext/extzstd_stream.c +347 -0
- data/ext/zstd_common.c +8 -0
- data/ext/zstd_compress.c +6 -0
- data/ext/zstd_decompress.c +5 -0
- data/ext/zstd_dictbuilder.c +5 -0
- data/ext/zstd_legacy_v07.c +1 -0
- data/gemstub.rb +18 -16
- data/lib/2.1/extzstd.so +0 -0
- data/lib/2.2/extzstd.so +0 -0
- data/lib/2.3/extzstd.so +0 -0
- data/lib/extzstd/version.rb +1 -1
- data/lib/extzstd.rb +77 -43
- data/test/test_basic.rb +11 -6
- metadata +23 -11
- data/contrib/zstd/common/error_public.h +0 -77
- data/contrib/zstd/common/zstd.h +0 -475
- data/ext/extzstd_buffered.c +0 -265
- data/ext/zstd_amalgam.c +0 -18
- data/lib/2.0/extzstd.so +0 -0
@@ -1,34 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
met:
|
11
|
-
* Redistributions of source code must retain the above copyright
|
12
|
-
notice, this list of conditions and the following disclaimer.
|
13
|
-
* Redistributions in binary form must reproduce the above
|
14
|
-
copyright notice, this list of conditions and the following disclaimer
|
15
|
-
in the documentation and/or other materials provided with the
|
16
|
-
distribution.
|
17
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
18
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
19
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
20
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
21
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
24
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
25
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28
|
-
|
29
|
-
You can contact the author at :
|
30
|
-
- zstd source repository : https://github.com/Cyan4973/zstd
|
31
|
-
*/
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
8
|
+
*/
|
9
|
+
|
32
10
|
#ifndef ZSTDv06_H
|
33
11
|
#define ZSTDv06_H
|
34
12
|
|
@@ -36,23 +14,19 @@
|
|
36
14
|
extern "C" {
|
37
15
|
#endif
|
38
16
|
|
39
|
-
|
40
|
-
* Dependencies
|
41
|
-
***************************************/
|
17
|
+
/*====== Dependency ======*/
|
42
18
|
#include <stddef.h> /* size_t */
|
43
19
|
|
44
20
|
|
45
|
-
|
46
|
-
* Export parameters
|
47
|
-
*****************************************************************/
|
21
|
+
/*====== Export for Windows ======*/
|
48
22
|
/*!
|
49
23
|
* ZSTDv06_DLL_EXPORT :
|
50
24
|
* Enable exporting of functions when building a Windows DLL
|
51
25
|
*/
|
52
26
|
#if defined(_WIN32) && defined(ZSTDv06_DLL_EXPORT) && (ZSTDv06_DLL_EXPORT==1)
|
53
|
-
# define
|
27
|
+
# define ZSTDLIBv06_API __declspec(dllexport)
|
54
28
|
#else
|
55
|
-
# define
|
29
|
+
# define ZSTDLIBv06_API
|
56
30
|
#endif
|
57
31
|
|
58
32
|
|
@@ -64,18 +38,18 @@ extern "C" {
|
|
64
38
|
`dstCapacity` must be large enough, equal or larger than originalSize.
|
65
39
|
@return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
|
66
40
|
or an errorCode if it fails (which can be tested using ZSTDv06_isError()) */
|
67
|
-
|
68
|
-
|
41
|
+
ZSTDLIBv06_API size_t ZSTDv06_decompress( void* dst, size_t dstCapacity,
|
42
|
+
const void* src, size_t compressedSize);
|
69
43
|
|
70
44
|
|
71
45
|
/* *************************************
|
72
46
|
* Helper functions
|
73
47
|
***************************************/
|
74
|
-
|
48
|
+
ZSTDLIBv06_API size_t ZSTDv06_compressBound(size_t srcSize); /*!< maximum compressed size (worst case scenario) */
|
75
49
|
|
76
50
|
/* Error Management */
|
77
|
-
|
78
|
-
|
51
|
+
ZSTDLIBv06_API unsigned ZSTDv06_isError(size_t code); /*!< tells if a `size_t` function result is an error code */
|
52
|
+
ZSTDLIBv06_API const char* ZSTDv06_getErrorName(size_t code); /*!< provides readable string for an error code */
|
79
53
|
|
80
54
|
|
81
55
|
/* *************************************
|
@@ -83,12 +57,12 @@ ZSTDLIB_API const char* ZSTDv06_getErrorName(size_t code); /*!< provides rea
|
|
83
57
|
***************************************/
|
84
58
|
/** Decompression context */
|
85
59
|
typedef struct ZSTDv06_DCtx_s ZSTDv06_DCtx;
|
86
|
-
|
87
|
-
|
60
|
+
ZSTDLIBv06_API ZSTDv06_DCtx* ZSTDv06_createDCtx(void);
|
61
|
+
ZSTDLIBv06_API size_t ZSTDv06_freeDCtx(ZSTDv06_DCtx* dctx); /*!< @return : errorCode */
|
88
62
|
|
89
63
|
/** ZSTDv06_decompressDCtx() :
|
90
64
|
* Same as ZSTDv06_decompress(), but requires an already allocated ZSTDv06_DCtx (see ZSTDv06_createDCtx()) */
|
91
|
-
|
65
|
+
ZSTDLIBv06_API size_t ZSTDv06_decompressDCtx(ZSTDv06_DCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
|
92
66
|
|
93
67
|
|
94
68
|
/*-***********************
|
@@ -98,10 +72,10 @@ ZSTDLIB_API size_t ZSTDv06_decompressDCtx(ZSTDv06_DCtx* ctx, void* dst, size_t d
|
|
98
72
|
* Decompression using a pre-defined Dictionary content (see dictBuilder).
|
99
73
|
* Dictionary must be identical to the one used during compression, otherwise regenerated data will be corrupted.
|
100
74
|
* Note : dict can be NULL, in which case, it's equivalent to ZSTDv06_decompressDCtx() */
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
75
|
+
ZSTDLIBv06_API size_t ZSTDv06_decompress_usingDict(ZSTDv06_DCtx* dctx,
|
76
|
+
void* dst, size_t dstCapacity,
|
77
|
+
const void* src, size_t srcSize,
|
78
|
+
const void* dict,size_t dictSize);
|
105
79
|
|
106
80
|
|
107
81
|
/*-************************
|
@@ -110,12 +84,12 @@ ZSTDLIB_API size_t ZSTDv06_decompress_usingDict(ZSTDv06_DCtx* dctx,
|
|
110
84
|
struct ZSTDv06_frameParams_s { unsigned long long frameContentSize; unsigned windowLog; };
|
111
85
|
typedef struct ZSTDv06_frameParams_s ZSTDv06_frameParams;
|
112
86
|
|
113
|
-
|
114
|
-
|
115
|
-
|
87
|
+
ZSTDLIBv06_API size_t ZSTDv06_getFrameParams(ZSTDv06_frameParams* fparamsPtr, const void* src, size_t srcSize); /**< doesn't consume input */
|
88
|
+
ZSTDLIBv06_API size_t ZSTDv06_decompressBegin_usingDict(ZSTDv06_DCtx* dctx, const void* dict, size_t dictSize);
|
89
|
+
ZSTDLIBv06_API void ZSTDv06_copyDCtx(ZSTDv06_DCtx* dctx, const ZSTDv06_DCtx* preparedDCtx);
|
116
90
|
|
117
|
-
|
118
|
-
|
91
|
+
ZSTDLIBv06_API size_t ZSTDv06_nextSrcSizeToDecompress(ZSTDv06_DCtx* dctx);
|
92
|
+
ZSTDLIBv06_API size_t ZSTDv06_decompressContinue(ZSTDv06_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
|
119
93
|
|
120
94
|
|
121
95
|
|
@@ -124,15 +98,15 @@ ZSTDLIB_API size_t ZSTDv06_decompressContinue(ZSTDv06_DCtx* dctx, void* dst, siz
|
|
124
98
|
***************************************/
|
125
99
|
|
126
100
|
typedef struct ZBUFFv06_DCtx_s ZBUFFv06_DCtx;
|
127
|
-
|
128
|
-
|
101
|
+
ZSTDLIBv06_API ZBUFFv06_DCtx* ZBUFFv06_createDCtx(void);
|
102
|
+
ZSTDLIBv06_API size_t ZBUFFv06_freeDCtx(ZBUFFv06_DCtx* dctx);
|
129
103
|
|
130
|
-
|
131
|
-
|
104
|
+
ZSTDLIBv06_API size_t ZBUFFv06_decompressInit(ZBUFFv06_DCtx* dctx);
|
105
|
+
ZSTDLIBv06_API size_t ZBUFFv06_decompressInitDictionary(ZBUFFv06_DCtx* dctx, const void* dict, size_t dictSize);
|
132
106
|
|
133
|
-
|
134
|
-
|
135
|
-
|
107
|
+
ZSTDLIBv06_API size_t ZBUFFv06_decompressContinue(ZBUFFv06_DCtx* dctx,
|
108
|
+
void* dst, size_t* dstCapacityPtr,
|
109
|
+
const void* src, size_t* srcSizePtr);
|
136
110
|
|
137
111
|
/*-***************************************************************************
|
138
112
|
* Streaming decompression howto
|
@@ -162,13 +136,13 @@ ZSTDLIB_API size_t ZBUFFv06_decompressContinue(ZBUFFv06_DCtx* dctx,
|
|
162
136
|
/* *************************************
|
163
137
|
* Tool functions
|
164
138
|
***************************************/
|
165
|
-
|
166
|
-
|
139
|
+
ZSTDLIBv06_API unsigned ZBUFFv06_isError(size_t errorCode);
|
140
|
+
ZSTDLIBv06_API const char* ZBUFFv06_getErrorName(size_t errorCode);
|
167
141
|
|
168
142
|
/** Functions below provide recommended buffer sizes for Compression or Decompression operations.
|
169
143
|
* These sizes are just hints, they tend to offer better latency */
|
170
|
-
|
171
|
-
|
144
|
+
ZSTDLIBv06_API size_t ZBUFFv06_recommendedDInSize(void);
|
145
|
+
ZSTDLIBv06_API size_t ZBUFFv06_recommendedDOutSize(void);
|
172
146
|
|
173
147
|
|
174
148
|
/*-*************************************
|