diff --git a/core-foundation-sys/src/socket.rs b/core-foundation-sys/src/socket.rs index af5b5fb..a3d81c4 100644 --- a/core-foundation-sys/src/socket.rs +++ b/core-foundation-sys/src/socket.rs @@ -66,7 +66,7 @@ pub const kCFSocketAutomaticallyReenableWriteCallBack: CFOptionFlags = 8; pub const kCFSocketLeaveErrors: CFOptionFlags = 64; pub const kCFSocketCloseOnInvalidate: CFOptionFlags = 128; -extern "C" { +extern { /* * CFSocket.h */ diff --git a/core-foundation-sys/src/stream.rs b/core-foundation-sys/src/stream.rs index 34168a5..26816e1 100644 --- a/core-foundation-sys/src/stream.rs +++ b/core-foundation-sys/src/stream.rs @@ -9,11 +9,12 @@ use std::os::raw::{c_void, c_int}; -use base::{CFIndex, CFOptionFlags, SInt32, CFTypeID, CFAllocatorRef, UInt8, Boolean, CFTypeRef}; +use base::{CFIndex, CFOptionFlags, SInt32, CFTypeID, CFAllocatorRef, UInt8, Boolean, CFTypeRef, UInt32}; use string::CFStringRef; use url::CFURLRef; use error::CFErrorRef; use runloop::CFRunLoopRef; +use socket::{CFSocketNativeHandle, CFSocketSignature}; #[repr(C)] pub struct __CFReadStream(c_void); @@ -109,9 +110,9 @@ extern { pub static kCFStreamErrorDomainSSL: c_int; /* CFStream: Creating Streams */ - //pub fn CFStreamCreatePairWithPeerSocketSignature(alloc: CFAllocatorRef, signature: *const CFSocketSignature,readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated - //pub fn CFStreamCreatePairWithSocketToHost(alloc: CFAllocatorRef, host: CFStringRef, port: UInt32, readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated - //pub fn CFStreamCreatePairWithSocket(alloc: CFAllocatorRef, sock: CFSocketNativeHandle, readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated + pub fn CFStreamCreatePairWithPeerSocketSignature(alloc: CFAllocatorRef, signature: *const CFSocketSignature,readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated + pub fn CFStreamCreatePairWithSocketToHost(alloc: CFAllocatorRef, host: CFStringRef, port: UInt32, readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated + pub fn CFStreamCreatePairWithSocket(alloc: CFAllocatorRef, sock: CFSocketNativeHandle, readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef); // deprecated pub fn CFStreamCreateBoundPair(alloc: CFAllocatorRef, readStream: *mut CFReadStreamRef, writeStream: *mut CFWriteStreamRef, transferBufferSize: CFIndex); //pub fn CFReadStreamSetDispatchQueue(stream: CFReadStreamRef, q: dispatch_queue_t); // macos(10.9)+