Source file posix_time2_generated_stubs.ml
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
module CI = Cstubs_internals
external posix_time2_1_asctime : _ CI.fatptr -> CI.voidp
= "posix_time2_1_asctime"
external posix_time2_2_clock_getres : Unsigned.uint32 -> _ CI.fatptr -> int
= "posix_time2_2_clock_getres"
external posix_time2_3_clock_gettime : Unsigned.uint32 -> _ CI.fatptr -> int
= "posix_time2_3_clock_gettime"
external posix_time2_4_clock_settime : Unsigned.uint32 -> _ CI.fatptr -> int
= "posix_time2_4_clock_settime"
external posix_time2_5_ctime : _ CI.fatptr -> CI.voidp
= "posix_time2_5_ctime"
external posix_time2_6_gmtime : _ CI.fatptr -> CI.voidp
= "posix_time2_6_gmtime"
external posix_time2_7_localtime : _ CI.fatptr -> CI.voidp
= "posix_time2_7_localtime"
external posix_time2_8_mktime : _ CI.fatptr -> int64 = "posix_time2_8_mktime"
external posix_time2_9_nanosleep : _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_9_nanosleep"
external posix_time2_10_clock_nanosleep
: Unsigned.uint32 -> int -> _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_10_clock_nanosleep"
external posix_time2_11_getitimer : int -> _ CI.fatptr -> int
= "posix_time2_11_getitimer"
external posix_time2_12_setitimer : int -> _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_12_setitimer"
external posix_time2_13_gettimeofday : _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_13_gettimeofday"
external posix_time2_14_ocaml_posix_time2_fd_zero : _ CI.fatptr -> unit
= "posix_time2_14_ocaml_posix_time2_fd_zero"
external posix_time2_15_ocaml_posix_time2_fd_set : int -> _ CI.fatptr -> unit
= "posix_time2_15_ocaml_posix_time2_fd_set"
external posix_time2_16_ocaml_posix_time2_fd_isset
: int -> _ CI.fatptr -> int = "posix_time2_16_ocaml_posix_time2_fd_isset"
external posix_time2_17_ocaml_posix_time2_fd_clr : int -> _ CI.fatptr -> unit
= "posix_time2_17_ocaml_posix_time2_fd_clr"
external posix_time2_18_select
: int -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_18_select"
external posix_time2_19_utimes : _ CI.fatptr -> _ CI.fatptr -> int
= "posix_time2_19_utimes"
type 'a result = 'a
type 'a return = 'a
type 'a fn =
| Returns : 'a CI.typ -> 'a return fn
| Function : 'a CI.typ * 'b fn -> ('a -> 'b) fn
let map_result f x = f x
let returning t = Returns t
let (@->) f p = Function (f, p)
let foreign : type a b. string -> (a -> b) fn -> (a -> b) =
fun name t -> match t, name with
| Function
(CI.View {CI.ty = CI.Pointer _; write = x2; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"utimes" ->
(fun x1 x5 ->
let CI.CPointer x6 = x5 in
let CI.CPointer x4 = x2 x1 in let x3 = x4 in posix_time2_19_utimes x3 x6)
| Function
(CI.Primitive CI.Int,
Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))))),
"select" ->
(fun x7 x8 x10 x12 x14 ->
let CI.CPointer x15 = x14 in
let CI.CPointer x13 = x12 in
let CI.CPointer x11 = x10 in
let CI.CPointer x9 = x8 in posix_time2_18_select x7 x9 x11 x13 x15)
| Function (CI.Primitive CI.Int, Function (CI.Pointer _, Returns CI.Void)),
"ocaml_posix_time2_fd_clr" ->
(fun x16 x17 ->
let CI.CPointer x18 = x17 in
posix_time2_17_ocaml_posix_time2_fd_clr x16 x18)
| Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"ocaml_posix_time2_fd_isset" ->
(fun x19 x20 ->
let CI.CPointer x21 = x20 in
posix_time2_16_ocaml_posix_time2_fd_isset x19 x21)
| Function (CI.Primitive CI.Int, Function (CI.Pointer _, Returns CI.Void)),
"ocaml_posix_time2_fd_set" ->
(fun x22 x23 ->
let CI.CPointer x24 = x23 in
posix_time2_15_ocaml_posix_time2_fd_set x22 x24)
| Function (CI.Pointer _, Returns CI.Void), "ocaml_posix_time2_fd_zero" ->
(fun x25 ->
let CI.CPointer x26 = x25 in posix_time2_14_ocaml_posix_time2_fd_zero x26)
| Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"gettimeofday" ->
(fun x27 x29 ->
let CI.CPointer x30 = x29 in
let CI.CPointer x28 = x27 in posix_time2_13_gettimeofday x28 x30)
| Function
(CI.Primitive CI.Int,
Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))),
"setitimer" ->
(fun x31 x32 x34 ->
let CI.CPointer x35 = x34 in
let CI.CPointer x33 = x32 in posix_time2_12_setitimer x31 x33 x35)
| Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"getitimer" ->
(fun x36 x37 ->
let CI.CPointer x38 = x37 in posix_time2_11_getitimer x36 x38)
| Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x40; _},
Function
(CI.Primitive CI.Int,
Function
(CI.Pointer _,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))))),
"clock_nanosleep" ->
(fun x39 x42 x43 x45 ->
let CI.CPointer x46 = x45 in
let CI.CPointer x44 = x43 in
let x41 = x40 x39 in posix_time2_10_clock_nanosleep x41 x42 x44 x46)
| Function
(CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"nanosleep" ->
(fun x47 x49 ->
let CI.CPointer x50 = x49 in
let CI.CPointer x48 = x47 in posix_time2_9_nanosleep x48 x50)
| Function
(CI.Pointer _,
Returns (CI.View {CI.ty = CI.Primitive CI.Int64_t; read = x53; _})),
"mktime" ->
(fun x51 -> let CI.CPointer x52 = x51 in x53 (posix_time2_8_mktime x52))
| Function (CI.Pointer _, Returns (CI.Pointer x56)), "localtime" ->
(fun x54 ->
let CI.CPointer x55 = x54 in
CI.make_ptr x56 (posix_time2_7_localtime x55))
| Function (CI.Pointer _, Returns (CI.Pointer x59)), "gmtime" ->
(fun x57 ->
let CI.CPointer x58 = x57 in CI.make_ptr x59 (posix_time2_6_gmtime x58))
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x62; read = x63; _})),
"ctime" ->
(fun x60 ->
let CI.CPointer x61 = x60 in
x63 (CI.make_ptr x62 (posix_time2_5_ctime x61)))
| Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x65; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"clock_settime" ->
(fun x64 x67 ->
let CI.CPointer x68 = x67 in
let x66 = x65 x64 in posix_time2_4_clock_settime x66 x68)
| Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x70; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"clock_gettime" ->
(fun x69 x72 ->
let CI.CPointer x73 = x72 in
let x71 = x70 x69 in posix_time2_3_clock_gettime x71 x73)
| Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x75; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"clock_getres" ->
(fun x74 x77 ->
let CI.CPointer x78 = x77 in
let x76 = x75 x74 in posix_time2_2_clock_getres x76 x78)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x81; read = x82; _})),
"asctime" ->
(fun x79 ->
let CI.CPointer x80 = x79 in
x82 (CI.make_ptr x81 (posix_time2_1_asctime x80)))
| _, s -> Printf.ksprintf failwith "No match for %s" s
let foreign_value : type a. string -> a Ctypes.typ -> a Ctypes.ptr =
fun name t -> match t, name with
| _, s -> Printf.ksprintf failwith "No match for %s" s