summaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: a1e83fc2e08f355e8724ebda47d06a48f5da27dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
extern crate bchlib_sys as ffi;

struct BCH(ffi::bch_control);

impl BCH {
    fn init(m: i32, t: i32, poly: u32) -> BCH {
        let bch = unsafe { *ffi::init_bch(m, t, poly) };
        BCH(bch)
    }
}


#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_works() {
        let bch = BCH::init(5, 2, 0);
    }
}