objc2_security/generated/
cssmspi.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_spi_moduleeventhandler?language=objc)
10#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
11pub type CSSM_SPI_ModuleEventHandler = Option<
12    unsafe extern "C-unwind" fn(
13        *const CSSM_GUID,
14        *mut c_void,
15        uint32,
16        CSSM_SERVICE_TYPE,
17        CSSM_MODULE_EVENT,
18    ) -> CSSM_RETURN,
19>;
20
21/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event?language=objc)
22#[cfg(feature = "cssmconfig")]
23pub type CSSM_CONTEXT_EVENT = uint32;
24
25/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_create?language=objc)
26pub const CSSM_CONTEXT_EVENT_CREATE: c_uint = 1;
27/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_delete?language=objc)
28pub const CSSM_CONTEXT_EVENT_DELETE: c_uint = 2;
29/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_context_event_update?language=objc)
30pub const CSSM_CONTEXT_EVENT_UPDATE: c_uint = 3;
31
32/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs?language=objc)
33#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
34#[deprecated]
35#[repr(C)]
36#[derive(Clone, Copy, Debug, PartialEq)]
37pub struct cssm_module_funcs {
38    pub ServiceType: CSSM_SERVICE_TYPE,
39    pub NumberOfServiceFuncs: uint32,
40    pub ServiceFuncs: *const CSSM_PROC_ADDR,
41}
42
43#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
44unsafe impl Encode for cssm_module_funcs {
45    const ENCODING: Encoding = Encoding::Struct(
46        "cssm_module_funcs",
47        &[
48            <CSSM_SERVICE_TYPE>::ENCODING,
49            <uint32>::ENCODING,
50            <*const CSSM_PROC_ADDR>::ENCODING,
51        ],
52    );
53}
54
55#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
56unsafe impl RefEncode for cssm_module_funcs {
57    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs?language=objc)
61#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
62pub type CSSM_MODULE_FUNCS = cssm_module_funcs;
63
64/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_module_funcs_ptr?language=objc)
65#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
66pub type CSSM_MODULE_FUNCS_PTR = *mut cssm_module_funcs;
67
68/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_malloc?language=objc)
69#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
70pub type CSSM_UPCALLS_MALLOC =
71    Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, usize) -> *mut c_void>;
72
73/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_free?language=objc)
74#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
75pub type CSSM_UPCALLS_FREE = Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, *mut c_void)>;
76
77/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_realloc?language=objc)
78#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
79pub type CSSM_UPCALLS_REALLOC =
80    Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, *mut c_void, usize) -> *mut c_void>;
81
82/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_calloc?language=objc)
83#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
84pub type CSSM_UPCALLS_CALLOC =
85    Option<unsafe extern "C-unwind" fn(CSSM_HANDLE, usize, usize) -> *mut c_void>;
86
87/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls?language=objc)
88#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
89#[deprecated]
90#[repr(C)]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub struct cssm_upcalls {
93    pub malloc_func: CSSM_UPCALLS_MALLOC,
94    pub free_func: CSSM_UPCALLS_FREE,
95    pub realloc_func: CSSM_UPCALLS_REALLOC,
96    pub calloc_func: CSSM_UPCALLS_CALLOC,
97    pub CcToHandle_func:
98        Option<unsafe extern "C-unwind" fn(CSSM_CC_HANDLE, CSSM_MODULE_HANDLE_PTR) -> CSSM_RETURN>,
99    pub GetModuleInfo_func: Option<
100        unsafe extern "C-unwind" fn(
101            CSSM_MODULE_HANDLE,
102            CSSM_GUID_PTR,
103            CSSM_VERSION_PTR,
104            *mut uint32,
105            *mut CSSM_SERVICE_TYPE,
106            *mut CSSM_ATTACH_FLAGS,
107            *mut CSSM_KEY_HIERARCHY,
108            CSSM_API_MEMORY_FUNCS_PTR,
109            CSSM_FUNC_NAME_ADDR_PTR,
110            uint32,
111        ) -> CSSM_RETURN,
112    >,
113}
114
115#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
116unsafe impl Encode for cssm_upcalls {
117    const ENCODING: Encoding = Encoding::Struct(
118        "cssm_upcalls",
119        &[
120            <CSSM_UPCALLS_MALLOC>::ENCODING,
121            <CSSM_UPCALLS_FREE>::ENCODING,
122            <CSSM_UPCALLS_REALLOC>::ENCODING,
123            <CSSM_UPCALLS_CALLOC>::ENCODING,
124            <Option<
125                unsafe extern "C-unwind" fn(CSSM_CC_HANDLE, CSSM_MODULE_HANDLE_PTR) -> CSSM_RETURN,
126            >>::ENCODING,
127            <Option<
128                unsafe extern "C-unwind" fn(
129                    CSSM_MODULE_HANDLE,
130                    CSSM_GUID_PTR,
131                    CSSM_VERSION_PTR,
132                    *mut uint32,
133                    *mut CSSM_SERVICE_TYPE,
134                    *mut CSSM_ATTACH_FLAGS,
135                    *mut CSSM_KEY_HIERARCHY,
136                    CSSM_API_MEMORY_FUNCS_PTR,
137                    CSSM_FUNC_NAME_ADDR_PTR,
138                    uint32,
139                ) -> CSSM_RETURN,
140            >>::ENCODING,
141        ],
142    );
143}
144
145#[cfg(all(feature = "cssmconfig", feature = "cssmtype", feature = "objc2"))]
146unsafe impl RefEncode for cssm_upcalls {
147    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
148}
149
150/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls?language=objc)
151#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
152pub type CSSM_UPCALLS = cssm_upcalls;
153
154/// [Apple's documentation](https://developer.apple.com/documentation/security/cssm_upcalls_ptr?language=objc)
155#[cfg(all(feature = "cssmconfig", feature = "cssmtype"))]
156pub type CSSM_UPCALLS_PTR = *mut cssm_upcalls;