zstd 1.1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +64 -0
- data/Rakefile +19 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/zstd +3 -0
- data/ext/zstd/extconf.rb +20 -0
- data/ext/zstd/libzstd/.gitignore +2 -0
- data/ext/zstd/libzstd/LICENSE +1262 -0
- data/ext/zstd/libzstd/Makefile +133 -0
- data/ext/zstd/libzstd/PATENTS +1272 -0
- data/ext/zstd/libzstd/README.md +77 -0
- data/ext/zstd/libzstd/common/bitstream.h +414 -0
- data/ext/zstd/libzstd/common/entropy_common.c +227 -0
- data/ext/zstd/libzstd/common/error_private.c +43 -0
- data/ext/zstd/libzstd/common/error_private.h +76 -0
- data/ext/zstd/libzstd/common/fse.h +668 -0
- data/ext/zstd/libzstd/common/fse_decompress.c +329 -0
- data/ext/zstd/libzstd/common/huf.h +238 -0
- data/ext/zstd/libzstd/common/mem.h +372 -0
- data/ext/zstd/libzstd/common/xxhash.c +867 -0
- data/ext/zstd/libzstd/common/xxhash.h +309 -0
- data/ext/zstd/libzstd/common/zstd_common.c +77 -0
- data/ext/zstd/libzstd/common/zstd_errors.h +60 -0
- data/ext/zstd/libzstd/common/zstd_internal.h +270 -0
- data/ext/zstd/libzstd/compress/fse_compress.c +850 -0
- data/ext/zstd/libzstd/compress/huf_compress.c +609 -0
- data/ext/zstd/libzstd/compress/zstd_compress.c +3291 -0
- data/ext/zstd/libzstd/compress/zstd_opt.h +919 -0
- data/ext/zstd/libzstd/decompress/huf_decompress.c +885 -0
- data/ext/zstd/libzstd/decompress/zstd_decompress.c +2154 -0
- data/ext/zstd/libzstd/deprecated/zbuff.h +210 -0
- data/ext/zstd/libzstd/deprecated/zbuff_compress.c +145 -0
- data/ext/zstd/libzstd/deprecated/zbuff_decompress.c +74 -0
- data/ext/zstd/libzstd/dictBuilder/divsufsort.c +1913 -0
- data/ext/zstd/libzstd/dictBuilder/divsufsort.h +67 -0
- data/ext/zstd/libzstd/dictBuilder/zdict.c +1012 -0
- data/ext/zstd/libzstd/dictBuilder/zdict.h +111 -0
- data/ext/zstd/libzstd/dll/example/Makefile +47 -0
- data/ext/zstd/libzstd/dll/example/README.md +69 -0
- data/ext/zstd/libzstd/dll/example/build_package.bat +17 -0
- data/ext/zstd/libzstd/dll/example/fullbench-dll.sln +25 -0
- data/ext/zstd/libzstd/dll/example/fullbench-dll.vcxproj +179 -0
- data/ext/zstd/libzstd/dll/libzstd.def +86 -0
- data/ext/zstd/libzstd/legacy/zstd_legacy.h +259 -0
- data/ext/zstd/libzstd/legacy/zstd_v01.c +2095 -0
- data/ext/zstd/libzstd/legacy/zstd_v01.h +80 -0
- data/ext/zstd/libzstd/legacy/zstd_v02.c +3518 -0
- data/ext/zstd/libzstd/legacy/zstd_v02.h +79 -0
- data/ext/zstd/libzstd/legacy/zstd_v03.c +3159 -0
- data/ext/zstd/libzstd/legacy/zstd_v03.h +79 -0
- data/ext/zstd/libzstd/legacy/zstd_v04.c +3795 -0
- data/ext/zstd/libzstd/legacy/zstd_v04.h +128 -0
- data/ext/zstd/libzstd/legacy/zstd_v05.c +4056 -0
- data/ext/zstd/libzstd/legacy/zstd_v05.h +149 -0
- data/ext/zstd/libzstd/legacy/zstd_v06.c +4167 -0
- data/ext/zstd/libzstd/legacy/zstd_v06.h +159 -0
- data/ext/zstd/libzstd/legacy/zstd_v07.c +4540 -0
- data/ext/zstd/libzstd/legacy/zstd_v07.h +173 -0
- data/ext/zstd/libzstd/libzstd.pc.in +14 -0
- data/ext/zstd/libzstd/zstd.h +673 -0
- data/ext/zstd/zstd.c +185 -0
- data/ext/zstd/zstd.h +7 -0
- data/lib/zstd/version.rb +3 -0
- data/lib/zstd.rb +6 -0
- data/zstd.gemspec +38 -0
- metadata +172 -0
@@ -0,0 +1,80 @@
|
|
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
|
+
|
10
|
+
#ifndef ZSTD_V01_H_28739879432
|
11
|
+
#define ZSTD_V01_H_28739879432
|
12
|
+
|
13
|
+
#if defined (__cplusplus)
|
14
|
+
extern "C" {
|
15
|
+
#endif
|
16
|
+
|
17
|
+
/* *************************************
|
18
|
+
* Includes
|
19
|
+
***************************************/
|
20
|
+
#include <stddef.h> /* size_t */
|
21
|
+
|
22
|
+
|
23
|
+
/* *************************************
|
24
|
+
* Simple one-step function
|
25
|
+
***************************************/
|
26
|
+
/**
|
27
|
+
ZSTDv01_decompress() : decompress ZSTD frames compliant with v0.1.x format
|
28
|
+
compressedSize : is the exact source size
|
29
|
+
maxOriginalSize : is the size of the 'dst' buffer, which must be already allocated.
|
30
|
+
It must be equal or larger than originalSize, otherwise decompression will fail.
|
31
|
+
return : the number of bytes decompressed into destination buffer (originalSize)
|
32
|
+
or an errorCode if it fails (which can be tested using ZSTDv01_isError())
|
33
|
+
*/
|
34
|
+
size_t ZSTDv01_decompress( void* dst, size_t maxOriginalSize,
|
35
|
+
const void* src, size_t compressedSize);
|
36
|
+
|
37
|
+
/**
|
38
|
+
ZSTDv01_isError() : tells if the result of ZSTDv01_decompress() is an error
|
39
|
+
*/
|
40
|
+
unsigned ZSTDv01_isError(size_t code);
|
41
|
+
|
42
|
+
|
43
|
+
/* *************************************
|
44
|
+
* Advanced functions
|
45
|
+
***************************************/
|
46
|
+
typedef struct ZSTDv01_Dctx_s ZSTDv01_Dctx;
|
47
|
+
ZSTDv01_Dctx* ZSTDv01_createDCtx(void);
|
48
|
+
size_t ZSTDv01_freeDCtx(ZSTDv01_Dctx* dctx);
|
49
|
+
|
50
|
+
size_t ZSTDv01_decompressDCtx(void* ctx,
|
51
|
+
void* dst, size_t maxOriginalSize,
|
52
|
+
const void* src, size_t compressedSize);
|
53
|
+
|
54
|
+
/* *************************************
|
55
|
+
* Streaming functions
|
56
|
+
***************************************/
|
57
|
+
size_t ZSTDv01_resetDCtx(ZSTDv01_Dctx* dctx);
|
58
|
+
|
59
|
+
size_t ZSTDv01_nextSrcSizeToDecompress(ZSTDv01_Dctx* dctx);
|
60
|
+
size_t ZSTDv01_decompressContinue(ZSTDv01_Dctx* dctx, void* dst, size_t maxDstSize, const void* src, size_t srcSize);
|
61
|
+
/**
|
62
|
+
Use above functions alternatively.
|
63
|
+
ZSTD_nextSrcSizeToDecompress() tells how much bytes to provide as 'srcSize' to ZSTD_decompressContinue().
|
64
|
+
ZSTD_decompressContinue() will use previous data blocks to improve compression if they are located prior to current block.
|
65
|
+
Result is the number of bytes regenerated within 'dst'.
|
66
|
+
It can be zero, which is not an error; it just means ZSTD_decompressContinue() has decoded some header.
|
67
|
+
*/
|
68
|
+
|
69
|
+
/* *************************************
|
70
|
+
* Prefix - version detection
|
71
|
+
***************************************/
|
72
|
+
#define ZSTDv01_magicNumber 0xFD2FB51E /* Big Endian version */
|
73
|
+
#define ZSTDv01_magicNumberLE 0x1EB52FFD /* Little Endian version */
|
74
|
+
|
75
|
+
|
76
|
+
#if defined (__cplusplus)
|
77
|
+
}
|
78
|
+
#endif
|
79
|
+
|
80
|
+
#endif /* ZSTD_V01_H_28739879432 */
|