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