-
Notifications
You must be signed in to change notification settings - Fork 1
/
HHServiceSupport.h
executable file
·57 lines (33 loc) · 1.2 KB
/
HHServiceSupport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// HHServiceSupport.h
// Part of Hejsan-Hoppsan-Services : http://www.github.com/tolo/HHServices
//
// Created by Tobias on 2011-11-02.
// Copyright (c) 2011 Leafnode AB. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <dns_sd.h>
@interface ContextWrapper : NSObject
@property (assign) id context;
@property (readonly) id contextRetained;
- (void) releaseContext;
@end
@interface HHServiceSupport : NSObject
@property (nonatomic, assign) DNSServiceErrorType lastError;
@property (nonatomic, readonly) BOOL hasFailed;
@property (nonatomic, retain) ContextWrapper* currentCallbackContext;
/** If you use HHServices in a different dispatch queue than the main dispatch queue, set this property to that queue. */
@property (nonatomic, assign) dispatch_queue_t mainDispatchQueue;
- (void) dnsServiceError:(DNSServiceErrorType)error;
- (BOOL) setServiceRef:(DNSServiceRef)serviceRef;
- (void) resetServiceRef;
- (ContextWrapper*) setCurrentCallbackContextWithSelf;
@end
#pragma mark -
#pragma mark Utility categories
@interface NSDictionary (HHServices)
- (NSData*) dataFromTXTRecordDictionary;
@end
@interface NSData (HHServices)
- (NSDictionary*) dictionaryFromTXTRecordData;
@end