The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 gkey(n)   (&(n)->i_key.tvk)
 
#define gval(n)   (&(n)->i_val)
 
#define gnext(n)   ((n)->i_key.nk.next)
 
#define invalidateTMcache(t)   ((t)->flags = 0)
 
#define keyfromval(v)   (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
 

Functions

LUAI_FUNC const TValueluaH_getint (Table *t, int key)
 
LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value)
 
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, int nasize, int nhsize)
 
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, 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 int luaH_getn (Table *t)
 

Macro Definition Documentation

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

Definition at line 15 of file ltable.h.

Referenced by findindex(), luaH_get(), luaH_getint(), luaH_getstr(), luaH_newkey(), and setnodevector().

#define gnode (   t,
  i 
)    (&(t)->node[i])
#define gval (   n)    (&(n)->i_val)
#define invalidateTMcache (   t)    ((t)->flags = 0)

Definition at line 17 of file ltable.h.

Referenced by lua_rawset(), and luaV_settable().

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

Definition at line 20 of file ltable.h.

Referenced by luaX_newstring().

Function Documentation

LUAI_FUNC void luaH_free ( lua_State L,
Table t 
)

Definition at line 378 of file ltable.cpp.

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

Referenced by freeobj().

LUAI_FUNC const TValue* luaH_get ( Table t,
const TValue key 
)
LUAI_FUNC const TValue* luaH_getint ( Table t,
int  key 
)
LUAI_FUNC int luaH_getn ( Table t)

Definition at line 559 of file ltable.cpp.

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

Referenced by lua_rawlen(), and luaV_objlen().

LUAI_FUNC const TValue* luaH_getstr ( Table t,
TString key 
)
LUAI_FUNC Table* luaH_new ( lua_State L)
LUAI_FUNC TValue* luaH_newkey ( lua_State L,
Table t,
const TValue key 
)
LUAI_FUNC int luaH_next ( lua_State L,
Table t,
StkId  key 
)

Definition at line 168 of file ltable.cpp.

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

Referenced by lua_next().

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

Definition at line 336 of file ltable.cpp.

References isdummy, luaH_resize(), Table::node, and sizenode.

Referenced by luaV_execute().

LUAI_FUNC TValue* luaH_set ( lua_State L,
Table t,
const TValue key 
)
LUAI_FUNC void luaH_setint ( lua_State L,
Table t,
int  key,
TValue value 
)