Skip to content

Commit 9287d5d

Browse files
authored
Lutf8lib (#3)
* Initial commit * Chop down to minimal * Remove static * Add new file so it gets compiled * Tests working * Working * Move more code * More more * More more stuff * Delete old code * Move more stuff * Remove stuff that has moved * Remove lutf8lib.c * Cleanup all the warnings * Cleanup stuff that's not public * cargo fmt * Cleanup more * Couple more cleanups * Fix types * More types cleanup
1 parent c74f44b commit 9287d5d

File tree

5 files changed

+425
-258
lines changed

5 files changed

+425
-258
lines changed

build/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ fn main() {
2323
.file("build/lstrlib.c")
2424
.file("build/ltablib.c")
2525
.file("build/lua.c")
26-
.file("build/lutf8lib.c")
2726
.compile("lua");
2827
}

build/lutf8lib.c

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

src/lauxlib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
** Auxiliary functions for building Lua libraries
33
*/
44

5-
use libc::{c_char, c_int};
5+
use libc::{c_char, c_int, size_t};
66

77
use crate::{lstate::lua_State, types::lua_CFunction};
88

@@ -25,3 +25,13 @@ extern "C" {
2525
pub fn luaL_loadfilex(L: *mut lua_State, filename: *const c_char, mode: *const c_char)
2626
-> c_int;
2727
}
28+
29+
#[derive(Copy, Clone)]
30+
#[repr(C)]
31+
pub struct luaL_Buffer {
32+
pub b: *mut libc::c_char,
33+
pub size: size_t,
34+
pub n: size_t,
35+
pub L: *mut lua_State,
36+
pub initb: [libc::c_char; 8192],
37+
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub(crate) mod lstring;
3030
pub(crate) mod ltable;
3131
pub(crate) mod ltm;
3232
pub(crate) mod lundump;
33+
pub(crate) mod lutf8lib;
3334
pub(crate) mod lvm;
3435
pub(crate) mod lzio;
3536

0 commit comments

Comments
 (0)