extzstd 0.0.3.CONCEPT → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.ja +5 -0
  3. data/LICENSE +6 -6
  4. data/README.md +35 -22
  5. data/contrib/zstd/LICENSE +13 -9
  6. data/contrib/zstd/README.md +37 -44
  7. data/contrib/zstd/common/entropy_common.c +33 -39
  8. data/contrib/zstd/common/error_private.c +43 -0
  9. data/contrib/zstd/common/error_private.h +11 -60
  10. data/contrib/zstd/common/fse.h +11 -5
  11. data/contrib/zstd/common/fse_decompress.c +14 -16
  12. data/contrib/zstd/common/huf.h +1 -1
  13. data/contrib/zstd/common/mem.h +36 -43
  14. data/contrib/zstd/common/xxhash.c +31 -18
  15. data/contrib/zstd/common/xxhash.h +71 -35
  16. data/contrib/zstd/common/zbuff.h +29 -35
  17. data/contrib/zstd/common/zstd_common.c +24 -32
  18. data/contrib/zstd/common/zstd_errors.h +60 -0
  19. data/contrib/zstd/common/zstd_internal.h +109 -80
  20. data/contrib/zstd/compress/fse_compress.c +9 -6
  21. data/contrib/zstd/compress/huf_compress.c +30 -74
  22. data/contrib/zstd/compress/zbuff_compress.c +43 -51
  23. data/contrib/zstd/compress/zstd_compress.c +953 -763
  24. data/contrib/zstd/compress/zstd_opt.h +115 -261
  25. data/contrib/zstd/decompress/huf_decompress.c +29 -40
  26. data/contrib/zstd/decompress/zbuff_decompress.c +36 -78
  27. data/contrib/zstd/decompress/zstd_decompress.c +976 -496
  28. data/contrib/zstd/dictBuilder/divsufsort.h +5 -5
  29. data/contrib/zstd/dictBuilder/zdict.c +194 -229
  30. data/contrib/zstd/dictBuilder/zdict.h +66 -68
  31. data/contrib/zstd/legacy/zstd_legacy.h +168 -49
  32. data/contrib/zstd/legacy/zstd_v01.c +95 -178
  33. data/contrib/zstd/legacy/zstd_v01.h +12 -32
  34. data/contrib/zstd/legacy/zstd_v02.c +48 -274
  35. data/contrib/zstd/legacy/zstd_v02.h +12 -32
  36. data/contrib/zstd/legacy/zstd_v03.c +48 -274
  37. data/contrib/zstd/legacy/zstd_v03.h +12 -32
  38. data/contrib/zstd/legacy/zstd_v04.c +63 -320
  39. data/contrib/zstd/legacy/zstd_v04.h +13 -33
  40. data/contrib/zstd/legacy/zstd_v05.c +80 -345
  41. data/contrib/zstd/legacy/zstd_v05.h +9 -31
  42. data/contrib/zstd/legacy/zstd_v06.c +48 -458
  43. data/contrib/zstd/legacy/zstd_v06.h +41 -67
  44. data/contrib/zstd/legacy/zstd_v07.c +4544 -0
  45. data/contrib/zstd/legacy/zstd_v07.h +173 -0
  46. data/contrib/zstd/zstd.h +640 -0
  47. data/ext/extconf.rb +7 -3
  48. data/ext/extzstd.c +263 -106
  49. data/ext/extzstd.h +8 -6
  50. data/ext/extzstd_nogvls.h +0 -117
  51. data/ext/extzstd_stream.c +347 -0
  52. data/ext/zstd_common.c +8 -0
  53. data/ext/zstd_compress.c +6 -0
  54. data/ext/zstd_decompress.c +5 -0
  55. data/ext/zstd_dictbuilder.c +5 -0
  56. data/ext/zstd_legacy_v07.c +1 -0
  57. data/gemstub.rb +18 -16
  58. data/lib/extzstd/version.rb +1 -1
  59. data/lib/extzstd.rb +77 -43
  60. data/test/test_basic.rb +11 -6
  61. metadata +23 -10
  62. data/contrib/zstd/common/error_public.h +0 -77
  63. data/contrib/zstd/common/zstd.h +0 -475
  64. data/ext/extzstd_buffered.c +0 -265
  65. data/ext/zstd_amalgam.c +0 -18
