Merge branch 'rs/archive-with-attr-pathspec-fix'
[git/gitster.git] / compat / fsmonitor / fsm-darwin-gcc.h
blob3496e29b3a1f1b8ea04224b63b65539edda602df
1 #ifndef FSM_DARWIN_GCC_H
2 #define FSM_DARWIN_GCC_H
4 #ifndef __clang__
5 /*
6 * It is possible to #include CoreFoundation/CoreFoundation.h when compiling
7 * with clang, but not with GCC as of time of writing.
9 * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082 for details.
11 typedef unsigned int FSEventStreamCreateFlags;
12 #define kFSEventStreamEventFlagNone 0x00000000
13 #define kFSEventStreamEventFlagMustScanSubDirs 0x00000001
14 #define kFSEventStreamEventFlagUserDropped 0x00000002
15 #define kFSEventStreamEventFlagKernelDropped 0x00000004
16 #define kFSEventStreamEventFlagEventIdsWrapped 0x00000008
17 #define kFSEventStreamEventFlagHistoryDone 0x00000010
18 #define kFSEventStreamEventFlagRootChanged 0x00000020
19 #define kFSEventStreamEventFlagMount 0x00000040
20 #define kFSEventStreamEventFlagUnmount 0x00000080
21 #define kFSEventStreamEventFlagItemCreated 0x00000100
22 #define kFSEventStreamEventFlagItemRemoved 0x00000200
23 #define kFSEventStreamEventFlagItemInodeMetaMod 0x00000400
24 #define kFSEventStreamEventFlagItemRenamed 0x00000800
25 #define kFSEventStreamEventFlagItemModified 0x00001000
26 #define kFSEventStreamEventFlagItemFinderInfoMod 0x00002000
27 #define kFSEventStreamEventFlagItemChangeOwner 0x00004000
28 #define kFSEventStreamEventFlagItemXattrMod 0x00008000
29 #define kFSEventStreamEventFlagItemIsFile 0x00010000
30 #define kFSEventStreamEventFlagItemIsDir 0x00020000
31 #define kFSEventStreamEventFlagItemIsSymlink 0x00040000
32 #define kFSEventStreamEventFlagOwnEvent 0x00080000
33 #define kFSEventStreamEventFlagItemIsHardlink 0x00100000
34 #define kFSEventStreamEventFlagItemIsLastHardlink 0x00200000
35 #define kFSEventStreamEventFlagItemCloned 0x00400000
37 typedef struct __FSEventStream *FSEventStreamRef;
38 typedef const FSEventStreamRef ConstFSEventStreamRef;
40 typedef unsigned int CFStringEncoding;
41 #define kCFStringEncodingUTF8 0x08000100
43 typedef const struct __CFString *CFStringRef;
44 typedef const struct __CFArray *CFArrayRef;
45 typedef const struct __CFRunLoop *CFRunLoopRef;
47 struct FSEventStreamContext {
48 long long version;
49 void *cb_data, *retain, *release, *copy_description;
52 typedef struct FSEventStreamContext FSEventStreamContext;
53 typedef unsigned int FSEventStreamEventFlags;
54 #define kFSEventStreamCreateFlagNoDefer 0x02
55 #define kFSEventStreamCreateFlagWatchRoot 0x04
56 #define kFSEventStreamCreateFlagFileEvents 0x10
58 typedef unsigned long long FSEventStreamEventId;
59 #define kFSEventStreamEventIdSinceNow 0xFFFFFFFFFFFFFFFFULL
61 typedef void (*FSEventStreamCallback)(ConstFSEventStreamRef streamRef,
62 void *context,
63 __SIZE_TYPE__ num_of_events,
64 void *event_paths,
65 const FSEventStreamEventFlags event_flags[],
66 const FSEventStreamEventId event_ids[]);
67 typedef double CFTimeInterval;
68 FSEventStreamRef FSEventStreamCreate(void *allocator,
69 FSEventStreamCallback callback,
70 FSEventStreamContext *context,
71 CFArrayRef paths_to_watch,
72 FSEventStreamEventId since_when,
73 CFTimeInterval latency,
74 FSEventStreamCreateFlags flags);
75 CFStringRef CFStringCreateWithCString(void *allocator, const char *string,
76 CFStringEncoding encoding);
77 CFArrayRef CFArrayCreate(void *allocator, const void **items, long long count,
78 void *callbacks);
79 void CFRunLoopRun(void);
80 void CFRunLoopStop(CFRunLoopRef run_loop);
81 CFRunLoopRef CFRunLoopGetCurrent(void);
82 extern CFStringRef kCFRunLoopDefaultMode;
83 void FSEventStreamSetDispatchQueue(FSEventStreamRef stream, dispatch_queue_t q);
84 unsigned char FSEventStreamStart(FSEventStreamRef stream);
85 void FSEventStreamStop(FSEventStreamRef stream);
86 void FSEventStreamInvalidate(FSEventStreamRef stream);
87 void FSEventStreamRelease(FSEventStreamRef stream);
89 #endif /* !clang */
90 #endif /* FSM_DARWIN_GCC_H */