ltable.h 844 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. ** $Id: ltable.h,v 1.14 1999/10/14 19:13:31 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(t,from,to) (luaH_setint(t, to, luaH_getint(t, from)))
  13. Hash *luaH_new (int nhash);
  14. void luaH_free (Hash *t);
  15. const TObject *luaH_get (const Hash *t, const TObject *key);
  16. void luaH_set (Hash *t, const TObject *key, const TObject *val);
  17. int luaH_pos (const Hash *t, const TObject *r);
  18. void luaH_setint (Hash *t, int key, const TObject *val);
  19. const TObject *luaH_getint (const Hash *t, int key);
  20. unsigned long luaH_hash (const TObject *key);
  21. /* exported only for debugging */
  22. Node *luaH_mainposition (const Hash *t, const TObject *key);
  23. #endif