ltable.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 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 gnode(t,i) (&(t)->node[i])
  10. #define gkey(n) (&(n)->i_key.tvk)
  11. #define gval(n) (&(n)->i_val)
  12. #define gnext(n) ((n)->i_key.nk.next)
  13. #define key2tval(n) (&(n)->i_key.tvk)
  14. LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
  15. LUAI_FUNC const TValue *luaH_getnum_ro (void *t, int key);
  16. LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
  17. LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
  18. LUAI_FUNC const TValue *luaH_getstr_ro (void *t, TString *key);
  19. LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
  20. LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
  21. LUAI_FUNC const TValue *luaH_get_ro (void *t, const TValue *key);
  22. LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
  23. LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
  24. LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
  25. LUAI_FUNC void luaH_free (lua_State *L, Table *t);
  26. LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
  27. LUAI_FUNC int luaH_next_ro (lua_State *L, void *t, StkId key);
  28. LUAI_FUNC int luaH_getn (Table *t);
  29. LUAI_FUNC int luaH_getn_ro (void *t);
  30. #if defined(LUA_DEBUG)
  31. LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
  32. LUAI_FUNC int luaH_isdummy (Node *n);
  33. #endif
  34. #endif