use core::ffi::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_SPI_ModuleEventHandler = Option<
unsafe extern "C-unwind" fn(
*const CSSM_GUID,
*mut c_void,
uint32,
CSSM_SERVICE_TYPE,
CSSM_MODULE_EVENT,
) -> CSSM_RETURN,
>;
#[cfg(feature = "cssmconfig")]
pub type CSSM_CONTEXT_EVENT = uint32;
pub const CSSM_CONTEXT_EVENT_CREATE: c_uint = 1;
pub const CSSM_CONTEXT_EVENT_DELETE: c_uint = 2;
pub const CSSM_CONTEXT_EVENT_UPDATE: c_uint = 3;
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_module_funcs {
pub ServiceType: CSSM_SERVICE_TYPE,
pub NumberOfServiceFuncs: uint32,
pub ServiceFuncs: *const CSSM_PROC_ADDR,
}
#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_module_funcs {
const ENCODING: Encoding = Encoding::Struct(
"cssm_module_funcs",
&[
<CSSM_SERVICE_TYPE>::ENCODING,
<uint32>::ENCODING,
<*const CSSM_PROC_ADDR>::ENCODING,
],
);
}
#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl RefEncode for cssm_module_funcs {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_MODULE_FUNCS = cssm_module_funcs;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_MODULE_FUNCS_PTR = *mut cssm_module_funcs;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_MALLOC =
Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, usize) -> *mut c_void>;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_FREE = Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, *mut c_void)>;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_REALLOC =
Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, *mut c_void, usize) -> *mut c_void>;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_CALLOC =
Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, usize, usize) -> *mut c_void>;
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
#[deprecated]
#[repr(C)]
#[allow(unpredictable_function_pointer_comparisons)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct cssm_upcalls {
pub malloc_func: CSSM_UPCALLS_MALLOC,
pub free_func: CSSM_UPCALLS_FREE,
pub realloc_func: CSSM_UPCALLS_REALLOC,
pub calloc_func: CSSM_UPCALLS_CALLOC,
pub CcToHandle_func:
Option<unsafe extern "C-unwind" fn(CSSM_CC_HANDLE, CSSM_MODULE_HANDLE_PTR) -> CSSM_RETURN>,
pub GetModuleInfo_func: Option<
unsafe extern "C-unwind" fn(
CSSM_MODULE_HANDLE,
CSSM_GUID_PTR,
CSSM_VERSION_PTR,
*mut uint32,
*mut CSSM_SERVICE_TYPE,
*mut CSSM_ATTACH_FLAGS,
*mut CSSM_KEY_HIERARCHY,
CSSM_API_MEMORY_FUNCS_PTR,
CSSM_FUNC_NAME_ADDR_PTR,
uint32,
) -> CSSM_RETURN,
>,
}
#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl Encode for cssm_upcalls {
const ENCODING: Encoding = Encoding::Struct(
"cssm_upcalls",
&[
<CSSM_UPCALLS_MALLOC>::ENCODING,
<CSSM_UPCALLS_FREE>::ENCODING,
<CSSM_UPCALLS_REALLOC>::ENCODING,
<CSSM_UPCALLS_CALLOC>::ENCODING,
<Option<
unsafe extern "C-unwind" fn(CSSM_CC_HANDLE, CSSM_MODULE_HANDLE_PTR) -> CSSM_RETURN,
>>::ENCODING,
<Option<
unsafe extern "C-unwind" fn(
CSSM_MODULE_HANDLE,
CSSM_GUID_PTR,
CSSM_VERSION_PTR,
*mut uint32,
*mut CSSM_SERVICE_TYPE,
*mut CSSM_ATTACH_FLAGS,
*mut CSSM_KEY_HIERARCHY,
CSSM_API_MEMORY_FUNCS_PTR,
CSSM_FUNC_NAME_ADDR_PTR,
uint32,
) -> CSSM_RETURN,
>>::ENCODING,
],
);
}
#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
unsafe impl RefEncode for cssm_upcalls {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS = cssm_upcalls;
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_PTR = *mut cssm_upcalls;