Debian Codegraph @

third_party/rust/cubeb-pulse/src/backend/mod.rs

raw
1 // Copyright © 2017-2018 Mozilla Foundation
2 //
3 // This program is made available under an ISC-style license. See the
4 // accompanying file LICENSE for details.
5
6 mod context;
7 mod cork_state;
8 mod intern;
9 mod stream;
10
11 pub use self::context::PulseContext;
12 use self::intern::Intern;
13 pub use self::stream::PulseStream;
14 use std::ffi::CStr;
15 use std::os::raw::c_char;
16
17 // helper to convert *const c_char to Option<CStr>
18 fn try_cstr_from<'str>(s: *const c_char) -> Option<&'str CStr> {
19 if s.is_null() {
20 None
21 } else {
22 Some(unsafe { CStr::from_ptr(s) })
23 }
24 }