summaryrefslogtreecommitdiffstats
path: root/third_party/rust/cubeb/src/context.rs
blob: 6b9d8fc03da2b4f9bc64431877773a4ae5c428a3 (plain)
1
2
3
4
5
6
7
8
9
use std::ffi::CString;
use {Context, Result};

/// Initialize a new cubeb [`Context`]
pub fn init<T: Into<Vec<u8>>>(name: T) -> Result<Context> {
    let name = CString::new(name)?;

    Context::init(Some(name.as_c_str()), None)
}