Skip to content

Commit bb7ec66

Browse files
committed
Migrate lstate
1 parent 235dd0d commit bb7ec66

File tree

15 files changed

+555
-383
lines changed

15 files changed

+555
-383
lines changed

build/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn main() {
2222
.file("build/lobject.c")
2323
.file("build/loslib.c")
2424
.file("build/lparser.c")
25-
.file("build/lstate.c")
2625
.file("build/lstrlib.c")
2726
.file("build/ltable.c")
2827
.file("build/ltablib.c")

build/lstate.c

Lines changed: 0 additions & 347 deletions
This file was deleted.

src/lapi.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
** Lua API
3+
*/
4+
5+
use crate::lstate::lua_State;
6+
use crate::types::lua_Number;
7+
8+
pub unsafe fn api_incr_top(L: *mut lua_State) {
9+
(*L).top = (*L).top.add(1);
10+
debug_assert!((*L).top <= (*(*L).ci).top, "stack overflow");
11+
}
12+
13+
extern "C" {
14+
pub fn lua_version(L: *mut lua_State) -> *const lua_Number;
15+
}

src/ldebug.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ extern "C" {
1212
p2: *const TValue,
1313
msg: *const c_char,
1414
) -> !;
15+
pub fn luaG_runerror(L: *mut lua_State, fmt: *const c_char, args: ...) -> !;
1516
}

0 commit comments

Comments
 (0)