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 27struct CFArrayCallBacks; 28struct CFRunLoopSourceContext; 29struct FSEventStreamContext; 30 31typedef double CFAbsoluteTime; 32typedef double CFTimeInterval; 33typedef int FSEventStreamEventFlags; 34typedef int OSStatus; 35typedef long CFIndex; 36typedef struct CFArrayCallBacks CFArrayCallBacks; 37typedef struct CFRunLoopSourceContext CFRunLoopSourceContext; 38typedef struct FSEventStreamContext FSEventStreamContext; 39typedef uint32_t FSEventStreamCreateFlags; 40typedef uint64_t FSEventStreamEventId; 41typedef unsigned CFStringEncoding; 42typedef void* CFAllocatorRef; 43typedef void* CFArrayRef; 44typedef void* CFBundleRef; 45typedef void* CFDictionaryRef; 46typedef void* CFRunLoopRef; 47typedef void* CFRunLoopSourceRef; 48typedef void* CFStringRef; 49typedef void* CFTypeRef; 50typedef void* FSEventStreamRef; 51 52typedef void (*FSEventStreamCallback)(const FSEventStreamRef, 53 void*, 54 size_t, 55 void*, 56 const FSEventStreamEventFlags*, 57 const FSEventStreamEventId*); 58 59struct CFRunLoopSourceContext { 60 CFIndex version; 61 void* info; 62 void* pad[7]; 63 void (*perform)(void*); 64}; 65 66struct FSEventStreamContext { 67 CFIndex version; 68 void* info; 69 void* pad[3]; 70}; 71 72static const CFStringEncoding kCFStringEncodingUTF8 = 0x8000100; 73static const OSStatus noErr = 0; 74 75static const FSEventStreamEventId kFSEventStreamEventIdSinceNow = -1; 76 77static const int kFSEventStreamCreateFlagNoDefer = 2; 78static const int kFSEventStreamCreateFlagFileEvents = 16; 79 80static const int kFSEventStreamEventFlagEventIdsWrapped = 8; 81static const int kFSEventStreamEventFlagHistoryDone = 16; 82static const int kFSEventStreamEventFlagItemChangeOwner = 0x4000; 83static const int kFSEventStreamEventFlagItemCreated = 0x100; 84static const int kFSEventStreamEventFlagItemFinderInfoMod = 0x2000; 85static const int kFSEventStreamEventFlagItemInodeMetaMod = 0x400; 86static const int kFSEventStreamEventFlagItemIsDir = 0x20000; 87static const int kFSEventStreamEventFlagItemModified = 0x1000; 88static const int kFSEventStreamEventFlagItemRemoved = 0x200; 89static const int kFSEventStreamEventFlagItemRenamed = 0x800; 90static const int kFSEventStreamEventFlagItemXattrMod = 0x8000; 91static const int kFSEventStreamEventFlagKernelDropped = 4; 92static const int kFSEventStreamEventFlagMount = 64; 93static const int kFSEventStreamEventFlagRootChanged = 32; 94static const int kFSEventStreamEventFlagUnmount = 128; 95static const int kFSEventStreamEventFlagUserDropped = 2; 96 97#endif /* UV_DARWIN_STUB_H_ */ 98