0 | -- Note: This module is automatically generated when Idris builds
  1 | -- the library and the constants will be replaced with values
  2 | -- matching the system this is generated on.
  3 | --
  4 | -- The placeholders are here so that it works with tools like the LSP
  5 | -- without first compiling the library. They were generated on an x86_64
  6 | -- GNU/Linux system with GCC. If you are on a similar system, your numbers
  7 | -- might very well be identical.
  8 | module System.Linux.Inotify.Flags
  9 |
 10 | import Data.Bits
 11 | import Derive.Prelude
 12 |
 13 | %default total
 14 | %language ElabReflection
 15 |
 16 | public export
 17 | record InotifyFlags where
 18 |   constructor IF
 19 |   flags : Bits32
 20 |
 21 | %runElab derive "InotifyFlags" [Show,Eq,Ord,FromInteger]
 22 |
 23 | public export
 24 | Semigroup InotifyFlags where
 25 |   IF x <+> IF y = IF $ x .|. y
 26 |
 27 | public export
 28 | Monoid InotifyFlags where neutral = IF 0
 29 |
 30 | public export
 31 | record InotifyMask where
 32 |   constructor IM
 33 |   mask : Bits32
 34 |
 35 | namespace InotifyMask
 36 |   %runElab derive "InotifyMask" [Show,Eq,Ord,FromInteger]
 37 |
 38 | public export
 39 | Semigroup InotifyMask where
 40 |   IM x <+> IM y = IM $ x .|. y
 41 |
 42 | public export
 43 | Monoid InotifyMask where neutral = IM 0
 44 |
 45 | ||| Checks if an inotify event mask holds the given event.
 46 | export
 47 | has : InotifyMask -> InotifyMask -> Bool
 48 | has (IM x) (IM y) = y == (x .&. y)
 49 |
 50 |
 51 | public export
 52 | IN_NONBLOCK : InotifyFlags
 53 | IN_NONBLOCK = 2048
 54 |
 55 | public export
 56 | IN_CLOEXEC : InotifyFlags
 57 | IN_CLOEXEC = 524288
 58 |
 59 | public export
 60 | IN_ACCESS : InotifyMask
 61 | IN_ACCESS = 1
 62 |
 63 | public export
 64 | IN_ATTRIB : InotifyMask
 65 | IN_ATTRIB = 4
 66 |
 67 | public export
 68 | IN_CLOSE_WRITE : InotifyMask
 69 | IN_CLOSE_WRITE = 8
 70 |
 71 | public export
 72 | IN_CLOSE_NOWRITE : InotifyMask
 73 | IN_CLOSE_NOWRITE = 16
 74 |
 75 | public export
 76 | IN_CREATE : InotifyMask
 77 | IN_CREATE = 256
 78 |
 79 | public export
 80 | IN_DELETE : InotifyMask
 81 | IN_DELETE = 512
 82 |
 83 | public export
 84 | IN_DELETE_SELF : InotifyMask
 85 | IN_DELETE_SELF = 1024
 86 |
 87 | public export
 88 | IN_MODIFY : InotifyMask
 89 | IN_MODIFY = 2
 90 |
 91 | public export
 92 | IN_MOVE_SELF : InotifyMask
 93 | IN_MOVE_SELF = 2048
 94 |
 95 | public export
 96 | IN_MOVED_FROM : InotifyMask
 97 | IN_MOVED_FROM = 64
 98 |
 99 | public export
100 | IN_MOVED_TO : InotifyMask
101 | IN_MOVED_TO = 128
102 |
103 | public export
104 | IN_OPEN : InotifyMask
105 | IN_OPEN = 32
106 |
107 | public export
108 | IN_ALL_EVENTS : InotifyMask
109 | IN_ALL_EVENTS = 4095
110 |
111 | public export
112 | IN_MOVE : InotifyMask
113 | IN_MOVE = 192
114 |
115 | public export
116 | IN_CLOSE : InotifyMask
117 | IN_CLOSE = 24
118 |
119 | public export
120 | IN_DONT_FOLLOW : InotifyMask
121 | IN_DONT_FOLLOW = 33554432
122 |
123 | public export
124 | IN_EXCL_UNLINK : InotifyMask
125 | IN_EXCL_UNLINK = 67108864
126 |
127 | public export
128 | IN_MASK_ADD : InotifyMask
129 | IN_MASK_ADD = 536870912
130 |
131 | public export
132 | IN_ONESHOT : InotifyMask
133 | IN_ONESHOT = -2147483648
134 |
135 | public export
136 | IN_ONLYDIR : InotifyMask
137 | IN_ONLYDIR = 16777216
138 |
139 | public export
140 | IN_MASK_CREATE : InotifyMask
141 | IN_MASK_CREATE = 268435456
142 |
143 | public export
144 | IN_IGNORED : InotifyMask
145 | IN_IGNORED = 32768
146 |
147 | public export
148 | IN_ISDIR : InotifyMask
149 | IN_ISDIR = 1073741824
150 |
151 | public export
152 | IN_Q_OVERFLOW : InotifyMask
153 | IN_Q_OVERFLOW = 16384
154 |
155 | public export
156 | IN_UNMOUNT : InotifyMask
157 | IN_UNMOUNT = 8192
158 |