Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
set_custom_app_data
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Aug 2, 2017
1 parent 749f35b commit 7a88296
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ pub unsafe fn ice_server_set_endpoint_timeout_ms(handle: ServerHandle, t: u64) {

let mut server = handle.lock().unwrap();
*server.prep.endpoint_timeout_ms.lock().unwrap() = t;
}
}

#[no_mangle]
pub unsafe fn ice_server_set_custom_app_data(handle: ServerHandle, ptr: *const c_void) {
let handle = &*handle;

let server = handle.lock().unwrap();
server.prep.custom_app_data.set_raw(ptr);
}

#[no_mangle]
pub unsafe fn ice_context_render_template(handle: ContextHandle, name: *const c_char, data: *const c_char) -> *mut c_char {
Expand Down Expand Up @@ -178,6 +186,13 @@ pub unsafe fn ice_context_stats_set_custom(handle: ContextHandle, k: *const c_ch
handle.stats.set_custom(k, v);
}

#[no_mangle]
pub unsafe fn ice_context_set_custom_app_data(handle: ContextHandle, ptr: *const c_void) {
let handle = &*handle;

handle.custom_app_data.set_raw(ptr);
}

#[no_mangle]
pub unsafe fn ice_core_destroy_context_handle(handle: ContextHandle) {
Arc::from_raw(handle);
Expand Down

0 comments on commit 7a88296

Please sign in to comment.