zstd 1.1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +5 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +64 -0
  7. data/Rakefile +19 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/exe/zstd +3 -0
  11. data/ext/zstd/extconf.rb +20 -0
  12. data/ext/zstd/libzstd/.gitignore +2 -0
  13. data/ext/zstd/libzstd/LICENSE +1262 -0
  14. data/ext/zstd/libzstd/Makefile +133 -0
  15. data/ext/zstd/libzstd/PATENTS +1272 -0
  16. data/ext/zstd/libzstd/README.md +77 -0
  17. data/ext/zstd/libzstd/common/bitstream.h +414 -0
  18. data/ext/zstd/libzstd/common/entropy_common.c +227 -0
  19. data/ext/zstd/libzstd/common/error_private.c +43 -0
  20. data/ext/zstd/libzstd/common/error_private.h +76 -0
  21. data/ext/zstd/libzstd/common/fse.h +668 -0
  22. data/ext/zstd/libzstd/common/fse_decompress.c +329 -0
  23. data/ext/zstd/libzstd/common/huf.h +238 -0
  24. data/ext/zstd/libzstd/common/mem.h +372 -0
  25. data/ext/zstd/libzstd/common/xxhash.c +867 -0
  26. data/ext/zstd/libzstd/common/xxhash.h +309 -0
  27. data/ext/zstd/libzstd/common/zstd_common.c +77 -0
  28. data/ext/zstd/libzstd/common/zstd_errors.h +60 -0
  29. data/ext/zstd/libzstd/common/zstd_internal.h +270 -0
  30. data/ext/zstd/libzstd/compress/fse_compress.c +850 -0
  31. data/ext/zstd/libzstd/compress/huf_compress.c +609 -0
  32. data/ext/zstd/libzstd/compress/zstd_compress.c +3291 -0
  33. data/ext/zstd/libzstd/compress/zstd_opt.h +919 -0
  34. data/ext/zstd/libzstd/decompress/huf_decompress.c +885 -0
  35. data/ext/zstd/libzstd/decompress/zstd_decompress.c +2154 -0
  36. data/ext/zstd/libzstd/deprecated/zbuff.h +210 -0
  37. data/ext/zstd/libzstd/deprecated/zbuff_compress.c +145 -0
  38. data/ext/zstd/libzstd/deprecated/zbuff_decompress.c +74 -0
  39. data/ext/zstd/libzstd/dictBuilder/divsufsort.c +1913 -0
  40. data/ext/zstd/libzstd/dictBuilder/divsufsort.h +67 -0
  41. data/ext/zstd/libzstd/dictBuilder/zdict.c +1012 -0
  42. data/ext/zstd/libzstd/dictBuilder/zdict.h +111 -0
  43. data/ext/zstd/libzstd/dll/example/Makefile +47 -0
  44. data/ext/zstd/libzstd/dll/example/README.md +69 -0
  45. data/ext/zstd/libzstd/dll/example/build_package.bat +17 -0
  46. data/ext/zstd/libzstd/dll/example/fullbench-dll.sln +25 -0
  47. data/ext/zstd/libzstd/dll/example/fullbench-dll.vcxproj +179 -0
  48. data/ext/zstd/libzstd/dll/libzstd.def +86 -0
  49. data/ext/zstd/libzstd/legacy/zstd_legacy.h +259 -0
  50. data/ext/zstd/libzstd/legacy/zstd_v01.c +2095 -0
  51. data/ext/zstd/libzstd/legacy/zstd_v01.h +80 -0
  52. data/ext/zstd/libzstd/legacy/zstd_v02.c +3518 -0
  53. data/ext/zstd/libzstd/legacy/zstd_v02.h +79 -0
  54. data/ext/zstd/libzstd/legacy/zstd_v03.c +3159 -0
  55. data/ext/zstd/libzstd/legacy/zstd_v03.h +79 -0
  56. data/ext/zstd/libzstd/legacy/zstd_v04.c +3795 -0
  57. data/ext/zstd/libzstd/legacy/zstd_v04.h +128 -0
  58. data/ext/zstd/libzstd/legacy/zstd_v05.c +4056 -0
  59. data/ext/zstd/libzstd/legacy/zstd_v05.h +149 -0
  60. data/ext/zstd/libzstd/legacy/zstd_v06.c +4167 -0
  61. data/ext/zstd/libzstd/legacy/zstd_v06.h +159 -0
  62. data/ext/zstd/libzstd/legacy/zstd_v07.c +4540 -0
  63. data/ext/zstd/libzstd/legacy/zstd_v07.h +173 -0
  64. data/ext/zstd/libzstd/libzstd.pc.in +14 -0
  65. data/ext/zstd/libzstd/zstd.h +673 -0
  66. data/ext/zstd/zstd.c +185 -0
  67. data/ext/zstd/zstd.h +7 -0
  68. data/lib/zstd/version.rb +3 -0
  69. data/lib/zstd.rb +6 -0
  70. data/zstd.gemspec +38 -0
  71. metadata +172 -0
@@ -0,0 +1,79 @@
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_V03_H_298734209782
11
+ #define ZSTD_V03_H_298734209782
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
+ ZSTDv03_decompress() : decompress ZSTD frames compliant with v0.3.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 ZSTDv03_decompress( void* dst, size_t maxOriginalSize,
35
+ const void* src, size_t compressedSize);
36
+
37
+ /**
38
+ ZSTDv03_isError() : tells if the result of ZSTDv03_decompress() is an error
39
+ */
40
+ unsigned ZSTDv03_isError(size_t code);
41
+
42
+
43
+ /* *************************************
44
+ * Advanced functions
45
+ ***************************************/
46
+ typedef struct ZSTDv03_Dctx_s ZSTDv03_Dctx;
47
+ ZSTDv03_Dctx* ZSTDv03_createDCtx(void);
48
+ size_t ZSTDv03_freeDCtx(ZSTDv03_Dctx* dctx);
49
+
50
+ size_t ZSTDv03_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 ZSTDv03_resetDCtx(ZSTDv03_Dctx* dctx);
58
+
59
+ size_t ZSTDv03_nextSrcSizeToDecompress(ZSTDv03_Dctx* dctx);
60
+ size_t ZSTDv03_decompressContinue(ZSTDv03_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 ZSTDv03_magicNumber 0xFD2FB523 /* v0.3 */
73
+
74
+
75
+ #if defined (__cplusplus)
76
+ }
77
+ #endif
78
+
79
+ #endif /* ZSTD_V03_H_298734209782 */