]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSTransportBackupPeer.m
Security-58286.270.3.0.1.tar.gz
[apple/security.git] / OSX / sec / SOSCircle / SecureObjectSync / SOSTransportBackupPeer.m
1 #include <CoreFoundation/CoreFoundation.h>
2 #include <Security/SecureObjectSync/SOSTransportBackupPeer.h>
3 #include <utilities/SecCFWrappers.h>
4 #include <AssertMacros.h>
5
6
7 CFGiblisWithHashFor(SOSTransportBackupPeer);
8
9 SOSTransportBackupPeerRef SOSTransportBackupPeerCreate(CFStringRef fileLocation, CFErrorRef *error)
10 {
11 SOSTransportBackupPeerRef tpt = (SOSTransportBackupPeerRef)CFTypeAllocateWithSpace(SOSTransportBackupPeer, sizeof(struct __OpaqueSOSTransportBackupPeer) - sizeof(CFRuntimeBase), kCFAllocatorDefault);
12 tpt->fileLocation = CFRetainSafe(fileLocation);
13 return tpt;
14 }
15
16 static CFStringRef SOSTransportBackupPeerCopyFormatDescription(CFTypeRef aObj, CFDictionaryRef formatOptions){
17 SOSTransportBackupPeerRef t = (SOSTransportBackupPeerRef) aObj;
18
19 return CFStringCreateWithFormat(NULL, NULL, CFSTR("<SOSTransportBackupPeer@%p\n>"), t);
20 }
21
22 static void SOSTransportBackupPeerDestroy(CFTypeRef aObj){
23 SOSTransportBackupPeerRef transport = (SOSTransportBackupPeerRef) aObj;
24 CFReleaseNull(transport);
25 }
26
27 CFIndex SOSTransportBackupPeerGetTransportType(SOSTransportBackupPeerRef transport, CFErrorRef *error){
28 return 3;
29 }
30
31 static CFHashCode SOSTransportBackupPeerHash(CFTypeRef obj){
32 return (intptr_t) obj;
33 }
34
35 static Boolean SOSTransportBackupPeerCompare(CFTypeRef lhs, CFTypeRef rhs){
36 return SOSTransportBackupPeerHash(lhs) == SOSTransportBackupPeerHash(rhs);
37 }