Debian Codegraph @

third_party/rust/cubeb-coreaudio/src/capi.rs

raw
1 // Copyright © 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 crate::backend::AudioUnitContext;
7 use cubeb_backend::{capi, ffi};
8 use std::os::raw::{c_char, c_int};
9
10 /// # Safety
11 ///
12 /// This function should only be called once per process.
13 #[no_mangle]
14 pub unsafe extern "C" fn audiounit_rust_init(
15 c: *mut *mut ffi::cubeb,
16 context_name: *const c_char,
17 ) -> c_int {
18 capi::capi_init::<AudioUnitContext>(c, context_name)
19 }