mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
embedding: cef_string_multimap_find_count()
This commit is contained in:
parent
cc55f88496
commit
f1f8c65de7
1 changed files with 16 additions and 0 deletions
|
@ -36,3 +36,19 @@ pub extern "C" fn cef_string_multimap_size(smm: *mut cef_string_multimap_t) -> c
|
||||||
c
|
c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn cef_string_multimap_find_count(smm: *mut cef_string_multimap_t, key: *const cef_string_t) -> c_int {
|
||||||
|
unsafe {
|
||||||
|
if smm.is_null() { return 0; }
|
||||||
|
let v = string_multimap_to_treemap(smm);
|
||||||
|
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||||
|
match (*v).find(&String::from_str(result)) {
|
||||||
|
Some(s) => {
|
||||||
|
s.len() as c_int
|
||||||
|
}
|
||||||
|
None => 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue