@ohos-ports/lmdb 2.5.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +536 -0
  3. package/SECURITY.md +12 -0
  4. package/binding.gyp +111 -0
  5. package/build/Release/lmdb.node +0 -0
  6. package/caching.js +156 -0
  7. package/dependencies/lmdb/libraries/liblmdb/COPYRIGHT +20 -0
  8. package/dependencies/lmdb/libraries/liblmdb/Doxyfile +1631 -0
  9. package/dependencies/lmdb/libraries/liblmdb/LICENSE +47 -0
  10. package/dependencies/lmdb/libraries/liblmdb/Makefile +136 -0
  11. package/dependencies/lmdb/libraries/liblmdb/chacha8.c +183 -0
  12. package/dependencies/lmdb/libraries/liblmdb/chacha8.h +14 -0
  13. package/dependencies/lmdb/libraries/liblmdb/crypto.c +121 -0
  14. package/dependencies/lmdb/libraries/liblmdb/intro.doc +192 -0
  15. package/dependencies/lmdb/libraries/liblmdb/lmdb.h +1792 -0
  16. package/dependencies/lmdb/libraries/liblmdb/mdb.c +12429 -0
  17. package/dependencies/lmdb/libraries/liblmdb/mdb_copy.1 +74 -0
  18. package/dependencies/lmdb/libraries/liblmdb/mdb_copy.c +106 -0
  19. package/dependencies/lmdb/libraries/liblmdb/mdb_drop.1 +53 -0
  20. package/dependencies/lmdb/libraries/liblmdb/mdb_drop.c +154 -0
  21. package/dependencies/lmdb/libraries/liblmdb/mdb_dump.1 +94 -0
  22. package/dependencies/lmdb/libraries/liblmdb/mdb_dump.c +333 -0
  23. package/dependencies/lmdb/libraries/liblmdb/mdb_load.1 +97 -0
  24. package/dependencies/lmdb/libraries/liblmdb/mdb_load.c +530 -0
  25. package/dependencies/lmdb/libraries/liblmdb/mdb_stat.1 +83 -0
  26. package/dependencies/lmdb/libraries/liblmdb/mdb_stat.c +276 -0
  27. package/dependencies/lmdb/libraries/liblmdb/midl.c +452 -0
  28. package/dependencies/lmdb/libraries/liblmdb/midl.h +208 -0
  29. package/dependencies/lmdb/libraries/liblmdb/module.c +101 -0
  30. package/dependencies/lmdb/libraries/liblmdb/module.h +16 -0
  31. package/dependencies/lmdb/libraries/liblmdb/mtest.c +178 -0
  32. package/dependencies/lmdb/libraries/liblmdb/mtest2.c +124 -0
  33. package/dependencies/lmdb/libraries/liblmdb/mtest3.c +133 -0
  34. package/dependencies/lmdb/libraries/liblmdb/mtest4.c +168 -0
  35. package/dependencies/lmdb/libraries/liblmdb/mtest5.c +135 -0
  36. package/dependencies/lmdb/libraries/liblmdb/mtest6.c +141 -0
  37. package/dependencies/lmdb/libraries/liblmdb/mtest_enc.c +190 -0
  38. package/dependencies/lmdb/libraries/liblmdb/mtest_enc2.c +189 -0
  39. package/dependencies/lmdb/libraries/liblmdb/mtest_remap.c +177 -0
  40. package/dependencies/lmdb/libraries/liblmdb/sample-bdb.txt +73 -0
  41. package/dependencies/lmdb/libraries/liblmdb/sample-mdb.txt +62 -0
  42. package/dependencies/lmdb/libraries/liblmdb/tooltag +27 -0
  43. package/dependencies/lmdb-data-v1/libraries/liblmdb/COPYRIGHT +20 -0
  44. package/dependencies/lmdb-data-v1/libraries/liblmdb/Doxyfile +1631 -0
  45. package/dependencies/lmdb-data-v1/libraries/liblmdb/LICENSE +47 -0
  46. package/dependencies/lmdb-data-v1/libraries/liblmdb/Makefile +118 -0
  47. package/dependencies/lmdb-data-v1/libraries/liblmdb/intro.doc +192 -0
  48. package/dependencies/lmdb-data-v1/libraries/liblmdb/lmdb.h +1653 -0
  49. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb.c +11359 -0
  50. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_copy.1 +61 -0
  51. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_copy.c +84 -0
  52. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_drop.1 +40 -0
  53. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_drop.c +135 -0
  54. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_dump.1 +81 -0
  55. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_dump.c +319 -0
  56. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_load.1 +84 -0
  57. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_load.c +492 -0
  58. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_stat.1 +70 -0
  59. package/dependencies/lmdb-data-v1/libraries/liblmdb/mdb_stat.c +264 -0
  60. package/dependencies/lmdb-data-v1/libraries/liblmdb/midl.c +421 -0
  61. package/dependencies/lmdb-data-v1/libraries/liblmdb/midl.h +200 -0
  62. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest.c +177 -0
  63. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest2.c +124 -0
  64. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest3.c +133 -0
  65. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest4.c +168 -0
  66. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest5.c +135 -0
  67. package/dependencies/lmdb-data-v1/libraries/liblmdb/mtest6.c +141 -0
  68. package/dependencies/lmdb-data-v1/libraries/liblmdb/sample-bdb.txt +73 -0
  69. package/dependencies/lmdb-data-v1/libraries/liblmdb/sample-mdb.txt +62 -0
  70. package/dependencies/lmdb-data-v1/libraries/liblmdb/tooltag +27 -0
  71. package/dependencies/lz4/LICENSE +11 -0
  72. package/dependencies/lz4/lib/LICENSE +24 -0
  73. package/dependencies/lz4/lib/README.md +137 -0
  74. package/dependencies/lz4/lib/dll/example/README.md +69 -0
  75. package/dependencies/lz4/lib/dll/example/fullbench-dll.sln +25 -0
  76. package/dependencies/lz4/lib/dll/example/fullbench-dll.vcxproj +182 -0
  77. package/dependencies/lz4/lib/dll/liblz4.def +62 -0
  78. package/dependencies/lz4/lib/liblz4-dll.rc.in +35 -0
  79. package/dependencies/lz4/lib/liblz4.pc.in +14 -0
  80. package/dependencies/lz4/lib/lz4.c +2495 -0
  81. package/dependencies/lz4/lib/lz4.h +774 -0
  82. package/dependencies/lz4/lib/lz4frame.c +1899 -0
  83. package/dependencies/lz4/lib/lz4frame.h +623 -0
  84. package/dependencies/lz4/lib/lz4frame_static.h +47 -0
  85. package/dependencies/lz4/lib/lz4hc.c +1615 -0
  86. package/dependencies/lz4/lib/lz4hc.h +413 -0
  87. package/dependencies/lz4/lib/xxhash.c +1030 -0
  88. package/dependencies/lz4/lib/xxhash.h +328 -0
  89. package/dependencies/v8/v8-fast-api-calls-v16.h +791 -0
  90. package/dependencies/v8/v8-fast-api-calls.h +888 -0
  91. package/dict/dict.txt +1 -0
  92. package/dict/dict2.txt +1 -0
  93. package/dist/index.cjs +2478 -0
  94. package/dist/index.cjs.map +1 -0
  95. package/index.d.ts +385 -0
  96. package/index.js +37 -0
  97. package/keys.js +102 -0
  98. package/level.js +27 -0
  99. package/native.js +82 -0
  100. package/node-index.js +28 -0
  101. package/open.js +414 -0
  102. package/package.json +70 -0
  103. package/read.js +590 -0
  104. package/rollup.config.js +12 -0
  105. package/src/compression.cpp +222 -0
  106. package/src/cursor.cpp +344 -0
  107. package/src/dbi.cpp +344 -0
  108. package/src/env.cpp +762 -0
  109. package/src/lmdb-js.cpp +64 -0
  110. package/src/lmdb-js.h +599 -0
  111. package/src/misc.cpp +324 -0
  112. package/src/ordered-binary.cpp +46 -0
  113. package/src/txn.cpp +257 -0
  114. package/src/v8-functions.cpp +166 -0
  115. package/src/windows.c +35 -0
  116. package/src/writer.cpp +452 -0
  117. package/util/RangeIterable.js +141 -0
  118. package/util/set-optional-deps.cjs +10 -0
  119. package/util/when.js +8 -0
  120. package/write.js +882 -0
