package portmidi

  1. Overview
  2. Docs

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

external portmidi_stub_1_Pm_Initialize : unit -> int
  = "portmidi_stub_1_Pm_Initialize" 

external portmidi_stub_2_Pm_Terminate : unit -> unit
  = "portmidi_stub_2_Pm_Terminate" 

external portmidi_stub_3_Pm_CountDevices : unit -> int
  = "portmidi_stub_3_Pm_CountDevices" 

external portmidi_stub_4_Pm_GetDeviceInfo : int -> CI.voidp
  = "portmidi_stub_4_Pm_GetDeviceInfo" 

external portmidi_stub_5_Pm_GetErrorText : int -> CI.voidp
  = "portmidi_stub_5_Pm_GetErrorText" 

external portmidi_stub_6_Pm_OpenInput
  : _ CI.fatptr -> int -> _ CI.fatptr -> int32 -> _ CI.fatptr ->
    _ CI.fatptr -> int
  = "portmidi_stub_6_Pm_OpenInput_byte6" "portmidi_stub_6_Pm_OpenInput" 

external portmidi_stub_7_Pm_OpenOutput
  : _ CI.fatptr -> int -> _ CI.fatptr -> int32 -> _ CI.fatptr ->
    _ CI.fatptr -> int32 -> int
  = "portmidi_stub_7_Pm_OpenOutput_byte7" "portmidi_stub_7_Pm_OpenOutput" 

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

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

external portmidi_stub_10_Pm_Read
  : _ CI.fatptr -> _ CI.fatptr -> int32 -> int = "portmidi_stub_10_Pm_Read" 

external portmidi_stub_11_Pm_Write
  : _ CI.fatptr -> _ CI.fatptr -> int32 -> int = "portmidi_stub_11_Pm_Write" 

external portmidi_stub_12_Pm_WriteSysEx
  : _ CI.fatptr -> int32 -> _ CI.fatptr -> int
  = "portmidi_stub_12_Pm_WriteSysEx" 

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

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.Int)), "Pm_Poll" ->
  (fun x1 -> let CI.CPointer x2 = x1 in portmidi_stub_13_Pm_Poll x2)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int32_t,
        Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))),
  "Pm_WriteSysEx" ->
  (fun x3 x5 x6 ->
    let CI.CPointer x7 = x6 in
    let CI.CPointer x4 = x3 in portmidi_stub_12_Pm_WriteSysEx x4 x5 x7)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function (CI.Primitive CI.Int32_t, Returns (CI.Primitive CI.Int)))),
  "Pm_Write" ->
  (fun x8 x10 x12 ->
    let CI.CPointer x11 = x10 in
    let CI.CPointer x9 = x8 in portmidi_stub_11_Pm_Write x9 x11 x12)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function (CI.Primitive CI.Int32_t, Returns (CI.Primitive CI.Int)))),
  "Pm_Read" ->
  (fun x13 x15 x17 ->
    let CI.CPointer x16 = x15 in
    let CI.CPointer x14 = x13 in portmidi_stub_10_Pm_Read x14 x16 x17)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "Pm_Close" ->
  (fun x18 -> let CI.CPointer x19 = x18 in portmidi_stub_9_Pm_Close x19)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "Pm_Abort" ->
  (fun x20 -> let CI.CPointer x21 = x20 in portmidi_stub_8_Pm_Abort x21)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Function
          (CI.Pointer _,
           Function
             (CI.Primitive CI.Int32_t,
              Function
                (CI.Pointer _,
                 Function
                   (CI.Pointer _,
                    Function
                      (CI.Primitive CI.Int32_t,
                       Returns (CI.Primitive CI.Int)))))))),
  "Pm_OpenOutput" ->
  (fun x22 x24 x25 x27 x28 x30 x32 ->
    let CI.CPointer x31 = x30 in
    let CI.CPointer x29 = x28 in
    let CI.CPointer x26 = x25 in
    let CI.CPointer x23 = x22 in
    portmidi_stub_7_Pm_OpenOutput x23 x24 x26 x27 x29 x31 x32)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Function
          (CI.Pointer _,
           Function
             (CI.Primitive CI.Int32_t,
              Function
                (CI.Pointer _,
                 Function (CI.Pointer _, Returns (CI.Primitive CI.Int))))))),
  "Pm_OpenInput" ->
  (fun x33 x35 x36 x38 x39 x41 ->
    let CI.CPointer x42 = x41 in
    let CI.CPointer x40 = x39 in
    let CI.CPointer x37 = x36 in
    let CI.CPointer x34 = x33 in
    portmidi_stub_6_Pm_OpenInput x34 x35 x37 x38 x40 x42)
| Function
    (CI.Primitive CI.Int,
     Returns (CI.View {CI.ty = CI.Pointer x44; read = x45; _})),
  "Pm_GetErrorText" ->
  (fun x43 -> x45 (CI.make_ptr x44 (portmidi_stub_5_Pm_GetErrorText x43)))
| Function (CI.Primitive CI.Int, Returns (CI.Pointer x47)),
  "Pm_GetDeviceInfo" ->
  (fun x46 -> CI.make_ptr x47 (portmidi_stub_4_Pm_GetDeviceInfo x46))
| Function (CI.Void, Returns (CI.Primitive CI.Int)), "Pm_CountDevices" ->
  portmidi_stub_3_Pm_CountDevices
| Function (CI.Void, Returns CI.Void), "Pm_Terminate" ->
  portmidi_stub_2_Pm_Terminate
| Function (CI.Void, Returns (CI.Primitive CI.Int)), "Pm_Initialize" ->
  portmidi_stub_1_Pm_Initialize
| _, 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.