Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/VM/include/lua.h
2725 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
// This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3
#pragma once
4
5
#include <stdarg.h>
6
#include <stddef.h>
7
#include <stdint.h>
8
9
#include "luaconf.h"
10
11
12
13
// option for multiple returns in `lua_pcall' and `lua_call'
14
#define LUA_MULTRET (-1)
15
16
/*
17
** pseudo-indices
18
*/
19
#define LUA_REGISTRYINDEX (-LUAI_MAXCSTACK - 2000)
20
#define LUA_ENVIRONINDEX (-LUAI_MAXCSTACK - 2001)
21
#define LUA_GLOBALSINDEX (-LUAI_MAXCSTACK - 2002)
22
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX - (i))
23
#define lua_ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
24
25
// thread status; 0 is OK
26
enum lua_Status
27
{
28
LUA_OK = 0,
29
LUA_YIELD,
30
LUA_ERRRUN,
31
LUA_ERRSYNTAX, // legacy error code, preserved for compatibility
32
LUA_ERRMEM,
33
LUA_ERRERR,
34
LUA_BREAK, // yielded for a debug breakpoint
35
};
36
37
enum lua_CoStatus
38
{
39
LUA_CORUN = 0, // running
40
LUA_COSUS, // suspended
41
LUA_CONOR, // 'normal' (it resumed another coroutine)
42
LUA_COFIN, // finished
43
LUA_COERR, // finished with error
44
};
45
46
typedef struct lua_State lua_State;
47
48
typedef int (*lua_CFunction)(lua_State* L);
49
typedef int (*lua_Continuation)(lua_State* L, int status);
50
51
/*
52
** prototype for memory-allocation functions
53
*/
54
55
typedef void* (*lua_Alloc)(void* ud, void* ptr, size_t osize, size_t nsize);
56
57
// non-return type
58
#define l_noret void LUA_NORETURN
59
60
/*
61
** basic types
62
*/
63
#define LUA_TNONE (-1)
64
65
/*
66
* WARNING: if you change the order of this enumeration,
67
* grep "ORDER TYPE"
68
*/
69
// clang-format off
70
enum lua_Type
71
{
72
LUA_TNIL = 0, // must be 0 due to lua_isnoneornil
73
LUA_TBOOLEAN = 1, // must be 1 due to l_isfalse
74
75
LUA_TLIGHTUSERDATA,
76
LUA_TNUMBER,
77
LUA_TINTEGER,
78
LUA_TVECTOR,
79
80
LUA_TSTRING, // all types above this must be value types, all types below this must be GC types - see iscollectable
81
82
LUA_TTABLE,
83
LUA_TFUNCTION,
84
LUA_TUSERDATA,
85
LUA_TTHREAD,
86
LUA_TBUFFER,
87
88
// values below this line are used in GCObject tags but may never show up in TValue type tags
89
LUA_TPROTO,
90
LUA_TUPVAL,
91
LUA_TDEADKEY,
92
93
// the count of TValue type tags
94
LUA_T_COUNT = LUA_TPROTO
95
};
96
// clang-format on
97
98
// type of numbers in Luau
99
typedef double lua_Number;
100
101
// type for integer functions
102
typedef int lua_Integer;
103
104
// unsigned integer type
105
typedef unsigned lua_Unsigned;
106
107
/*
108
** state manipulation
109
*/
110
LUA_API lua_State* lua_newstate(lua_Alloc f, void* ud);
111
LUA_API void lua_close(lua_State* L);
112
LUA_API lua_State* lua_newthread(lua_State* L);
113
LUA_API lua_State* lua_mainthread(lua_State* L);
114
LUA_API void lua_resetthread(lua_State* L);
115
LUA_API int lua_isthreadreset(lua_State* L);
116
117
/*
118
** basic stack manipulation
119
*/
120
LUA_API int lua_absindex(lua_State* L, int idx);
121
LUA_API int lua_gettop(lua_State* L);
122
LUA_API void lua_settop(lua_State* L, int idx);
123
LUA_API void lua_pushvalue(lua_State* L, int idx);
124
LUA_API void lua_remove(lua_State* L, int idx);
125
LUA_API void lua_insert(lua_State* L, int idx);
126
LUA_API void lua_replace(lua_State* L, int idx);
127
LUA_API int lua_checkstack(lua_State* L, int sz);
128
LUA_API void lua_rawcheckstack(lua_State* L, int sz); // allows for unlimited stack frames
129
130
LUA_API void lua_xmove(lua_State* from, lua_State* to, int n);
131
LUA_API void lua_xpush(lua_State* from, lua_State* to, int idx);
132
133
/*
134
** access functions (stack -> C)
135
*/
136
137
LUA_API int lua_isnumber(lua_State* L, int idx);
138
LUA_API int lua_isstring(lua_State* L, int idx);
139
LUA_API int lua_isinteger64(lua_State* L, int idx);
140
LUA_API int lua_iscfunction(lua_State* L, int idx);
141
LUA_API int lua_isLfunction(lua_State* L, int idx);
142
LUA_API int lua_isuserdata(lua_State* L, int idx);
143
LUA_API int lua_type(lua_State* L, int idx);
144
LUA_API const char* lua_typename(lua_State* L, int tp);
145
146
LUA_API int lua_equal(lua_State* L, int idx1, int idx2);
147
LUA_API int lua_rawequal(lua_State* L, int idx1, int idx2);
148
LUA_API int lua_lessthan(lua_State* L, int idx1, int idx2);
149
150
LUA_API double lua_tonumberx(lua_State* L, int idx, int* isnum);
151
LUA_API int lua_tointegerx(lua_State* L, int idx, int* isnum);
152
LUA_API unsigned lua_tounsignedx(lua_State* L, int idx, int* isnum);
153
LUA_API const float* lua_tovector(lua_State* L, int idx);
154
LUA_API int lua_toboolean(lua_State* L, int idx);
155
LUA_API int64_t lua_tointeger64(lua_State* L, int idx, int* isinteger);
156
LUA_API const char* lua_tolstring(lua_State* L, int idx, size_t* len);
157
LUA_API const char* lua_tostringatom(lua_State* L, int idx, int* atom);
158
LUA_API const char* lua_tolstringatom(lua_State* L, int idx, size_t* len, int* atom);
159
LUA_API const char* lua_namecallatom(lua_State* L, int* atom);
160
LUA_API int lua_objlen(lua_State* L, int idx);
161
LUA_API lua_CFunction lua_tocfunction(lua_State* L, int idx);
162
LUA_API void* lua_tolightuserdata(lua_State* L, int idx);
163
LUA_API void* lua_tolightuserdatatagged(lua_State* L, int idx, int tag);
164
LUA_API void* lua_touserdata(lua_State* L, int idx);
165
LUA_API void* lua_touserdatatagged(lua_State* L, int idx, int tag);
166
LUA_API int lua_userdatatag(lua_State* L, int idx);
167
LUA_API int lua_lightuserdatatag(lua_State* L, int idx);
168
LUA_API lua_State* lua_tothread(lua_State* L, int idx);
169
LUA_API void* lua_tobuffer(lua_State* L, int idx, size_t* len);
170
LUA_API const void* lua_topointer(lua_State* L, int idx);
171
172
/*
173
** push functions (C -> stack)
174
*/
175
LUA_API void lua_pushnil(lua_State* L);
176
LUA_API void lua_pushnumber(lua_State* L, double n);
177
LUA_API void lua_pushinteger(lua_State* L, int n);
178
LUA_API void lua_pushinteger64(lua_State* L, int64_t n);
179
LUA_API void lua_pushunsigned(lua_State* L, unsigned n);
180
#if LUA_VECTOR_SIZE == 4
181
LUA_API void lua_pushvector(lua_State* L, float x, float y, float z, float w);
182
#else
183
LUA_API void lua_pushvector(lua_State* L, float x, float y, float z);
184
#endif
185
LUA_API void lua_pushlstring(lua_State* L, const char* s, size_t l);
186
LUA_API void lua_pushstring(lua_State* L, const char* s);
187
LUA_API const char* lua_pushvfstring(lua_State* L, const char* fmt, va_list argp);
188
LUA_API LUA_PRINTF_ATTR(2, 3) const char* lua_pushfstringL(lua_State* L, const char* fmt, ...);
189
LUA_API void lua_pushcclosurek(lua_State* L, lua_CFunction fn, const char* debugname, int nup, lua_Continuation cont);
190
LUA_API void lua_pushboolean(lua_State* L, int b);
191
LUA_API int lua_pushthread(lua_State* L);
192
193
LUA_API void lua_pushlightuserdatatagged(lua_State* L, void* p, int tag);
194
LUA_API void* lua_newuserdatatagged(lua_State* L, size_t sz, int tag);
195
LUA_API void* lua_newuserdatataggedwithmetatable(lua_State* L, size_t sz, int tag); // metatable fetched with lua_getuserdatametatable
196
LUA_API void* lua_newuserdatadtor(lua_State* L, size_t sz, void (*dtor)(void*));
197
198
LUA_API void* lua_newbuffer(lua_State* L, size_t sz);
199
200
/*
201
** get functions (Lua -> stack)
202
*/
203
LUA_API int lua_gettable(lua_State* L, int idx);
204
LUA_API int lua_getfield(lua_State* L, int idx, const char* k);
205
LUA_API int lua_rawgetfield(lua_State* L, int idx, const char* k);
206
LUA_API int lua_rawget(lua_State* L, int idx);
207
LUA_API int lua_rawgeti(lua_State* L, int idx, int n);
208
LUA_API int lua_rawgetptagged(lua_State* L, int idx, void* p, int tag);
209
LUA_API void lua_createtable(lua_State* L, int narr, int nrec);
210
211
LUA_API void lua_setreadonly(lua_State* L, int idx, int enabled);
212
LUA_API int lua_getreadonly(lua_State* L, int idx);
213
LUA_API void lua_setsafeenv(lua_State* L, int idx, int enabled);
214
215
LUA_API int lua_getmetatable(lua_State* L, int objindex);
216
LUA_API void lua_getfenv(lua_State* L, int idx);
217
218
/*
219
** set functions (stack -> Lua)
220
*/
221
LUA_API void lua_settable(lua_State* L, int idx);
222
LUA_API void lua_setfield(lua_State* L, int idx, const char* k);
223
LUA_API void lua_rawsetfield(lua_State* L, int idx, const char* k);
224
LUA_API void lua_rawset(lua_State* L, int idx);
225
LUA_API void lua_rawseti(lua_State* L, int idx, int n);
226
LUA_API void lua_rawsetptagged(lua_State* L, int idx, void* p, int tag);
227
LUA_API int lua_setmetatable(lua_State* L, int objindex);
228
LUA_API int lua_setfenv(lua_State* L, int idx);
229
230
/*
231
** `load' and `call' functions (load and run Luau bytecode)
232
*/
233
LUA_API int luau_load(lua_State* L, const char* chunkname, const char* data, size_t size, int env);
234
LUA_API void lua_call(lua_State* L, int nargs, int nresults);
235
LUA_API int lua_pcall(lua_State* L, int nargs, int nresults, int errfunc);
236
LUA_API int lua_cpcall(lua_State* L, lua_CFunction func, void* ud);
237
238
/*
239
** coroutine functions
240
*/
241
LUA_API int lua_yield(lua_State* L, int nresults);
242
LUA_API int lua_break(lua_State* L);
243
LUA_API int lua_resume(lua_State* L, lua_State* from, int narg);
244
LUA_API int lua_resumeerror(lua_State* L, lua_State* from);
245
LUA_API int lua_status(lua_State* L);
246
LUA_API int lua_isyieldable(lua_State* L);
247
LUA_API void* lua_getthreaddata(lua_State* L);
248
LUA_API void lua_setthreaddata(lua_State* L, void* data);
249
LUA_API int lua_costatus(lua_State* L, lua_State* co);
250
251
/*
252
** garbage-collection function and options
253
*/
254
255
enum lua_GCOp
256
{
257
// stop and resume incremental garbage collection
258
LUA_GCSTOP,
259
LUA_GCRESTART,
260
261
// run a full GC cycle; not recommended for latency sensitive applications
262
LUA_GCCOLLECT,
263
264
// return the heap size in KB and the remainder in bytes
265
LUA_GCCOUNT,
266
LUA_GCCOUNTB,
267
268
// return 1 if GC is active (not stopped); note that GC may not be actively collecting even if it's running
269
LUA_GCISRUNNING,
270
271
/*
272
** perform an explicit GC step, with the step size specified in KB
273
**
274
** garbage collection is handled by 'assists' that perform some amount of GC work matching pace of allocation
275
** explicit GC steps allow to perform some amount of work at custom points to offset the need for GC assists
276
** note that GC might also be paused for some duration (until bytes allocated meet the threshold)
277
** if an explicit step is performed during this pause, it will trigger the start of the next collection cycle
278
*/
279
LUA_GCSTEP,
280
281
/*
282
** tune GC parameters G (goal), S (step multiplier) and step size (usually best left ignored)
283
**
284
** garbage collection is incremental and tries to maintain the heap size to balance memory and performance overhead
285
** this overhead is determined by G (goal) which is the ratio between total heap size and the amount of live data in it
286
** G is specified in percentages; by default G=200% which means that the heap is allowed to grow to ~2x the size of live data.
287
**
288
** collector tries to collect S% of allocated bytes by interrupting the application after step size bytes were allocated.
289
** when S is too small, collector may not be able to catch up and the effective goal that can be reached will be larger.
290
** S is specified in percentages; by default S=200% which means that collector will run at ~2x the pace of allocations.
291
**
292
** it is recommended to set S in the interval [100 / (G - 100), 100 + 100 / (G - 100))] with a minimum value of 150%; for example:
293
** - for G=200%, S should be in the interval [150%, 200%]
294
** - for G=150%, S should be in the interval [200%, 300%]
295
** - for G=125%, S should be in the interval [400%, 500%]
296
*/
297
LUA_GCSETGOAL,
298
LUA_GCSETSTEPMUL,
299
LUA_GCSETSTEPSIZE,
300
};
301
302
LUA_API int lua_gc(lua_State* L, int what, int data);
303
304
/*
305
** memory statistics
306
** all allocated bytes are attributed to the memory category of the running thread (0..LUA_MEMORY_CATEGORIES-1)
307
*/
308
309
LUA_API void lua_setmemcat(lua_State* L, int category);
310
LUA_API size_t lua_totalbytes(lua_State* L, int category);
311
312
/*
313
** miscellaneous functions
314
*/
315
316
LUA_API l_noret lua_error(lua_State* L);
317
318
LUA_API int lua_next(lua_State* L, int idx);
319
LUA_API int lua_rawiter(lua_State* L, int idx, int iter);
320
321
LUA_API void lua_concat(lua_State* L, int n);
322
323
LUA_API uintptr_t lua_encodepointer(lua_State* L, uintptr_t p);
324
325
LUA_API double lua_clock();
326
327
LUA_API void lua_setuserdatatag(lua_State* L, int idx, int tag);
328
329
typedef void (*lua_Destructor)(lua_State* L, void* userdata);
330
331
LUA_API void lua_setuserdatadtor(lua_State* L, int tag, lua_Destructor dtor);
332
LUA_API lua_Destructor lua_getuserdatadtor(lua_State* L, int tag);
333
334
// alternative access for metatables already registered with luaL_newmetatable
335
// used by lua_newuserdatataggedwithmetatable to create tagged userdata with the associated metatable assigned
336
LUA_API void lua_setuserdatametatable(lua_State* L, int tag);
337
LUA_API void lua_getuserdatametatable(lua_State* L, int tag);
338
339
LUA_API void lua_setlightuserdataname(lua_State* L, int tag, const char* name);
340
LUA_API const char* lua_getlightuserdataname(lua_State* L, int tag);
341
342
LUA_API void lua_clonefunction(lua_State* L, int idx);
343
344
LUA_API void lua_cleartable(lua_State* L, int idx);
345
LUA_API void lua_clonetable(lua_State* L, int idx);
346
347
LUA_API lua_Alloc lua_getallocf(lua_State* L, void** ud);
348
349
/*
350
** reference system, can be used to pin objects
351
*/
352
#define LUA_NOREF -1
353
#define LUA_REFNIL 0
354
355
LUA_API int lua_ref(lua_State* L, int idx);
356
LUA_API void lua_unref(lua_State* L, int ref);
357
358
#define lua_getref(L, ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
359
360
/*
361
** ===============================================================
362
** some useful macros
363
** ===============================================================
364
*/
365
#define lua_tonumber(L, i) lua_tonumberx(L, i, NULL)
366
#define lua_tointeger(L, i) lua_tointegerx(L, i, NULL)
367
#define lua_tounsigned(L, i) lua_tounsignedx(L, i, NULL)
368
369
#define lua_pop(L, n) lua_settop(L, -(n)-1)
370
371
#define lua_newtable(L) lua_createtable(L, 0, 0)
372
#define lua_newuserdata(L, s) lua_newuserdatatagged(L, s, 0)
373
374
#define lua_strlen(L, i) lua_objlen(L, (i))
375
376
#define lua_isfunction(L, n) (lua_type(L, (n)) == LUA_TFUNCTION)
377
#define lua_istable(L, n) (lua_type(L, (n)) == LUA_TTABLE)
378
#define lua_islightuserdata(L, n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
379
#define lua_isnil(L, n) (lua_type(L, (n)) == LUA_TNIL)
380
#define lua_isboolean(L, n) (lua_type(L, (n)) == LUA_TBOOLEAN)
381
#define lua_isinteger64(L, n) (lua_type(L, (n)) == LUA_TINTEGER)
382
#define lua_isvector(L, n) (lua_type(L, (n)) == LUA_TVECTOR)
383
#define lua_isthread(L, n) (lua_type(L, (n)) == LUA_TTHREAD)
384
#define lua_isbuffer(L, n) (lua_type(L, (n)) == LUA_TBUFFER)
385
#define lua_isnone(L, n) (lua_type(L, (n)) == LUA_TNONE)
386
#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= LUA_TNIL)
387
388
#define lua_pushliteral(L, s) lua_pushlstring(L, "" s, (sizeof(s) / sizeof(char)) - 1)
389
#define lua_pushcfunction(L, fn, debugname) lua_pushcclosurek(L, fn, debugname, 0, NULL)
390
#define lua_pushcclosure(L, fn, debugname, nup) lua_pushcclosurek(L, fn, debugname, nup, NULL)
391
#define lua_pushlightuserdata(L, p) lua_pushlightuserdatatagged(L, p, 0)
392
393
#define lua_rawgetp(L, idx, p) lua_rawgetptagged(L, idx, p, 0)
394
#define lua_rawsetp(L, idx, p) lua_rawsetptagged(L, idx, p, 0)
395
396
#define lua_setglobal(L, s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
397
#define lua_getglobal(L, s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
398
399
#define lua_tostring(L, i) lua_tolstring(L, (i), NULL)
400
401
#define lua_pushfstring(L, fmt, ...) lua_pushfstringL(L, fmt, ##__VA_ARGS__)
402
403
/*
404
** {======================================================================
405
** Debug API
406
** =======================================================================
407
*/
408
409
typedef struct lua_Debug lua_Debug; // activation record
410
411
// Functions to be called by the debugger in specific events
412
typedef void (*lua_Hook)(lua_State* L, lua_Debug* ar);
413
414
LUA_API int lua_stackdepth(lua_State* L);
415
LUA_API int lua_getinfo(lua_State* L, int level, const char* what, lua_Debug* ar);
416
LUA_API int lua_getargument(lua_State* L, int level, int n);
417
LUA_API const char* lua_getlocal(lua_State* L, int level, int n);
418
LUA_API const char* lua_setlocal(lua_State* L, int level, int n);
419
LUA_API const char* lua_getupvalue(lua_State* L, int funcindex, int n);
420
LUA_API const char* lua_setupvalue(lua_State* L, int funcindex, int n);
421
422
LUA_API void lua_singlestep(lua_State* L, int enabled);
423
LUA_API int lua_breakpoint(lua_State* L, int funcindex, int line, int enabled);
424
425
typedef void (*lua_Coverage)(void* context, const char* function, int linedefined, int depth, const int* hits, size_t size);
426
427
LUA_API void lua_getcoverage(lua_State* L, int funcindex, void* context, lua_Coverage callback);
428
429
typedef void (*lua_CounterFunction)(void* context, const char* function, int linedefined);
430
typedef void (*lua_CounterValue)(void* context, int kind, int line, uint64_t hits);
431
432
// Unlike 'lua_getcoverage', counters are customizable in ways which prevent merging them together
433
// 'lua_getcounters' will visit the specified function and all nested functions
434
// 'functionvisit' is called first to establish a function, then multiple calls of 'countervisit' are made for each counter in that function
435
LUA_API void lua_getcounters(lua_State* L, int funcindex, void* context, lua_CounterFunction functionvisit, lua_CounterValue countervisit);
436
437
// Warning: this function is not thread-safe since it stores the result in a shared global array! Only use for debugging.
438
LUA_API const char* lua_debugtrace(lua_State* L);
439
440
struct lua_Debug
441
{
442
const char* name; // (n)
443
const char* what; // (s) `Lua', `C', `main', `tail'
444
const char* source; // (s)
445
const char* short_src; // (s)
446
int linedefined; // (s)
447
int currentline; // (l)
448
unsigned char nupvals; // (u) number of upvalues
449
unsigned char nparams; // (a) number of parameters
450
char isvararg; // (a)
451
void* userdata; // only valid in luau_callhook
452
453
char ssbuf[LUA_IDSIZE];
454
};
455
456
// }======================================================================
457
458
/* Callbacks that can be used to reconfigure behavior of the VM dynamically.
459
* These are shared between all coroutines.
460
*
461
* Note: interrupt is safe to set from an arbitrary thread but all other callbacks
462
* can only be changed when the VM is not running any code */
463
struct lua_Callbacks
464
{
465
void* userdata; // arbitrary userdata pointer that is never overwritten by Luau
466
467
void (*interrupt)(lua_State* L, int gc); // gets called at safepoints (loop back edges, call/ret, gc) if set
468
void (*panic)(lua_State* L, int errcode); // gets called when an unprotected error is raised (if longjmp is used)
469
470
void (*userthread)(lua_State* LP, lua_State* L); // gets called when L is created (LP == parent) or destroyed (LP == NULL)
471
int16_t (*useratom)(lua_State* L, const char* s, size_t l); // gets called when a string is created to assign an atom id
472
473
void (*debugbreak)(lua_State* L, lua_Debug* ar); // gets called when BREAK instruction is encountered
474
void (*debugstep)(lua_State* L, lua_Debug* ar); // gets called after each instruction in single step mode
475
void (*debuginterrupt)(lua_State* L, lua_Debug* ar); // gets called when thread execution is interrupted by break in another thread
476
void (*debugprotectederror)(lua_State* L); // gets called when protected call results in an error
477
478
void (*onallocate)(lua_State* L, size_t osize, size_t nsize); // gets called when memory is allocated
479
};
480
typedef struct lua_Callbacks lua_Callbacks;
481
482
LUA_API lua_Callbacks* lua_callbacks(lua_State* L);
483
484
/******************************************************************************
485
* Copyright (c) 2019-2023 Roblox Corporation
486
* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
487
*
488
* Permission is hereby granted, free of charge, to any person obtaining
489
* a copy of this software and associated documentation files (the
490
* "Software"), to deal in the Software without restriction, including
491
* without limitation the rights to use, copy, modify, merge, publish,
492
* distribute, sublicense, and/or sell copies of the Software, and to
493
* permit persons to whom the Software is furnished to do so, subject to
494
* the following conditions:
495
*
496
* The above copyright notice and this permission notice shall be
497
* included in all copies or substantial portions of the Software.
498
*
499
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
500
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
501
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
502
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
503
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
504
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
505
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
506
******************************************************************************/
507
508