summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2019-03-18 14:16:49 +0200
committerYuval Adam <_@yuv.al>2019-03-18 14:20:57 +0200
commit77614da6736185a50b71713e4e0b3f7a7c4e840b (patch)
treebd74ab84f37d6c2485fae3a36082f6407b025194
parent2cda7faab3eab847947d5da85202d1fb7bfbc766 (diff)
Initial version of bchlib-sys
-rw-r--r--.gitignore3
-rw-r--r--Cargo.toml6
-rw-r--r--README.md4
-rw-r--r--build.rs4
-rw-r--r--src/bch/bchbin22976 -> 0 bytes
-rw-r--r--src/lib.rs6
6 files changed, 15 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 8b6b607..391c970 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/src/bch/bch
/target
**/*.rs.bk
@@ -7,4 +8,4 @@
#/target
#**/*.rs.bk
-Cargo.lock \ No newline at end of file
+Cargo.lock
diff --git a/Cargo.toml b/Cargo.toml
index 7617876..035ef45 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,8 +1,12 @@
[package]
-name = "bchlib"
+name = "bchlib-sys"
version = "0.1.0"
authors = ["Yuval Adam <_@yuv.al>"]
edition = "2018"
+description = "Low-level Rust bindings for BCH encoding/decoding library, based on the bch_codec fork"
+license = "GPL-2.0"
+license-file = "LICENSE.md"
+repository = "https://github.com/yuvadm/bchlib-sys"
[build-dependencies]
bindgen = "0.42.2"
diff --git a/README.md b/README.md
index 96e1c81..721e13b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# bchlib
+# bchlib-sys
-Rust bindings for BCH encoding/decoding library, based on the [bch_codec](https://github.com/mborgerding/bch_codec) fork.
+Low-level Rust bindings for BCH encoding/decoding library, based on the [bch_codec](https://github.com/mborgerding/bch_codec) fork.
## Build
diff --git a/build.rs b/build.rs
index 3ccb76d..605fec2 100644
--- a/build.rs
+++ b/build.rs
@@ -5,9 +5,7 @@ use std::env;
use std::path::PathBuf;
fn main() {
- cc::Build::new().file("src/bch/bch.c");
-
- println!("cargo:rustc-link-lib=bch");
+ cc::Build::new().file("src/bch/bch.c").compile("bch");
let bindings = bindgen::Builder::default()
.header("src/bch/bch.h")
diff --git a/src/bch/bch b/src/bch/bch
deleted file mode 100644
index 5b438cd..0000000
--- a/src/bch/bch
+++ /dev/null
Binary files differ
diff --git a/src/lib.rs b/src/lib.rs
index 4a01ab7..47eaa43 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,8 +6,12 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(test)]
mod tests {
+ use super::*;
+
#[test]
fn it_works() {
- assert_eq!(2 + 2, 4);
+ unsafe {
+ let _c = init_bch(5, 2, 37);
+ }
}
}