use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSMethodInvocationResult: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSFaultString: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSFaultCode: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSFaultExtra: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSNetworkStreamFaultString: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSStreamErrorMessage: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSStreamErrorDomain: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSStreamErrorError: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPMessage: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPResponseMessage: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPExtraHeaders: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPVersion: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPProxy: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSHTTPFollowsRedirects: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSDebugOutgoingHeaders: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSDebugOutgoingBody: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSDebugIncomingHeaders: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSDebugIncomingBody: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSSOAPBodyEncodingStyle: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSSOAPMethodNamespaceURI: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSSOAPStyleDoc: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSSOAPStyleRPC: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSSOAPMessageHeaders: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSRecordParameterOrder: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSRecordNamespaceURI: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSRecordType: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSMethodInvocationResultParameterName: Option<&'static CFString>;
}
extern "C" {
#[deprecated = "No longer supported"]
pub static kWSMethodInvocationTimeoutValue: Option<&'static CFString>;
}
#[doc(alias = "WSMethodInvocationRef")]
#[repr(C)]
pub struct WSMethodInvocation {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl WSMethodInvocation {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueWSMethodInvocationRef"> for WSMethodInvocation {}
);
unsafe impl ConcreteType for WSMethodInvocation {
#[doc(alias = "WSMethodInvocationGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn WSMethodInvocationGetTypeID() -> CFTypeID;
}
unsafe { WSMethodInvocationGetTypeID() }
}
}
impl WSMethodInvocation {
#[doc(alias = "WSMethodInvocationCreate")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn new(
url: Option<&CFURL>,
method_name: Option<&CFString>,
protocol: Option<&CFString>,
) -> Option<CFRetained<WSMethodInvocation>> {
extern "C-unwind" {
fn WSMethodInvocationCreate(
url: Option<&CFURL>,
method_name: Option<&CFString>,
protocol: Option<&CFString>,
) -> Option<NonNull<WSMethodInvocation>>;
}
let ret = unsafe { WSMethodInvocationCreate(url, method_name, protocol) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "WSMethodInvocationCreateFromSerialization")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn from_serialization(
contract: Option<&CFData>,
) -> Option<CFRetained<WSMethodInvocation>> {
extern "C-unwind" {
fn WSMethodInvocationCreateFromSerialization(
contract: Option<&CFData>,
) -> Option<NonNull<WSMethodInvocation>>;
}
let ret = unsafe { WSMethodInvocationCreateFromSerialization(contract) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "WSMethodInvocationCopySerialization")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn serialization(&self) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn WSMethodInvocationCopySerialization(
invocation: &WSMethodInvocation,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { WSMethodInvocationCopySerialization(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "WSMethodInvocationSetParameters")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn set_parameters(
&self,
parameters: Option<&CFDictionary>,
parameter_order: Option<&CFArray>,
) {
extern "C-unwind" {
fn WSMethodInvocationSetParameters(
invocation: &WSMethodInvocation,
parameters: Option<&CFDictionary>,
parameter_order: Option<&CFArray>,
);
}
unsafe { WSMethodInvocationSetParameters(self, parameters, parameter_order) }
}
#[doc(alias = "WSMethodInvocationCopyParameters")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn parameters(
&self,
parameter_order: *mut *const CFArray,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn WSMethodInvocationCopyParameters(
invocation: &WSMethodInvocation,
parameter_order: *mut *const CFArray,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { WSMethodInvocationCopyParameters(self, parameter_order) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "WSMethodInvocationSetProperty")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn set_property(
&self,
property_name: Option<&CFString>,
property_value: Option<&CFType>,
) {
extern "C-unwind" {
fn WSMethodInvocationSetProperty(
invocation: &WSMethodInvocation,
property_name: Option<&CFString>,
property_value: Option<&CFType>,
);
}
unsafe { WSMethodInvocationSetProperty(self, property_name, property_value) }
}
#[doc(alias = "WSMethodInvocationCopyProperty")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn property(&self, property_name: Option<&CFString>) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn WSMethodInvocationCopyProperty(
invocation: &WSMethodInvocation,
property_name: Option<&CFString>,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { WSMethodInvocationCopyProperty(self, property_name) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "WSMethodInvocationInvoke")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn invoke(&self) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn WSMethodInvocationInvoke(
invocation: &WSMethodInvocation,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { WSMethodInvocationInvoke(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
#[deprecated = "No longer supported"]
pub type WSMethodInvocationCallBackProcPtr =
Option<unsafe extern "C-unwind" fn(*mut WSMethodInvocation, *mut c_void, *const CFDictionary)>;
impl WSMethodInvocation {
#[doc(alias = "WSMethodInvocationSetCallBack")]
#[cfg(feature = "WSTypes")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn set_call_back(
&self,
client_cb: WSMethodInvocationCallBackProcPtr,
context: *mut WSClientContext,
) {
extern "C-unwind" {
fn WSMethodInvocationSetCallBack(
invocation: &WSMethodInvocation,
client_cb: WSMethodInvocationCallBackProcPtr,
context: *mut WSClientContext,
);
}
unsafe { WSMethodInvocationSetCallBack(self, client_cb, context) }
}
#[doc(alias = "WSMethodInvocationScheduleWithRunLoop")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn schedule_with_run_loop(
&self,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
) {
extern "C-unwind" {
fn WSMethodInvocationScheduleWithRunLoop(
invocation: &WSMethodInvocation,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
);
}
unsafe { WSMethodInvocationScheduleWithRunLoop(self, run_loop, run_loop_mode) }
}
#[doc(alias = "WSMethodInvocationUnscheduleFromRunLoop")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn unschedule_from_run_loop(
&self,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
) {
extern "C-unwind" {
fn WSMethodInvocationUnscheduleFromRunLoop(
invocation: &WSMethodInvocation,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
);
}
unsafe { WSMethodInvocationUnscheduleFromRunLoop(self, run_loop, run_loop_mode) }
}
}
#[deprecated = "No longer supported"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodResultIsFault(
method_result: Option<&CFDictionary>,
) -> bool {
extern "C-unwind" {
fn WSMethodResultIsFault(method_result: Option<&CFDictionary>) -> Boolean;
}
let ret = unsafe { WSMethodResultIsFault(method_result) };
ret != 0
}
#[deprecated = "No longer supported"]
pub type WSMethodInvocationSerializationProcPtr = Option<
unsafe extern "C-unwind" fn(
*mut WSMethodInvocation,
*const CFType,
*mut c_void,
) -> *const CFString,
>;
impl WSMethodInvocation {
#[doc(alias = "WSMethodInvocationAddSerializationOverride")]
#[cfg(feature = "WSTypes")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn add_serialization_override(
&self,
obj_type: CFTypeID,
serialization_proc: WSMethodInvocationSerializationProcPtr,
context: *mut WSClientContext,
) {
extern "C-unwind" {
fn WSMethodInvocationAddSerializationOverride(
invocation: &WSMethodInvocation,
obj_type: CFTypeID,
serialization_proc: WSMethodInvocationSerializationProcPtr,
context: *mut WSClientContext,
);
}
unsafe {
WSMethodInvocationAddSerializationOverride(self, obj_type, serialization_proc, context)
}
}
}
#[deprecated = "No longer supported"]
pub type WSMethodInvocationDeserializationProcPtr = Option<
unsafe extern "C-unwind" fn(
*mut WSMethodInvocation,
*mut CFXMLTree,
*mut CFXMLTree,
*mut c_void,
) -> *const CFType,
>;
impl WSMethodInvocation {
#[doc(alias = "WSMethodInvocationAddDeserializationOverride")]
#[cfg(feature = "WSTypes")]
#[deprecated = "No longer supported"]
#[inline]
pub unsafe fn add_deserialization_override(
&self,
type_namespace: Option<&CFString>,
type_name: Option<&CFString>,
deserialization_proc: WSMethodInvocationDeserializationProcPtr,
context: *mut WSClientContext,
) {
extern "C-unwind" {
fn WSMethodInvocationAddDeserializationOverride(
invocation: &WSMethodInvocation,
type_namespace: Option<&CFString>,
type_name: Option<&CFString>,
deserialization_proc: WSMethodInvocationDeserializationProcPtr,
context: *mut WSClientContext,
);
}
unsafe {
WSMethodInvocationAddDeserializationOverride(
self,
type_namespace,
type_name,
deserialization_proc,
context,
)
}
}
}
#[deprecated = "renamed to `WSMethodInvocation::new`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationCreate(
url: Option<&CFURL>,
method_name: Option<&CFString>,
protocol: Option<&CFString>,
) -> Option<CFRetained<WSMethodInvocation>> {
extern "C-unwind" {
fn WSMethodInvocationCreate(
url: Option<&CFURL>,
method_name: Option<&CFString>,
protocol: Option<&CFString>,
) -> Option<NonNull<WSMethodInvocation>>;
}
let ret = unsafe { WSMethodInvocationCreate(url, method_name, protocol) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `WSMethodInvocation::from_serialization`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationCreateFromSerialization(
contract: Option<&CFData>,
) -> Option<CFRetained<WSMethodInvocation>> {
extern "C-unwind" {
fn WSMethodInvocationCreateFromSerialization(
contract: Option<&CFData>,
) -> Option<NonNull<WSMethodInvocation>>;
}
let ret = unsafe { WSMethodInvocationCreateFromSerialization(contract) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `WSMethodInvocation::serialization`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationCopySerialization(
invocation: &WSMethodInvocation,
) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn WSMethodInvocationCopySerialization(
invocation: &WSMethodInvocation,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { WSMethodInvocationCopySerialization(invocation) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `WSMethodInvocation::set_parameters`"]
pub fn WSMethodInvocationSetParameters(
invocation: &WSMethodInvocation,
parameters: Option<&CFDictionary>,
parameter_order: Option<&CFArray>,
);
}
#[deprecated = "renamed to `WSMethodInvocation::parameters`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationCopyParameters(
invocation: &WSMethodInvocation,
parameter_order: *mut *const CFArray,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn WSMethodInvocationCopyParameters(
invocation: &WSMethodInvocation,
parameter_order: *mut *const CFArray,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { WSMethodInvocationCopyParameters(invocation, parameter_order) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `WSMethodInvocation::set_property`"]
pub fn WSMethodInvocationSetProperty(
invocation: &WSMethodInvocation,
property_name: Option<&CFString>,
property_value: Option<&CFType>,
);
}
#[deprecated = "renamed to `WSMethodInvocation::property`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationCopyProperty(
invocation: &WSMethodInvocation,
property_name: Option<&CFString>,
) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn WSMethodInvocationCopyProperty(
invocation: &WSMethodInvocation,
property_name: Option<&CFString>,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { WSMethodInvocationCopyProperty(invocation, property_name) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `WSMethodInvocation::invoke`"]
#[inline]
pub unsafe extern "C-unwind" fn WSMethodInvocationInvoke(
invocation: &WSMethodInvocation,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn WSMethodInvocationInvoke(
invocation: &WSMethodInvocation,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { WSMethodInvocationInvoke(invocation) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[cfg(feature = "WSTypes")]
#[deprecated = "renamed to `WSMethodInvocation::set_call_back`"]
pub fn WSMethodInvocationSetCallBack(
invocation: &WSMethodInvocation,
client_cb: WSMethodInvocationCallBackProcPtr,
context: *mut WSClientContext,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `WSMethodInvocation::schedule_with_run_loop`"]
pub fn WSMethodInvocationScheduleWithRunLoop(
invocation: &WSMethodInvocation,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `WSMethodInvocation::unschedule_from_run_loop`"]
pub fn WSMethodInvocationUnscheduleFromRunLoop(
invocation: &WSMethodInvocation,
run_loop: Option<&CFRunLoop>,
run_loop_mode: Option<&CFString>,
);
}
extern "C-unwind" {
#[cfg(feature = "WSTypes")]
#[deprecated = "renamed to `WSMethodInvocation::add_serialization_override`"]
pub fn WSMethodInvocationAddSerializationOverride(
invocation: &WSMethodInvocation,
obj_type: CFTypeID,
serialization_proc: WSMethodInvocationSerializationProcPtr,
context: *mut WSClientContext,
);
}
extern "C-unwind" {
#[cfg(feature = "WSTypes")]
#[deprecated = "renamed to `WSMethodInvocation::add_deserialization_override`"]
pub fn WSMethodInvocationAddDeserializationOverride(
invocation: &WSMethodInvocation,
type_namespace: Option<&CFString>,
type_name: Option<&CFString>,
deserialization_proc: WSMethodInvocationDeserializationProcPtr,
context: *mut WSClientContext,
);
}