summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2019-03-18 16:54:52 +0200
committerYuval Adam <_@yuv.al>2019-03-18 16:54:52 +0200
commit4e5cac1c627648fd8ade50024490d541d0c6bf93 (patch)
tree5a7b1e7f781ab52706d9584f00f780f52823e79f
parent82388514aa38f632738e60337712dc036fc3dbb8 (diff)
Initial ffi calls not working
-rw-r--r--Cargo.toml1
-rw-r--r--src/lib.rs12
2 files changed, 12 insertions, 1 deletions
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();
}
}