package/src/dbi.cpp ADDED
@@ -0,0 +1,344 @@
1
+ #include "lmdb-js.h"
2
+ #include <cstdio>
3
+
4
+ using namespace Napi;
5
+
6
+ void setFlagFromValue(int *flags, int flag, const char *name, bool defaultValue, Object options);
7
+
8
+ DbiWrap::DbiWrap(const Napi::CallbackInfo& info) : ObjectWrap<DbiWrap>(info) {
9
+ this->dbi = 0;
10
+ this->keyType = LmdbKeyType::DefaultKey;
11
+ this->compression = nullptr;
12
+ this->isOpen = false;
13
+ this->getFast = false;
14
+ this->ew = nullptr;
15
+ EnvWrap *ew;
16
+ napi_unwrap(info.Env(), info[0], (void**) &ew);
17
+ this->env = ew->env;
18
+ this->ew = ew;
19
+ int flags = info[1].As<Number>();
20
+ char* nameBytes;
21
+ std::string name;
22
+ if (info[2].IsString()) {
23
+ name = info[2].As<String>().Utf8Value();
24
+ nameBytes = (char*) name.c_str();
25
+ } else
26
+ nameBytes = nullptr;
27
+ LmdbKeyType keyType = (LmdbKeyType) info[3].As<Number>().Int32Value();
28
+ Compression* compression;
29
+ if (info[4].IsObject())
30
+ napi_unwrap(info.Env(), info[4], (void**) &compression);
31
+ else
32
+ compression = nullptr;
33
+ int rc = this->open(flags & ~HAS_VERSIONS, nameBytes, flags & HAS_VERSIONS,
34
+ keyType, compression);
35
+ //if (nameBytes)
36
+ //delete nameBytes;
37
+ if (rc) {
38
+ if (rc == MDB_NOTFOUND)
39
+ this->dbi = (MDB_dbi) 0xffffffff;
40
+ else {
41
+ //delete this;
42
+ throwLmdbError(info.Env(), rc);
43
+ return;
44
+ }
45
+ }
46
+ info.This().As<Object>().Set("dbi", Number::New(info.Env(), this->dbi));
47
+ info.This().As<Object>().Set("address", Number::New(info.Env(), (size_t) this));
48
+ }
49
+
50
+
51
+ DbiWrap::~DbiWrap() {
52
+ // Imagine the following JS:
53
+ // ------------------------
54
+ // var dbi1 = env.openDbi({ name: "hello" });
55
+ // var dbi2 = env.openDbi({ name: "hello" });
56
+ // dbi1.close();
57
+ // txn.putString(dbi2, "world");
58
+ // -----
59
+ // The above DbiWrap objects would both wrap the same MDB_dbi, and if closing the first one called mdb_dbi_close,
60
+ // that'd also render the second DbiWrap instance unusable.
61
+ //
62
+ // For this reason, we will never call mdb_dbi_close
63
+ // NOTE: according to LMDB authors, it is perfectly fine if mdb_dbi_close is never called on an MDB_dbi
64
+ }
65
+
66
+
67
+ int DbiWrap::open(int flags, char* name, bool hasVersions, LmdbKeyType keyType, Compression* compression) {
68
+ MDB_txn* txn = ew->getReadTxn();
69
+ this->hasVersions = hasVersions;
70
+ this->compression = compression;
71
+ this->keyType = keyType;
72
+ this->flags = flags;
73
+ flags &= ~HAS_VERSIONS;
74
+ int rc = txn ? mdb_dbi_open(txn, name, flags, &this->dbi) : EINVAL;
75
+ if (rc)
76
+ return rc;
77
+ this->isOpen = true;
78
+ if (keyType == LmdbKeyType::DefaultKey && name) { // use the fast compare, but can't do it if we have db table/names mixed in
79
+ mdb_set_compare(txn, dbi, compareFast);
80
+ }
81
+ return 0;
82
+ }
83
+
84
+ Value DbiWrap::close(const Napi::CallbackInfo& info) {
85
+ if (this->isOpen) {
86
+ mdb_dbi_close(this->env, this->dbi);
87
+ this->isOpen = false;
88
+ this->ew = nullptr;
89
+ }
90
+ else {
91
+ return throwError(info.Env(), "The Dbi is not open, you can't close it.");
92
+ }
93
+ return info.Env().Undefined();
94
+ }
95
+
96
+ Value DbiWrap::drop(const Napi::CallbackInfo& info) {
97
+ int del = 1;
98
+ int rc;
99
+ if (!this->isOpen) {
100
+ return throwError(info.Env(), "The Dbi is not open, you can't drop it.");
101
+ }
102
+
103
+ // Check if the database should be deleted
104
+ if (info.Length() == 1 && info[0].IsObject()) {
105
+ Napi::Object options = info[0].As<Object>();
106
+
107
+ // Just free pages
108
+ Napi::Value opt = options.Get("justFreePages");
109
+ del = opt.IsBoolean() ? !opt.As<Boolean>().Value() : 1;
110
+ }
111
+
112
+ // Drop database
113
+ rc = mdb_drop(ew->writeTxn->txn, dbi, del);
114
+ if (rc != 0) {
115
+ return throwLmdbError(info.Env(), rc);
116
+ }
117
+
118
+ // Only close database if del == 1
119
+ if (del == 1) {
120
+ isOpen = false;
121
+ ew = nullptr;
122
+ }
123
+ return info.Env().Undefined();
124
+ }
125
+
126
+ Value DbiWrap::stat(const Napi::CallbackInfo& info) {
127
+ MDB_stat stat;
128
+ mdb_stat(this->ew->getReadTxn(), dbi, &stat);
129
+ Object stats = Object::New(info.Env());
130
+ stats.Set("pageSize", Number::New(info.Env(), stat.ms_psize));
131
+ stats.Set("treeDepth", Number::New(info.Env(), stat.ms_depth));
132
+ stats.Set("treeBranchPageCount", Number::New(info.Env(), stat.ms_branch_pages));
133
+ stats.Set("treeLeafPageCount", Number::New(info.Env(), stat.ms_leaf_pages));
134
+ stats.Set("entryCount", Number::New(info.Env(), stat.ms_entries));
135
+ stats.Set("overflowPages", Number::New(info.Env(), stat.ms_overflow_pages));
136
+ return stats;
137
+ }
138
+
139
+
140
+ int32_t DbiWrap::doGetByBinary(uint32_t keySize) {
141
+ char* keyBuffer = ew->keyBuffer;
142
+ MDB_txn* txn = ew->getReadTxn();
143
+ MDB_val key, data;
144
+ key.mv_size = keySize;
145
+ key.mv_data = (void*) keyBuffer;
146
+
147
+ int result = mdb_get(txn, dbi, &key, &data);
148
+ if (result) {
149
+ if (result > 0)
150
+ return -result;
151
+ return result;
152
+ }
153
+ result = getVersionAndUncompress(data, this);
154
+ if (result)
155
+ valToBinaryFast(data, this);
156
+ if (data.mv_size < 0x80000000)
157
+ return data.mv_size;
158
+ *((uint32_t*)keyBuffer) = data.mv_size;
159
+ return -30000;
160
+ /*
161
+ alternately, if we want to send over the address, which can be used for direct access to the LMDB shared memory, but all benchmarking shows it is slower
162
+ *((size_t*) keyBuffer) = data.mv_size;
163
+ *((uint64_t*) (keyBuffer + 8)) = (uint64_t) data.mv_data;
164
+ return 0;*/
165
+ }
166
+
167
+ NAPI_FUNCTION(getByBinary) {
168
+ ARGS(2)
169
+ GET_INT64_ARG(0);
170
+ DbiWrap* dw = (DbiWrap*) i64;
171
+ uint32_t keySize;
172
+ GET_UINT32_ARG(keySize, 1);
173
+ RETURN_INT32(dw->doGetByBinary(keySize));
174
+ }
175
+
176
+ uint32_t getByBinaryFFI(double dwPointer, uint32_t keySize) {
177
+ DbiWrap* dw = (DbiWrap*) (size_t) dwPointer;
178
+ return dw->doGetByBinary(keySize);
179
+ }
180
+
181
+ napi_finalize noopDbi = [](napi_env, void *, void *) {
182
+ // Data belongs to LMDB, we shouldn't free it here
183
+ };
184
+ NAPI_FUNCTION(getSharedByBinary) {
185
+ ARGS(2)
186
+ GET_INT64_ARG(0);
187
+ DbiWrap* dw = (DbiWrap*) i64;
188
+ uint32_t keySize;
189
+ GET_UINT32_ARG(keySize, 1);
190
+ MDB_val key;
191
+ MDB_val data;
192
+ key.mv_size = keySize;
193
+ key.mv_data = (void*) dw->ew->keyBuffer;
194
+ MDB_txn* txn = dw->ew->getReadTxn();
195
+ int rc = mdb_get(txn, dw->dbi, &key, &data);
196
+ if (rc) {
197
+ if (rc == MDB_NOTFOUND) {
198
+ RETURN_UNDEFINED;
199
+ } else
200
+ return throwLmdbError(env, rc);
201
+ }
202
+ rc = getVersionAndUncompress(data, dw);
203
+ napi_create_external_buffer(env, data.mv_size,
204
+ (char*) data.mv_data, noopDbi, nullptr, &returnValue);
205
+ return returnValue;
206
+ }
207
+ NAPI_FUNCTION(getStringByBinary) {
208
+ ARGS(2)
209
+ GET_INT64_ARG(0);
210
+ DbiWrap* dw = (DbiWrap*) i64;
211
+ uint32_t keySize;
212
+ GET_UINT32_ARG(keySize, 1);
213
+ MDB_val key;
214
+ MDB_val data;
215
+ key.mv_size = keySize;
216
+ key.mv_data = (void*) dw->ew->keyBuffer;
217
+ MDB_txn* txn = dw->ew->getReadTxn();
218
+ int rc = mdb_get(txn, dw->dbi, &key, &data);
219
+ if (rc) {
220
+ if (rc == MDB_NOTFOUND) {
221
+ RETURN_UNDEFINED;
222
+ } else
223
+ return throwLmdbError(env, rc);
224
+ }
225
+ rc = getVersionAndUncompress(data, dw);
226
+ if (rc)
227
+ napi_create_string_utf8(env, (char*) data.mv_data, data.mv_size, &returnValue);
228
+ else
229
+ napi_create_int32(env, data.mv_size, &returnValue);
230
+ return returnValue;
231
+ }
232
+
233
+ int DbiWrap::prefetch(uint32_t* keys) {
234
+ MDB_txn* txn;
235
+ mdb_txn_begin(ew->env, nullptr, MDB_RDONLY, &txn);
236
+ MDB_val key;
237
+ MDB_val data;
238
+ unsigned int flags;
239
+ mdb_dbi_flags(txn, dbi, &flags);
240
+ bool dupSort = flags & MDB_DUPSORT;
241
+ int effected = 0;
242
+ MDB_cursor *cursor;
243
+ int rc = mdb_cursor_open(txn, dbi, &cursor);
244
+ if (rc)
245
+ return rc;
246
+ while((key.mv_size = *keys++) > 0) {
247
+ if (key.mv_size == 0xffffffff) {
248
+ // it is a pointer to a new buffer
249
+ keys = (uint32_t*) (size_t) *((double*) keys); // read as a double pointer
250
+ key.mv_size = *keys++;
251
+ if (key.mv_size == 0)
252
+ break;
253
+ }
254
+ key.mv_data = (void*) keys;
255
+ keys += (key.mv_size + 12) >> 2;
256
+ int rc = mdb_cursor_get(cursor, &key, &data, MDB_SET_KEY);
257
+ while (!rc) {
258
+ // access one byte from each of the pages to ensure they are in the OS cache,
259
+ // potentially triggering the hard page fault in this thread
260
+ int pages = (data.mv_size + 0xfff) >> 12;
261
+ // TODO: Adjust this for the page headers, I believe that makes the first page slightly less 4KB.
262
+ for (int i = 0; i < pages; i++) {
263
+ effected += *(((uint8_t*)data.mv_data) + (i << 12));
264
+ }
265
+ if (dupSort) // in dupsort databases, access the rest of the values
266
+ rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT_DUP);
267
+ else
268
+ rc = 1; // done
269
+ }
270
+ }
271
+ mdb_cursor_close(cursor);
272
+ mdb_txn_abort(txn);
273
+ return effected;
274
+ }
275
+
276
+ class PrefetchWorker : public AsyncWorker {
277
+ public:
278
+ PrefetchWorker(DbiWrap* dw, uint32_t* keys, const Function& callback)
279
+ : AsyncWorker(callback), dw(dw), keys(keys) {}
280
+
281
+ void Execute() {
282
+ dw->prefetch(keys);
283
+ }
284
+
285
+ void OnOK() {
286
+ Callback().Call({Env().Null()});
287
+ }
288
+
289
+ private:
290
+ DbiWrap* dw;
291
+ uint32_t* keys;
292
+ };
293
+
294
+ NAPI_FUNCTION(prefetchNapi) {
295
+ ARGS(3)
296
+ GET_INT64_ARG(0);
297
+ DbiWrap* dw = (DbiWrap*) i64;
298
+ napi_get_value_int64(env, args[1], &i64);
299
+ uint32_t* keys = (uint32_t*) i64;
300
+ PrefetchWorker* worker = new PrefetchWorker(dw, keys, Function(env, args[2]));
301
+ worker->Queue();
302
+ RETURN_UNDEFINED;
303
+ }
304
+
305
+ void DbiWrap::setupExports(Napi::Env env, Object exports) {
306
+ Function DbiClass = DefineClass(env, "Dbi", {
307
+ // DbiWrap: Prepare constructor template
308
+ // DbiWrap: Add functions to the prototype
309
+ DbiWrap::InstanceMethod("close", &DbiWrap::close),
310
+ DbiWrap::InstanceMethod("drop", &DbiWrap::drop),
311
+ DbiWrap::InstanceMethod("stat", &DbiWrap::stat),
312
+ });
313
+ exports.Set("Dbi", DbiClass);
314
+ EXPORT_NAPI_FUNCTION("getByBinary", getByBinary);
315
+ EXPORT_NAPI_FUNCTION("prefetch", prefetchNapi);
316
+ EXPORT_NAPI_FUNCTION("getStringByBinary", getStringByBinary);
317
+ EXPORT_NAPI_FUNCTION("getSharedByBinary", getSharedByBinary);
318
+ EXPORT_FUNCTION_ADDRESS("getByBinaryPtr", getByBinaryFFI);
319
+ // TODO: wrap mdb_stat too
320
+ }
321
+
322
+ // This file contains code from the node-lmdb project
323
+ // Copyright (c) 2013-2017 Timur Kristóf
324
+ // Copyright (c) 2021 Kristopher Tate
325
+ // Licensed to you under the terms of the MIT license
326
+ //
327
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
328
+ // of this software and associated documentation files (the "Software"), to deal
329
+ // in the Software without restriction, including without limitation the rights
330
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
331
+ // copies of the Software, and to permit persons to whom the Software is
332
+ // furnished to do so, subject to the following conditions:
333
+
334
+ // The above copyright notice and this permission notice shall be included in
335
+ // all copies or substantial portions of the Software.
336
+
337
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
338
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
339
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
340
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
341
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
342
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
343
+ // THE SOFTWARE.
344
+