mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
embedding: cef_string_list_append()
This commit is contained in:
parent
ee8ef615a6
commit
f957f989cf
1 changed files with 11 additions and 0 deletions
|
@ -26,3 +26,14 @@ extern "C" fn cef_string_list_size(lt: *const cef_string_list_t) -> c_int {
|
|||
v.len() as c_int
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn cef_string_list_append(lt: *mut cef_string_list_t, value: *const cef_string_t) {
|
||||
unsafe {
|
||||
if fptr_is_null(mem::transmute(lt)) { return; }
|
||||
let mut v: Box<Vec<*mut cef_string_t>> = mem::transmute(lt);
|
||||
let cs = cef_string_userfree_utf8_alloc();
|
||||
cef_string_utf8_set(mem::transmute((*value).str), (*value).length, cs, 1);
|
||||
v.push(cs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue