use core::ptr::NonNull;
use objc2_core_foundation::*;
use crate::*;
#[cfg(feature = "SCDynamicStore")]
impl SCDynamicStore {
#[doc(alias = "SCDynamicStoreCopyDHCPInfo")]
#[cfg(feature = "SCDynamicStore")]
#[inline]
pub fn dhcp_info(
store: Option<&SCDynamicStore>,
service_id: Option<&CFString>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCDynamicStoreCopyDHCPInfo(
store: Option<&SCDynamicStore>,
service_id: Option<&CFString>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCDynamicStoreCopyDHCPInfo(store, service_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
#[inline]
pub unsafe extern "C-unwind" fn DHCPInfoGetOptionData(
info: &CFDictionary,
code: u8,
) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn DHCPInfoGetOptionData(info: &CFDictionary, code: u8) -> Option<NonNull<CFData>>;
}
let ret = unsafe { DHCPInfoGetOptionData(info, code) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub unsafe extern "C-unwind" fn DHCPInfoGetLeaseStartTime(
info: &CFDictionary,
) -> Option<CFRetained<CFDate>> {
extern "C-unwind" {
fn DHCPInfoGetLeaseStartTime(info: &CFDictionary) -> Option<NonNull<CFDate>>;
}
let ret = unsafe { DHCPInfoGetLeaseStartTime(info) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[inline]
pub unsafe extern "C-unwind" fn DHCPInfoGetLeaseExpirationTime(
info: &CFDictionary,
) -> Option<CFRetained<CFDate>> {
extern "C-unwind" {
fn DHCPInfoGetLeaseExpirationTime(info: &CFDictionary) -> Option<NonNull<CFDate>>;
}
let ret = unsafe { DHCPInfoGetLeaseExpirationTime(info) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[cfg(feature = "SCDynamicStore")]
#[deprecated = "renamed to `SCDynamicStore::dhcp_info`"]
#[inline]
pub extern "C-unwind" fn SCDynamicStoreCopyDHCPInfo(
store: Option<&SCDynamicStore>,
service_id: Option<&CFString>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn SCDynamicStoreCopyDHCPInfo(
store: Option<&SCDynamicStore>,
service_id: Option<&CFString>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { SCDynamicStoreCopyDHCPInfo(store, service_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}