Fix callback types

This commit is contained in:
Jeff Muizelaar
2017-03-15 11:50:43 -04:00
parent ecf21c2c5b
commit 34659f9ae2
+12 -12
View File
@@ -9,21 +9,21 @@
use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType};
use libc::{c_void, size_t};
use libc::{c_void, size_t, off_t};
use std::mem;
use std::ptr;
pub type CGDataProviderGetBytesCallback = *const u8;
pub type CGDataProviderReleaseInfoCallback = *const u8;
pub type CGDataProviderRewindCallback = *const u8;
pub type CGDataProviderSkipBytesCallback = *const u8;
pub type CGDataProviderSkipForwardCallback = *const u8;
pub type CGDataProviderGetBytesCallback = Option<unsafe extern fn (*mut c_void, *mut c_void, size_t) -> size_t>;
pub type CGDataProviderReleaseInfoCallback = Option<unsafe extern fn (*mut c_void)>;
pub type CGDataProviderRewindCallback = Option<unsafe extern fn (*mut c_void)>;
pub type CGDataProviderSkipBytesCallback = Option<unsafe extern fn (*mut c_void, size_t)>;
pub type CGDataProviderSkipForwardCallback = Option<unsafe extern fn (*mut c_void, off_t) -> off_t>;
pub type CGDataProviderGetBytePointerCallback = *const u8;
pub type CGDataProviderGetBytesAtOffsetCallback = *const u8;
pub type CGDataProviderReleaseBytePointerCallback = *const u8;
pub type CGDataProviderReleaseDataCallback = *const u8;
pub type CGDataProviderGetBytesAtPositionCallback = *const u8;
pub type CGDataProviderGetBytePointerCallback = Option<unsafe extern fn (*mut c_void) -> *mut c_void>;
pub type CGDataProviderGetBytesAtOffsetCallback = Option<unsafe extern fn (*mut c_void, *mut c_void, size_t, size_t)>;
pub type CGDataProviderReleaseBytePointerCallback = Option<unsafe extern fn (*mut c_void, *const c_void)>;
pub type CGDataProviderReleaseDataCallback = Option<unsafe extern fn (*mut c_void, *const c_void, size_t)>;
pub type CGDataProviderGetBytesAtPositionCallback = Option<unsafe extern fn (*mut c_void, *mut c_void, off_t, size_t)>;
#[repr(C)]
pub struct __CGDataProvider;
@@ -82,7 +82,7 @@ impl CGDataProvider {
let result = CGDataProviderCreateWithData(ptr::null_mut(),
buffer.as_ptr() as *const c_void,
buffer.len() as size_t,
ptr::null());
None);
TCFType::wrap_under_create_rule(result)
}
}