objc2-cf-network 0.3.2

Bindings to the CFNetwork framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2_core_foundation::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreamerrordomainftp?language=objc)
    pub static kCFStreamErrorDomainFTP: i32;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpusername?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPUserName: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftppassword?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPPassword: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpusepassivemode?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPUsePassiveMode: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpresourcesize?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPResourceSize: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpfetchresourceinfo?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPFetchResourceInfo: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpfiletransferoffset?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPFileTransferOffset: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpattemptpersistentconnection?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPAttemptPersistentConnection: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpproxy?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPProxy: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpproxyhost?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPProxyHost: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpproxyport?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPProxyPort: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpproxyuser?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPProxyUser: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfstreampropertyftpproxypassword?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFStreamPropertyFTPProxyPassword: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcemode?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceMode: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcename?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceName: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourceowner?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceOwner: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcegroup?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceGroup: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcelink?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceLink: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcesize?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceSize: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcetype?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceType: &'static CFString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfftpresourcemoddate?language=objc)
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub static kCFFTPResourceModDate: &'static CFString;
}

#[deprecated = "Use NSURLSessionAPI for ftp requests"]
#[inline]
pub unsafe extern "C-unwind" fn CFReadStreamCreateWithFTPURL(
    alloc: Option<&CFAllocator>,
    ftp_url: &CFURL,
) -> CFRetained<CFReadStream> {
    extern "C-unwind" {
        fn CFReadStreamCreateWithFTPURL(
            alloc: Option<&CFAllocator>,
            ftp_url: &CFURL,
        ) -> Option<NonNull<CFReadStream>>;
    }
    let ret = unsafe { CFReadStreamCreateWithFTPURL(alloc, ftp_url) };
    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
    unsafe { CFRetained::from_raw(ret) }
}

extern "C-unwind" {
    /// # Safety
    ///
    /// - `buffer` must be a valid pointer.
    /// - `parsed` must be a valid pointer or null.
    #[deprecated = "Use NSURLSessionAPI for ftp requests"]
    pub fn CFFTPCreateParsedResourceListing(
        alloc: Option<&CFAllocator>,
        buffer: NonNull<u8>,
        buffer_length: CFIndex,
        parsed: *mut *const CFDictionary,
    ) -> CFIndex;
}

#[deprecated = "Use NSURLSessionAPI for ftp requests"]
#[inline]
pub unsafe extern "C-unwind" fn CFWriteStreamCreateWithFTPURL(
    alloc: Option<&CFAllocator>,
    ftp_url: &CFURL,
) -> CFRetained<CFWriteStream> {
    extern "C-unwind" {
        fn CFWriteStreamCreateWithFTPURL(
            alloc: Option<&CFAllocator>,
            ftp_url: &CFURL,
        ) -> Option<NonNull<CFWriteStream>>;
    }
    let ret = unsafe { CFWriteStreamCreateWithFTPURL(alloc, ftp_url) };
    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
    unsafe { CFRetained::from_raw(ret) }
}