ltable.h 733 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. ** $Id: ltable.h,v 1.10 1999/01/25 17:40:10 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 ref(n) (&(n)->ref)
  11. #define val(n) (&(n)->val)
  12. #define nhash(t) ((t)->nhash)
  13. #define luaH_get(t,ref) (val(luaH_present((t), (ref))))
  14. #define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from)))
  15. Hash *luaH_new (int nhash);
  16. void luaH_free (Hash *frees);
  17. Node *luaH_present (Hash *t, TObject *key);
  18. void luaH_set (Hash *t, TObject *ref, TObject *val);
  19. int luaH_pos (Hash *t, TObject *r);
  20. void luaH_setint (Hash *t, int ref, TObject *val);
  21. TObject *luaH_getint (Hash *t, int ref);
  22. #endif