data/lib/extzstd.rb CHANGED
@@ -14,32 +14,46 @@ require "stringio"
14
14
  module Zstd
15
15
  #
16
16
  # call-seq:
17
- # encode(src_string, level = nil, dict = nil) -> zstd string
18
- # encode(src_string, encoder_params, dict = nil) -> zstd string
19
- # encode(outport, level = nil, dict = nil) -> zstd encoder
20
- # encode(outport, level = nil, dict = nil) { |encoder| ... } -> yield returned value
21
- # encode(outport, encoder_params, dict = nil) -> zstd encoder
22
- # encode(outport, encoder_params, dict = nil) { |encoder| ... } -> yield returned value
17
+ # encode(src_string, level = nil, opts = {}) -> zstd string
18
+ # encode(src_string, encode_params, opts = {}) -> zstd string
19
+ # encode(outport, level = nil, opts = {}) -> zstd encoder
20
+ # encode(outport, level = nil, opts = {}) { |encoder| ... } -> yield returned value
21
+ # encode(outport, encode_params, opts = {}) -> zstd encoder
22
+ # encode(outport, encode_params, opts = {}) { |encoder| ... } -> yield returned value
23
23
  #
24
- def self.encode(src, *args, &block)
24
+ # [src_string (string)]
25
+ # [outport (io liked object)]
26
+ # [level = nil (integer or nil)]
27
+ # [encode_params (instance of Zstd::Parameters)]
28
+ # [opts dict: nil (string or nil)]
29
+ def self.encode(src, params = nil, dict: nil, &block)
25
30
  if src.kind_of?(String)
26
- dest = Aux::EMPTY_BUFFER.dup
27
- return Encoder.open(dest, *args) { |e| e.write src; dest }
31
+ return ContextLess.encode(src, Aux::EMPTY_BUFFER.dup, nil, dict, params)
28
32
  end
29
33
 
30
- Encoder.open(src, *args, &block)
34
+ Encoder.open(src, params, dict, &block)
31
35
  end
32
36
 
33
37
  #
34
38
  # call-seq:
35
- # decode(zstd_string, maxsize = nil, dict = nil) -> string
36
- # decode(zstd_stream, maxsize = nil, dict = nil) -> zstd decoder
37
- # decode(zstd_stream, maxsize = nil, dict = nil) { |decoder| ... } -> yield returned value
39
+ # decode(zstd_string, maxsize = nil, dict: nil) -> string
40
+ # decode(zstd_stream, dict: nil) -> zstd decoder
41
+ # decode(zstd_stream, dict: nil) { |decoder| ... } -> yield returned value
38
42
  #
39
- def self.decode(src, maxsize = nil, dict = nil, &block)
43
+ def self.decode(src, *args, dict: nil, &block)
40
44
  if src.kind_of?(String)
41
- maxsize &&= maxsize.to_i
42
- return Decoder.open(src, dict) { |d| return d.read(maxsize) }
45
+ case args.size
46
+ when 0
47
+ return ContextLess.decode(src, Aux::EMPTY_BUFFER.dup, nil, dict)
48
+ when 1
49
+ Decoder.open(src, dict) { |d| return d.read(args[0].to_i) }
50
+ else
51
+ raise ArgumentError, "wrong argument number (given #{args.size}, expect 1 or 2)"
52
+ end
53
+ end
54
+
55
+ unless args.empty?
56
+ raise ArgumentError, "wrong argument number (given #{args.size}, expect 1)"
43
57
  end
44
58
 
45
59
  Decoder.open(src, dict, &block)
@@ -49,7 +63,7 @@ module Zstd
49
63
  #
50
64
  # call-seq:
51
65
  # open(outport, level = nil, dict = nil) -> zstd encoder
