1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2017 Google
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
#import "GoogleUtilities/Reachability/Public/GoogleUtilities/GULReachabilityChecker.h"
|
|
|
18 |
|
|
|
19 |
#if !TARGET_OS_WATCH
|
|
|
20 |
typedef SCNetworkReachabilityRef (*GULReachabilityCreateWithNameFn)(CFAllocatorRef allocator,
|
|
|
21 |
const char *host);
|
|
|
22 |
|
|
|
23 |
typedef Boolean (*GULReachabilitySetCallbackFn)(SCNetworkReachabilityRef target,
|
|
|
24 |
SCNetworkReachabilityCallBack callback,
|
|
|
25 |
SCNetworkReachabilityContext *context);
|
|
|
26 |
typedef Boolean (*GULReachabilityScheduleWithRunLoopFn)(SCNetworkReachabilityRef target,
|
|
|
27 |
CFRunLoopRef runLoop,
|
|
|
28 |
CFStringRef runLoopMode);
|
|
|
29 |
typedef Boolean (*GULReachabilityUnscheduleFromRunLoopFn)(SCNetworkReachabilityRef target,
|
|
|
30 |
CFRunLoopRef runLoop,
|
|
|
31 |
CFStringRef runLoopMode);
|
|
|
32 |
|
|
|
33 |
typedef void (*GULReachabilityReleaseFn)(CFTypeRef cf);
|
|
|
34 |
|
|
|
35 |
struct GULReachabilityApi {
|
|
|
36 |
GULReachabilityCreateWithNameFn createWithNameFn;
|
|
|
37 |
GULReachabilitySetCallbackFn setCallbackFn;
|
|
|
38 |
GULReachabilityScheduleWithRunLoopFn scheduleWithRunLoopFn;
|
|
|
39 |
GULReachabilityUnscheduleFromRunLoopFn unscheduleFromRunLoopFn;
|
|
|
40 |
GULReachabilityReleaseFn releaseFn;
|
|
|
41 |
};
|
|
|
42 |
#endif
|
|
|
43 |
@interface GULReachabilityChecker (Internal)
|
|
|
44 |
|
|
|
45 |
- (const struct GULReachabilityApi *)reachabilityApi;
|
|
|
46 |
- (void)setReachabilityApi:(const struct GULReachabilityApi *)reachabilityApi;
|
|
|
47 |
|
|
|
48 |
@end
|