5 // Created by Richard Murphy on 12/4/14.
9 #ifndef sec_SOSCirclePriv_h
10 #define sec_SOSCirclePriv_h
12 #include <CoreFoundation/CFRuntime.h>
13 #include <CoreFoundation/CoreFoundation.h>
16 kOnlyCompatibleVersion
= 1, // Sometime in the future this name will be improved to reflect history.
17 kAlwaysIncompatibleVersion
= UINT64_MAX
,
20 struct __OpaqueSOSCircle
{
23 CFNumberRef generation
;
24 CFMutableSetRef peers
;
25 CFMutableSetRef applicants
;
26 CFMutableSetRef rejected_applicants
;
27 CFMutableDictionaryRef signatures
;
31 static inline void SOSCircleAssertStable(SOSCircleRef circle
) {
34 assert(circle
->generation
);
35 assert(circle
->peers
);
36 assert(circle
->applicants
);
37 assert(circle
->rejected_applicants
);
38 assert(circle
->signatures
);
42 static inline SOSCircleRef
SOSCircleConvertAndAssertStable(CFTypeRef circleAsType
) {
43 if (CFGetTypeID(circleAsType
) != SOSCircleGetTypeID()) return NULL
;
44 SOSCircleRef circle
= (SOSCircleRef
) circleAsType
;
45 SOSCircleAssertStable(circle
);