package ceph

  1. Overview
  2. Docs

Source file generated.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
module CI = Cstubs_internals

external ceph_stub__1_ceph_version
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "ceph_stub__1_ceph_version" 

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

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

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

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

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

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

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

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

external ceph_stub__10_ceph_getcwd : _ CI.fatptr -> CI.voidp
  = "ceph_stub__10_ceph_getcwd" 

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

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

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

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

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

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

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

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

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

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

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

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

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

external ceph_stub__24_ceph_readdir : _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "ceph_stub__24_ceph_readdir" 

external ceph_stub__25_ceph_readdirplus_r
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr ->
    Unsigned.uint -> Unsigned.uint -> _ CI.fatptr -> int
  =
  "ceph_stub__25_ceph_readdirplus_r_byte7" "ceph_stub__25_ceph_readdirplus_r" 

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

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

external ceph_stub__28_ceph_fallocate
  : _ CI.fatptr -> int -> int -> int64 -> int64 -> int
  = "ceph_stub__28_ceph_fallocate" 

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

external ceph_stub__30_ceph_statx
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> Unsigned.uint ->
    Unsigned.uint -> int = "ceph_stub__30_ceph_statx" 

external ceph_stub__31_ceph_fstatx
  : _ CI.fatptr -> int -> _ CI.fatptr -> Unsigned.uint -> Unsigned.uint ->
    int = "ceph_stub__31_ceph_fstatx" 

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.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Function
          (CI.Pointer _,
           Function
             (CI.Primitive CI.Uint,
              Function (CI.Primitive CI.Uint, Returns (CI.Primitive CI.Int)))))),
  "ceph_fstatx" ->
  (fun x1 x3 x4 x6 x7 ->
    let CI.CPointer x5 = x4 in
    let CI.CPointer x2 = x1 in ceph_stub__31_ceph_fstatx x2 x3 x5 x6 x7)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x11; _},
        Function
          (CI.Pointer _,
           Function
             (CI.Primitive CI.Uint,
              Function (CI.Primitive CI.Uint, Returns (CI.Primitive CI.Int)))))),
  "ceph_statx" ->
  (fun x8 x10 x14 x16 x17 ->
    let CI.CPointer x15 = x14 in
    let CI.CPointer x13 = x11 x10 in
    let CI.CPointer x9 = x8 in
    let x12 = x13 in ceph_stub__30_ceph_statx x9 x12 x15 x16 x17)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
  "ceph_fsync" ->
  (fun x18 x20 x21 ->
    let CI.CPointer x19 = x18 in ceph_stub__29_ceph_fsync x19 x20 x21)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Function
          (CI.Primitive CI.Int,
           Function
             (CI.Primitive CI.Int64_t,
              Function
                (CI.Primitive CI.Int64_t, Returns (CI.Primitive CI.Int)))))),
  "ceph_fallocate" ->
  (fun x22 x24 x25 x26 x27 ->
    let CI.CPointer x23 = x22 in
    ceph_stub__28_ceph_fallocate x23 x24 x25 x26 x27)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))),
  "ceph_close" ->
  (fun x28 x30 ->
    let CI.CPointer x29 = x28 in ceph_stub__27_ceph_close x29 x30)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x34; _},
        Function
          (CI.Primitive CI.Int,
           Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
  "ceph_open" ->
  (fun x31 x33 x37 x38 ->
    let CI.CPointer x36 = x34 x33 in
    let CI.CPointer x32 = x31 in
    let x35 = x36 in ceph_stub__26_ceph_open x32 x35 x37 x38)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _,
           Function
             (CI.Pointer _,
              Function
                (CI.Primitive CI.Uint,
                 Function
                   (CI.Primitive CI.Uint,
                    Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))))))),
  "ceph_readdirplus_r" ->
  (fun x39 x41 x43 x45 x47 x48 x49 ->
    let CI.CPointer x50 = x49 in
    let CI.CPointer x46 = x45 in
    let CI.CPointer x44 = x43 in
    let CI.CPointer x42 = x41 in
    let CI.CPointer x40 = x39 in
    ceph_stub__25_ceph_readdirplus_r x40 x42 x44 x46 x47 x48 x50)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Returns (CI.View {CI.ty = CI.Pointer x55; read = x56; _}))),
  "ceph_readdir" ->
  (fun x51 x53 ->
    let CI.CPointer x54 = x53 in
    let CI.CPointer x52 = x51 in
    x56 (CI.make_ptr x55 (ceph_stub__24_ceph_readdir x52 x54)))
