1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
use crate*;
/// Index of the lua registry.
/// What you'd get from debug.getregistry()
pub const REGISTRYINDEX: c_int = -10000;
/// Index of the lua environment.
/// This is like ``getfenv()`` or ``_ENV`` in later lua versions
pub const ENVIRONINDEX: c_int = -10001;
/// Index of _G
pub const GLOBALSINDEX: c_int = -10002;
/// Number of returns to use in functions like lua_pcall to represent 0 or more.
pub const MULTRET: c_int = -1;
/// Number of primitive lua types (excluding garrysmod userdata types)
pub const NUMTYPES: c_int = 9;
pub const NUMTAGS: c_int = NUMTYPES;
/// 'None' / 'No value' type.
pub const TNONE: c_int = -1;
/// 'nil' type
pub const TNIL: c_int = 0;
/// Boolean type
pub const TBOOLEAN: c_int = 1;
/// 'Light' Userdata type.
/// This is just a pointer to something owned by C without a custom metatable, as a [TUSERDATA] may have.
pub const TLIGHTUSERDATA: c_int = 2;
/// Number type.
/// This is a double, or [f64]
pub const TNUMBER: c_int = 3;
/// String type, this is a [LuaString]
pub const TSTRING: c_int = 4;
/// Table type created by [lua_newtable](super::lua_newtable)
pub const TTABLE: c_int = 5;
/// Function type created by [lua_pushcfunction](super::lua_pushcfunction), [lua_pushcfunction](super::lua_pushcclosure) or retrieved from lua.
pub const TFUNCTION: c_int = 6;
/// 'Heavy' Userdata type managed by lua.
/// Created by [lua_newuserdata](super::lua_newuserdata)
pub const TUSERDATA: c_int = 7;
/// Thread / Coroutine type, created by [lua_newthread](super::lua_newthread)
pub const TTHREAD: c_int = 8;
/// Minimum number of stack levels guaranteed to C whenever it is called into by lua.
pub const MINSTACK: c_int = 20;
/// OK status code used by several functions like [lua_status](super::lua_status), [lua_pcall](super::lua_pcall)
pub const OK: c_int = 0;
/// YIELD status code used by [lua_status](super::lua_status)
pub const YIELD: c_int = 1;
/// Runtime error, code used by functions like [lua_pcall](super::lua_pcall)
pub const ERRRUN: c_int = 2;
/// Syntax error, code used by functions like [lua_load](super::lua_load)
pub const ERRSYNTAX: c_int = 3;
/// Memory allocation, error code used by many functions like [super::lua_load]
pub const ERRMEM: c_int = 4;
/// Error when running the error handler, code used by functions like [lua_pcall](super::lua_pcall)
pub const ERRERR: c_int = 5;
/// Enum used with [lua_gc](super::lua_gc) - Stops the garbage collector.
pub const GCSTOP: c_int = 0;
/// Enum used with [lua_gc](super::lua_gc) - Restarts the garbage collector
pub const GCRESTART: c_int = 1;
/// Enum used with [lua_gc](super::lua_gc) - Restarts the garbage collector
pub const GCCOLLECT: c_int = 2;
/// Enum used with [lua_gc](super::lua_gc) - Returns the total number of live Lua objects in the current Lua state
pub const GCCOUNT: c_int = 3;
/// Enum used with [lua_gc](super::lua_gc) - Returns the total number of live Lua objects in the current Lua state, plus the total number of Lua objects in unreachable threads
pub const GCCOUNTB: c_int = 4;
/// Enum used with [lua_gc](super::lua_gc) - Performs a single step of the garbage collector.
pub const GCSTEP: c_int = 5;
/// Enum used with [lua_gc](super::lua_gc) - Sets `lua_gc`'s pause threshold.
pub const GCSETPAUSE: c_int = 6;
/// Enum used with [lua_gc](super::lua_gc) - Sets `lua_gc`'s step multiplier.
pub const GCSETSTEPMUL: c_int = 7;
pub const HOOKCALL: c_int = 0;
pub const HOOKRET: c_int = 1;
pub const HOOKLINE: c_int = 2;
pub const HOOKCOUNT: c_int = 3;
pub const HOOKTAILRET: c_int = 4;
/// Enum used by [lua_sethook](super::lua_sethook)
pub const MASKCALL: c_int = 1 << HOOKCALL;
/// Enum used by [lua_sethook](super::lua_sethook)
pub const MASKRET: c_int = 1 << HOOKRET;
/// Enum used by [lua_sethook](super::lua_sethook)
pub const MASKLINE: c_int = 1 << HOOKLINE;
/// Enum used by [lua_sethook](super::lua_sethook)
pub const MASKCOUNT: c_int = 1 << HOOKCOUNT;
/// Size of [LuaDebug].short_src
pub const IDSIZE: usize = 128;
/// This is libc's default so we'll roll with it
/// Used internally for [LuaBuffer].
pub const BUFFERSIZE: usize = 8192;
pub const NOREF: c_int = -2;
pub const REFNIL: c_int = -1;
/// LuaJIT specific global constants