diff options
Diffstat (limited to 'ltable.h')
-rw-r--r-- | ltable.h | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.h,v 1.12 1999/08/16 20:52:00 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 1.13 1999/10/04 17:51:04 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -11,20 +11,19 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | #define node(t,i) (&(t)->node[i]) | 13 | #define node(t,i) (&(t)->node[i]) |
14 | #define ref(n) (&(n)->ref) | 14 | #define key(n) (&(n)->key) |
15 | #define val(n) (&(n)->val) | 15 | #define val(n) (&(n)->val) |
16 | #define nhash(t) ((t)->nhash) | ||
17 | 16 | ||
18 | #define luaH_get(t,ref) (val(luaH_present((t), (ref)))) | ||
19 | #define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from))) | 17 | #define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from))) |
20 | 18 | ||
21 | Hash *luaH_new (int nhash); | 19 | Hash *luaH_new (int nhash); |
22 | void luaH_free (Hash *t); | 20 | void luaH_free (Hash *t); |
23 | Node *luaH_present (const Hash *t, const TObject *key); | 21 | const TObject *luaH_get (const Hash *t, const TObject *key); |
24 | void luaH_set (Hash *t, const TObject *ref, const TObject *val); | 22 | void luaH_set (Hash *t, const TObject *key, const TObject *val); |
25 | int luaH_pos (const Hash *t, const TObject *r); | 23 | int luaH_pos (const Hash *t, const TObject *r); |
26 | void luaH_setint (Hash *t, int ref, const TObject *val); | 24 | void luaH_setint (Hash *t, int key, const TObject *val); |
27 | TObject *luaH_getint (const Hash *t, int ref); | 25 | const TObject *luaH_getint (const Hash *t, int key); |
26 | unsigned long luaH_hash (const TObject *key); /* exported only for debugging */ | ||
28 | 27 | ||
29 | 28 | ||
30 | #endif | 29 | #endif |