| Function
    (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
  "ceph_closedir" ->
  (fun x57 x59 ->
    let CI.CPointer x60 = x59 in
    let CI.CPointer x58 = x57 in ceph_stub__23_ceph_closedir x58 x60)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x64; _},
        Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))),
  "ceph_opendir" ->
  (fun x61 x63 x67 ->
    let CI.CPointer x68 = x67 in
    let CI.CPointer x66 = x64 x63 in
    let CI.CPointer x62 = x61 in
    let x65 = x66 in ceph_stub__22_ceph_opendir x62 x65 x68)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x72; _},
        Function
          (CI.Primitive CI.Int,
           Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
  "ceph_lchown" ->
  (fun x69 x71 x75 x76 ->
    let CI.CPointer x74 = x72 x71 in
    let CI.CPointer x70 = x69 in
    let x73 = x74 in ceph_stub__21_ceph_lchown x70 x73 x75 x76)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x80; _},
        Function
          (CI.Primitive CI.Int,
           Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
  "ceph_chown" ->
  (fun x77 x79 x83 x84 ->
    let CI.CPointer x82 = x80 x79 in
    let CI.CPointer x78 = x77 in
    let x81 = x82 in ceph_stub__20_ceph_chown x78 x81 x83 x84)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x88; _},
        Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
  "ceph_chmod" ->
  (fun x85 x87 x91 ->
    let CI.CPointer x90 = x88 x87 in
    let CI.CPointer x86 = x85 in
    let x89 = x90 in ceph_stub__19_ceph_chmod x86 x89 x91)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x95; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x99; _},
           Returns (CI.Primitive CI.Int)))),
  "ceph_rename" ->
  (fun x92 x94 x98 ->
    let CI.CPointer x101 = x99 x98 in
    let CI.CPointer x97 = x95 x94 in
    let CI.CPointer x93 = x92 in
    let x96 = x97 in
    let x100 = x101 in ceph_stub__18_ceph_rename x93 x96 x100)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x105; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_unlink" ->
  (fun x102 x104 ->
    let CI.CPointer x107 = x105 x104 in
    let CI.CPointer x103 = x102 in
    let x106 = x107 in ceph_stub__17_ceph_unlink x103 x106)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x111; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x115; _},
           Returns (CI.Primitive CI.Int)))),
  "ceph_symlink" ->
  (fun x108 x110 x114 ->
    let CI.CPointer x117 = x115 x114 in
    let CI.CPointer x113 = x111 x110 in
    let CI.CPointer x109 = x108 in
    let x112 = x113 in
    let x116 = x117 in ceph_stub__16_ceph_symlink x109 x112 x116)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x121; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x125; _},
           Returns (CI.Primitive CI.Int)))),
  "ceph_link" ->
  (fun x118 x120 x124 ->
    let CI.CPointer x127 = x125 x124 in
    let CI.CPointer x123 = x121 x120 in
    let CI.CPointer x119 = x118 in
    let x122 = x123 in
    let x126 = x127 in ceph_stub__15_ceph_link x119 x122 x126)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x131; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_rmdir" ->
  (fun x128 x130 ->
    let CI.CPointer x133 = x131 x130 in
    let CI.CPointer x129 = x128 in
    let x132 = x133 in ceph_stub__14_ceph_rmdir x129 x132)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x137; _},
        Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
  "ceph_mkdirs" ->
  (fun x134 x136 x140 ->
    let CI.CPointer x139 = x137 x136 in
    let CI.CPointer x135 = x134 in
    let x138 = x139 in ceph_stub__13_ceph_mkdirs x135 x138 x140)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x144; _},
        Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
  "ceph_mkdir" ->
  (fun x141 x143 x147 ->
    let CI.CPointer x146 = x144 x143 in
    let CI.CPointer x142 = x141 in
    let x145 = x146 in ceph_stub__12_ceph_mkdir x142 x145 x147)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x151; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_chdir" ->
  (fun x148 x150 ->
    let CI.CPointer x153 = x151 x150 in
    let CI.CPointer x149 = x148 in
    let x152 = x153 in ceph_stub__11_ceph_chdir x149 x152)
| Function
    (CI.Pointer _,
     Returns (CI.View {CI.ty = CI.Pointer x156; read = x157; _})),
  "ceph_getcwd" ->
  (fun x154 ->
    let CI.CPointer x155 = x154 in
    x157 (CI.make_ptr x156 (ceph_stub__10_ceph_getcwd x155)))
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x161; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x165; _},
           Returns (CI.Primitive CI.Int)))),
  "ceph_conf_set" ->
  (fun x158 x160 x164 ->
    let CI.CPointer x167 = x165 x164 in
    let CI.CPointer x163 = x161 x160 in
    let CI.CPointer x159 = x158 in
    let x162 = x163 in
    let x166 = x167 in ceph_stub__9_ceph_conf_set x159 x162 x166)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x171; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_conf_parse_env" ->
  (fun x168 x170 ->
    let CI.CPointer x173 = x171 x170 in
    let CI.CPointer x169 = x168 in
    let x172 = x173 in ceph_stub__8_ceph_conf_parse_env x169 x172)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x177; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_conf_read_file" ->
  (fun x174 x176 ->
    let CI.CPointer x179 = x177 x176 in
    let CI.CPointer x175 = x174 in
    let x178 = x179 in ceph_stub__7_ceph_conf_read_file x175 x178)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "ceph_unmount" ->
  (fun x180 -> let CI.CPointer x181 = x180 in ceph_stub__6_ceph_unmount x181)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x185; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_mount" ->
  (fun x182 x184 ->
    let CI.CPointer x187 = x185 x184 in
    let CI.CPointer x183 = x182 in
    let x186 = x187 in ceph_stub__5_ceph_mount x183 x186)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "ceph_init" ->
  (fun x188 -> let CI.CPointer x189 = x188 in ceph_stub__4_ceph_init x189)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "ceph_release" ->
  (fun x190 -> let CI.CPointer x191 = x190 in ceph_stub__3_ceph_release x191)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x195; _},
        Returns (CI.Primitive CI.Int))),
  "ceph_create" ->
  (fun x192 x194 ->
    let CI.CPointer x197 = x195 x194 in
    let CI.CPointer x193 = x192 in
    let x196 = x197 in ceph_stub__2_ceph_create x193 x196)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _,
           Returns (CI.View {CI.ty = CI.Pointer x204; read = x205; _})))),
  "ceph_version" ->
  (fun x198 x200 x202 ->
    let CI.CPointer x203 = x202 in
    let CI.CPointer x201 = x200 in
    let CI.CPointer x199 = x198 in
    x205 (CI.make_ptr x204 (ceph_stub__1_ceph_version x199 x201 x203)))
| _, 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