ltable.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. ** $Id: ltable.h,v 1.19 2000/04/25 16:55:09 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 node(t,i) (&(t)->node[i])
  10. #define key(n) (&(n)->key)
  11. #define val(n) (&(n)->val)
  12. #define luaH_move(L, t,from,to) (luaH_setint(L, t, to, luaH_getnum(t, from)))
  13. Hash *luaH_new (lua_State *L, int nhash);
  14. void luaH_free (lua_State *L, Hash *t);
  15. const TObject *luaH_get (lua_State *L, const Hash *t, const TObject *key);
  16. const TObject *luaH_getnum (const Hash *t, Number key);
  17. const TObject *luaH_getstr (const Hash *t, TString *key);
  18. void luaH_set (lua_State *L, Hash *t, const TObject *key, const TObject *val);
  19. int luaH_pos (lua_State *L, const Hash *t, const TObject *r);
  20. void luaH_setint (lua_State *L, Hash *t, int key, const TObject *val);
  21. unsigned long luaH_hash (lua_State *L, const TObject *key);
  22. const TObject *luaH_getglobal (lua_State *L, const char *name);
  23. /* exported only for debugging */
  24. Node *luaH_mainposition (const Hash *t, const TObject *key);
  25. #endif