Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split a -sys crate out #68

Merged
merged 19 commits into from Oct 15, 2015

Port data to sys crate

  • Loading branch information
sfackler committed Sep 6, 2015
commit 80593ffc5de0b3d289fe0f12eed4e6d049314017
@@ -0,0 +1,19 @@
use libc::c_void;

use base::{CFAllocatorRef, CFTypeID, CFIndex};

pub type CFDataRef = *const c_void;

extern {
/*
* CFData.h
*/

pub fn CFDataCreate(allocator: CFAllocatorRef,
bytes: *const u8, length: CFIndex) -> CFDataRef;
//fn CFDataFind
pub fn CFDataGetBytePtr(theData: CFDataRef) -> *const u8;
pub fn CFDataGetLength(theData: CFDataRef) -> CFIndex;

pub fn CFDataGetTypeID() -> CFTypeID;
}
@@ -5,5 +5,6 @@ extern crate libc;
pub mod array;
pub mod base;
pub mod bundle;
pub mod data;
pub mod number;
pub mod string;
@@ -9,19 +9,15 @@

//! Core Foundation byte buffers.

use core_foundation_sys::base::{CFAllocatorRef, CFIndex, CFRelease};
use core_foundation_sys::base::{CFTypeID, kCFAllocatorDefault};
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault};
use core_foundation_sys::data::*;
use std::mem;
use std::ops::Deref;
use std::slice;

use base::{CFIndexConvertible, TCFType};

#[repr(C)]
struct __CFData;

pub type CFDataRef = *const __CFData;

/// A byte buffer.
pub struct CFData(CFDataRef);

@@ -71,18 +67,3 @@ impl Deref for CFData {
self.bytes()
}
}

#[link(name = "CoreFoundation", kind = "framework")]
extern {
/*
* CFData.h
*/

fn CFDataCreate(allocator: CFAllocatorRef,
bytes: *const u8, length: CFIndex) -> CFDataRef;
//fn CFDataFind
fn CFDataGetBytePtr(theData: CFDataRef) -> *const u8;
fn CFDataGetLength(theData: CFDataRef) -> CFIndex;

fn CFDataGetTypeID() -> CFTypeID;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.