From ee8ef615a6198f2c0760823bef734d9c71121477 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 14 Oct 2014 15:20:44 -0400 Subject: [PATCH] embedding: cef_string_list_size() --- ports/cef/string_list.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/cef/string_list.rs b/ports/cef/string_list.rs index 9516c5b1848..74716e017d0 100644 --- a/ports/cef/string_list.rs +++ b/ports/cef/string_list.rs @@ -17,3 +17,12 @@ extern "C" fn cef_string_list_alloc() -> *mut cef_string_list_t { mem::transmute(lt) } } + +#[no_mangle] +extern "C" fn cef_string_list_size(lt: *const cef_string_list_t) -> c_int { + unsafe { + if fptr_is_null(mem::transmute(lt)) { return 0; } + let v: Box> = mem::transmute(lt); + v.len() as c_int + } +}