]> git.proxmox.com Git - rustc.git/blob - vendor/core-foundation-sys/src/data.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / vendor / core-foundation-sys / src / data.rs
1 // Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9
10 use std::os::raw::c_void;
11
12 use base::{CFAllocatorRef, CFTypeID, CFIndex, CFRange};
13
14 #[repr(C)]
15 pub struct __CFData(c_void);
16
17 pub type CFDataRef = *const __CFData;
18
19 extern {
20 /*
21 * CFData.h
22 */
23
24 pub fn CFDataCreate(allocator: CFAllocatorRef,
25 bytes: *const u8, length: CFIndex) -> CFDataRef;
26 //fn CFDataFind
27 pub fn CFDataGetBytePtr(theData: CFDataRef) -> *const u8;
28 pub fn CFDataGetBytes(theData: CFDataRef, range: CFRange, buffer: *mut u8);
29 pub fn CFDataGetLength(theData: CFDataRef) -> CFIndex;
30 pub fn CFDataCreateWithBytesNoCopy(
31 allocator: CFAllocatorRef,
32 bytes: *const u8,
33 length: CFIndex,
34 allocator: CFAllocatorRef,
35 ) -> CFDataRef;
36
37 pub fn CFDataGetTypeID() -> CFTypeID;
38 }