]>
git.saurik.com Git - apple/security.git/blob - authd/debugging.h
1 /* Copyright (c) 2012 Apple Inc. All rights reserved. */
3 #ifndef _SECURITY_AUTH_DEBUGGING_H_
4 #define _SECURITY_AUTH_DEBUGGING_H_
6 #if defined(__cplusplus)
16 #define LOG(...) security_auth_log(AUTH_LOG_NORMAL, ##__VA_ARGS__)
17 #define LOGV(...) security_auth_log(AUTH_LOG_VERBOSE, ##__VA_ARGS__)
18 #define LOGE(...) security_auth_log(AUTH_LOG_ERROR, ##__VA_ARGS__)
20 #define LOGD(...) security_auth_log(AUTH_LOG_VERBOSE, ##__VA_ARGS__)
25 void security_auth_log(int,const char *,...) __printflike(2, 3);
27 #define CFReleaseSafe(CF) { CFTypeRef _cf = (CF); if (_cf) CFRelease(_cf); }
28 #define CFReleaseNull(CF) { CFTypeRef _cf = (CF); \
29 if (_cf) { (CF) = NULL; CFRelease(_cf); } }
30 #define CFRetainSafe(CF) { CFTypeRef _cf = (CF); if (_cf) CFRetain(_cf); }
32 #define xpc_release_safe(obj) if (obj) { xpc_release(obj); obj = NULL; }
33 #define free_safe(obj) if (obj) { free(obj); obj = NULL; }
35 void _show_cf(CFTypeRef
);
37 #if defined(__cplusplus)
41 #endif /* !_SECURITY_AUTH_DEBUGGING_H_ */