embedding: cef_string_list_size()

This commit is contained in:
Mike Blumenkrantz 2014-10-14 15:20:44 -04:00
parent 4d8ed45e7b
commit ee8ef615a6

View file

@ -17,3 +17,12 @@ extern "C" fn cef_string_list_alloc() -> *mut cef_string_list_t {
mem::transmute(lt) 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<Vec<*mut cef_string_t>> = mem::transmute(lt);
v.len() as c_int
}
}