You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.2 KiB

  1. /*
  2. ** $Id: ltable.h,v 2.16 2011/08/17 20:26:47 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 invalidateTMcache(t) ((t)->flags = 0)
  14. LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
  15. LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value);
  16. LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
  17. LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
  18. LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);
  19. LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
  20. LUAI_FUNC Table *luaH_new (lua_State *L);
  21. LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
  22. LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
  23. LUAI_FUNC void luaH_free (lua_State *L, Table *t);
  24. LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
  25. LUAI_FUNC int luaH_getn (Table *t);
  26. #if defined(LUA_DEBUG)
  27. LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
  28. LUAI_FUNC int luaH_isdummy (Node *n);
  29. #endif
  30. #endif