package posix-uname

  1. Overview
  2. Docs

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

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

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

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)), "strlen" ->
  (fun x1 -> let CI.CPointer x2 = x1 in posix_uname_2_strlen x2)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "uname" ->
  (fun x3 -> let CI.CPointer x4 = x3 in posix_uname_1_uname x4)
| _, 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.