Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:37:57

0001 /*
0002 ** $Id: ltable.h $
0003 ** Lua tables (hash)
0004 ** See Copyright Notice in lua.h
0005 */
0006 
0007 #ifndef ltable_h
0008 #define ltable_h
0009 
0010 #include "lobject.h"
0011 
0012 
0013 #define gnode(t,i)  (&(t)->node[i])
0014 #define gval(n)     (&(n)->i_val)
0015 #define gnext(n)    ((n)->u.next)
0016 
0017 
0018 /*
0019 ** Clear all bits of fast-access metamethods, which means that the table
0020 ** may have any of these metamethods. (First access that fails after the
0021 ** clearing will set the bit again.)
0022 */
0023 #define invalidateTMcache(t)    ((t)->flags &= ~maskflags)
0024 
0025 
0026 /* true when 't' is using 'dummynode' as its hash part */
0027 #define isdummy(t)      ((t)->lastfree == NULL)
0028 
0029 
0030 /* allocated size for hash nodes */
0031 #define allocsizenode(t)    (isdummy(t) ? 0 : sizenode(t))
0032 
0033 
0034 /* returns the Node, given the value of a table entry */
0035 #define nodefromval(v)  cast(Node *, (v))
0036 
0037 
0038 LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
0039 LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
0040                                                     TValue *value);
0041 LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
0042 LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
0043 LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
0044 LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key,
0045                                                  TValue *value);
0046 LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key,
0047                                        const TValue *slot, TValue *value);
0048 LUAI_FUNC Table *luaH_new (lua_State *L);
0049 LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
0050                                                     unsigned int nhsize);
0051 LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize);
0052 LUAI_FUNC void luaH_free (lua_State *L, Table *t);
0053 LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
0054 LUAI_FUNC lua_Unsigned luaH_getn (Table *t);
0055 LUAI_FUNC unsigned int luaH_realasize (const Table *t);
0056 
0057 
0058 #if defined(LUA_DEBUG)
0059 LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
0060 #endif
0061 
0062 
0063 #endif