pub unsafe extern "C-unwind" fn SecTransformSetAttributeAction(
ref: SecTransformImplementationRef,
action: &CFString,
attribute: Option<&SecTransformStringOrAttribute>,
new_action: SecTransformAttributeActionBlock,
) -> Option<CFRetained<CFError>>
SecCustomTransform
and block2
only.Expand description
Be notified when a attribute is set. The supplied block is called when the attribute is set. This can be done for a specific named attribute or all attributes.
Parameter ref
: A SecTransformImplementationRef that is bound to an instance
of a custom transform.
Parameter action
: The behavior to be set. This can be one of the following
actions:
kSecTransformActionAttributeNotification - add a block that is called when an attribute is set. If the name is NULL, then the supplied block is called for all set attributes except for ones that have a specific block as a handler.
For example, if there is a handler for the attribute “foo” and for all attributes, the “foo” handler is called when the “foo” attribute is set, but all other attribute sets will call the NULL handler.
The kSecTransformActionProcessData action is a special case of a SecTransformSetAttributeAction action. If this is called on the input attribute then it will overwrite any kSecTransformActionProcessData that was set.
kSecTransformActionAttributeValidation Add a block that is called to validate the input to an attribute.
Parameter attribute
: The name of the attribute that will be handled. An attribute
reference may also be given here. A NULL name indicates that
the supplied action is for all attributes.
Parameter newAction
: A SecTransformAttributeActionBlock which implements the
behavior.
Returns: A CFErrorRef if an error occured NULL otherwise.
This function may be called multiple times for either a named attribute or for all attributes when the attribute parameter is NULL. Each time the API is called it overwrites what was there previously.
§Safety
ref
must be a valid pointer.attribute
should be of the correct type.new_action
must be a valid pointer.