sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
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
42
LUAI_FUNC
const
TValue
*luaH_getint (
Table
*t, lua_Integer key);
43
LUAI_FUNC
void
luaH_setint (
lua_State
*L,
Table
*t, lua_Integer key,
44
TValue
*value);
45
LUAI_FUNC
const
TValue
*luaH_getshortstr (
Table
*t,
TString
*key);
46
LUAI_FUNC
const
TValue
*luaH_getstr (
Table
*t,
TString
*key);
47
LUAI_FUNC
const
TValue
*luaH_get (
Table
*t,
const
TValue
*key);
48
LUAI_FUNC
void
luaH_newkey (
lua_State
*L,
Table
*t,
const
TValue
*key,
49
TValue
*value);
50
LUAI_FUNC
void
luaH_set (
lua_State
*L,
Table
*t,
const
TValue
*key,
51
TValue
*value);
52
LUAI_FUNC
void
luaH_finishset (
lua_State
*L,
Table
*t,
const
TValue
*key,
53
const
TValue
*slot,
TValue
*value);
54
LUAI_FUNC
Table
*luaH_new (
lua_State
*L);
55
LUAI_FUNC
void
luaH_resize (
lua_State
*L,
Table
*t,
unsigned
int
nasize,
56
unsigned
int
nhsize);
57
LUAI_FUNC
void
luaH_resizearray (
lua_State
*L,
Table
*t,
unsigned
int
nasize);
58
LUAI_FUNC
void
luaH_free (
lua_State
*L,
Table
*t);
59
LUAI_FUNC
int
luaH_next (
lua_State
*L,
Table
*t, StkId key);
60
LUAI_FUNC lua_Unsigned luaH_getn (
Table
*t);
61
LUAI_FUNC
unsigned
int
luaH_realasize (
const
Table
*t);
62
63
64
#if defined(LUA_DEBUG)
65
LUAI_FUNC
Node
*luaH_mainposition (
const
Table
*t,
const
TValue
*key);
66
#endif
67
68
69
#endif
lobject.h
TString
Definition
lobject.h:390
TValue
Definition
lobject.h:71
Table
Definition
lobject.h:743
lua_State
Definition
lstate.h:313
Node
Definition
lobject.h:705
lua
src
ltable.h
Generated by
1.18.0