1use std::ffi::CStr;
4use std::marker::{PhantomData, PhantomPinned};
5use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_void};
6use std::{mem, ptr};
7
8pub const LUA_MULTRET: c_int = -1;
10
11const LUAI_MAXCSTACK: c_int = 1000000;
13
14pub const LUA_UTAG_LIMIT: c_int = 128;
16
17pub const LUA_LUTAG_LIMIT: c_int = 128;
19
20pub const LUA_REGISTRYINDEX: c_int = -LUAI_MAXCSTACK - 2000;
24pub const LUA_ENVIRONINDEX: c_int = -LUAI_MAXCSTACK - 2001;
25pub const LUA_GLOBALSINDEX: c_int = -LUAI_MAXCSTACK - 2002;
26
27pub const fn lua_upvalueindex(i: c_int) -> c_int {
28 LUA_GLOBALSINDEX - i
29}
30
31pub const LUA_OK: c_int = 0;
35pub const LUA_YIELD: c_int = 1;
36pub const LUA_ERRRUN: c_int = 2;
37pub const LUA_ERRSYNTAX: c_int = 3;
38pub const LUA_ERRMEM: c_int = 4;
39pub const LUA_ERRERR: c_int = 5;
40
41#[repr(C)]
43pub struct lua_State {
44 _data: [u8; 0],
45 _marker: PhantomData<(*mut u8, PhantomPinned)>,
46}
47
48pub const LUA_TNONE: c_int = -1;
52
53pub const LUA_TNIL: c_int = 0;
54pub const LUA_TBOOLEAN: c_int = 1;
55
56pub const LUA_TLIGHTUSERDATA: c_int = 2;
57pub const LUA_TNUMBER: c_int = 3;
58pub const LUA_TVECTOR: c_int = 4;
59
60pub const LUA_TSTRING: c_int = 5;
61pub const LUA_TTABLE: c_int = 6;
62pub const LUA_TFUNCTION: c_int = 7;
63pub const LUA_TUSERDATA: c_int = 8;
64pub const LUA_TTHREAD: c_int = 9;
65pub const LUA_TBUFFER: c_int = 10;
66
67pub const LUA_MINSTACK: c_int = 20;
69
70pub type lua_Number = c_double;
72
73#[cfg(target_pointer_width = "32")]
75pub type lua_Integer = i32;
76#[cfg(target_pointer_width = "64")]
77pub type lua_Integer = i64;
78
79pub type lua_Unsigned = c_uint;
81
82pub type lua_CFunction = unsafe extern "C-unwind" fn(L: *mut lua_State) -> c_int;
84pub type lua_Continuation = unsafe extern "C-unwind" fn(L: *mut lua_State, status: c_int) -> c_int;
85
86pub type lua_Destructor = unsafe extern "C" fn(L: *mut lua_State, *mut c_void);
88
89pub type lua_Alloc =
91 unsafe extern "C" fn(ud: *mut c_void, ptr: *mut c_void, osize: usize, nsize: usize) -> *mut c_void;
92
93pub const fn luau_version() -> Option<&'static str> {
95 option_env!("LUAU_VERSION")
96}
97
98unsafe extern "C-unwind" {
99 pub fn lua_newstate(f: lua_Alloc, ud: *mut c_void) -> *mut lua_State;
103 pub fn lua_close(L: *mut lua_State);
104 pub fn lua_newthread(L: *mut lua_State) -> *mut lua_State;
105 pub fn lua_mainthread(L: *mut lua_State) -> *mut lua_State;
106 pub fn lua_resetthread(L: *mut lua_State);
107 pub fn lua_isthreadreset(L: *mut lua_State) -> c_int;
108
109 pub fn lua_absindex(L: *mut lua_State, idx: c_int) -> c_int;
113 pub fn lua_gettop(L: *mut lua_State) -> c_int;
114 pub fn lua_settop(L: *mut lua_State, idx: c_int);
115 pub fn lua_pushvalue(L: *mut lua_State, idx: c_int);
116 pub fn lua_remove(L: *mut lua_State, idx: c_int);
117 pub fn lua_insert(L: *mut lua_State, idx: c_int);
118 pub fn lua_replace(L: *mut lua_State, idx: c_int);
119 pub fn lua_checkstack(L: *mut lua_State, sz: c_int) -> c_int;
120 pub fn lua_rawcheckstack(L: *mut lua_State, sz: c_int);
121
122 pub fn lua_xmove(from: *mut lua_State, to: *mut lua_State, n: c_int);
123 pub fn lua_xpush(from: *mut lua_State, to: *mut lua_State, idx: c_int);
124
125 pub fn lua_isnumber(L: *mut lua_State, idx: c_int) -> c_int;
129 pub fn lua_isstring(L: *mut lua_State, idx: c_int) -> c_int;
130 pub fn lua_iscfunction(L: *mut lua_State, idx: c_int) -> c_int;
131 pub fn lua_isLfunction(L: *mut lua_State, idx: c_int) -> c_int;
132 pub fn lua_isuserdata(L: *mut lua_State, idx: c_int) -> c_int;
133 pub fn lua_type(L: *mut lua_State, idx: c_int) -> c_int;
134 pub fn lua_typename(L: *mut lua_State, tp: c_int) -> *const c_char;
135
136 pub fn lua_equal(L: *mut lua_State, idx1: c_int, idx2: c_int) -> c_int;
137 pub fn lua_rawequal(L: *mut lua_State, idx1: c_int, idx2: c_int) -> c_int;
138 pub fn lua_lessthan(L: *mut lua_State, idx1: c_int, idx2: c_int) -> c_int;
139
140 pub fn lua_tonumberx(L: *mut lua_State, idx: c_int, isnum: *mut c_int) -> lua_Number;
141 #[link_name = "lua_tointegerx"]
142 pub fn lua_tointegerx_(L: *mut lua_State, idx: c_int, isnum: *mut c_int) -> c_int;
143 pub fn lua_tounsignedx(L: *mut lua_State, idx: c_int, isnum: *mut c_int) -> lua_Unsigned;
144 pub fn lua_tovector(L: *mut lua_State, idx: c_int) -> *const c_float;
145 pub fn lua_toboolean(L: *mut lua_State, idx: c_int) -> c_int;
146 pub fn lua_tolstring(L: *mut lua_State, idx: c_int, len: *mut usize) -> *const c_char;
147 pub fn lua_tostringatom(L: *mut lua_State, idx: c_int, atom: *mut c_int) -> *const c_char;
148 pub fn lua_namecallatom(L: *mut lua_State, atom: *mut c_int) -> *const c_char;
149 pub fn lua_objlen(L: *mut lua_State, idx: c_int) -> usize;
150 pub fn lua_tocfunction(L: *mut lua_State, idx: c_int) -> Option<lua_CFunction>;
151 pub fn lua_tolightuserdata(L: *mut lua_State, idx: c_int) -> *mut c_void;
152 pub fn lua_tolightuserdatatagged(L: *mut lua_State, idx: c_int, tag: c_int) -> *mut c_void;
153 pub fn lua_touserdata(L: *mut lua_State, idx: c_int) -> *mut c_void;
154 pub fn lua_touserdatatagged(L: *mut lua_State, idx: c_int, tag: c_int) -> *mut c_void;
155 pub fn lua_userdatatag(L: *mut lua_State, idx: c_int) -> c_int;
156 pub fn lua_lightuserdatatag(L: *mut lua_State, idx: c_int) -> c_int;
157 pub fn lua_tothread(L: *mut lua_State, idx: c_int) -> *mut lua_State;
158 pub fn lua_tobuffer(L: *mut lua_State, idx: c_int, len: *mut usize) -> *mut c_void;
159 pub fn lua_topointer(L: *mut lua_State, idx: c_int) -> *const c_void;
160
161 pub fn lua_pushnil(L: *mut lua_State);
165 pub fn lua_pushnumber(L: *mut lua_State, n: lua_Number);
166 #[link_name = "lua_pushinteger"]
167 pub fn lua_pushinteger_(L: *mut lua_State, n: c_int);
168 pub fn lua_pushunsigned(L: *mut lua_State, n: lua_Unsigned);
169 #[cfg(not(feature = "luau-vector4"))]
170 pub fn lua_pushvector(L: *mut lua_State, x: c_float, y: c_float, z: c_float);
171 #[cfg(feature = "luau-vector4")]
172 pub fn lua_pushvector(L: *mut lua_State, x: c_float, y: c_float, z: c_float, w: c_float);
173 #[link_name = "lua_pushlstring"]
174 pub fn lua_pushlstring_(L: *mut lua_State, s: *const c_char, l: usize);
175 #[link_name = "lua_pushstring"]
176 pub fn lua_pushstring_(L: *mut lua_State, s: *const c_char);
177 #[link_name = "lua_pushfstringL"]
179 pub fn lua_pushfstring(L: *mut lua_State, fmt: *const c_char, ...) -> *const c_char;
180 pub fn lua_pushcclosurek(
181 L: *mut lua_State,
182 f: lua_CFunction,
183 debugname: *const c_char,
184 nup: c_int,
185 cont: Option<lua_Continuation>,
186 );
187 pub fn lua_pushboolean(L: *mut lua_State, b: c_int);
188 pub fn lua_pushthread(L: *mut lua_State) -> c_int;
189
190 pub fn lua_pushlightuserdatatagged(L: *mut lua_State, p: *mut c_void, tag: c_int);
191 pub fn lua_newuserdatatagged(L: *mut lua_State, sz: usize, tag: c_int) -> *mut c_void;
192 pub fn lua_newuserdatataggedwithmetatable(L: *mut lua_State, sz: usize, tag: c_int) -> *mut c_void;
193 pub fn lua_newuserdatadtor(L: *mut lua_State, sz: usize, dtor: lua_Destructor) -> *mut c_void;
194
195 pub fn lua_newbuffer(L: *mut lua_State, sz: usize) -> *mut c_void;
196
197 pub fn lua_gettable(L: *mut lua_State, idx: c_int) -> c_int;
201 pub fn lua_getfield(L: *mut lua_State, idx: c_int, k: *const c_char) -> c_int;
202 pub fn lua_rawgetfield(L: *mut lua_State, idx: c_int, k: *const c_char) -> c_int;
203 pub fn lua_rawget(L: *mut lua_State, idx: c_int) -> c_int;
204 #[link_name = "lua_rawgeti"]
205 pub fn lua_rawgeti_(L: *mut lua_State, idx: c_int, n: c_int) -> c_int;
206 pub fn lua_rawgetptagged(L: *mut lua_State, idx: c_int, p: *const c_void, tag: c_int) -> c_int;
207 pub fn lua_createtable(L: *mut lua_State, narr: c_int, nrec: c_int);
208
209 pub fn lua_setreadonly(L: *mut lua_State, idx: c_int, enabled: c_int);
210 pub fn lua_getreadonly(L: *mut lua_State, idx: c_int) -> c_int;
211 pub fn lua_setsafeenv(L: *mut lua_State, idx: c_int, enabled: c_int);
212
213 pub fn lua_getmetatable(L: *mut lua_State, objindex: c_int) -> c_int;
214 pub fn lua_getfenv(L: *mut lua_State, idx: c_int);
215
216 pub fn lua_settable(L: *mut lua_State, idx: c_int);
220 pub fn lua_setfield(L: *mut lua_State, idx: c_int, k: *const c_char);
221 pub fn lua_rawset(L: *mut lua_State, idx: c_int);
222 #[link_name = "lua_rawseti"]
223 pub fn lua_rawseti_(L: *mut lua_State, idx: c_int, n: c_int);
224 pub fn lua_rawsetptagged(L: *mut lua_State, idx: c_int, p: *const c_void, tag: c_int);
225 pub fn lua_setmetatable(L: *mut lua_State, objindex: c_int) -> c_int;
226 pub fn lua_setfenv(L: *mut lua_State, idx: c_int) -> c_int;
227
228 pub fn luau_load(
232 L: *mut lua_State,
233 chunkname: *const c_char,
234 data: *const c_char,
235 size: usize,
236 env: c_int,
237 ) -> c_int;
238 pub fn lua_call(L: *mut lua_State, nargs: c_int, nresults: c_int);
239 pub fn lua_pcall(L: *mut lua_State, nargs: c_int, nresults: c_int, errfunc: c_int) -> c_int;
240 pub fn lua_cpcall(L: *mut lua_State, f: lua_CFunction, ud: *mut c_void) -> c_int;
241
242 pub fn lua_yield(L: *mut lua_State, nresults: c_int) -> c_int;
246 pub fn lua_break(L: *mut lua_State) -> c_int;
247 #[link_name = "lua_resume"]
248 pub fn lua_resume_(L: *mut lua_State, from: *mut lua_State, narg: c_int) -> c_int;
249 pub fn lua_resumeerror(L: *mut lua_State, from: *mut lua_State) -> c_int;
250 pub fn lua_status(L: *mut lua_State) -> c_int;
251 pub fn lua_isyieldable(L: *mut lua_State) -> c_int;
252 pub fn lua_getthreaddata(L: *mut lua_State) -> *mut c_void;
253 pub fn lua_setthreaddata(L: *mut lua_State, data: *mut c_void);
254}
255
256pub const LUA_GCSTOP: c_int = 0;
260pub const LUA_GCRESTART: c_int = 1;
261pub const LUA_GCCOLLECT: c_int = 2;
262pub const LUA_GCCOUNT: c_int = 3;
263pub const LUA_GCCOUNTB: c_int = 4;
264pub const LUA_GCISRUNNING: c_int = 5;
265pub const LUA_GCSTEP: c_int = 6;
266pub const LUA_GCSETGOAL: c_int = 7;
267pub const LUA_GCSETSTEPMUL: c_int = 8;
268pub const LUA_GCSETSTEPSIZE: c_int = 9;
269
270unsafe extern "C-unwind" {
271 pub fn lua_gc(L: *mut lua_State, what: c_int, data: c_int) -> c_int;
272}
273
274unsafe extern "C-unwind" {
278 pub fn lua_setmemcat(L: *mut lua_State, category: c_int);
279 pub fn lua_totalbytes(L: *mut lua_State, category: c_int) -> usize;
280}
281
282unsafe extern "C-unwind" {
286 pub fn lua_error(L: *mut lua_State) -> !;
287 pub fn lua_next(L: *mut lua_State, idx: c_int) -> c_int;
288 pub fn lua_rawiter(L: *mut lua_State, idx: c_int, iter: c_int) -> c_int;
289 pub fn lua_concat(L: *mut lua_State, n: c_int);
290 pub fn lua_clock() -> c_double;
292 pub fn lua_setuserdatatag(L: *mut lua_State, idx: c_int, tag: c_int);
293 pub fn lua_setuserdatadtor(L: *mut lua_State, tag: c_int, dtor: Option<lua_Destructor>);
294 pub fn lua_getuserdatadtor(L: *mut lua_State, tag: c_int) -> Option<lua_Destructor>;
295 pub fn lua_setuserdatametatable(L: *mut lua_State, tag: c_int);
296 pub fn lua_getuserdatametatable(L: *mut lua_State, tag: c_int);
297 pub fn lua_setlightuserdataname(L: *mut lua_State, tag: c_int, name: *const c_char);
298 pub fn lua_getlightuserdataname(L: *mut lua_State, tag: c_int) -> *const c_char;
299 pub fn lua_clonefunction(L: *mut lua_State, idx: c_int);
300 pub fn lua_cleartable(L: *mut lua_State, idx: c_int);
301 pub fn lua_getallocf(L: *mut lua_State, ud: *mut *mut c_void) -> lua_Alloc;
302}
303
304pub const LUA_NOREF: c_int = -1;
308pub const LUA_REFNIL: c_int = 0;
309
310unsafe extern "C-unwind" {
311 pub fn lua_ref(L: *mut lua_State, idx: c_int) -> c_int;
312 pub fn lua_unref(L: *mut lua_State, r#ref: c_int);
313}
314
315#[inline(always)]
320pub unsafe fn lua_tonumber(L: *mut lua_State, idx: c_int) -> lua_Number {
321 lua_tonumberx(L, idx, ptr::null_mut())
322}
323
324#[inline(always)]
325pub unsafe fn lua_tointeger_(L: *mut lua_State, idx: c_int) -> c_int {
326 lua_tointegerx_(L, idx, ptr::null_mut())
327}
328
329#[inline(always)]
330pub unsafe fn lua_tounsigned(L: *mut lua_State, i: c_int) -> lua_Unsigned {
331 lua_tounsignedx(L, i, ptr::null_mut())
332}
333
334#[inline(always)]
335pub unsafe fn lua_pop(L: *mut lua_State, n: c_int) {
336 lua_settop(L, -n - 1)
337}
338
339#[inline(always)]
340pub unsafe fn lua_newtable(L: *mut lua_State) {
341 lua_createtable(L, 0, 0)
342}
343
344#[inline(always)]
345pub unsafe fn lua_newuserdata(L: *mut lua_State, sz: usize) -> *mut c_void {
346 lua_newuserdatatagged(L, sz, 0)
347}
348
349#[inline(always)]
350pub unsafe fn lua_newuserdata_t<T>(L: *mut lua_State, data: T) -> *mut T {
351 unsafe extern "C" fn destructor<T>(_: *mut lua_State, ud: *mut c_void) {
352 ptr::drop_in_place(ud as *mut T);
353 }
354
355 let ud_ptr = lua_newuserdatadtor(L, const { mem::size_of::<T>() }, destructor::<T>) as *mut T;
356 ptr::write(ud_ptr, data);
357 ud_ptr
358}
359
360#[inline(always)]
363pub unsafe fn lua_isfunction(L: *mut lua_State, n: c_int) -> c_int {
364 (lua_type(L, n) == LUA_TFUNCTION) as c_int
365}
366
367#[inline(always)]
368pub unsafe fn lua_istable(L: *mut lua_State, n: c_int) -> c_int {
369 (lua_type(L, n) == LUA_TTABLE) as c_int
370}
371
372#[inline(always)]
373pub unsafe fn lua_islightuserdata(L: *mut lua_State, n: c_int) -> c_int {
374 (lua_type(L, n) == LUA_TLIGHTUSERDATA) as c_int
375}
376
377#[inline(always)]
378pub unsafe fn lua_isnil(L: *mut lua_State, n: c_int) -> c_int {
379 (lua_type(L, n) == LUA_TNIL) as c_int
380}
381
382#[inline(always)]
383pub unsafe fn lua_isboolean(L: *mut lua_State, n: c_int) -> c_int {
384 (lua_type(L, n) == LUA_TBOOLEAN) as c_int
385}
386
387#[inline(always)]
388pub unsafe fn lua_isvector(L: *mut lua_State, n: c_int) -> c_int {
389 (lua_type(L, n) == LUA_TVECTOR) as c_int
390}
391
392#[inline(always)]
393pub unsafe fn lua_isthread(L: *mut lua_State, n: c_int) -> c_int {
394 (lua_type(L, n) == LUA_TTHREAD) as c_int
395}
396
397#[inline(always)]
398pub unsafe fn lua_isbuffer(L: *mut lua_State, n: c_int) -> c_int {
399 (lua_type(L, n) == LUA_TBUFFER) as c_int
400}
401
402#[inline(always)]
403pub unsafe fn lua_isnone(L: *mut lua_State, n: c_int) -> c_int {
404 (lua_type(L, n) == LUA_TNONE) as c_int
405}
406
407#[inline(always)]
408pub unsafe fn lua_isnoneornil(L: *mut lua_State, n: c_int) -> c_int {
409 (lua_type(L, n) <= LUA_TNIL) as c_int
410}
411
412#[inline(always)]
413pub unsafe fn lua_pushliteral(L: *mut lua_State, s: &'static CStr) {
414 lua_pushstring_(L, s.as_ptr());
415}
416
417#[inline(always)]
418pub unsafe fn lua_pushcfunction(L: *mut lua_State, f: lua_CFunction) {
419 lua_pushcclosurek(L, f, ptr::null(), 0, None)
420}
421
422#[inline(always)]
423pub unsafe fn lua_pushcfunctiond(L: *mut lua_State, f: lua_CFunction, debugname: *const c_char) {
424 lua_pushcclosurek(L, f, debugname, 0, None)
425}
426
427#[inline(always)]
428pub unsafe fn lua_pushcclosure(L: *mut lua_State, f: lua_CFunction, nup: c_int) {
429 lua_pushcclosurek(L, f, ptr::null(), nup, None)
430}
431
432#[inline(always)]
433pub unsafe fn lua_pushcclosured(L: *mut lua_State, f: lua_CFunction, debugname: *const c_char, nup: c_int) {
434 lua_pushcclosurek(L, f, debugname, nup, None)
435}
436
437#[inline(always)]
438pub unsafe fn lua_pushlightuserdata(L: *mut lua_State, p: *mut c_void) {
439 lua_pushlightuserdatatagged(L, p, 0)
440}
441
442#[inline(always)]
443pub unsafe fn lua_setglobal(L: *mut lua_State, var: *const c_char) {
444 lua_setfield(L, LUA_GLOBALSINDEX, var)
445}
446
447#[inline(always)]
448pub unsafe fn lua_getglobal(L: *mut lua_State, var: *const c_char) -> c_int {
449 lua_getfield(L, LUA_GLOBALSINDEX, var)
450}
451
452#[inline(always)]
453pub unsafe fn lua_tostring(L: *mut lua_State, i: c_int) -> *const c_char {
454 lua_tolstring(L, i, ptr::null_mut())
455}
456
457const LUA_IDSIZE: usize = 256;
463
464pub type lua_Hook = unsafe extern "C-unwind" fn(L: *mut lua_State, ar: *mut lua_Debug);
466
467pub type lua_Coverage = unsafe extern "C-unwind" fn(
468 context: *mut c_void,
469 function: *const c_char,
470 linedefined: c_int,
471 depth: c_int,
472 hits: *const c_int,
473 size: usize,
474);
475
476unsafe extern "C-unwind" {
477 pub fn lua_stackdepth(L: *mut lua_State) -> c_int;
478 pub fn lua_getinfo(L: *mut lua_State, level: c_int, what: *const c_char, ar: *mut lua_Debug) -> c_int;
479 pub fn lua_getargument(L: *mut lua_State, level: c_int, n: c_int) -> c_int;
480 pub fn lua_getlocal(L: *mut lua_State, level: c_int, n: c_int) -> *const c_char;
481 pub fn lua_setlocal(L: *mut lua_State, level: c_int, n: c_int) -> *const c_char;
482 pub fn lua_getupvalue(L: *mut lua_State, funcindex: c_int, n: c_int) -> *const c_char;
483 pub fn lua_setupvalue(L: *mut lua_State, funcindex: c_int, n: c_int) -> *const c_char;
484
485 pub fn lua_singlestep(L: *mut lua_State, enabled: c_int);
486 pub fn lua_breakpoint(L: *mut lua_State, funcindex: c_int, line: c_int, enabled: c_int) -> c_int;
487
488 pub fn lua_getcoverage(L: *mut lua_State, funcindex: c_int, context: *mut c_void, callback: lua_Coverage);
489
490 pub fn lua_debugtrace(L: *mut lua_State) -> *const c_char;
491}
492
493#[repr(C)]
494pub struct lua_Debug {
495 pub name: *const c_char,
496 pub what: *const c_char,
497 pub source: *const c_char,
498 pub short_src: *const c_char,
499 pub linedefined: c_int,
500 pub currentline: c_int,
501 pub nupvals: u8,
502 pub nparams: u8,
503 pub isvararg: c_char,
504 pub userdata: *mut c_void,
505 pub ssbuf: [c_char; LUA_IDSIZE],
506}
507
508#[repr(C)]
514#[non_exhaustive]
515pub struct lua_Callbacks {
516 pub userdata: *mut c_void,
518
519 pub interrupt: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, gc: c_int)>,
521 pub panic: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, errcode: c_int)>,
523
524 pub userthread: Option<unsafe extern "C-unwind" fn(LP: *mut lua_State, L: *mut lua_State)>,
526 pub useratom: Option<unsafe extern "C-unwind" fn(s: *const c_char, l: usize) -> i16>,
528
529 pub debugbreak: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, ar: *mut lua_Debug)>,
531 pub debugstep: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, ar: *mut lua_Debug)>,
533 pub debuginterrupt: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, ar: *mut lua_Debug)>,
535 pub debugprotectederror: Option<unsafe extern "C-unwind" fn(L: *mut lua_State)>,
537
538 pub onallocate: Option<unsafe extern "C-unwind" fn(L: *mut lua_State, osize: usize, nsize: usize)>,
540}
541
542unsafe extern "C" {
543 pub fn lua_callbacks(L: *mut lua_State) -> *mut lua_Callbacks;
544}
545
546unsafe extern "C" {
548 pub fn luau_setfflag(name: *const c_char, value: c_int) -> c_int;
549 pub fn lua_getmetatablepointer(L: *mut lua_State, idx: c_int) -> *const c_void;
550 pub fn lua_gcdump(
551 L: *mut lua_State,
552 file: *mut c_void,
553 category_name: Option<unsafe extern "C" fn(L: *mut lua_State, memcat: u8) -> *const c_char>,
554 );
555}