ltable.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. ** $Id: ltable.h,v 1.37 2001/10/25 19:14:14 roberto Exp $
  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. void luaH_setstr (lua_State *L, Table *t, TString *key, const TObject *val);
  17. const TObject *luaH_get (Table *t, const TObject *key);
  18. void luaH_set (lua_State *L, Table *t, const TObject *key, const TObject *val);
  19. Table *luaH_new (lua_State *L, int narray, int lnhash);
  20. void luaH_free (lua_State *L, Table *t);
  21. int luaH_index (lua_State *L, Table *t, const TObject *key);
  22. int luaH_nexti (Table *t, int i, TObject *where);
  23. /* exported only for debugging */
  24. Node *luaH_mainposition (const Table *t, const TObject *key);
  25. #endif