sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
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
11#ifndef ltable_h
12#define ltable_h
13
14#include "lobject.h"
15
16
17#define gnode(t,i) (&(t)->node[i])
18#define gval(n) (&(n)->i_val)
19#define gnext(n) ((n)->u.next)
20
21
22/*
23** Clear all bits of fast-access metamethods, which means that the table
24** may have any of these metamethods. (First access that fails after the
25** clearing will set the bit again.)
26*/
27#define invalidateTMcache(t) ((t)->flags &= ~maskflags)
28
29
30/* true when 't' is using 'dummynode' as its hash part */
31#define isdummy(t) ((t)->lastfree == NULL)
32
33
34/* allocated size for hash nodes */
35#define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t))
36
37
38/* returns the Node, given the value of a table entry */
39#define nodefromval(v) cast(Node *, (v))
40
41
42LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
43LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
44 TValue *value);
45LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
46LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
47LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
48LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key,
49 TValue *value);
50LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key,
51 TValue *value);
52LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key,
53 const TValue *slot, TValue *value);
54LUAI_FUNC Table *luaH_new (lua_State *L);
55LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
56 unsigned int nhsize);
57LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize);
58LUAI_FUNC void luaH_free (lua_State *L, Table *t);
59LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
60LUAI_FUNC lua_Unsigned luaH_getn (Table *t);
61LUAI_FUNC unsigned int luaH_realasize (const Table *t);
62
63
64#if defined(LUA_DEBUG)
65LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
66#endif
67
68
69#endif