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