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