The Battle for Wesnoth  1.15.12+dev
Macros | Functions
ltable.h File Reference
#include "lobject.h"
Include dependency graph for ltable.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define gnode(t, i)   (&(t)->node[i])
 
#define gval(n)   (&(n)->i_val)
 
#define gnext(n)   ((n)->u.next)
 
#define invalidateTMcache(t)   ((t)->flags &= ~maskflags)
 
#define isdummy(t)   ((t)->lastfree == NULL)
 
#define allocsizenode(t)   (isdummy(t) ? 0 : sizenode(t))
 
#define nodefromval(v)   cast(Node *, (v))
 

Functions

LUAI_FUNC const TValueluaH_getint (Table *t, lua_Integer key)
 
LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value)
 
LUAI_FUNC const TValueluaH_getshortstr (Table *t, TString *key)
 
LUAI_FUNC const TValueluaH_getstr (Table *t, TString *key)
 
LUAI_FUNC const TValueluaH_get (Table *t, const TValue *key)
 
LUAI_FUNC TValueluaH_newkey (lua_State *L, Table *t, const TValue *key)
 
LUAI_FUNC TValueluaH_set (lua_State *L, Table *t, const TValue *key)
 
LUAI_FUNC TableluaH_new (lua_State *L)
 
LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize)
 
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize)
 
LUAI_FUNC void luaH_free (lua_State *L, Table *t)
 
LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key)
 
LUAI_FUNC lua_Unsigned luaH_getn (Table *t)
 
LUAI_FUNC unsigned int luaH_realasize (const Table *t)
 

Macro Definition Documentation

◆ allocsizenode

#define allocsizenode (   t)    (isdummy(t) ? 0 : sizenode(t))

Definition at line 31 of file ltable.h.

Referenced by luaH_resizearray(), and traversetable().

◆ gnext

#define gnext (   n)    ((n)->u.next)

Definition at line 15 of file ltable.h.

Referenced by getgeneric(), luaH_getint(), luaH_getshortstr(), luaH_newkey(), and setnodevector().

◆ gnode

#define gnode (   t,
  i 
)    (&(t)->node[i])

◆ gval

#define gval (   n)    (&(n)->i_val)

◆ invalidateTMcache

#define invalidateTMcache (   t)    ((t)->flags &= ~maskflags)

Definition at line 23 of file ltable.h.

Referenced by aux_rawset(), and luaV_finishset().

◆ isdummy

#define isdummy (   t)    ((t)->lastfree == NULL)

Definition at line 27 of file ltable.h.

Referenced by freehash(), getfreepos(), luaH_getn(), and luaH_newkey().

◆ nodefromval

#define nodefromval (   v)    cast(Node *, (v))

Definition at line 35 of file ltable.h.

Referenced by findindex(), and luaX_newstring().

Function Documentation

◆ luaH_free()

LUAI_FUNC void luaH_free ( lua_State L,
Table t 
)

Definition at line 608 of file ltable.cpp.

References Table::array, freehash(), luaH_realasize(), luaM_free, and luaM_freearray.

Referenced by freeobj().

◆ luaH_get()

LUAI_FUNC const TValue* luaH_get ( Table t,
const TValue key 
)

◆ luaH_getint()

LUAI_FUNC const TValue* luaH_getint ( Table t,
lua_Integer  key 
)

◆ luaH_getn()

LUAI_FUNC lua_Unsigned luaH_getn ( Table t)

◆ luaH_getshortstr()

LUAI_FUNC const TValue* luaH_getshortstr ( Table t,
TString key 
)

◆ luaH_getstr()

LUAI_FUNC const TValue* luaH_getstr ( Table t,
TString key 
)

Definition at line 741 of file ltable.cpp.

References cast, getgeneric(), LUA_VSHRSTR, luaH_getshortstr(), and setsvalue.

Referenced by auxgetstr(), auxsetstr(), and luaV_execute().

◆ luaH_new()

LUAI_FUNC Table* luaH_new ( lua_State L)

◆ luaH_newkey()

LUAI_FUNC TValue* luaH_newkey ( lua_State L,
Table t,
const TValue key 
)

◆ luaH_next()

LUAI_FUNC int luaH_next ( lua_State L,
Table t,
StkId  key 
)

Definition at line 319 of file ltable.cpp.

References Table::array, cast_int, findindex(), getnodekey, gnode, gval, i, isempty, luaH_realasize(), n, s2v, setivalue, setobj2s, and sizenode.

Referenced by lua_next().

◆ luaH_realasize()

LUAI_FUNC unsigned int luaH_realasize ( const Table t)

◆ luaH_resize()

LUAI_FUNC void luaH_resize ( lua_State L,
Table t,
unsigned int  nasize,
unsigned int  nhsize 
)

◆ luaH_resizearray()

LUAI_FUNC void luaH_resizearray ( lua_State L,
Table t,
unsigned int  nasize 
)

Definition at line 560 of file ltable.cpp.

References allocsizenode, and luaH_resize().

Referenced by luaV_execute().

◆ luaH_set()

LUAI_FUNC TValue* luaH_set ( lua_State L,
Table t,
const TValue key 
)

Definition at line 776 of file ltable.cpp.

References cast, isabstkey, luaH_get(), luaH_newkey(), and p.

Referenced by addk(), aux_rawset(), luaH_newkey(), luaX_newstring(), and reinsert().

◆ luaH_setint()

LUAI_FUNC void luaH_setint ( lua_State L,
Table t,
lua_Integer  key,
TValue value 
)