ltable.h 1000 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. ** $Id: ltable.h,v 1.34 2001/07/05 20:31:14 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 settableval(p,v) setobj(cast(TObject *, p), v)
  13. const TObject *luaH_getnum (Hash *t, int key);
  14. void luaH_setnum (lua_State *L, Hash *t, int key, const TObject *val);
  15. const TObject *luaH_getstr (Hash *t, TString *key);
  16. void luaH_setstr (lua_State *L, Hash *t, TString *key, const TObject *val);
  17. const TObject *luaH_get (Hash *t, const TObject *key);
  18. void luaH_set (lua_State *L, Hash *t, const TObject *key, const TObject *val);
  19. Hash *luaH_new (lua_State *L, int nhash);
  20. void luaH_free (lua_State *L, Hash *t);
  21. Node *luaH_next (lua_State *L, Hash *t, const TObject *r);
  22. int luaH_nexti (Hash *t, int i);
  23. /* exported only for debugging */
  24. Node *luaH_mainposition (const Hash *t, const TObject *key);
  25. #endif