The Battle for Wesnoth  1.15.1+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)->i_key.nk.next)
 
#define gkey(n)   cast(const TValue*, (&(n)->i_key.tvk))
 
#define wgkey(n)   (&(n)->i_key.nk)
 
#define invalidateTMcache(t)   ((t)->flags = 0)
 
#define isdummy(t)   ((t)->lastfree == NULL)
 
#define allocsizenode(t)   (isdummy(t) ? 0 : sizenode(t))
 
#define keyfromval(v)   (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
 

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)
 

Macro Definition Documentation

◆ allocsizenode

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

Definition at line 35 of file ltable.h.

Referenced by luaH_resize(), luaH_resizearray(), and traversetable().

◆ gkey

#define gkey (   n)    cast(const TValue*, (&(n)->i_key.tvk))

◆ gnext

#define gnext (   n)    ((n)->i_key.nk.next)

◆ gnode

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

◆ gval

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

◆ invalidateTMcache

#define invalidateTMcache (   t)    ((t)->flags = 0)

Definition at line 27 of file ltable.h.

Referenced by lua_rawset(), and luaV_finishset().

◆ isdummy

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

Definition at line 31 of file ltable.h.

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

◆ keyfromval

#define keyfromval (   v)    (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))

Definition at line 39 of file ltable.h.

Referenced by luaX_newstring().

◆ wgkey

#define wgkey (   n)    (&(n)->i_key.nk)

Definition at line 25 of file ltable.h.

Referenced by removeentry(), and setnodevector().

Function Documentation

◆ luaH_free()

LUAI_FUNC void luaH_free ( lua_State L,
Table t 
)

Definition at line 433 of file ltable.cpp.

References Table::array, cast, isdummy, luaM_free, luaM_freearray, Table::node, Table::sizearray, and sizenode.

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)

Definition at line 660 of file ltable.cpp.

References Table::array, i, isdummy, mainposition(), Table::sizearray, t, ttisnil, and unbound_search().

Referenced by lua_rawlen(), and luaV_objlen().

◆ 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 575 of file ltable.cpp.

References cast, getgeneric(), LUA_TSHRSTR, 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 186 of file ltable.cpp.

References Table::array, cast_int, findindex(), gkey, gnode, gval, i, setivalue, setobj2s, Table::sizearray, sizenode, and ttisnil.

Referenced by lua_next().

◆ 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 387 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 610 of file ltable.cpp.

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

Referenced by addk(), lua_rawset(), lua_rawsetp(), luaH_newkey(), luaH_resize(), and luaX_newstring().

◆ luaH_setint()

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