rlm@1: /* rlm@1: ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ rlm@1: ** Lua tables (hash) rlm@1: ** See Copyright Notice in lua.h rlm@1: */ rlm@1: rlm@1: #ifndef ltable_h rlm@1: #define ltable_h rlm@1: rlm@1: #include "lobject.h" rlm@1: rlm@1: rlm@1: #define gnode(t,i) (&(t)->node[i]) rlm@1: #define gkey(n) (&(n)->i_key.nk) rlm@1: #define gval(n) (&(n)->i_val) rlm@1: #define gnext(n) ((n)->i_key.nk.next) rlm@1: rlm@1: #define key2tval(n) (&(n)->i_key.tvk) rlm@1: rlm@1: rlm@1: LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); rlm@1: LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); rlm@1: LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); rlm@1: LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); rlm@1: LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); rlm@1: LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); rlm@1: LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); rlm@1: LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); rlm@1: LUAI_FUNC void luaH_free (lua_State *L, Table *t); rlm@1: LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); rlm@1: LUAI_FUNC int luaH_getn (Table *t); rlm@1: rlm@1: rlm@1: #if defined(LUA_DEBUG) rlm@1: LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); rlm@1: LUAI_FUNC int luaH_isdummy (Node *n); rlm@1: #endif rlm@1: rlm@1: rlm@1: #endif