ltable.h
Go to the documentation of this file.
1 /*
2 ** $Id: ltable.h $
3 ** Lua tables (hash)
4 ** See Copyright Notice in lua.h
5 */
6 
7 #ifndef ltable_h
8 #define ltable_h
9 
10 #include "lobject.h"
11 
12 
13 #define gnode(t,i) (&(t)->node[i])
14 #define gval(n) (&(n)->i_val)
15 #define gnext(n) ((n)->u.next)
16 
17 
18 /*
19 ** Clear all bits of fast-access metamethods, which means that the table
20 ** may have any of these metamethods. (First access that fails after the
21 ** clearing will set the bit again.)
22 */
23 #define invalidateTMcache(t) ((t)->flags &= ~maskflags)
24 
25 
26 /* true when 't' is using 'dummynode' as its hash part */
27 #define isdummy(t) ((t)->lastfree == NULL)
28 
29 
30 /* allocated size for hash nodes */
31 #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t))
32 
33 
34 /* returns the Node, given the value of a table entry */
35 #define nodefromval(v) cast(Node *, (v))
36 
37 
40  TValue *value);
42 LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
43 LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
44 LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key,
45  TValue *value);
46 LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key,
47  TValue *value);
48 LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key,
49  const TValue *slot, TValue *value);
51 LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
52  unsigned int nhsize);
53 LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize);
54 LUAI_FUNC void luaH_free (lua_State *L, Table *t);
55 LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
57 LUAI_FUNC unsigned int luaH_realasize (const Table *t);
58 
59 
60 #if defined(LUA_DEBUG)
61 LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
62 LUAI_FUNC int luaH_isdummy (const Table *t);
63 #endif
64 
65 
66 #endif
luaH_next
LUAI_FUNC int luaH_next(lua_State *L, Table *t, StkId key)
Definition: ltable.c:338
luaH_getint
const LUAI_FUNC TValue * luaH_getint(Table *t, lua_Integer key)
Definition: ltable.c:719
lua_Unsigned
LUA_UNSIGNED lua_Unsigned
Definition: lua.h:97
LUAI_FUNC
#define LUAI_FUNC
Definition: luaconf.h:312
luaH_new
LUAI_FUNC Table * luaH_new(lua_State *L)
Definition: ltable.c:615
TString
Definition: lobject.h:373
luaH_realasize
LUAI_FUNC unsigned int luaH_realasize(const Table *t)
Definition: ltable.c:241
StackValue
Definition: lobject.h:146
luaH_newkey
LUAI_FUNC void luaH_newkey(lua_State *L, Table *t, const TValue *key, TValue *value)
Definition: ltable.c:654
luaH_set
LUAI_FUNC void luaH_set(lua_State *L, Table *t, const TValue *key, TValue *value)
Definition: ltable.c:813
luaH_setint
LUAI_FUNC void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
Definition: ltable.c:819
lua_State
Definition: lstate.h:304
lobject.h
luaH_finishset
LUAI_FUNC void luaH_finishset(lua_State *L, Table *t, const TValue *key, const TValue *slot, TValue *value)
Definition: ltable.c:800
lua_Integer
LUA_INTEGER lua_Integer
Definition: lua.h:94
luaH_resize
LUAI_FUNC void luaH_resize(lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize)
Definition: ltable.c:542
Node
Definition: lobject.h:686
luaH_free
LUAI_FUNC void luaH_free(lua_State *L, Table *t)
Definition: ltable.c:627
luaH_getstr
const LUAI_FUNC TValue * luaH_getstr(Table *t, TString *key)
Definition: ltable.c:763
luaH_getn
LUAI_FUNC lua_Unsigned luaH_getn(Table *t)
Definition: ltable.c:912
luaH_resizearray
LUAI_FUNC void luaH_resizearray(lua_State *L, Table *t, unsigned int nasize)
Definition: ltable.c:579
Table
Definition: lobject.h:724
luaH_getshortstr
const LUAI_FUNC TValue * luaH_getshortstr(Table *t, TString *key)
Definition: ltable.c:747
luaH_get
const LUAI_FUNC TValue * luaH_get(Table *t, const TValue *key)
Definition: ltable.c:777
TValue
Definition: lobject.h:65


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45