Lines Matching defs:Ashmem
14 //! Ashmem provides interfaces for operating shared memory.
30 /// Module Ashmem::ffi. Includes interfaces which will call c++ counterparts via
37 /// Create an C++ Ashmem object managed by std::shared_ptr.
39 /// Requires C-style string as parameter to specify the name of Ashmem.
40 pub unsafe fn CreateAshmemStd(name: *const c_char, size: i32) -> SharedPtr<Ashmem>;
58 /// C++ Ashmem class.
59 pub type Ashmem;
63 pub fn CloseAshmem(self: &Ashmem) -> ();
66 pub fn MapAshmem(self: &Ashmem, mapType: i32) -> bool;
69 pub fn MapReadAndWriteAshmem(self: &Ashmem) -> bool;
72 pub fn MapReadOnlyAshmem(self: &Ashmem) -> bool;
75 pub fn UnmapAshmem(self: &Ashmem) -> ();
78 pub fn SetProtection(self: &Ashmem, protType: i32) -> bool;
81 pub fn GetProtection(self: &Ashmem) -> i32;
84 pub fn GetAshmemSize(self: &Ashmem) -> i32;
91 self: &Ashmem,
101 pub unsafe fn ReadFromAshmem(self: &Ashmem, size: i32, offset: i32) -> *const c_void;
104 pub fn GetAshmemFd(self: &Ashmem) -> i32;
108 /// Ashmem in rust.
109 pub struct Ashmem {
110 c_ashmem: SharedPtr<ffi::Ashmem>,
113 /// Ashmem implementation.
114 impl Ashmem {
116 pub fn new(c_ashmem: SharedPtr<ffi::Ashmem>) -> Ashmem {
117 Ashmem { c_ashmem }
177 pub unsafe fn c_ashmem(&self) -> &SharedPtr<ffi::Ashmem> {
190 /// Create Ashmem struct in Rust, which holds a refrence to c++ Ashmem object.
193 pub unsafe fn create_ashmem_instance(name: &str, size: i32) -> Option<Ashmem> {
201 Some(Ashmem::new(c_ashmem_ptr))