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

Move set to sys crate

  • Loading branch information
sfackler committed Sep 6, 2015
commit 59632fcae628d4add5eb6a30f1c53b85e14a487c
@@ -10,4 +10,5 @@ pub mod date;
pub mod dictionary;
pub mod number;
pub mod runloop;
pub mod set;
pub mod string;
@@ -0,0 +1,43 @@
use libc::c_void;

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

pub type CFSetRetainCallBack = *const u8;
pub type CFSetReleaseCallBack = *const u8;
pub type CFSetCopyDescriptionCallBack = *const u8;
pub type CFSetEqualCallBack = *const u8;
pub type CFSetHashCallBack = *const u8;

#[repr(C)]
#[derive(Clone, Copy)]
pub struct CFSetCallBacks {
pub version: CFIndex,
pub retain: CFSetRetainCallBack,
pub release: CFSetReleaseCallBack,
pub copyDescription: CFSetCopyDescriptionCallBack,
pub equal: CFSetEqualCallBack,
pub hash: CFSetHashCallBack,
}

#[repr(C)]
struct __CFSet;

pub type CFSetRef = *const __CFSet;

extern {
/*
* CFSet.h
*/

pub static kCFTypeSetCallBacks: CFSetCallBacks;

/* Creating Sets */
pub fn CFSetCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex,
callBacks: *const CFSetCallBacks) -> CFSetRef;

/* Applying a Function to Set Members */
//fn CFSetApplyFunction

pub fn CFSetGetTypeID() -> CFTypeID;
}

@@ -9,37 +9,14 @@

//! An immutable bag of elements.

use core_foundation_sys::base::{CFAllocatorRef, CFIndex, CFRelease};
use core_foundation_sys::base::{CFTypeID, CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::set::*;

use base::{CFIndexConvertible, TCFType};

use libc::c_void;
use std::mem;

pub type CFSetRetainCallBack = *const u8;
pub type CFSetReleaseCallBack = *const u8;
pub type CFSetCopyDescriptionCallBack = *const u8;
pub type CFSetEqualCallBack = *const u8;
pub type CFSetHashCallBack = *const u8;

#[allow(dead_code)]
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CFSetCallBacks {
version: CFIndex,
retain: CFSetRetainCallBack,
release: CFSetReleaseCallBack,
copyDescription: CFSetCopyDescriptionCallBack,
equal: CFSetEqualCallBack,
hash: CFSetHashCallBack,
}

#[repr(C)]
struct __CFSet;

pub type CFSetRef = *const __CFSet;

/// An immutable bag of elements.
pub struct CFSet(CFSetRef);

@@ -66,22 +43,3 @@ impl CFSet {
}
}
}

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

static kCFTypeSetCallBacks: CFSetCallBacks;

/* Creating Sets */
fn CFSetCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex,
callBacks: *const CFSetCallBacks) -> CFSetRef;

/* Applying a Function to Set Members */
//fn CFSetApplyFunction

fn CFSetGetTypeID() -> CFTypeID;
}

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