From 4e5cac1c627648fd8ade50024490d541d0c6bf93 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 18 Mar 2019 16:54:52 +0200 Subject: Initial ffi calls not working --- Cargo.toml | 1 + src/lib.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 19ded13..73f3293 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,4 @@ authors = ["Yuval Adam <_@yuv.al>"] edition = "2018" [dependencies] +bchlib-sys = "0.1.0" diff --git a/src/lib.rs b/src/lib.rs index 31e1bb2..0af03a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,17 @@ +extern crate bchlib_sys as ffi; + +pub fn init(m:i32, t:i32, poly: u32) { + unsafe { + let bch = ffi::init_bch(m, t, poly); + } +} + #[cfg(test)] mod tests { + use super::*; + #[test] fn it_works() { - assert_eq!(2 + 2, 4); + init(); } } -- cgit v1.3.1