52
- # open(outport, encoder_params, dict = nil) { |encoder| ... } -> yield returned value
66
+ # open(outport, encode_params, dict = nil) { |encoder| ... } -> yield returned value
53
67
  #
54
68
  def self.open(outport, *args)
55
69
  e = new(outport, *args)
@@ -66,12 +80,12 @@ module Zstd
66
80
  #
67
81
  # call-seq:
68
82
  # initialize(outport, level = nil, dict = nil)
69
- # initialize(outport, encoder_params, dict = nil)
83
+ # initialize(outport, encode_params, dict = nil)
70
84
  #
71
85
  # +outport+ need has +.<<+ method.
72
86
  #
73
87
  def initialize(outport, params = nil, dict = nil)
74
- encoder = BufferedEncoder.new(params, dict)
88
+ encoder = StreamEncoder.new(params, dict)
75
89
  super encoder, outport, "".force_encoding(Encoding::BINARY), [true]
76
90
  end
77
91
 
@@ -83,7 +97,7 @@ module Zstd
83
97
 
84
98
  def close
85
99
  return nil if eof?
86
- encoder.end(destbuf, BufferedEncoder.recommended_outsize)
100
+ encoder.end(destbuf, StreamEncoder::OUTSIZE)
87
101
  outport << destbuf
88
102
  status[0] = false
89
103
  nil
@@ -94,9 +108,9 @@ module Zstd
94
108
 
95
109
  off = 0
96
110
  rest = buf.bytesize
97
- outsize = BufferedEncoder.recommended_outsize
111
+ outsize = StreamEncoder::OUTSIZE
98
112
  while off && off < rest
99
- off = encoder.continue(buf, off, destbuf, outsize)
113
+ off = encoder.update(buf, off, destbuf, outsize)
100
114
  outport << destbuf
101
115
  end
102
116
 
@@ -109,14 +123,16 @@ module Zstd
109
123
  raise IOError, "closed stream" if eof?
110
124
 
111
125
  off = 0
112
- encoder.flush(destbuf, BufferedEncoder.recommended_outsize)
126
+ encoder.flush(destbuf, StreamEncoder::OUTSIZE)
113
127
  outport << destbuf
114
128
 
115
129
  self
116
130
  end
117
131
  end
118
132
 
119
- class Decoder < Struct.new(:decoder, :inport, :readbuf, :destbuf, :status)
133
+ class Decoder
134
+ attr_reader :decoder, :inport, :readbuf, :destbuf, :status, :pos
135
+
120
136
  STATUS_CLOSED = nil
121
137
  STATUS_READY = 0
122
138
  STATUS_INPORT_EOF = 1
@@ -145,15 +161,19 @@ module Zstd
145
161
 
146
162
  def initialize(inport, dict = nil)
147
163
  raise Error, "require .read method - <%s:0x%08x>" % [inport.class, inport.object_id << 1] unless inport.respond_to?(:read)
148
- super(BufferedDecoder.new(dict), inport, StringIO.new(Aux::EMPTY_BUFFER.dup), StringIO.new(Aux::EMPTY_BUFFER.dup), STATUS_READY)
164
+ @decoder = StreamDecoder.new(dict)
165
+ @inport = inport
166
+ @readbuf = StringIO.new(Aux::EMPTY_BUFFER.dup)
167
+ @destbuf = StringIO.new(Aux::EMPTY_BUFFER.dup)
168
+ @status = STATUS_READY
169
+ @pos = 0
149
170
  end
150
171
 
151
172
  def close
152
- decoder.reset
153
173
  inport.close rescue nil if inport.respond_to?(:close)
154
- readbuf.clear
155
- #destbuf.clear
156
- self.status = STATUS_CLOSED
174
+ readbuf.truncate 0
175
+ destbuf.truncate 0
176
+ @status = STATUS_CLOSED
157
177
  nil
158
178
  end
159
179
 
@@ -165,11 +185,11 @@ module Zstd
165
185
 
166
186
  def read(size = nil, dest = Aux::EMPTY_BUFFER.dup)
167
187
  dest ||= Aux::EMPTY_BUFFER.dup
