5 // Created by Mitch Adler on 7/18/12.
6 // Copyright (c) 2012 Apple Inc. All rights reserved.
10 #define _SECCFERROR_H_
12 #include <CoreFoundation/CoreFoundation.h>
15 // Leaf error creation from other systems
18 // kern_return_t errors
19 #define kSecKernDomain kCFErrorDomainMach
20 bool SecKernError(kern_return_t result
, CFErrorRef
*error
, CFStringRef format
, ...);
23 #define kSecErrnoDomain kCFErrorDomainPOSIX
24 bool SecCheckErrno(int result
, CFErrorRef
*error
, CFStringRef format
, ...);
27 #define kSecErrorDomain kCFErrorDomainOSStatus
28 bool SecError(OSStatus status
, CFErrorRef
*error
, CFStringRef format
, ...);
33 void SecCFCreateError(CFIndex errorCode
, CFStringRef domain
, CFStringRef descriptionString
,
34 CFErrorRef previousError
, CFErrorRef
*newError
);
36 void SecCFCreateErrorWithFormat(CFIndex errorCode
, CFStringRef domain
, CFErrorRef previousError
, CFErrorRef
*newError
,
37 CFDictionaryRef formatoptions
, CFStringRef descriptionString
, ...)
38 CF_FORMAT_FUNCTION(6,7);
41 void SecCFCreateErrorWithFormatAndArguments(CFIndex errorCode
, CFStringRef domain
,
42 CFErrorRef previousError
, CFErrorRef
*newError
,
43 CFDictionaryRef formatoptions
, CFStringRef descriptionString
, va_list args
)
44 CF_FORMAT_FUNCTION(6, 0);