ltable.h 1021 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. ** $Id: ltable.h,v 2.2 2004/03/26 14:02:41 roberto Exp roberto $
  3. ** Lua tables (hash)
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef ltable_h
  7. #define ltable_h
  8. #include "lobject.h"
  9. #define gnode(t,i) (&(t)->node[i])
  10. #define gkey(n) (&(n)->i_key)
  11. #define gval(n) (&(n)->i_val)
  12. #define gnext(n) ((n)->i_key.next)
  13. #define key2tval(n) (cast(const TValue *, gkey(n)))
  14. const TValue *luaH_getnum (Table *t, int key);
  15. TValue *luaH_setnum (lua_State *L, Table *t, int key);
  16. const TValue *luaH_getstr (Table *t, TString *key);
  17. TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
  18. const TValue *luaH_get (Table *t, const TValue *key);
  19. TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
  20. Table *luaH_new (lua_State *L, int narray, int lnhash);
  21. void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
  22. void luaH_free (lua_State *L, Table *t);
  23. int luaH_next (lua_State *L, Table *t, StkId key);
  24. /* exported only for debugging */
  25. Node *luaH_mainposition (const Table *t, const TValue *key);
  26. #endif