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.Timer.Types
 9 |
10 | import Data.Bits
11 | import Data.C.Integer
12 | import Derive.Finite
13 | import Derive.Prelude
14 |
15 | %default total
16 | %language ElabReflection
17 |
18 | public export
19 | data Which = ITIMER_REAL | ITIMER_VIRTUAL | ITIMER_PROF
20 |
21 | %runElab derive "Which" [Show,Eq,Ord,Finite]
22 |
23 | public export
24 | data ClockId : Type where
25 |   CLOCK_REALTIME           : ClockId
26 |   CLOCK_MONOTONIC          : ClockId
27 |   CLOCK_PROCESS_CPUTIME_ID : ClockId
28 |   CLOCK_THREAD_CPUTIME_ID  : ClockId
29 |
30 | %runElab derive "ClockId" [Show,Eq,Ord,Finite]
31 |
32 |
33 | public export
34 | whichCode : Which -> Bits8
35 | whichCode ITIMER_REAL = 0
36 | whichCode ITIMER_VIRTUAL = 1
37 | whichCode ITIMER_PROF = 2
38 |
39 | public export
40 | clockCode : ClockId -> Bits8
41 | clockCode CLOCK_REALTIME = 0
42 | clockCode CLOCK_MONOTONIC = 1
43 | clockCode CLOCK_PROCESS_CPUTIME_ID = 2
44 | clockCode CLOCK_THREAD_CPUTIME_ID = 3
45 |
46 | public export %inline
47 | timeval_size : Bits32
48 | timeval_size = 16
49 |
50 | public export %inline
51 | itimerval_size : Bits32
52 | itimerval_size = 32
53 |
54 | public export %inline
55 | itimerspec_size : Bits32
56 | itimerspec_size = 32
57 |
58 | public export %inline
59 | CLOCKS_PER_SEC : ClockT
60 | CLOCKS_PER_SEC = 1000000
61 |