package hdr_histogram

  1. Overview
  2. Docs

Source file hdr_histogram__c_generated_functions__function_description__function.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
module CI = Cstubs_internals

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

external hdr_histogram_stubs_2_hdr_record_value
  : _ CI.fatptr -> int64 -> bool = "hdr_histogram_stubs_2_hdr_record_value" 

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

external hdr_histogram_stubs_4_hdr_value_at_percentile
  : _ CI.fatptr -> float -> int64
  = "hdr_histogram_stubs_4_hdr_value_at_percentile" 

external hdr_histogram_stubs_5_hdr_min : _ CI.fatptr -> int64
  = "hdr_histogram_stubs_5_hdr_min" 

external hdr_histogram_stubs_6_hdr_max : _ CI.fatptr -> int64
  = "hdr_histogram_stubs_6_hdr_max" 

external hdr_histogram_stubs_7_hdr_mean : _ CI.fatptr -> float
  = "hdr_histogram_stubs_7_hdr_mean" 

external hdr_histogram_stubs_8_hdr_stddev : _ CI.fatptr -> float
  = "hdr_histogram_stubs_8_hdr_stddev" 

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 _, Returns (CI.Primitive CI.Double)), "hdr_stddev" ->
  (fun x1 -> let CI.CPointer x2 = x1 in hdr_histogram_stubs_8_hdr_stddev x2)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Double)), "hdr_mean" ->
  (fun x3 -> let CI.CPointer x4 = x3 in hdr_histogram_stubs_7_hdr_mean x4)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int64_t)), "hdr_max" ->
  (fun x5 -> let CI.CPointer x6 = x5 in hdr_histogram_stubs_6_hdr_max x6)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int64_t)), "hdr_min" ->
  (fun x7 -> let CI.CPointer x8 = x7 in hdr_histogram_stubs_5_hdr_min x8)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Double, Returns (CI.Primitive CI.Int64_t))),
  "hdr_value_at_percentile" ->
  (fun x9 x11 ->
    let CI.CPointer x10 = x9 in
    hdr_histogram_stubs_4_hdr_value_at_percentile x10 x11)
| Function (CI.Pointer _, Returns CI.Void), "hdr_close" ->
  (fun x12 ->
    let CI.CPointer x13 = x12 in hdr_histogram_stubs_3_hdr_close x13)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Int64_t, Returns (CI.Primitive CI.Bool))),
  "hdr_record_value" ->
  (fun x14 x16 ->
    let CI.CPointer x15 = x14 in
    hdr_histogram_stubs_2_hdr_record_value x15 x16)
| Function
    (CI.Primitive CI.Int64_t,
     Function
       (CI.Primitive CI.Int64_t,
        Function
          (CI.Primitive CI.Int,
           Function (CI.Pointer _, Returns (CI.Primitive CI.Int))))),
  "hdr_init" ->
  (fun x17 x18 x19 x20 ->
    let CI.CPointer x21 = x20 in
    hdr_histogram_stubs_1_hdr_init x17 x18 x19 x21)
| _, 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