ltable.h 953 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. ** $Id: ltable.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
  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 (Table *t, int key);
  14. void luaH_setnum (lua_State *L, Table *t, int key, const TObject *val);
  15. const TObject *luaH_getstr (Table *t, TString *key);
  16. const TObject *luaH_get (Table *t, const TObject *key);
  17. void luaH_set (lua_State *L, Table *t, const TObject *key, const TObject *val);
  18. Table *luaH_new (lua_State *L, int narray, int lnhash);
  19. void luaH_free (lua_State *L, Table *t);
  20. int luaH_index (lua_State *L, Table *t, const TObject *key);
  21. int luaH_nexti (Table *t, int i, TObject *where);
  22. /* exported only for debugging */
  23. Node *luaH_mainposition (const Table *t, const TObject *key);
  24. #endif