]> git.saurik.com Git - apple/security.git/blob - utilities/src/SecCFError.h
Security-55471.14.tar.gz
[apple/security.git] / utilities / src / SecCFError.h
1 //
2 // SecCFError.h
3 // utilities
4 //
5 // Created by Mitch Adler on 7/18/12.
6 // Copyright (c) 2012 Apple Inc. All rights reserved.
7 //
8
9 #ifndef _SECCFERROR_H_
10 #define _SECCFERROR_H_
11
12 #include <CoreFoundation/CoreFoundation.h>
13
14 //
15 // Leaf error creation from other systems
16 //
17
18 // kern_return_t errors
19 #define kSecKernDomain kCFErrorDomainMach
20 bool SecKernError(kern_return_t result, CFErrorRef *error, CFStringRef format, ...);
21
22 // Unix errno errors
23 #define kSecErrnoDomain kCFErrorDomainPOSIX
24 bool SecCheckErrno(int result, CFErrorRef *error, CFStringRef format, ...);
25
26 // OSStatus errors
27 #define kSecErrorDomain kCFErrorDomainOSStatus
28 bool SecError(OSStatus status, CFErrorRef *error, CFStringRef format, ...);
29
30 //
31 // Create and chain
32 //
33 void SecCFCreateError(CFIndex errorCode, CFStringRef domain, CFStringRef descriptionString,
34 CFErrorRef previousError, CFErrorRef *newError);
35
36 void SecCFCreateErrorWithFormat(CFIndex errorCode, CFStringRef domain, CFErrorRef previousError, CFErrorRef *newError,
37 CFDictionaryRef formatoptions, CFStringRef descriptionString, ...)
38 CF_FORMAT_FUNCTION(6,7);
39
40
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);
45
46 #endif