objc2-security 0.3.2

Bindings to the Security framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_spi_moduleeventhandler?language=objc)
#[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,
>;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event?language=objc)
#[cfg(feature = "cssmconfig")]
pub type CSSM_CONTEXT_EVENT = uint32;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_create?language=objc)
pub const CSSM_CONTEXT_EVENT_CREATE: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_delete?language=objc)
pub const CSSM_CONTEXT_EVENT_DELETE: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_update?language=objc)
pub const CSSM_CONTEXT_EVENT_UPDATE: c_uint = 3;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs?language=objc)
#[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);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_MODULE_FUNCS = cssm_module_funcs;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_MODULE_FUNCS_PTR = *mut cssm_module_funcs;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_malloc?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_MALLOC =
    Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, usize) -> *mut c_void>;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_free?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_FREE = Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, *mut c_void)>;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_realloc?language=objc)
#[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>;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_calloc?language=objc)
#[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>;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls?language=objc)
#[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);
}

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS = cssm_upcalls;

/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_ptr?language=objc)
#[deprecated]
#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
pub type CSSM_UPCALLS_PTR = *mut cssm_upcalls;