Debian Codegraph @

third_party/rust/cubeb-pulse/src/capi.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 use backend::PulseContext;
7 use cubeb_backend::{capi, ffi};
8 use std::os::raw::{c_char, c_int};
9
10 /// # Safety
11 ///
12 /// Entry point from C code. This function is unsafe because it dereferences
13 /// the given `c` and `context_name` pointers. The caller should ensure those
14 /// pointers are valid.
15 #[no_mangle]
16 pub unsafe extern "C" fn pulse_rust_init(
17 c: *mut *mut ffi::cubeb,
18 context_name: *const c_char,
19 ) -> c_int {
20 capi::capi_init::<PulseContext>(c, context_name)
21 }