188
+ size &&= size.to_i
168
189
  Aux.change_binary(dest) do
169
190
  #dest.clear
170
- dest[0 .. -1] = Aux::EMPTY_BUFFER # keep allocated heap
171
-
172
- return dest if size == 0
191
+ dest[0 .. -1] = Aux::EMPTY_BUFFER unless dest.empty? # keep allocated heap
192
+ return dest unless !size || size > 0
173
193
 
174
194
  d = Aux::EMPTY_BUFFER.dup
175
195
  until size && size <= 0
@@ -187,33 +207,45 @@ module Zstd
187
207
  if dest.empty?
188
208
  nil
189
209
  else
210
+ @pos += dest.bytesize
190
211
  dest
191
212
  end
192
213
  end
193
214
 
194
215
  private
195
216
  def fetch
196
- return nil if eof? || status == STATUS_INPORT_EOF
217
+ return nil if eof?
218
+
219
+ destbuf.rewind
220
+ destbuf.truncate 0
197
221
 
198
222
  while true
199
- if readbuf.eof?
200
- readbuf.string[0 .. -1] = Aux::EMPTY_BUFFER
223
+ if readbuf.eof? && status != STATUS_INPORT_EOF
201
224
  readbuf.rewind
202
- unless inport.read(BufferedDecoder.recommended_insize, readbuf.string)
203
- self.status = STATUS_INPORT_EOF
204
- return nil
225
+ unless inport.read StreamDecoder::INSIZE, readbuf.string
226
+ @status = STATUS_INPORT_EOF
205
227
  end
206
228
  end
207
229
 
208
- off = decoder.continue(readbuf.string, readbuf.pos, destbuf.string, BufferedDecoder.recommended_outsize)
209
- readbuf.pos = off if off
210
- destbuf.rewind
211
- return self if destbuf.size > 0
230
+ begin
231
+ off = decoder.update readbuf.string, readbuf.pos, destbuf.string, StreamDecoder::OUTSIZE
232
+ readbuf.pos = off if off
233
+ return self if destbuf.size > 0
234
+ break if readbuf.eof? && status == STATUS_INPORT_EOF
235
+ rescue Zstd::InitMissingError
236
+ break if readbuf.eof? && status == STATUS_INPORT_EOF
237
+ raise
238
+ end
212
239
  end
240
+
241
+ # when readbuf.eof? && status == STATUS_INPORT_EOF
242
+
243
+ @status = nil
244
+ nil
213
245
  end
214
246
  end
215
247
 
216
- class EncodeParameters
248
+ class Parameters
217
249
  def inspect
218
250
  "#<#{self.class} windowlog=#{windowlog}, chainlog=#{chainlog}, " \
219
251
  "hashlog=#{hashlog}, searchlog=#{searchlog}, " \
@@ -233,6 +265,8 @@ module Zstd
233
265
  q.breakable " "
234
266
  q.text "searchlength=#{searchlength},"
235
267
  q.breakable " "
268
+ q.text "targetlength=#{targetlength},"
269
+ q.breakable " "
236
270
  q.text "strategy=#{strategy}>"
237
271
  end
238
272
  end
data/test/test_basic.rb CHANGED
@@ -18,24 +18,29 @@ class TestZstd < Test::Unit::TestCase
18
18
 
19
19
  def test_huge
20
20
  src = "ABCDEFGabcdefg" * 10000000
21
- assert_equal(Digest::MD5.hexdigest(src), Digest::MD5.hexdigest(Zstd.decode(Zstd.encode(src))))
21
+ resrc = Zstd.decode(Zstd.encode(src))
22
+ assert_equal(src.bytesize, resrc.bytesize)
23
+ assert_equal(Digest::MD5.hexdigest(src), Digest::MD5.hexdigest(resrc))
22
24
  end
23
25
 
24
26
  def test_huge_stream
25
27
  src = "abcdefghijklmnopqrstuvwxyz" * 1000
28
+ size_a = 0
26
29
  md5a = Digest::MD5.new
27
30
  d = StringIO.new("")
