aboutsummaryrefslogtreecommitdiff
path: root/src/lua/ltable.h
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-06-22 16:50:40 +0800
committerLi Jin <dragon-fly@qq.com>2020-06-22 16:50:40 +0800
commitcd2b60b101a398cb9356d746364e70eaed1860f1 (patch)
treea1fe71b76faabc4883f16905a94164ce5c23e692 /src/lua/ltable.h
parent88c1052e700f38cf3d8ad82d469da4c487760b7e (diff)
downloadyuescript-cd2b60b101a398cb9356d746364e70eaed1860f1.tar.gz
yuescript-cd2b60b101a398cb9356d746364e70eaed1860f1.tar.bz2
yuescript-cd2b60b101a398cb9356d746364e70eaed1860f1.zip
add support for local variable declared with attribute 'close' and 'const' for Lua 5.4.
Diffstat (limited to 'src/lua/ltable.h')
-rw-r--r--src/lua/ltable.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/lua/ltable.h b/src/lua/ltable.h
new file mode 100644
index 0000000..ebd7f8e
--- /dev/null
+++ b/src/lua/ltable.h
@@ -0,0 +1,57 @@
1/*
2** $Id: ltable.h $
3** Lua tables (hash)
4** See Copyright Notice in lua.h
5*/
6
7#ifndef ltable_h
8#define ltable_h
9
10#include "lobject.h"
11
12
13#define gnode(t,i) (&(t)->node[i])
14#define gval(n) (&(n)->i_val)
15#define gnext(n) ((n)->u.next)
16
17
18#define invalidateTMcache(t) ((t)->flags = 0)
19
20
21/* true when 't' is using 'dummynode' as its hash part */
22#define isdummy(t) ((t)->lastfree == NULL)
23
24
25/* allocated size for hash nodes */
26#define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t))
27
28
29/* returns the Node, given the value of a table entry */
30#define nodefromval(v) cast(Node *, (v))
31
32
33LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
34LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
35 TValue *value);
36LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
37LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
38LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
39LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);
40LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
41LUAI_FUNC Table *luaH_new (lua_State *L);
42LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
43 unsigned int nhsize);
44LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize);
45LUAI_FUNC void luaH_free (lua_State *L, Table *t);
46LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
47LUAI_FUNC lua_Unsigned luaH_getn (Table *t);
48LUAI_FUNC unsigned int luaH_realasize (const Table *t);
49
50
51#if defined(LUA_DEBUG)
52LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
53LUAI_FUNC int luaH_isdummy (const Table *t);
54#endif
55
56
57#endif