package srt

  1. Overview
  2. Docs

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

external ocaml_srt_1_memcpy : bytes CI.ocaml -> _ CI.fatptr -> int -> unit
  = "ocaml_srt_1_memcpy" 

external ocaml_srt_2_memcpy : _ CI.fatptr -> string CI.ocaml -> int -> unit
  = "ocaml_srt_2_memcpy" 

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.OCaml CI.String, Function (CI.Primitive CI.Int, Returns CI.Void))),
  "memcpy" ->
  (fun x1 x3 x4 -> let CI.CPointer x2 = x1 in ocaml_srt_2_memcpy x2 x3 x4)
| Function
    (CI.OCaml CI.Bytes,
     Function (CI.Pointer _, Function (CI.Primitive CI.Int, Returns CI.Void))),
  "memcpy" ->
  (fun x5 x6 x8 -> let CI.CPointer x7 = x6 in ocaml_srt_1_memcpy x5 x7 x8)
| _, 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.