diff options
author | Li Jin <dragon-fly@qq.com> | 2020-06-22 16:50:40 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-06-22 16:50:40 +0800 |
commit | cd2b60b101a398cb9356d746364e70eaed1860f1 (patch) | |
tree | a1fe71b76faabc4883f16905a94164ce5c23e692 /src/lua/ltable.h | |
parent | 88c1052e700f38cf3d8ad82d469da4c487760b7e (diff) | |
download | yuescript-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.h | 57 |
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 | |||
33 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); | ||
34 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, | ||
35 | TValue *value); | ||
36 | LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); | ||
37 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); | ||
38 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); | ||
39 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); | ||
40 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); | ||
41 | LUAI_FUNC Table *luaH_new (lua_State *L); | ||
42 | LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, | ||
43 | unsigned int nhsize); | ||
44 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); | ||
45 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); | ||
46 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); | ||
47 | LUAI_FUNC lua_Unsigned luaH_getn (Table *t); | ||
48 | LUAI_FUNC unsigned int luaH_realasize (const Table *t); | ||
49 | |||
50 | |||
51 | #if defined(LUA_DEBUG) | ||
52 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); | ||
53 | LUAI_FUNC int luaH_isdummy (const Table *t); | ||
54 | #endif | ||
55 | |||
56 | |||
57 | #endif | ||