objc2_security/generated/
SecTransform.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2_core_foundation::*;
6
7use crate::*;
8
9extern "C" {
10    /// The domain for CFErrorRefs created by Transforms
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrordomain?language=objc)
13    pub static kSecTransformErrorDomain: &'static CFString;
14}
15
16extern "C" {
17    /// If multiple errors occurred, the CFErrorRef that
18    /// is returned from a Transfo]rm API will have a userInfo
19    /// dictionary and that dictionary will have the previous
20    /// error keyed by the kSecTransformPreviousErrorKey.
21    ///
22    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformpreviouserrorkey?language=objc)
23    pub static kSecTransformPreviousErrorKey: &'static CFString;
24}
25
26extern "C" {
27    /// The value of this key will be the transform that caused
28    /// the transform chain to abort.
29    ///
30    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformabortoriginatorkey?language=objc)
31    pub static kSecTransformAbortOriginatorKey: &'static CFString;
32}
33
34/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorattributenotfound?language=objc)
35#[deprecated = "SecTransform is no longer supported"]
36pub const kSecTransformErrorAttributeNotFound: CFIndex = 1;
37/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidoperation?language=objc)
38#[deprecated = "SecTransform is no longer supported"]
39pub const kSecTransformErrorInvalidOperation: CFIndex = 2;
40/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrornotinitializedcorrectly?language=objc)
41#[deprecated = "SecTransform is no longer supported"]
42pub const kSecTransformErrorNotInitializedCorrectly: CFIndex = 3;
43/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrormorethanoneoutput?language=objc)
44#[deprecated = "SecTransform is no longer supported"]
45pub const kSecTransformErrorMoreThanOneOutput: CFIndex = 4;
46/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidinputdictionary?language=objc)
47#[deprecated = "SecTransform is no longer supported"]
48pub const kSecTransformErrorInvalidInputDictionary: CFIndex = 5;
49/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidalgorithm?language=objc)
50#[deprecated = "SecTransform is no longer supported"]
51pub const kSecTransformErrorInvalidAlgorithm: CFIndex = 6;
52/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidlength?language=objc)
53#[deprecated = "SecTransform is no longer supported"]
54pub const kSecTransformErrorInvalidLength: CFIndex = 7;
55/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidtype?language=objc)
56#[deprecated = "SecTransform is no longer supported"]
57pub const kSecTransformErrorInvalidType: CFIndex = 8;
58/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidinput?language=objc)
59#[deprecated = "SecTransform is no longer supported"]
60pub const kSecTransformErrorInvalidInput: CFIndex = 10;
61/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrornamealreadyregistered?language=objc)
62#[deprecated = "SecTransform is no longer supported"]
63pub const kSecTransformErrorNameAlreadyRegistered: CFIndex = 11;
64/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorunsupportedattribute?language=objc)
65#[deprecated = "SecTransform is no longer supported"]
66pub const kSecTransformErrorUnsupportedAttribute: CFIndex = 12;
67/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformoperationnotsupportedongroup?language=objc)
68#[deprecated = "SecTransform is no longer supported"]
69pub const kSecTransformOperationNotSupportedOnGroup: CFIndex = 13;
70/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrormissingparameter?language=objc)
71#[deprecated = "SecTransform is no longer supported"]
72pub const kSecTransformErrorMissingParameter: CFIndex = 14;
73/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorinvalidconnection?language=objc)
74#[deprecated = "SecTransform is no longer supported"]
75pub const kSecTransformErrorInvalidConnection: CFIndex = 15;
76/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformtransformisexecuting?language=objc)
77#[deprecated = "SecTransform is no longer supported"]
78pub const kSecTransformTransformIsExecuting: CFIndex = 16;
79/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransforminvalidoverride?language=objc)
80#[deprecated = "SecTransform is no longer supported"]
81pub const kSecTransformInvalidOverride: CFIndex = 17;
82/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformtransformisnotregistered?language=objc)
83#[deprecated = "SecTransform is no longer supported"]
84pub const kSecTransformTransformIsNotRegistered: CFIndex = 18;
85/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerrorabortinprogress?language=objc)
86#[deprecated = "SecTransform is no longer supported"]
87pub const kSecTransformErrorAbortInProgress: CFIndex = 19;
88/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformerroraborted?language=objc)
89#[deprecated = "SecTransform is no longer supported"]
90pub const kSecTransformErrorAborted: CFIndex = 20;
91/// [Apple's documentation](https://developer.apple.com/documentation/security/ksectransforminvalidargument?language=objc)
92#[deprecated = "SecTransform is no longer supported"]
93pub const kSecTransformInvalidArgument: CFIndex = 21;
94
95/// [Apple's documentation](https://developer.apple.com/documentation/security/sectransform?language=objc)
96#[doc(alias = "SecTransformRef")]
97#[deprecated = "SecTransform is no longer supported"]
98pub type SecTransform = CFType;
99
100/// [Apple's documentation](https://developer.apple.com/documentation/security/secgrouptransform?language=objc)
101#[doc(alias = "SecGroupTransformRef")]
102#[deprecated = "SecTransform is no longer supported"]
103pub type SecGroupTransform = CFType;
104
105/// Return the CFTypeID for a SecTransform.
106///
107/// Returns: The CFTypeID
108#[deprecated = "SecTransform is no longer supported"]
109#[inline]
110pub extern "C-unwind" fn SecTransformGetTypeID() -> CFTypeID {
111    extern "C-unwind" {
112        fn SecTransformGetTypeID() -> CFTypeID;
113    }
114    unsafe { SecTransformGetTypeID() }
115}
116
117/// Return the CFTypeID for a SecTransformGroup.
118///
119/// Returns: The CFTypeID
120#[deprecated = "SecTransform is no longer supported"]
121#[inline]
122pub extern "C-unwind" fn SecGroupTransformGetTypeID() -> CFTypeID {
123    extern "C-unwind" {
124        fn SecGroupTransformGetTypeID() -> CFTypeID;
125    }
126    unsafe { SecGroupTransformGetTypeID() }
127}
128
129extern "C" {
130    /// **************    Transform Attribute Names  ***************
131    ///
132    ///
133    /// The name of the input attribute.
134    ///
135    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransforminputattributename?language=objc)
136    #[deprecated = "SecTransform is no longer supported"]
137    pub static kSecTransformInputAttributeName: &'static CFString;
138}
139
140extern "C" {
141    /// The name of the output attribute.
142    ///
143    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformoutputattributename?language=objc)
144    #[deprecated = "SecTransform is no longer supported"]
145    pub static kSecTransformOutputAttributeName: &'static CFString;
146}
147
148extern "C" {
149    /// Set this attribute to a CFWriteStream.
150    /// This will signal the transform to write debugging
151    /// information to the stream.
152    /// If this attribute is set to kCFBooleanTrue then
153    /// the debugging data will be written out to
154    /// stderr.
155    ///
156    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformdebugattributename?language=objc)
157    #[deprecated = "SecTransform is no longer supported"]
158    pub static kSecTransformDebugAttributeName: &'static CFString;
159}
160
161extern "C" {
162    /// The name of the transform.
163    ///
164    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformtransformname?language=objc)
165    #[deprecated = "SecTransform is no longer supported"]
166    pub static kSecTransformTransformName: &'static CFString;
167}
168
169extern "C" {
170    /// The name of the abort attribute.
171    ///
172    /// See also [Apple's documentation](https://developer.apple.com/documentation/security/ksectransformabortattributename?language=objc)
173    #[deprecated = "SecTransform is no longer supported"]
174    pub static kSecTransformAbortAttributeName: &'static CFString;
175}
176
177/// Creates a transform instance from a CFDictionary of
178/// parameters.
179///
180///
181/// Parameter `dictionary`: The dictionary of parameters.
182///
183///
184/// Parameter `error`: An optional pointer to a CFErrorRef. This value is
185/// set if an error occurred.  If not NULL the caller is
186/// responsible for releasing the CFErrorRef.
187///
188///
189/// Returns: A pointer to a SecTransformRef object.  You
190/// must release the object with CFRelease when you are done
191/// with it. A NULL will be returned if an error occurred during
192/// initialization, and if the error parameter
193/// is non-null, it contains the specific error data.
194///
195/// # Safety
196///
197/// - `dictionary` generics must be of the correct type.
198/// - `error` must be a valid pointer or null.
199#[deprecated = "SecTransform is no longer supported"]
200#[inline]
201pub unsafe extern "C-unwind" fn SecTransformCreateFromExternalRepresentation(
202    dictionary: &CFDictionary,
203    error: *mut *mut CFError,
204) -> Option<CFRetained<SecTransform>> {
205    extern "C-unwind" {
206        fn SecTransformCreateFromExternalRepresentation(
207            dictionary: &CFDictionary,
208            error: *mut *mut CFError,
209        ) -> Option<NonNull<SecTransform>>;
210    }
211    let ret = unsafe { SecTransformCreateFromExternalRepresentation(dictionary, error) };
212    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
213}
214
215/// Create a CFDictionaryRef that contains enough
216/// information to be able to recreate a transform.
217///
218///
219/// Parameter `transformRef`: The transformRef to be externalized.
220///
221///
222/// This function returns a CFDictionaryRef that contains
223/// sufficient information to be able to recreate this
224/// transform.  You can pass this CFDictionaryRef to
225/// SecTransformCreateFromExternalRepresentation
226/// to be able to recreate the transform.  The dictionary
227/// can also be written out to disk using the techniques
228/// described here.
229///
230/// http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFPropertyLists/Articles/Saving.html
231///
232/// # Safety
233///
234/// `transform_ref` should be of the correct type.
235#[deprecated = "SecTransform is no longer supported"]
236#[inline]
237pub unsafe extern "C-unwind" fn SecTransformCopyExternalRepresentation(
238    transform_ref: &SecTransform,
239) -> CFRetained<CFDictionary> {
240    extern "C-unwind" {
241        fn SecTransformCopyExternalRepresentation(
242            transform_ref: &SecTransform,
243        ) -> Option<NonNull<CFDictionary>>;
244    }
245    let ret = unsafe { SecTransformCopyExternalRepresentation(transform_ref) };
246    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
247    unsafe { CFRetained::from_raw(ret) }
248}
249
250/// Create a SecGroupTransformRef that acts as a
251/// container for a set of connected transforms.
252///
253///
254/// Returns: A reference to a SecGroupTransform.
255///
256///
257/// A SecGroupTransformRef is a container for all of
258/// the transforms that are in a directed graph.
259/// A SecGroupTransformRef can be used with
260/// SecTransformExecute, SecTransformExecuteAsync
261/// and SecTransformCopyExternalRepresentation
262/// APIs. While the intention is that a
263/// SecGroupTransformRef willwork just like a S
264/// SecTransformRef that is currently not the case.
265/// Using a SecGroupTransformRef with the
266/// SecTransformConnectTransforms,
267/// SecTransformSetAttribute and
268/// SecTransformGetAttribute is undefined.
269#[deprecated = "SecTransform is no longer supported"]
270#[inline]
271pub unsafe extern "C-unwind" fn SecTransformCreateGroupTransform() -> CFRetained<SecGroupTransform>
272{
273    extern "C-unwind" {
274        fn SecTransformCreateGroupTransform() -> Option<NonNull<SecGroupTransform>>;
275    }
276    let ret = unsafe { SecTransformCreateGroupTransform() };
277    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
278    unsafe { CFRetained::from_raw(ret) }
279}
280
281/// Pipe fitting for transforms.
282///
283///
284/// Parameter `sourceTransformRef`: The transform that sends the data to the
285/// destinationTransformRef.
286///
287///
288/// Parameter `sourceAttributeName`: The name of the attribute in the sourceTransformRef that
289/// supplies the data to the destinationTransformRef.
290/// Any attribute of the transform may be used as a source.
291///
292///
293/// Parameter `destinationTransformRef`: The transform that has one of its attributes
294/// be set with the data from the sourceTransformRef
295/// parameter.
296///
297///
298/// Parameter `destinationAttributeName`: The name of the attribute within the
299/// destinationTransformRef whose data is set with the
300/// data from the sourceTransformRef sourceAttributeName
301/// attribute. Any attribute of the transform may be set.
302///
303///
304/// Parameter `group`: In order to ensure referential integrity, transforms
305/// are chained together into a directed graph and
306/// placed into a group.  Each transform that makes up the
307/// graph must be placed into the same group.  After
308/// a SecTransformRef has been placed into a group by
309/// calling the SecTransformConnectTransforms it may be
310/// released as the group will retain the transform.
311/// CFRelease the group after you execute
312/// it, or when you determine you will never execute it.
313///
314/// In the example below, the output of trans1 is
315/// set to be the input of trans2.  The output of trans2
316/// is set to be the input of trans3.  Since the
317/// same group was used for the connections, the three
318/// transforms are in the same group.
319///
320/// <pre>
321///
322/// ```text
323///                         SecGroupTransformRef group =SecTransformCreateGroupTransform();
324///                         CFErrorRef error = NULL;
325///                         
326///                         SecTransformRef trans1; // previously created using a
327///                                                 // Transform construction API
328///                                                 // like SecEncryptTransformCreate
329///                                                 
330///                         SecTransformRef trans2;    // previously created using a
331///                                                 // Transform construction API
332///                                                 // like SecEncryptTransformCreate
333///                     
334///                         SecTransformRef trans3; // previously created using a
335///                                                 // Transform construction API
336///                                                 // like SecEncryptTransformCreate
337///                         
338///                         
339///                         SecTransformConnectTransforms(trans1, kSecTransformOutputAttributeName,
340///                                                       trans2, kSecTransformInputAttributeName,
341///                                                       group, &error);
342///                         
343///                         SecTransformConnectTransforms(trans2, kSecTransformOutputAttributeName,
344///                                                       trans3, kSecTransformInputAttributeName.
345///                                                       group, &error);
346///                         CFRelease(trans1);
347///                         CFRelease(trans2);
348///                         CFRelease(trans3);
349///                         
350///                         CFDataRef = (CFDataRef)SecTransformExecute(group, &error, NULL, NULL);
351///                         CFRelease(group);                    
352/// ```
353///
354/// </pre>
355///
356///
357/// Parameter `error`: An optional pointer to a CFErrorRef.  This value
358/// is set if an error occurred. If not NULL, the caller
359/// is responsible for releasing the CFErrorRef.
360///
361///
362/// Returns: The value returned is SecGroupTransformRef parameter.
363/// This will allow for chaining calls to
364/// SecTransformConnectTransforms.
365///
366///
367/// This function places transforms into a group by attaching
368/// the value of an attribute of one transform to the
369/// attribute of another transform.  Typically the attribute
370/// supplying the data is the kSecTransformAttrOutput
371/// attribute but that is not a requirement.  It can be used to
372/// set an attribute like Salt with the output attribute of
373/// a random number transform. This function returns an
374/// error and the named attribute will not be changed if
375/// SecTransformExecute had previously been called on the
376/// transform.
377///
378/// # Safety
379///
380/// - `source_transform_ref` should be of the correct type.
381/// - `destination_transform_ref` should be of the correct type.
382/// - `group` should be of the correct type.
383/// - `error` must be a valid pointer or null.
384#[deprecated = "SecTransform is no longer supported"]
385#[inline]
386pub unsafe extern "C-unwind" fn SecTransformConnectTransforms(
387    source_transform_ref: &SecTransform,
388    source_attribute_name: &CFString,
389    destination_transform_ref: &SecTransform,
390    destination_attribute_name: &CFString,
391    group: &SecGroupTransform,
392    error: *mut *mut CFError,
393) -> Option<CFRetained<SecGroupTransform>> {
394    extern "C-unwind" {
395        fn SecTransformConnectTransforms(
396            source_transform_ref: &SecTransform,
397            source_attribute_name: &CFString,
398            destination_transform_ref: &SecTransform,
399            destination_attribute_name: &CFString,
400            group: &SecGroupTransform,
401            error: *mut *mut CFError,
402        ) -> Option<NonNull<SecGroupTransform>>;
403    }
404    let ret = unsafe {
405        SecTransformConnectTransforms(
406            source_transform_ref,
407            source_attribute_name,
408            destination_transform_ref,
409            destination_attribute_name,
410            group,
411            error,
412        )
413    };
414    ret.map(|ret| unsafe { CFRetained::retain(ret) })
415}
416
417/// Set a static value as the value of an attribute in a
418/// transform. This is useful for things like iteration
419/// counts and other non-changing values.
420///
421///
422/// Parameter `transformRef`: The transform whose attribute is to be set.
423///
424///
425/// Parameter `key`: The name of the attribute to be set.
426///
427///
428/// Parameter `value`: The static value to set for the named attribute.
429///
430///
431/// Parameter `error`: An optional pointer to a CFErrorRef.  This value
432/// is set if an error occurred. If not NULL the caller
433/// is responsible for releasing the CFErrorRef.
434///
435///
436/// Returns: Returns true if the call succeeded. If an error occurred,
437/// the error parameter has more information
438/// about the failure case.
439///
440///
441/// This API allows for setting static data into an
442/// attribute for a transform.  This is in contrast to
443/// the SecTransformConnectTransforms function which sets derived
444/// data. This function will return an error and the
445/// named attribute will not be changed if SecTransformExecute
446/// has been called on the transform.
447///
448/// # Safety
449///
450/// - `transform_ref` should be of the correct type.
451/// - `value` should be of the correct type.
452/// - `error` must be a valid pointer or null.
453#[deprecated = "SecTransform is no longer supported"]
454#[inline]
455pub unsafe extern "C-unwind" fn SecTransformSetAttribute(
456    transform_ref: &SecTransform,
457    key: &CFString,
458    value: &CFType,
459    error: *mut *mut CFError,
460) -> bool {
461    extern "C-unwind" {
462        fn SecTransformSetAttribute(
463            transform_ref: &SecTransform,
464            key: &CFString,
465            value: &CFType,
466            error: *mut *mut CFError,
467        ) -> Boolean;
468    }
469    let ret = unsafe { SecTransformSetAttribute(transform_ref, key, value, error) };
470    ret != 0
471}
472
473/// Get the current value of a transform attribute.
474///
475///
476/// Parameter `transformRef`: The transform whose attribute value will be retrieved.
477///
478///
479/// Parameter `key`: The name of the attribute to retrieve.
480///
481///
482/// Returns: The value of an attribute.  If this attribute
483/// is being set as the output of another transform
484/// and SecTransformExecute has not been called on the
485/// transform or if the attribute does not exists
486/// then NULL will be returned.
487///
488///
489/// This may be called after SecTransformExecute.
490///
491/// # Safety
492///
493/// `transform_ref` should be of the correct type.
494#[deprecated = "SecTransform is no longer supported"]
495#[inline]
496pub unsafe extern "C-unwind" fn SecTransformGetAttribute(
497    transform_ref: &SecTransform,
498    key: &CFString,
499) -> Option<CFRetained<CFType>> {
500    extern "C-unwind" {
501        fn SecTransformGetAttribute(
502            transform_ref: &SecTransform,
503            key: &CFString,
504        ) -> Option<NonNull<CFType>>;
505    }
506    let ret = unsafe { SecTransformGetAttribute(transform_ref, key) };
507    ret.map(|ret| unsafe { CFRetained::retain(ret) })
508}
509
510/// Finds a member of a transform group by its name.
511///
512///
513/// Parameter `transform`: The transform group to be searched.
514///
515///
516/// Parameter `name`: The name of the transform to be found.
517///
518///
519/// When a transform instance is created it will be given a
520/// unique name.  This name can be used to find that instance
521/// in a group.  While it is possible to change this unique
522/// name using the SecTransformSetAttribute API, developers
523/// should not do so.  This allows
524/// SecTransformFindTransformByName to work correctly.
525///
526///
527/// Returns: The transform group member, or NULL if the member
528/// was not found.
529///
530/// # Safety
531///
532/// `transform` should be of the correct type.
533#[deprecated = "SecTransform is no longer supported"]
534#[inline]
535pub unsafe extern "C-unwind" fn SecTransformFindByName(
536    transform: &SecGroupTransform,
537    name: &CFString,
538) -> Option<CFRetained<SecTransform>> {
539    extern "C-unwind" {
540        fn SecTransformFindByName(
541            transform: &SecGroupTransform,
542            name: &CFString,
543        ) -> Option<NonNull<SecTransform>>;
544    }
545    let ret = unsafe { SecTransformFindByName(transform, name) };
546    ret.map(|ret| unsafe { CFRetained::retain(ret) })
547}
548
549/// Executes a Transform or transform group synchronously.
550///
551///
552/// Parameter `transformRef`: The transform to execute.
553///
554///
555/// Parameter `errorRef`: An optional pointer to a CFErrorRef.  This value
556/// will be set if an error occurred during
557/// initialization or execution of the transform or group.
558/// If not NULL the caller will be responsible for releasing
559/// the returned CFErrorRef.
560///
561///
562/// Returns: This is the result of the transform. The specific value
563/// is determined by the transform being executed.
564///
565///
566/// There are two phases that occur when executing a
567/// transform. The first phase checks to see if the tranforms
568/// have all of their required attributes set.
569/// If a GroupTransform is being executed, then a required
570/// attribute for a transform is valid if it is connected
571/// to another attribute that supplies the required value.
572/// If any of the required attributes are not set or connected
573/// then SecTransformExecute will not run the transform but will
574/// return NULL and the apporiate error is placed in the
575/// error parameter if it is not NULL.
576///
577/// The second phase is the actual execution of the transform.
578/// SecTransformExecute executes the transform or
579/// GroupTransform and when all of the processing is completed
580/// it returns the result.  If an error occurs during
581/// execution, then all processing will stop and NULL will be
582/// returned and the appropriate error will be placed in the
583/// error parameter if it is not NULL.
584///
585/// # Safety
586///
587/// - `transform_ref` should be of the correct type.
588/// - `error_ref` must be a valid pointer or null.
589#[deprecated = "SecTransform is no longer supported"]
590#[inline]
591pub unsafe extern "C-unwind" fn SecTransformExecute(
592    transform_ref: &SecTransform,
593    error_ref: *mut *mut CFError,
594) -> CFRetained<CFType> {
595    extern "C-unwind" {
596        fn SecTransformExecute(
597            transform_ref: &SecTransform,
598            error_ref: *mut *mut CFError,
599        ) -> Option<NonNull<CFType>>;
600    }
601    let ret = unsafe { SecTransformExecute(transform_ref, error_ref) };
602    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
603    unsafe { CFRetained::from_raw(ret) }
604}
605
606/// A SecMessageBlock is used by a transform instance to
607/// deliver messages during asynchronous operations.
608///
609///
610/// Parameter `message`: A CFType containing the message.  This is where
611/// either intermediate or final results are returned.
612///
613///
614/// Parameter `error`: If an error occurred, this will contain a CFErrorRef,
615/// otherwise this will be NULL. If not NULL the caller
616/// is responsible for releasing the CFErrorRef.
617///
618///
619/// Parameter `isFinal`: If set the message returned is the final result
620/// otherwise it is an intermediate result.
621///
622/// See also [Apple's documentation](https://developer.apple.com/documentation/security/secmessageblock?language=objc)
623#[cfg(feature = "block2")]
624pub type SecMessageBlock = *mut block2::DynBlock<dyn Fn(*const CFType, *mut CFError, Boolean)>;