Skip to main content

luaur_vm/records/
lua_l_strbuf.rs

1//! Node: lua_l_strbuf
2//! Source: `VM/include/lualib.h` (lualib.h:86-98, hand-ported)
3
4use crate::records::t_string::TString;
5use crate::type_aliases::lua_state::lua_State;
6use core::ffi::c_char;
7
8// luaconf.h:96
9pub const LUA_BUFFERSIZE: usize = 512;
10
11#[repr(C)]
12#[derive(Debug)]
13pub struct LuaLStrbuf {
14    pub p: *mut c_char,   // current position in buffer
15    pub end: *mut c_char, // end of the current buffer
16    pub L: *mut lua_State,
17    pub storage: *mut TString,
18    pub buffer: [c_char; LUA_BUFFERSIZE],
19}
20
21#[allow(non_camel_case_types)]
22pub type luaL_Strbuf = LuaLStrbuf;
23// compatibility typedef: called luaL_Buffer in Lua headers
24#[allow(non_camel_case_types)]
25pub type luaL_Buffer = LuaLStrbuf;