28
- Zstd.encode(d) { |z| 1000.times { z << src; md5a.update src } }
31
+ Zstd.encode(d) { |z| 1000.times { z << src; size_a += src.bytesize; md5a.update src } }
29
32
  d.pos = 0
33
+ size_b = 0
30
34
  md5b = Digest::MD5.new
31
- Zstd.decode(d) { |z| buf = ""; while z.read(654321, buf); md5b.update buf; end }
35
+ Zstd.decode(d) { |z| buf = ""; while z.read(654321, buf); size_b += buf.bytesize; md5b.update buf; end }
36
+ assert_equal size_a, size_b
32
37
  assert_equal(md5a.hexdigest, md5b.hexdigest)
33
38
  end
34
39
 
35
40
  def test_dictionary
36
- dictsrc = "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz" * 10
37
- dict = Zstd.dict_train_from_buffer(dictsrc, 10000)
41
+ dictsrc = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-" * 5
42
+ dict = Zstd::Dictionary.train_from_buffer(dictsrc, 10000)
38
43
  src = "ABCDEFGabcdefg" * 50
39
- assert_equal(src, Zstd.decode(Zstd.encode(src, nil, dict), src.bytesize, dict))
44
+ assert_equal(src, Zstd.decode(Zstd.encode(src, dict: dict), src.bytesize, dict: dict))
40
45
  end
41
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extzstd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.CONCEPT
4
+ version: '0.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - dearblue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-31 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -32,24 +32,30 @@ executables: []
32
32
  extensions:
33
33
  - ext/extconf.rb
34
34
  extra_rdoc_files:
35
+ - HISTORY.ja
35
36
  - LICENSE
36
37
  - README.md
37
38
  - contrib/zstd/LICENSE
38
39
  - contrib/zstd/README.md
39
40
  - ext/extzstd.c
40
41
  - ext/extzstd.h
41
- - ext/extzstd_buffered.c
42
42
  - ext/extzstd_nogvls.h
43
- - ext/zstd_amalgam.c
43
+ - ext/extzstd_stream.c
44
+ - ext/zstd_common.c
45
+ - ext/zstd_compress.c
46
+ - ext/zstd_decompress.c
47
+ - ext/zstd_dictbuilder.c
44
48
  - ext/zstd_legacy_v01.c
45
49
  - ext/zstd_legacy_v02.c
46
50
  - ext/zstd_legacy_v03.c
47
51
  - ext/zstd_legacy_v04.c
48
52
  - ext/zstd_legacy_v05.c
49
53
  - ext/zstd_legacy_v06.c
54
+ - ext/zstd_legacy_v07.c
50
55
  - lib/extzstd.rb
51
56
  - lib/extzstd/version.rb
52
57
  files:
58
+ - HISTORY.ja
53
59
  - LICENSE
54
60
  - README.md
55
61
  - Rakefile
@@ -57,8 +63,8 @@ files:
57
63
  - contrib/zstd/README.md
58
64
  - contrib/zstd/common/bitstream.h
59
65
  - contrib/zstd/common/entropy_common.c
66
+ - contrib/zstd/common/error_private.c
60
67
  - contrib/zstd/common/error_private.h
61
- - contrib/zstd/common/error_public.h
62
68
  - contrib/zstd/common/fse.h
63
69
  - contrib/zstd/common/fse_decompress.c
64
70
  - contrib/zstd/common/huf.h
@@ -66,8 +72,8 @@ files:
66
72
  - contrib/zstd/common/xxhash.c
67
73
  - contrib/zstd/common/xxhash.h
68
74
  - contrib/zstd/common/zbuff.h
69
- - contrib/zstd/common/zstd.h
70
75
  - contrib/zstd/common/zstd_common.c
76
+ - contrib/zstd/common/zstd_errors.h
71
77
  - contrib/zstd/common/zstd_internal.h
72
78
  - contrib/zstd/compress/fse_compress.c
73
79
  - contrib/zstd/compress/huf_compress.c
@@ -94,18 +100,25 @@ files:
94
100
  - contrib/zstd/legacy/zstd_v05.h
