blob: 08e7b310ca1b83ed753289b63bfa4568ddbe7c99 (
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
39
40
41
|
#![cfg_attr(test, allow(dead_code))]
use self::imp::{make_handler, drop_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) {
}
}
|