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