mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
embedding: cef_string_multimap_value()
This commit is contained in:
parent
ce3e9fb511
commit
ef288f1195
1 changed files with 19 additions and 0 deletions
|
@ -114,3 +114,22 @@ pub extern "C" fn cef_string_multimap_key(smm: *mut cef_string_multimap_t, index
|
|||
}
|
||||
0
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_multimap_value(smm: *mut cef_string_multimap_t, index: c_int, value: *mut cef_string_t) -> c_int {
|
||||
unsafe {
|
||||
if index < 0 || smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
let mut rem = index as uint;
|
||||
|
||||
for (_, val) in (*v).values().enumerate() {
|
||||
if rem < (*val).len() {
|
||||
let cs = (*val)[rem as uint];
|
||||
return cef_string_utf8_set((*cs).str as *const u8, (*cs).length, value, 1);
|
||||
} else {
|
||||
rem = rem - (*val).len();
|
||||
}
|
||||
}
|
||||
}
|
||||
0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue