package posix-time2

  1. Overview
  2. Docs

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
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 : int64 -> CI.voidp = "posix_time2_5_ctime" 

external posix_time2_6_gmtime : int64 -> CI.voidp = "posix_time2_6_gmtime" 

external posix_time2_7_localtime : int64 -> 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_getitimer : int -> _ CI.fatptr -> int
  = "posix_time2_10_getitimer" 

external posix_time2_11_setitimer : int -> _ CI.fatptr -> _ CI.fatptr -> int
  = "posix_time2_11_setitimer" 

external posix_time2_12_gettimeofday : _ CI.fatptr -> _ CI.fatptr -> int
  = "posix_time2_12_gettimeofday" 

external posix_time2_13_ocaml_posix_time2_fd_zero : _ CI.fatptr -> unit
  = "posix_time2_13_ocaml_posix_time2_fd_zero" 

external posix_time2_14_ocaml_posix_time2_fd_set : int -> _ CI.fatptr -> unit
  = "posix_time2_14_ocaml_posix_time2_fd_set" 

external posix_time2_15_ocaml_posix_time2_fd_isset
  : int -> _ CI.fatptr -> int = "posix_time2_15_ocaml_posix_time2_fd_isset" 

external posix_time2_16_ocaml_posix_time2_fd_clr : int -> _ CI.fatptr -> unit
  = "posix_time2_16_ocaml_posix_time2_fd_clr" 

external posix_time2_17_select
  : int -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int
  = "posix_time2_17_select" 

external posix_time2_18_utimes : _ CI.fatptr -> _ CI.fatptr -> int
  = "posix_time2_18_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_18_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_17_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_16_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_15_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_14_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_13_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_12_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_11_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_10_getitimer x36 x38)
| Function
    (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "nanosleep" ->
  (fun x39 x41 ->
    let CI.CPointer x42 = x41 in
    let CI.CPointer x40 = x39 in posix_time2_9_nanosleep x40 x42)
| Function
    (CI.Pointer _,
     Returns (CI.View {CI.ty = CI.Primitive CI.Int64_t; read = x45; _})),
  "mktime" ->
  (fun x43 -> let CI.CPointer x44 = x43 in x45 (posix_time2_8_mktime x44))
| Function
    (CI.View {CI.ty = CI.Primitive CI.Int64_t; write = x47; _},
     Returns (CI.Pointer x49)),
  "localtime" ->
  (fun x46 ->
    let x48 = x47 x46 in CI.make_ptr x49 (posix_time2_7_localtime x48))
| Function
    (CI.View {CI.ty = CI.Primitive CI.Int64_t; write = x51; _},
     Returns (CI.Pointer x53)),
  "gmtime" ->
  (fun x50 ->
    let x52 = x51 x50 in CI.make_ptr x53 (posix_time2_6_gmtime x52))
| Function
    (CI.View {CI.ty = CI.Primitive CI.Int64_t; write = x55; _},
     Returns (CI.View {CI.ty = CI.Pointer x57; read = x58; _})),
  "ctime" ->
  (fun x54 ->
    let x56 = x55 x54 in x58 (CI.make_ptr x57 (posix_time2_5_ctime x56)))
| Function
    (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x60; _},
     Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "clock_settime" ->
  (fun x59 x62 ->
    let CI.CPointer x63 = x62 in
    let x61 = x60 x59 in posix_time2_4_clock_settime x61 x63)
| Function
    (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x65; _},
     Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "clock_gettime" ->
  (fun x64 x67 ->
    let CI.CPointer x68 = x67 in
    let x66 = x65 x64 in posix_time2_3_clock_gettime x66 x68)
| Function
    (CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x70; _},
     Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "clock_getres" ->
  (fun x69 x72 ->
    let CI.CPointer x73 = x72 in
    let x71 = x70 x69 in posix_time2_2_clock_getres x71 x73)
| Function
    (CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x76; read = x77; _})),
  "asctime" ->
  (fun x74 ->
    let CI.CPointer x75 = x74 in
    x77 (CI.make_ptr x76 (posix_time2_1_asctime x75)))
| _, 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

OCaml

Innovation. Community. Security.