extbrotli 0.0.1.PROTOTYPE

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +67 -0
  4. data/Rakefile +158 -0
  5. data/contrib/brotli/LICENSE +202 -0
  6. data/contrib/brotli/README.md +18 -0
  7. data/contrib/brotli/dec/bit_reader.c +55 -0
  8. data/contrib/brotli/dec/bit_reader.h +256 -0
  9. data/contrib/brotli/dec/context.h +260 -0
  10. data/contrib/brotli/dec/decode.c +1573 -0
  11. data/contrib/brotli/dec/decode.h +160 -0
  12. data/contrib/brotli/dec/dictionary.h +9494 -0
  13. data/contrib/brotli/dec/huffman.c +325 -0
  14. data/contrib/brotli/dec/huffman.h +77 -0
  15. data/contrib/brotli/dec/port.h +148 -0
  16. data/contrib/brotli/dec/prefix.h +756 -0
  17. data/contrib/brotli/dec/state.c +149 -0
  18. data/contrib/brotli/dec/state.h +185 -0
  19. data/contrib/brotli/dec/streams.c +99 -0
  20. data/contrib/brotli/dec/streams.h +100 -0
  21. data/contrib/brotli/dec/transform.h +315 -0
  22. data/contrib/brotli/dec/types.h +36 -0
  23. data/contrib/brotli/enc/backward_references.cc +769 -0
  24. data/contrib/brotli/enc/backward_references.h +50 -0
  25. data/contrib/brotli/enc/bit_cost.h +147 -0
  26. data/contrib/brotli/enc/block_splitter.cc +418 -0
  27. data/contrib/brotli/enc/block_splitter.h +78 -0
  28. data/contrib/brotli/enc/brotli_bit_stream.cc +884 -0
  29. data/contrib/brotli/enc/brotli_bit_stream.h +149 -0
  30. data/contrib/brotli/enc/cluster.h +290 -0
  31. data/contrib/brotli/enc/command.h +140 -0
  32. data/contrib/brotli/enc/context.h +185 -0
  33. data/contrib/brotli/enc/dictionary.h +9485 -0
  34. data/contrib/brotli/enc/dictionary_hash.h +4125 -0
  35. data/contrib/brotli/enc/encode.cc +715 -0
  36. data/contrib/brotli/enc/encode.h +196 -0
  37. data/contrib/brotli/enc/encode_parallel.cc +354 -0
  38. data/contrib/brotli/enc/encode_parallel.h +37 -0
  39. data/contrib/brotli/enc/entropy_encode.cc +492 -0
  40. data/contrib/brotli/enc/entropy_encode.h +88 -0
  41. data/contrib/brotli/enc/fast_log.h +179 -0
  42. data/contrib/brotli/enc/find_match_length.h +87 -0
  43. data/contrib/brotli/enc/hash.h +686 -0
  44. data/contrib/brotli/enc/histogram.cc +76 -0
  45. data/contrib/brotli/enc/histogram.h +100 -0
  46. data/contrib/brotli/enc/literal_cost.cc +172 -0
  47. data/contrib/brotli/enc/literal_cost.h +38 -0
  48. data/contrib/brotli/enc/metablock.cc +544 -0
  49. data/contrib/brotli/enc/metablock.h +88 -0
  50. data/contrib/brotli/enc/port.h +151 -0
  51. data/contrib/brotli/enc/prefix.h +85 -0
  52. data/contrib/brotli/enc/ringbuffer.h +108 -0
  53. data/contrib/brotli/enc/static_dict.cc +441 -0
  54. data/contrib/brotli/enc/static_dict.h +40 -0
  55. data/contrib/brotli/enc/static_dict_lut.h +12063 -0
  56. data/contrib/brotli/enc/streams.cc +127 -0
  57. data/contrib/brotli/enc/streams.h +129 -0
  58. data/contrib/brotli/enc/transform.h +250 -0
  59. data/contrib/brotli/enc/write_bits.h +91 -0
  60. data/ext/extbrotli.cc +24 -0
  61. data/ext/extbrotli.h +73 -0
  62. data/ext/extconf.rb +35 -0
  63. data/ext/lldecoder.c +220 -0
  64. data/ext/llencoder.cc +433 -0
  65. data/gemstub.rb +21 -0
  66. data/lib/extbrotli.rb +243 -0
  67. data/lib/extbrotli/version.rb +3 -0
  68. metadata +140 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 225210d4ad573aa1a26b917faf6397d32f08bbee
