1use core::ffi::*;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
11#[deprecated]
12#[repr(C)]
13#[allow(unpredictable_function_pointer_comparisons)]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub struct cssm_spi_dl_funcs {
16 pub DbOpen: Option<
17 unsafe extern "C-unwind" fn(
18 CSSM_DL_HANDLE,
19 *const c_char,
20 *const CSSM_NET_ADDRESS,
21 CSSM_DB_ACCESS_TYPE,
22 *const CSSM_ACCESS_CREDENTIALS,
23 *const c_void,
24 *mut CSSM_DB_HANDLE,
25 ) -> CSSM_RETURN,
26 >,
27 pub DbClose: Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE) -> CSSM_RETURN>,
28 pub DbCreate: Option<
29 unsafe extern "C-unwind" fn(
30 CSSM_DL_HANDLE,
31 *const c_char,
32 *const CSSM_NET_ADDRESS,
33 *const CSSM_DBINFO,
34 CSSM_DB_ACCESS_TYPE,
35 *const CSSM_RESOURCE_CONTROL_CONTEXT,
36 *const c_void,
37 *mut CSSM_DB_HANDLE,
38 ) -> CSSM_RETURN,
39 >,
40 pub DbDelete: Option<
41 unsafe extern "C-unwind" fn(
42 CSSM_DL_HANDLE,
43 *const c_char,
44 *const CSSM_NET_ADDRESS,
45 *const CSSM_ACCESS_CREDENTIALS,
46 ) -> CSSM_RETURN,
47 >,
48 pub CreateRelation: Option<
49 unsafe extern "C-unwind" fn(
50 CSSM_DL_DB_HANDLE,
51 CSSM_DB_RECORDTYPE,
52 *const c_char,
53 uint32,
54 *const CSSM_DB_SCHEMA_ATTRIBUTE_INFO,
55 uint32,
56 *const CSSM_DB_SCHEMA_INDEX_INFO,
57 ) -> CSSM_RETURN,
58 >,
59 pub DestroyRelation:
60 Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, CSSM_DB_RECORDTYPE) -> CSSM_RETURN>,
61 pub Authenticate: Option<
62 unsafe extern "C-unwind" fn(
63 CSSM_DL_DB_HANDLE,
64 CSSM_DB_ACCESS_TYPE,
65 *const CSSM_ACCESS_CREDENTIALS,
66 ) -> CSSM_RETURN,
67 >,
68 pub GetDbAcl: Option<
69 unsafe extern "C-unwind" fn(
70 CSSM_DL_DB_HANDLE,
71 *const CSSM_STRING,
72 *mut uint32,
73 *mut CSSM_ACL_ENTRY_INFO_PTR,
74 ) -> CSSM_RETURN,
75 >,
76 pub ChangeDbAcl: Option<
77 unsafe extern "C-unwind" fn(
78 CSSM_DL_DB_HANDLE,
79 *const CSSM_ACCESS_CREDENTIALS,
80 *const CSSM_ACL_EDIT,
81 ) -> CSSM_RETURN,
82 >,
83 pub GetDbOwner: Option<
84 unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, CSSM_ACL_OWNER_PROTOTYPE_PTR) -> CSSM_RETURN,
85 >,
86 pub ChangeDbOwner: Option<
87 unsafe extern "C-unwind" fn(
88 CSSM_DL_DB_HANDLE,
89 *const CSSM_ACCESS_CREDENTIALS,
90 *const CSSM_ACL_OWNER_PROTOTYPE,
91 ) -> CSSM_RETURN,
92 >,
93 pub GetDbNames:
94 Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE, *mut CSSM_NAME_LIST_PTR) -> CSSM_RETURN>,
95 pub GetDbNameFromHandle:
96 Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, *mut *mut c_char) -> CSSM_RETURN>,
97 pub FreeNameList:
98 Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE, CSSM_NAME_LIST_PTR) -> CSSM_RETURN>,
99 pub DataInsert: Option<
100 unsafe extern "C-unwind" fn(
101 CSSM_DL_DB_HANDLE,
102 CSSM_DB_RECORDTYPE,
103 *const CSSM_DB_RECORD_ATTRIBUTE_DATA,
104 *const SecAsn1Item,
105 *mut CSSM_DB_UNIQUE_RECORD_PTR,
106 ) -> CSSM_RETURN,
107 >,
108 pub DataDelete: Option<
109 unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, *const CSSM_DB_UNIQUE_RECORD) -> CSSM_RETURN,
110 >,
111 pub DataModify: Option<
112 unsafe extern "C-unwind" fn(
113 CSSM_DL_DB_HANDLE,
114 CSSM_DB_RECORDTYPE,
115 CSSM_DB_UNIQUE_RECORD_PTR,
116 *const CSSM_DB_RECORD_ATTRIBUTE_DATA,
117 *const SecAsn1Item,
118 CSSM_DB_MODIFY_MODE,
119 ) -> CSSM_RETURN,
120 >,
121 pub DataGetFirst: Option<
122 unsafe extern "C-unwind" fn(
123 CSSM_DL_DB_HANDLE,
124 *const CSSM_QUERY,
125 CSSM_HANDLE_PTR,
126 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,
127 CSSM_DATA_PTR,
128 *mut CSSM_DB_UNIQUE_RECORD_PTR,
129 ) -> CSSM_RETURN,
130 >,
131 pub DataGetNext: Option<
132 unsafe extern "C-unwind" fn(
133 CSSM_DL_DB_HANDLE,
134 CSSM_HANDLE,
135 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,
136 CSSM_DATA_PTR,
137 *mut CSSM_DB_UNIQUE_RECORD_PTR,
138 ) -> CSSM_RETURN,
139 >,
140 pub DataAbortQuery:
141 Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, CSSM_HANDLE) -> CSSM_RETURN>,
142 pub DataGetFromUniqueRecordId: Option<
143 unsafe extern "C-unwind" fn(
144 CSSM_DL_DB_HANDLE,
145 *const CSSM_DB_UNIQUE_RECORD,
146 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,
147 CSSM_DATA_PTR,
148 ) -> CSSM_RETURN,
149 >,
150 pub FreeUniqueRecord: Option<
151 unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE, CSSM_DB_UNIQUE_RECORD_PTR) -> CSSM_RETURN,
152 >,
153 pub PassThrough: Option<
154 unsafe extern "C-unwind" fn(
155 CSSM_DL_DB_HANDLE,
156 uint32,
157 *const c_void,
158 *mut *mut c_void,
159 ) -> CSSM_RETURN,
160 >,
161}
162
163#[cfg(all(
164 feature = "SecAsn1Types",
165 feature = "cssmconfig",
166 feature = "cssmtype",
167 feature = "objc2"
168))]
169unsafe impl Encode for cssm_spi_dl_funcs {
170 const ENCODING: Encoding = Encoding::Struct("cssm_spi_dl_funcs", &[
171 <Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE,*const c_char,*const CSSM_NET_ADDRESS,CSSM_DB_ACCESS_TYPE,*const CSSM_ACCESS_CREDENTIALS,*const c_void,*mut CSSM_DB_HANDLE,) -> CSSM_RETURN>>::ENCODING,
172 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,) -> CSSM_RETURN>>::ENCODING,
173 <Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE,*const c_char,*const CSSM_NET_ADDRESS,*const CSSM_DBINFO,CSSM_DB_ACCESS_TYPE,*const CSSM_RESOURCE_CONTROL_CONTEXT,*const c_void,*mut CSSM_DB_HANDLE,) -> CSSM_RETURN>>::ENCODING,
174 <Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE,*const c_char,*const CSSM_NET_ADDRESS,*const CSSM_ACCESS_CREDENTIALS,) -> CSSM_RETURN>>::ENCODING,
175 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_RECORDTYPE,*const c_char,uint32,*const CSSM_DB_SCHEMA_ATTRIBUTE_INFO,uint32,*const CSSM_DB_SCHEMA_INDEX_INFO,) -> CSSM_RETURN>>::ENCODING,
176 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_RECORDTYPE,) -> CSSM_RETURN>>::ENCODING,
177 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_ACCESS_TYPE,*const CSSM_ACCESS_CREDENTIALS,) -> CSSM_RETURN>>::ENCODING,
178 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_STRING,*mut uint32,*mut CSSM_ACL_ENTRY_INFO_PTR,) -> CSSM_RETURN>>::ENCODING,
179 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_ACCESS_CREDENTIALS,*const CSSM_ACL_EDIT,) -> CSSM_RETURN>>::ENCODING,
180 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_ACL_OWNER_PROTOTYPE_PTR,) -> CSSM_RETURN>>::ENCODING,
181 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_ACCESS_CREDENTIALS,*const CSSM_ACL_OWNER_PROTOTYPE,) -> CSSM_RETURN>>::ENCODING,
182 <Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE,*mut CSSM_NAME_LIST_PTR,) -> CSSM_RETURN>>::ENCODING,
183 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*mut *mut c_char,) -> CSSM_RETURN>>::ENCODING,
184 <Option<unsafe extern "C-unwind" fn(CSSM_DL_HANDLE,CSSM_NAME_LIST_PTR,) -> CSSM_RETURN>>::ENCODING,
185 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_RECORDTYPE,*const CSSM_DB_RECORD_ATTRIBUTE_DATA,*const SecAsn1Item,*mut CSSM_DB_UNIQUE_RECORD_PTR,) -> CSSM_RETURN>>::ENCODING,
186 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_DB_UNIQUE_RECORD,) -> CSSM_RETURN>>::ENCODING,
187 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_RECORDTYPE,CSSM_DB_UNIQUE_RECORD_PTR,*const CSSM_DB_RECORD_ATTRIBUTE_DATA,*const SecAsn1Item,CSSM_DB_MODIFY_MODE,) -> CSSM_RETURN>>::ENCODING,
188 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_QUERY,CSSM_HANDLE_PTR,CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,CSSM_DATA_PTR,*mut CSSM_DB_UNIQUE_RECORD_PTR,) -> CSSM_RETURN>>::ENCODING,
189 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_HANDLE,CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,CSSM_DATA_PTR,*mut CSSM_DB_UNIQUE_RECORD_PTR,) -> CSSM_RETURN>>::ENCODING,
190 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_HANDLE,) -> CSSM_RETURN>>::ENCODING,
191 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,*const CSSM_DB_UNIQUE_RECORD,CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR,CSSM_DATA_PTR,) -> CSSM_RETURN>>::ENCODING,
192 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,CSSM_DB_UNIQUE_RECORD_PTR,) -> CSSM_RETURN>>::ENCODING,
193 <Option<unsafe extern "C-unwind" fn(CSSM_DL_DB_HANDLE,uint32,*const c_void,*mut *mut c_void,) -> CSSM_RETURN>>::ENCODING,
194 ]);
195}
196
197#[cfg(all(
198 feature = "SecAsn1Types",
199 feature = "cssmconfig",
200 feature = "cssmtype",
201 feature = "objc2"
202))]
203unsafe impl RefEncode for cssm_spi_dl_funcs {
204 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
205}
206
207#[deprecated]
209#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
210pub type CSSM_SPI_DL_FUNCS = cssm_spi_dl_funcs;
211
212#[deprecated]
214#[cfg(all(feature = "SecAsn1Types", feature = "cssmconfig", feature = "cssmtype"))]
215pub type CSSM_SPI_DL_FUNCS_PTR = *mut cssm_spi_dl_funcs;