The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ltable.h
Go to the documentation of this file.
1 /*
2 ** Lua tables (hash)
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef ltable_h
7 #define ltable_h
8 
9 #include "lobject.h"
10 
11 
12 #define gnode(t,i) (&(t)->node[i])
13 #define gkey(n) (&(n)->i_key.tvk)
14 #define gval(n) (&(n)->i_val)
15 #define gnext(n) ((n)->i_key.nk.next)
16 
17 #define invalidateTMcache(t) ((t)->flags = 0)
18 
19 /* returns the key, given the value of a table entry */
20 #define keyfromval(v) \
21  (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))
22 
23 
24 LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
25 LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value);
26 LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
27 LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
28 LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);
29 LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
31 LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize);
32 LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
33 LUAI_FUNC void luaH_free (lua_State *L, Table *t);
34 LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
35 LUAI_FUNC int luaH_getn (Table *t);
36 
37 
38 #if defined(LUA_DEBUG)
39 LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
40 LUAI_FUNC int luaH_isdummy (Node *n);
41 #endif
42 
43 
44 #endif
Definition: lobject.h:559
#define LUAI_FUNC
Definition: luaconf.h:187
Definition: lobject.h:553
GLdouble GLdouble t
Definition: glew.h:1366
LUAI_FUNC void luaH_resize(lua_State *L, Table *t, int nasize, int nhsize)
Definition: ltable.cpp:303
GLsizei const GLfloat * value
Definition: glew.h:1817
LUAI_FUNC int luaH_next(lua_State *L, Table *t, StkId key)
Definition: ltable.cpp:168
LUAI_FUNC const TValue * luaH_getint(Table *t, int key)
Definition: ltable.cpp:445
LUAI_FUNC void luaH_free(lua_State *L, Table *t)
Definition: ltable.cpp:378
LUAI_FUNC TValue * luaH_newkey(lua_State *L, Table *t, const TValue *key)
Definition: ltable.cpp:404
LUAI_FUNC void luaH_resizearray(lua_State *L, Table *t, int nasize)
Definition: ltable.cpp:336
LUAI_FUNC const TValue * luaH_getstr(Table *t, TString *key)
Definition: ltable.cpp:465
GLclampd n
Definition: glew.h:5903
LUAI_FUNC TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
Definition: ltable.cpp:509
LUAI_FUNC int luaH_getn(Table *t)
Definition: ltable.cpp:559
LUAI_FUNC void luaH_setint(lua_State *L, Table *t, int key, TValue *value)
Definition: ltable.cpp:517
LUAI_FUNC Table * luaH_new(lua_State *L)
Definition: ltable.cpp:367
LUAI_FUNC const TValue * luaH_get(Table *t, const TValue *key)
Definition: ltable.cpp:480