• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright libuv project contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #ifndef UV_DARWIN_STUB_H_
23 #define UV_DARWIN_STUB_H_
24 
25 #include <stdint.h>
26 
27 struct CFArrayCallBacks;
28 struct CFRunLoopSourceContext;
29 struct FSEventStreamContext;
30 struct CFRange;
31 
32 typedef double CFAbsoluteTime;
33 typedef double CFTimeInterval;
34 typedef int FSEventStreamEventFlags;
35 typedef int OSStatus;
36 typedef long CFIndex;
37 typedef struct CFArrayCallBacks CFArrayCallBacks;
38 typedef struct CFRunLoopSourceContext CFRunLoopSourceContext;
39 typedef struct FSEventStreamContext FSEventStreamContext;
40 typedef uint32_t FSEventStreamCreateFlags;
41 typedef uint64_t FSEventStreamEventId;
42 typedef unsigned CFStringEncoding;
43 typedef void* CFAllocatorRef;
44 typedef void* CFArrayRef;
45 typedef void* CFBundleRef;
46 typedef void* CFDataRef;
47 typedef void* CFDictionaryRef;
48 typedef void* CFMutableDictionaryRef;
49 typedef struct CFRange CFRange;
50 typedef void* CFRunLoopRef;
51 typedef void* CFRunLoopSourceRef;
52 typedef void* CFStringRef;
53 typedef void* CFTypeRef;
54 typedef void* FSEventStreamRef;
55 
56 typedef uint32_t IOOptionBits;
57 typedef unsigned int io_iterator_t;
58 typedef unsigned int io_object_t;
59 typedef unsigned int io_service_t;
60 typedef unsigned int io_registry_entry_t;
61 
62 
63 typedef void (*FSEventStreamCallback)(const FSEventStreamRef,
64                                       void*,
65                                       size_t,
66                                       void*,
67                                       const FSEventStreamEventFlags*,
68                                       const FSEventStreamEventId*);
69 
70 struct CFRunLoopSourceContext {
71   CFIndex version;
72   void* info;
73   void* pad[7];
74   void (*perform)(void*);
75 };
76 
77 struct FSEventStreamContext {
78   CFIndex version;
79   void* info;
80   void* pad[3];
81 };
82 
83 struct CFRange {
84   CFIndex location;
85   CFIndex length;
86 };
87 
88 static const CFStringEncoding kCFStringEncodingUTF8 = 0x8000100;
89 static const OSStatus noErr = 0;
90 
91 static const FSEventStreamEventId kFSEventStreamEventIdSinceNow = -1;
92 
93 static const int kFSEventStreamCreateFlagNoDefer = 2;
94 static const int kFSEventStreamCreateFlagFileEvents = 16;
95 
96 static const int kFSEventStreamEventFlagEventIdsWrapped = 8;
97 static const int kFSEventStreamEventFlagHistoryDone = 16;
98 static const int kFSEventStreamEventFlagItemChangeOwner = 0x4000;
99 static const int kFSEventStreamEventFlagItemCreated = 0x100;
100 static const int kFSEventStreamEventFlagItemFinderInfoMod = 0x2000;
101 static const int kFSEventStreamEventFlagItemInodeMetaMod = 0x400;
102 static const int kFSEventStreamEventFlagItemIsDir = 0x20000;
103 static const int kFSEventStreamEventFlagItemModified = 0x1000;
104 static const int kFSEventStreamEventFlagItemRemoved = 0x200;
105 static const int kFSEventStreamEventFlagItemRenamed = 0x800;
106 static const int kFSEventStreamEventFlagItemXattrMod = 0x8000;
107 static const int kFSEventStreamEventFlagKernelDropped = 4;
108 static const int kFSEventStreamEventFlagMount = 64;
109 static const int kFSEventStreamEventFlagRootChanged = 32;
110 static const int kFSEventStreamEventFlagUnmount = 128;
111 static const int kFSEventStreamEventFlagUserDropped = 2;
112 
113 #endif  /* UV_DARWIN_STUB_H_ */
114