95
101
  - contrib/zstd/legacy/zstd_v06.c
96
102
  - contrib/zstd/legacy/zstd_v06.h
103
+ - contrib/zstd/legacy/zstd_v07.c
104
+ - contrib/zstd/legacy/zstd_v07.h
105
+ - contrib/zstd/zstd.h
97
106
  - ext/extconf.rb
98
107
  - ext/extzstd.c
99
108
  - ext/extzstd.h
100
- - ext/extzstd_buffered.c
101
109
  - ext/extzstd_nogvls.h
102
- - ext/zstd_amalgam.c
110
+ - ext/extzstd_stream.c
111
+ - ext/zstd_common.c
112
+ - ext/zstd_compress.c
113
+ - ext/zstd_decompress.c
114
+ - ext/zstd_dictbuilder.c
103
115
  - ext/zstd_legacy_v01.c
104
116
  - ext/zstd_legacy_v02.c
105
117
  - ext/zstd_legacy_v03.c
106
118
  - ext/zstd_legacy_v04.c
107
119
  - ext/zstd_legacy_v05.c
108
120
  - ext/zstd_legacy_v06.c
121
+ - ext/zstd_legacy_v07.c
109
122
  - gemstub.rb
110
123
  - lib/extzstd.rb
111
124
  - lib/extzstd/version.rb
@@ -129,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
142
  version: '2.0'
130
143
  required_rubygems_version: !ruby/object:Gem::Requirement
131
144
  requirements:
132
- - - ">"
145
+ - - ">="
133
146
  - !ruby/object:Gem::Version
134
- version: 1.3.1
147
+ version: '0'
135
148
  requirements: []
136
149
  rubyforge_project:
137
150
  rubygems_version: 2.6.4
@@ -1,77 +0,0 @@
1
- /* ******************************************************************
2
- Error codes list
3
- Copyright (C) 2016, Yann Collet
4
-
5
- BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
6
-
7
- Redistribution and use in source and binary forms, with or without
8
- modification, are permitted provided that the following conditions are
9
- met:
10
-
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
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
-
30
- You can contact the author at :
31
- - Homepage : http://www.zstd.net
32
- ****************************************************************** */
33
- #ifndef ERROR_PUBLIC_H_MODULE
34
- #define ERROR_PUBLIC_H_MODULE
35
-
36
- #if defined (__cplusplus)
37
- extern "C" {
38
- #endif
39
-
40
-
41
- /* ****************************************
42
- * error codes list
43
- ******************************************/
44
- typedef enum {
45
- ZSTD_error_no_error,
46
- ZSTD_error_GENERIC,
47
- ZSTD_error_prefix_unknown,
48
- ZSTD_error_frameParameter_unsupported,
49
- ZSTD_error_frameParameter_unsupportedBy32bits,
50
- ZSTD_error_compressionParameter_unsupported,
51
- ZSTD_error_init_missing,
52
- ZSTD_error_memory_allocation,
53
- ZSTD_error_stage_wrong,
54
- ZSTD_error_dstSize_tooSmall,
55
- ZSTD_error_srcSize_wrong,
56
- ZSTD_error_corruption_detected,
57
- ZSTD_error_checksum_wrong,
58
- ZSTD_error_tableLog_tooLarge,
59
- ZSTD_error_maxSymbolValue_tooLarge,
60
- ZSTD_error_maxSymbolValue_tooSmall,
61
- ZSTD_error_dictionary_corrupted,
62
- ZSTD_error_dictionary_wrong,
63
- ZSTD_error_maxCode
64
- } ZSTD_ErrorCode;
65
-
66
- /*! ZSTD_getErrorCode() :
67
- convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
68
- which can be used to compare directly with enum list published into "error_public.h" */
69
- ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult);
70
- const char* ZSTD_getErrorString(ZSTD_ErrorCode code);
71
-
72
-
73
- #if defined (__cplusplus)
74
- }
75
- #endif
76
-
77
- #endif /* ERROR_PUBLIC_H_MODULE */