hello/hello.rs
1extern crate lua53_sys;
2extern crate libc;
3
4use lua53_sys::{lauxlib, lua};
5
6pub const HELLO: &'static [u8] = b"print(\"Hello\")\0";
7
8fn main() {
9 unsafe {
10 let state = lauxlib::luaL_newstate();
11 lauxlib::luaL_openlibs(state);
12 lauxlib::luaL_dostring(state, HELLO.as_ptr() as *const libc::c_char);
13 lua::lua_close(state);
14 }
15}