Extract ffi to lua52-sys
This commit is contained in:
parent
414922ca5a
commit
582b188101
2
lua52-sys/.gitignore
vendored
Normal file
2
lua52-sys/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Cargo.lock
|
||||||
|
target
|
13
lua52-sys/Cargo.toml
Normal file
13
lua52-sys/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
|
||||||
|
name = "lua52-sys"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||||
|
description = "Bindings for Lua 5.2"
|
||||||
|
build = "build.rs"
|
||||||
|
links = "lua52"
|
||||||
|
license = "MIT"
|
||||||
|
repository = "https://github.com/tomaka/rust-hl-lua"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
pkg-config = "*"
|
5
lua52-sys/build.rs
Normal file
5
lua52-sys/build.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
extern crate "pkg-config" as pkg_config;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
pkg_config::find_library("lua5.2").unwrap();
|
||||||
|
}
|
@ -2,9 +2,10 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use libc;
|
extern crate libc;
|
||||||
|
|
||||||
use libc::c_int;
|
use libc::c_int;
|
||||||
use std::{ default, ptr };
|
use std::{default, ptr};
|
||||||
|
|
||||||
pub const MULTRET: c_int = -1;
|
pub const MULTRET: c_int = -1;
|
||||||
|
|
||||||
@ -20,8 +21,8 @@ pub const LUA_ERRMEM: c_int = 4;
|
|||||||
pub const LUA_ERRGCMM: c_int = 5;
|
pub const LUA_ERRGCMM: c_int = 5;
|
||||||
pub const LUA_ERRERR: c_int = 6;
|
pub const LUA_ERRERR: c_int = 6;
|
||||||
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
#[allow(missing_copy_implementations)]
|
||||||
pub struct lua_State;
|
pub struct lua_State;
|
||||||
|
|
||||||
pub type lua_CFunction = extern "C" fn(L: *mut lua_State) -> c_int;
|
pub type lua_CFunction = extern "C" fn(L: *mut lua_State) -> c_int;
|
||||||
@ -92,6 +93,7 @@ pub const LUA_MASKLINE: c_int = 1 << LUA_HOOKLINE as uint;
|
|||||||
pub const LUA_MASKCOUNT: c_int = 1 << LUA_HOOKCOUNT as uint;
|
pub const LUA_MASKCOUNT: c_int = 1 << LUA_HOOKCOUNT as uint;
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
#[allow(missing_copy_implementations)]
|
||||||
pub struct lua_Debug {
|
pub struct lua_Debug {
|
||||||
pub event: c_int,
|
pub event: c_int,
|
||||||
pub name: *const libc::c_char,
|
pub name: *const libc::c_char,
|
@ -4,3 +4,7 @@ name = "rust-hl-lua"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = [ "pierre.krieger1708@gmail.com" ]
|
authors = [ "pierre.krieger1708@gmail.com" ]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
|
[dependencies.lua52-sys]
|
||||||
|
version = "*"
|
||||||
|
path = "../lua52-sys"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
|
extern crate "lua52-sys" as ffi;
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::io::IoError;
|
use std::io::IoError;
|
||||||
@ -17,7 +18,6 @@ pub mod functions_read;
|
|||||||
pub mod lua_tables;
|
pub mod lua_tables;
|
||||||
pub mod userdata;
|
pub mod userdata;
|
||||||
|
|
||||||
mod ffi;
|
|
||||||
mod functions_write;
|
mod functions_write;
|
||||||
mod rust_tables;
|
mod rust_tables;
|
||||||
mod tuples;
|
mod tuples;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user