diff options
Diffstat (limited to 'ltable.h')
-rw-r--r-- | ltable.h | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 | |||
54 | LUAI_FUNC int luaH_getshortstr1 (Table *t, TString *key, TValue *res); | ||
55 | LUAI_FUNC int luaH_getstr1 (Table *t, TString *key, TValue *res); | ||
56 | LUAI_FUNC int luaH_get1 (Table *t, const TValue *key, TValue *res); | ||
57 | LUAI_FUNC int luaH_getint1 (Table *t, lua_Integer key, TValue *res); | ||
58 | |||
38 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); | 59 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); |
39 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, | 60 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, |
40 | TValue *value); | 61 | TValue *value); |