ldpc-toolbox 0.12.0

Utilities to aid in LDPC code design
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use libc::size_t;
use std::{
    convert::TryFrom,
    ffi::{CStr, c_char},
};

mod decoder;
mod encoder;

unsafe fn c_to_string(s: *const c_char) -> String {
    String::from_utf8_lossy(unsafe { CStr::from_ptr(s) }.to_bytes()).to_string()
}

#[allow(clippy::useless_conversion)]
fn size_t_to_usize(n: size_t) -> usize {
    usize::try_from(n).unwrap()
}