4
+ data.tar.gz: 77895f4fa587b3c2b4eac7fbe0529225543a3d9d
5
+ SHA512:
6
+ metadata.gz: d7a2f8b536e5d34d54c27718b17e3ec544d8b8dd2be6a77a32dc5bd9c740e1dc3c75ef87aea0f964f888e989c0957f61732c4a2196186a857980d7e1dc337163
7
+ data.tar.gz: a07e19915f969cabf324bdfee186a58d68e696d4671aeb166700cb038c713847257e5b43878d1425e8766051c5f4bb19bba1dfeb07509234c50fd9d35be350c5
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ extbrotli license - 2-clause BSD License
2
+
3
+ ----
4
+
5
+ Copyright (c) 2015, dearblue. All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or
8
+ without modification, are permitted provided that the following
9
+ conditions are met:
10
+
11
+ 1. Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+ 2. Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in
15
+ 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
+ HOLDER 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.
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # encoding:utf-8 ;
2
+
3
+ # extbrotli - ruby bindings for Brotli
4
+
5
+ This is ruby bindings for compression library
6
+ [Brotli (https://github.com/google/brotli)](https://github.com/google/brotli).
7
+
8
+ * package name: extbrotli
9
+ * author: dearblue (mailto:dearblue@users.osdn.me)
10
+ * version: 0.0.1.PROTOTYPE
11
+ * software quality: EXPERIMENTAL
12
+ * license: 2-clause BSD License
13
+ * report issue to: <https://osdn.jp/projects/rutsubo/ticket/>
14
+ * dependency ruby: ruby-2.0+
15
+ * dependency ruby gems: (none)
16
+ * dependency libraries: (none)
17
+ * bundled external libraries:
18
+ * brotli-0.2 <https://github.com/google/brotli/tree/v0.2.0>
19
+
20
+
21
+ ## HOW TO USE (***a stub***)
22
+
23
+ ### basic usage (one pass encode/decode)
24
+
25
+ ``` ruby:ruby
26
+ # First, load library
27
+ require "extbrotli"
28
+
29
+ # Prepair data
30
+ source = "sample data..." * 50
31
+
32
+ # Directly compression
33
+ encdata = Brotli.encode(source)
34
+ puts "encdata.bytesize=#{encdata.bytesize}"
35
+
36
+ # Directly decompression
37
+ decdata = Brotli.decode(encdata)
38
+ puts "decdata.bytesize=#{decdata.bytesize}"
39
+
40
+ # Comparison source and decoded data
41
+ p source == decdata # => true
42
+ ```
43
+
44
+ ### Fastest encoding
45
+
46
+ ``` ruby:ruby
47
+ best_speed = 0
48
+ Brotli.encode(source, quality: best_speed)
49
+ ```
50
+
51
+ ### Highest encoding
52
+
53
+ ``` ruby:ruby
54
+ best_compression = 11
55
+ Brotli.encode(source, quality: best_compression)
56
+ ```
57
+
58
+ ### Data decoding with limitation size
59
+
60
+ ``` ruby:ruby
61
+ maxdestsize = 5 # as byte size
62
+ Brotli.decode(brotli_data, maxdestsize)
63
+ ```
64
+
65
+ ----
66
+
67
+ [a stub]
data/Rakefile ADDED
@@ -0,0 +1,158 @@
1
+
2
+ require "rake/clean"
3
+
4
+ DOC = FileList["{README,LICENSE,CHANGELOG,Changelog,HISTORY}{,.ja}{,.txt,.rd,.rdoc,.md,.markdown}"] +
5
+ FileList["{contrib,ext}/**/{README,LICENSE,CHANGELOG,Changelog,HISTORY}{,.ja}{,.txt,.rd,.rdoc,.md,.markdown}"] +
6
+ FileList["ext/**/*.{c,C,cc,cxx,cpp,h,H,hh}"]
7
+ #EXT = FileList["ext/**/*.{h,hh,c,cc,cpp,cxx}"] +
8
+ # FileList["ext/externals/**/*"]
9
+ EXT = FileList["ext/**/*"]
10
+ BIN = FileList["bin/*"]
11
+ LIB = FileList["lib/**/*.rb"]
12
+ SPEC = FileList["spec/**/*"]
13
+ TEST = FileList["test/**/*"]
14
+ EXAMPLE = FileList["examples/**/*"]
15
+ GEMSTUB_SRC = "gemstub.rb"
16
+ RAKEFILE = [File.basename(__FILE__), GEMSTUB_SRC]
17
+ EXTRA = []
18
+
19
+ load GEMSTUB_SRC
20
+
21
+ EXTCONF = FileList["ext/extconf.rb"]
22
+ EXTCONF.reject! { |n| !File.file?(n) }
23
+ GEMSTUB.extensions += EXTCONF
24
+ GEMSTUB.executables += FileList["bin/*"].map { |n| File.basename n }
25
+ GEMSTUB.executables.sort!
26
+
27
+ PACKAGENAME = "#{GEMSTUB.name}-#{GEMSTUB.version}"
28
+ GEMFILE = "#{PACKAGENAME}.gem"
29
+ GEMSPEC = "#{GEMSTUB.name}.gemspec"
30
+
31
+ GEMSTUB.files += DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + EXTRA
32
+ GEMSTUB.files.sort!
33
+ if GEMSTUB.rdoc_options.nil? || GEMSTUB.rdoc_options.empty?
34
+ readme = %W(.md .markdown .rd .rdoc .txt #{""}).map { |ext| "README#{ext}" }.find { |m| DOC.find { |n| n == m } }
35
+ GEMSTUB.rdoc_options = %w(--charset UTF-8) + (readme ? %W(-m #{readme}) : [])
36
+ end
37
+ GEMSTUB.extra_rdoc_files += DOC + LIB + EXT.reject { |n| n.include?("/externals/") || !%w(.h .hh .c .cc .cpp .cxx).include?(File.extname(n)) }
38
+ GEMSTUB.extra_rdoc_files.sort!
39
+
40
+ CLEAN << GEMSPEC
41
+ CLOBBER << GEMFILE
42
+
43
+ task :default => :all
44
+
45
+
46
+ unless EXTCONF.empty?
47
+ RUBYSET ||= (ENV["RUBYSET"] || "").split(",")
48
+
49
+ if RUBYSET.nil? || RUBYSET.empty?
50
+ $stderr.puts <<-EOS
51
+ #{__FILE__}:
52
+ |
53
+ | If you want binary gem package, launch rake with ``RUBYSET`` enviroment
54
+ | variable for set ruby interpreters by comma separated.
55
+ |
56
+ | e.g.) $ rake RUBYSET=ruby
57
+ | or) $ rake RUBYSET=ruby20,ruby21,ruby22
58
+ |
59
+ EOS
60
+ else
61
+ platforms = RUBYSET.map { |ruby| `#{ruby} --disable gems -rrbconfig -e "puts RbConfig::CONFIG['arch']"`.chomp }
62
+ platforms1 = platforms.uniq
63
+ unless platforms1.size == 1 && !platforms1[0].empty?
64
+ raise "different platforms (#{Hash[*RUBYSET.zip(platforms).flatten].inspect})"
65
+ end
66
+ PLATFORM = platforms1[0]
67
+
68
+ RUBY_VERSIONS = RUBYSET.map do |ruby|
69
+ ver = `#{ruby} --disable gem -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']"`.slice(/\d+\.\d+/)
70
+ raise "failed ruby checking - ``#{ruby}''" unless $?.success?
71
+ [ver, ruby]
72
+ end
73
+ SOFILES_SET = RUBY_VERSIONS.map { |(ver, ruby)| ["lib/#{ver}/#{GEMSTUB.name}.so", ruby] }
74
+ SOFILES = SOFILES_SET.map { |(lib, ruby)| lib }
75
+
76
+ GEMSTUB_NATIVE = GEMSTUB.dup
77
+ GEMSTUB_NATIVE.files += SOFILES
78
+ GEMSTUB_NATIVE.platform = Gem::Platform.new(PLATFORM).to_s
79
+ GEMSTUB_NATIVE.extensions.clear
80
+ GEMFILE_NATIVE = "#{GEMSTUB_NATIVE.name}-#{GEMSTUB_NATIVE.version}-#{GEMSTUB_NATIVE.platform}.gem"
81
+ GEMSPEC_NATIVE = "#{GEMSTUB_NATIVE.name}-#{GEMSTUB_NATIVE.platform}.gemspec"
82
+
83
+ task :all => ["native-gem", GEMFILE]
84
+
85
+ desc "build binary gem package"
86
+ task "native-gem" => GEMFILE_NATIVE
87
+
88
+ desc "generate binary gemspec"
89
+ task "native-gemspec" => GEMSPEC_NATIVE
90
+
91
+ file GEMFILE_NATIVE => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + SOFILES + RAKEFILE + [GEMSPEC_NATIVE] do
92
+ sh "gem build #{GEMSPEC_NATIVE}"
93
+ end
94
+
95
+ file GEMSPEC_NATIVE => RAKEFILE do
96
+ File.write(GEMSPEC_NATIVE, GEMSTUB_NATIVE.to_ruby, mode: "wb")
97
+ end
98
+
99
+ desc "build c-extension libraries"
100
+ task "sofiles" => SOFILES
101
+
102
+ SOFILES_SET.each do |(soname, ruby)|
103
+ sodir = File.dirname(soname)
104
+ makefile = File.join(sodir, "Makefile")
105
+
106
+ CLEAN << GEMSPEC_NATIVE << sodir
107
+ CLOBBER << GEMFILE_NATIVE
108
+
109
+ directory sodir
110
+
111
+ desc "generate Makefile for binary extension library"
112
+ file makefile => [sodir] + EXTCONF do
113
+ cd sodir do
114
+ sh "#{ruby} ../../#{EXTCONF[0]} \"--ruby=#{ruby}\""
115
+ end
116
+ end
117
+
118
+ desc "build binary extension library"
119
+ file soname => [makefile] + EXT do
120
+ cd sodir do
121
+ sh "make"
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+
128
+
129
+ task :all => GEMFILE
130
+
131
+ desc "generate local rdoc"
132
+ task :rdoc => DOC + LIB do
133
+ sh *(%w(rdoc) + GEMSTUB.rdoc_options + DOC + LIB)
134
+ end
135
+
136
+ desc "launch rspec"
137
+ task rspec: :all do
138
+ sh "rspec"
139
+ end
140
+
141
+ desc "build gem package"
142
+ task gem: GEMFILE
143
+
144
+ desc "generate gemspec"
145
+ task gemspec: GEMSPEC
146
+
147
+ desc "print package name"
148
+ task "package-name" do
149
+ puts PACKAGENAME
150
+ end
151
+
152
+ file GEMFILE => DOC + EXT + EXTCONF + BIN + LIB + SPEC + TEST + EXAMPLE + RAKEFILE + [GEMSPEC] do
153
+ sh "gem build #{GEMSPEC}"
154
+ end
155
+
156
+ file GEMSPEC => RAKEFILE do
157
+ File.write(GEMSPEC, GEMSTUB.to_ruby, mode: "wb")
158
+ end
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.