forked from convox/changes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatch_darwin.c
More file actions
32 lines (29 loc) · 866 Bytes
/
watch_darwin.c
File metadata and controls
32 lines (29 loc) · 866 Bytes
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
// +build darwin,cgo
#include <CoreServices/CoreServices.h>
#include "_cgo_export.h"
void
fswatch_cb(ConstFSEventStreamRef streamRef,
void *clientCallBackInfo,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
cb(
(FSEventStreamRef)streamRef,
clientCallBackInfo,
numEvents,
eventPaths,
(FSEventStreamEventFlags*)eventFlags,
(FSEventStreamEventId*)eventIds);
}
FSEventStreamRef fswatch_new(FSEventStreamContext *ctx, CFMutableArrayRef pathsToWatch, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
return FSEventStreamCreate(
NULL,
fswatch_cb,
ctx,
pathsToWatch,
since,
latency,
flags);
}