1
|
/*
|
2
|
** © 2014 by Philipp Dunkel <pip@pipobscure.com>
|
3
|
** Licensed under MIT License.
|
4
|
*/
|
5
|
|
6
|
// constants from https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/index.html#//apple_ref/doc/constant_group/FSEventStreamEventFlags
|
7
|
#ifndef kFSEventStreamEventFlagNone
|
8
|
#define kFSEventStreamEventFlagNone 0x00000000
|
9
|
#endif
|
10
|
|
11
|
#ifndef kFSEventStreamEventFlagMustScanSubDirs
|
12
|
#define kFSEventStreamEventFlagMustScanSubDirs 0x00000001
|
13
|
#endif
|
14
|
|
15
|
#ifndef kFSEventStreamEventFlagUserDropped
|
16
|
#define kFSEventStreamEventFlagUserDropped 0x00000002
|
17
|
#endif
|
18
|
|
19
|
#ifndef kFSEventStreamEventFlagKernelDropped
|
20
|
#define kFSEventStreamEventFlagKernelDropped 0x00000004
|
21
|
#endif
|
22
|
|
23
|
#ifndef kFSEventStreamEventFlagEventIdsWrapped
|
24
|
#define kFSEventStreamEventFlagEventIdsWrapped 0x00000008
|
25
|
#endif
|
26
|
|
27
|
#ifndef kFSEventStreamEventFlagHistoryDone
|
28
|
#define kFSEventStreamEventFlagHistoryDone 0x00000010
|
29
|
#endif
|
30
|
|
31
|
#ifndef kFSEventStreamEventFlagRootChanged
|
32
|
#define kFSEventStreamEventFlagRootChanged 0x00000020
|
33
|
#endif
|
34
|
|
35
|
#ifndef kFSEventStreamEventFlagMount
|
36
|
#define kFSEventStreamEventFlagMount 0x00000040
|
37
|
#endif
|
38
|
|
39
|
#ifndef kFSEventStreamEventFlagUnmount
|
40
|
#define kFSEventStreamEventFlagUnmount 0x00000080
|
41
|
#endif
|
42
|
|
43
|
#ifndef kFSEventStreamEventFlagItemCreated
|
44
|
#define kFSEventStreamEventFlagItemCreated 0x00000100
|
45
|
#endif
|
46
|
|
47
|
#ifndef kFSEventStreamEventFlagItemRemoved
|
48
|
#define kFSEventStreamEventFlagItemRemoved 0x00000200
|
49
|
#endif
|
50
|
|
51
|
#ifndef kFSEventStreamEventFlagItemInodeMetaMod
|
52
|
#define kFSEventStreamEventFlagItemInodeMetaMod 0x00000400
|
53
|
#endif
|
54
|
|
55
|
#ifndef kFSEventStreamEventFlagItemRenamed
|
56
|
#define kFSEventStreamEventFlagItemRenamed 0x00000800
|
57
|
#endif
|
58
|
|
59
|
#ifndef kFSEventStreamEventFlagItemModified
|
60
|
#define kFSEventStreamEventFlagItemModified 0x00001000
|
61
|
#endif
|
62
|
|
63
|
#ifndef kFSEventStreamEventFlagItemFinderInfoMod
|
64
|
#define kFSEventStreamEventFlagItemFinderInfoMod 0x00002000
|
65
|
#endif
|
66
|
|
67
|
#ifndef kFSEventStreamEventFlagItemChangeOwner
|
68
|
#define kFSEventStreamEventFlagItemChangeOwner 0x00004000
|
69
|
#endif
|
70
|
|
71
|
#ifndef kFSEventStreamEventFlagItemXattrMod
|
72
|
#define kFSEventStreamEventFlagItemXattrMod 0x00008000
|
73
|
#endif
|
74
|
|
75
|
#ifndef kFSEventStreamEventFlagItemIsFile
|
76
|
#define kFSEventStreamEventFlagItemIsFile 0x00010000
|
77
|
#endif
|
78
|
|
79
|
#ifndef kFSEventStreamEventFlagItemIsDir
|
80
|
#define kFSEventStreamEventFlagItemIsDir 0x00020000
|
81
|
#endif
|
82
|
|
83
|
#ifndef kFSEventStreamEventFlagItemIsSymlink
|
84
|
#define kFSEventStreamEventFlagItemIsSymlink 0x00040000
|
85
|
#endif
|
86
|
|
87
|
static v8::Local<v8::Object> Constants() {
|
88
|
v8::Local<v8::Object> object = Nan::New<v8::Object>();
|
89
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagNone").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagNone));
|
90
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagMustScanSubDirs").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagMustScanSubDirs));
|
91
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagUserDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagUserDropped));
|
92
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagKernelDropped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagKernelDropped));
|
93
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagEventIdsWrapped").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagEventIdsWrapped));
|
94
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagHistoryDone").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagHistoryDone));
|
95
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagRootChanged").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagRootChanged));
|
96
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagMount").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagMount));
|
97
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagUnmount").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagUnmount));
|
98
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemCreated").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemCreated));
|
99
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemRemoved").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemRemoved));
|
100
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemInodeMetaMod").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemInodeMetaMod));
|
101
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemRenamed").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemRenamed));
|
102
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemModified").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemModified));
|
103
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemFinderInfoMod").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemFinderInfoMod));
|
104
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemChangeOwner").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemChangeOwner));
|
105
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemXattrMod").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemXattrMod));
|
106
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemIsFile").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemIsFile));
|
107
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemIsDir").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemIsDir));
|
108
|
Nan::Set(object, Nan::New<v8::String>("kFSEventStreamEventFlagItemIsSymlink").ToLocalChecked(), Nan::New<v8::Integer>(kFSEventStreamEventFlagItemIsSymlink));
|
109
|
return object;
|
110
|
}
|