aboutsummaryrefslogtreecommitdiff
path: root/ltable.h
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.h')
-rw-r--r--ltable.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/ltable.h b/ltable.h
index 75dd9e26..c8a8c5e7 100644
--- a/ltable.h
+++ b/ltable.h
@@ -35,6 +35,27 @@
35#define nodefromval(v) cast(Node *, (v)) 35#define nodefromval(v) cast(Node *, (v))
36 36
37 37
38/* results from get/set */
39#define HOK 0
40#define HNOTFOUND 1
41#define HNOTATABLE 2
42
43
44/* fast access to components of array values */
45#define getArrTag(t,k) (&(t)->array[k - 1].tt_)
46#define getArrVal(t,k) (&(t)->array[k - 1].value_)
47
48#define tagisempty(tag) (novariant(tag) == LUA_TNIL)
49
50#define arr2val(h,k,tag,res) \
51 ((res)->tt_ = tag, (res)->value_ = *getArrVal(h,k))
52
53
54LUAI_FUNC int luaH_getshortstr1 (Table *t, TString *key, TValue *res);
55LUAI_FUNC int luaH_getstr1 (Table *t, TString *key, TValue *res);
56LUAI_FUNC int luaH_get1 (Table *t, const TValue *key, TValue *res);
57LUAI_FUNC int luaH_getint1 (Table *t, lua_Integer key, TValue *res);
58
38LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); 59LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
39LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, 60LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
40 TValue *value); 61 TValue *value);