diff options
author | Lua Team <team@lua.org> | 2000-11-06 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2000-11-06 12:00:00 +0000 |
commit | 8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch) | |
tree | 25859eb162c67eafc46866e0ec3a9a7ebf93157a /src/ltable.h | |
parent | b7610da5fed99f59ac73ae452da8839a0f2c1bda (diff) | |
download | lua-github-4.0.tar.gz |
Lua 4.04.0
Diffstat (limited to 'src/ltable.h')
-rw-r--r-- | src/ltable.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/ltable.h b/src/ltable.h index 49b485f2..8ee41a81 100644 --- a/src/ltable.h +++ b/src/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 1.11 1999/02/23 14:57:28 roberto Exp $ +** $Id: ltable.h,v 1.24 2000/08/31 14:08:27 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -10,21 +10,25 @@ #include "lobject.h" -#define node(t,i) (&(t)->node[i]) -#define ref(n) (&(n)->ref) +#define node(t,i) (&(t)->node[i]) +#define key(n) (&(n)->key) #define val(n) (&(n)->val) -#define nhash(t) ((t)->nhash) - -#define luaH_get(t,ref) (val(luaH_present((t), (ref)))) -#define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from))) - -Hash *luaH_new (int nhash); -void luaH_free (Hash *frees); -Node *luaH_present (Hash *t, TObject *key); -void luaH_set (Hash *t, TObject *ref, TObject *val); -int luaH_pos (Hash *t, TObject *r); -void luaH_setint (Hash *t, int ref, TObject *val); -TObject *luaH_getint (Hash *t, int ref); + +Hash *luaH_new (lua_State *L, int nhash); +void luaH_free (lua_State *L, Hash *t); +const TObject *luaH_get (lua_State *L, const Hash *t, const TObject *key); +const TObject *luaH_getnum (const Hash *t, Number key); +const TObject *luaH_getstr (const Hash *t, TString *key); +void luaH_remove (Hash *t, TObject *key); +TObject *luaH_set (lua_State *L, Hash *t, const TObject *key); +Node * luaH_next (lua_State *L, const Hash *t, const TObject *r); +TObject *luaH_setint (lua_State *L, Hash *t, int key); +void luaH_setstrnum (lua_State *L, Hash *t, TString *key, Number val); +unsigned long luaH_hash (lua_State *L, const TObject *key); +const TObject *luaH_getglobal (lua_State *L, const char *name); + +/* exported only for debugging */ +Node *luaH_mainposition (const Hash *t, const TObject *key); #endif |