libsoxr_sys/
lib.rs

1//! # libsoxr-sys
2//! This crate is generated from [libsoxr](https://sourceforge.net/projects/soxr/) 
3//! using [bindgen](https://github.com/rust-lang/rust-bindgen).
4//!
5//! The documentation for this library can be found in the original C header 
6//! file [`soxr.h`](https://sourceforge.net/p/soxr/code/ci/master/tree/src/soxr.h) of libsoxr.
7
8#![allow(non_camel_case_types)]
9#![allow(clippy::redundant_static_lifetimes)]
10include!("generated.rs");
11
12pub type soxr_fn_state_t = *const std::os::raw::c_void;
13pub type soxr_fn_state_t_mut = *mut std::os::raw::c_void;
14
15// bindgen did not generate the following redefines
16pub const SOXR_HQ: u32 = SOXR_20_BITQ; /* 'High quality'. */
17pub const SOXR_VHQ: u32 = SOXR_28_BITQ; /* 'Very high quality'. */
18
19#[test]
20fn test_version() {
21    use std::ffi::CStr;
22
23    let version = unsafe { soxr_version() };
24    let cstr = unsafe { CStr::from_ptr(version) };
25    let version = std::str::from_utf8(cstr.to_bytes()).unwrap();
26    println!("{}", version);
27    assert_eq!("libsoxr-0.1.3", version);
28}