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.Posix.Poll.Types
 9 |
10 | import Data.Bits
11 | import Derive.Prelude
12 |
13 | %default total
14 | %language ElabReflection
15 |
16 | public export
17 | record PollEvent where
18 |   constructor PE
19 |   event : Bits32
20 |
21 | %runElab derive "PollEvent" [Show,Eq,Ord,FromInteger]
22 |
23 | public export
24 | Semigroup PollEvent where
25 |   PE x <+> PE y = PE $ x .|. y
26 |
27 | public export
28 | Monoid PollEvent where neutral = PE 0
29 |
30 | export
31 | hasEvent : PollEvent -> PollEvent -> Bool
32 | hasEvent (PE x) (PE y) = (x .&. y) == y
33 |
34 | public export
35 | POLLIN : PollEvent
36 | POLLIN = 1
37 |
38 | public export
39 | POLLOUT : PollEvent
40 | POLLOUT = 4
41 |
42 | public export
43 | POLLPRI : PollEvent
44 | POLLPRI = 2
45 |
46 | public export
47 | POLLERR : PollEvent
48 | POLLERR = 8
49 |
50 | public export
51 | POLLHUP : PollEvent
52 | POLLHUP = 16
53 |
54 | public export %inline
55 | pollfd_size : Bits32
56 | pollfd_size = 8
57 |