-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCFFileDescriptor.h
58 lines (38 loc) · 1.88 KB
/
CFFileDescriptor.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
/*
* CFFileDescriptor.h
*
* Stuart Crook, 2/3/09
*/
#if !defined(__COREFOUNDATION_CFFILEDESCRIPTOR__)
#define __COREFOUNDATION_CFFILEDESCRIPTOR__ 1
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFRunLoop.h>
#if (MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED) || DEPLOYMENT_TARGET_WINDOWS || DEPLOYMENT_TARGET_LINUX
CF_EXTERN_C_BEGIN
typedef int CFFileDescriptorNativeDescriptor;
typedef struct __CFFileDescriptor * CFFileDescriptorRef;
/* Callback Reason Types */
enum {
kCFFileDescriptorReadCallBack = 1 << 0,
kCFFileDescriptorWriteCallBack = 1 << 1
};
typedef void (*CFFileDescriptorCallBack)(CFFileDescriptorRef f, CFOptionFlags callBackTypes, void *info);
typedef struct {
CFIndex version;
void * info;
void * (*retain)(void *info);
void (*release)(void *info);
CFStringRef (*copyDescription)(void *info);
} CFFileDescriptorContext;
CF_EXPORT CFTypeID CFFileDescriptorGetTypeID(void);
CF_EXPORT CFFileDescriptorRef CFFileDescriptorCreate(CFAllocatorRef allocator, CFFileDescriptorNativeDescriptor fd, Boolean closeOnInvalidate, CFFileDescriptorCallBack callout, const CFFileDescriptorContext *context);
CF_EXPORT CFFileDescriptorNativeDescriptor CFFileDescriptorGetNativeDescriptor(CFFileDescriptorRef f);
CF_EXPORT void CFFileDescriptorGetContext(CFFileDescriptorRef f, CFFileDescriptorContext *context);
CF_EXPORT void CFFileDescriptorEnableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes);
CF_EXPORT void CFFileDescriptorDisableCallBacks(CFFileDescriptorRef f, CFOptionFlags callBackTypes);
CF_EXPORT void CFFileDescriptorInvalidate(CFFileDescriptorRef f);
CF_EXPORT Boolean CFFileDescriptorIsValid(CFFileDescriptorRef f);
CF_EXPORT CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource(CFAllocatorRef allocator, CFFileDescriptorRef f, CFIndex order);
CF_EXTERN_C_END
#endif
#endif /* ! __COREFOUNDATION_CFFILEDESCRIPTOR__ */