From 6dd1eca677a58787f87aae076185a1e04dab1caf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 7 Nov 2014 15:39:15 -0500 Subject: [PATCH] embedding: begin cef string_map api cef_string_map_alloc() --- ports/cef/lib.rs | 1 + ports/cef/string_map.rs | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ports/cef/string_map.rs diff --git a/ports/cef/lib.rs b/ports/cef/lib.rs index a13c489b790..ad2452ce60b 100644 --- a/ports/cef/lib.rs +++ b/ports/cef/lib.rs @@ -51,6 +51,7 @@ pub mod mem; pub mod request; pub mod string; pub mod string_list; +pub mod string_map; pub mod task; pub mod types; pub mod urlrequest; diff --git a/ports/cef/string_map.rs b/ports/cef/string_map.rs new file mode 100644 index 00000000000..ed3ca226060 --- /dev/null +++ b/ports/cef/string_map.rs @@ -0,0 +1,23 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use eutil::fptr_is_null; +use libc::{c_int}; +use std::collections::TreeMap; +use std::mem; +use std::slice; +use std::str; +use std::string::String; +use string::{cef_string_userfree_utf8_alloc,cef_string_userfree_utf8_free,cef_string_utf8_set}; +use types::{cef_string_map_t,cef_string_t}; + +//cef_string_map + +#[no_mangle] +pub extern "C" fn cef_string_map_alloc() -> *mut cef_string_map_t { + unsafe { + let sm: Box> = box TreeMap::new(); + mem::transmute(sm) + } +}