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

Ensure back-compat

  • Loading branch information
sfackler committed Sep 6, 2015
commit a3ce1d3ac30ee96992059e075ebdd73ee771987b
@@ -33,7 +33,10 @@ pub struct CFArrayCallBacks {
pub equal: CFArrayEqualCallBack,
}

pub type CFArrayRef = *const c_void;
#[repr(C)]
struct __CFArray;

pub type CFArrayRef = *const __CFArray;

extern {
/*
@@ -26,6 +26,16 @@ pub struct CFRange {
pub length: CFIndex
}

// for back-compat
impl CFRange {
pub fn init(location: CFIndex, length: CFIndex) -> CFRange {
CFRange {
location: location,
length: length,
}
}
}

extern {
/*
* CFBase.h
@@ -12,7 +12,10 @@ use libc::c_void;
use base::CFTypeID;
use string::CFStringRef;

pub type CFBundleRef = *const c_void;
#[repr(C)]
struct __CFBundle;

pub type CFBundleRef = *const __CFBundle;

extern {
/*
@@ -1,8 +1,9 @@
use libc::c_void;

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

pub type CFDataRef = *const c_void;
#[repr(C)]
struct __CFData;

pub type CFDataRef = *const __CFData;

extern {
/*
@@ -11,7 +11,10 @@ use libc::c_void;

use base::{CFAllocatorRef, CFTypeID};

pub type CFBooleanRef = *const c_void;
#[repr(C)]
struct __CFBoolean;

pub type CFBooleanRef = *const __CFBoolean;

pub type CFNumberType = u32;

@@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use libc::{c_char, c_void, c_ushort};
use libc::{c_char, c_ushort};

use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, CFRange, CFTypeID};

@@ -49,7 +49,7 @@ pub static kCFStringEncodingUTF8: CFStringEncoding = 0x08000100;

// CFStringEncodingExt.h

type CFStringEncodings = CFIndex;
pub type CFStringEncodings = CFIndex;

// External encodings, except those defined above.
// Defined above: kCFStringEncodingMacRoman = 0
@@ -187,7 +187,10 @@ type CFStringEncodings = CFIndex;
//static kCFStringEncodingUTF7_IMAP: CFStringEncoding = 0x0A10;
//static kCFStringEncodingShiftJIS_X0213_00: CFStringEncoding = 0x0628; /* Deprecated */

pub type CFStringRef = *const c_void;
#[repr(C)]
struct __CFString;

pub type CFStringRef = *const __CFString;

extern {
/*
@@ -9,7 +9,7 @@

//! Heterogeneous immutable arrays.

use core_foundation_sys::array::*;
pub use core_foundation_sys::array::*;
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use libc::c_void;
@@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core_foundation_sys::base::*;
pub use core_foundation_sys::base::*;

pub trait CFIndexConvertible {
/// Always use this method to construct a `CFIndex` value. It performs bounds checking to
@@ -10,7 +10,7 @@
//! A Boolean type.

use core_foundation_sys::base::{CFRelease};
use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
pub use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
use std::mem;

use base::TCFType;
@@ -9,8 +9,8 @@

//! Core Foundation Bundle Type

pub use core_foundation_sys::bundle::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::bundle::{CFBundleRef, CFBundleGetTypeID};
use std::mem;

use base::{TCFType};
@@ -9,9 +9,9 @@

//! Core Foundation byte buffers.

pub use core_foundation_sys::data::*;
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;
@@ -9,9 +9,9 @@

//! Dictionaries of key-value pairs.

pub use core_foundation_sys::dictionary::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::dictionary::*;
use libc::c_void;
use std::mem;
use std::ptr;
@@ -9,10 +9,8 @@

//! Immutable numbers.

#![allow(non_upper_case_globals)]

use core_foundation_sys::base::{CFRelease, kCFAllocatorDefault};
use core_foundation_sys::number::*;
pub use core_foundation_sys::number::*;
use std::mem;

use base::{TCFType};
@@ -9,11 +9,11 @@

#![allow(non_upper_case_globals)]

pub use core_foundation_sys::runloop::*;
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault, CFOptionFlags};
use core_foundation_sys::string::CFStringRef;
use core_foundation_sys::date::{CFAbsoluteTime, CFTimeInterval};
use core_foundation_sys::runloop::*;
use std::mem;

use base::{TCFType};
@@ -9,9 +9,9 @@

//! An immutable bag of elements.

pub use core_foundation_sys::set::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::set::*;

use base::{CFIndexConvertible, TCFType};

@@ -9,13 +9,12 @@

//! Immutable strings.

#![allow(non_upper_case_globals)]
pub use core_foundation_sys::string::*;

use base::{CFIndexConvertible, TCFType};

use core_foundation_sys::base::{Boolean, CFIndex, CFRange, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault, kCFAllocatorNull};
use core_foundation_sys::string::*;
use std::fmt;
use std::str::{self, FromStr};
use std::mem;
@@ -9,13 +9,12 @@

//! A URL type for Core Foundation.

#![allow(non_upper_case_globals)]
pub use core_foundation_sys::url::*;

use base::{TCFType};
use string::{CFString};

use core_foundation_sys::base::{kCFAllocatorDefault, CFRelease};
use core_foundation_sys::url::*;
use std::fmt;
use std::mem;

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.