blob: 7b58c83193bf3579d484798a21d6c125a378d6d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#![cfg_attr(test, allow(dead_code))]
use self::imp::{drop_handler, make_handler};
pub use self::imp::cleanup;
pub use self::imp::init;
pub struct Handler {
_data: *mut libc::c_void,
}
impl Handler {
pub unsafe fn new() -> Handler {
make_handler()
}
}
impl Drop for Handler {
fn drop(&mut self) {
unsafe {
drop_handler(self);
}
}
}
mod imp {
use crate::ptr;
pub unsafe fn init() {}
pub unsafe fn cleanup() {}
pub unsafe fn make_handler() -> super::Handler {
super::Handler { _data: ptr::null_mut() }
}
pub unsafe fn drop_handler(_handler: &mut super::Handler) {}
}
|