package posix-getopt

  1. Overview
  2. Docs

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

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

external posix_getopt_2_has_getopt_long : unit -> bool
  = "posix_getopt_2_has_getopt_long" 

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

external posix_getopt_4_has_getopt_long_only : unit -> bool
  = "posix_getopt_4_has_getopt_long_only" 

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

external posix_getopt_6_getoptarg : unit -> CI.voidp
  = "posix_getopt_6_getoptarg" 

external posix_getopt_7_getoptind : unit -> CI.voidp
  = "posix_getopt_7_getoptind" 

external posix_getopt_8_getopterr : unit -> CI.voidp
  = "posix_getopt_8_getopterr" 

external posix_getopt_9_getoptopt : unit -> CI.voidp
  = "posix_getopt_9_getoptopt" 

external posix_getopt_10_getoptreset : unit -> CI.voidp
  = "posix_getopt_10_getoptreset" 

external posix_getopt_11_strlen : _ CI.fatptr -> int
  = "posix_getopt_11_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_getopt_11_strlen x2)
| Function (CI.Void, Returns (CI.Pointer x4)), "getoptreset" ->
  (fun x3 -> CI.make_ptr x4 (posix_getopt_10_getoptreset x3))
| Function (CI.Void, Returns (CI.Pointer x6)), "getoptopt" ->
  (fun x5 -> CI.make_ptr x6 (posix_getopt_9_getoptopt x5))
| Function (CI.Void, Returns (CI.Pointer x8)), "getopterr" ->
  (fun x7 -> CI.make_ptr x8 (posix_getopt_8_getopterr x7))
| Function (CI.Void, Returns (CI.Pointer x10)), "getoptind" ->
  (fun x9 -> CI.make_ptr x10 (posix_getopt_7_getoptind x9))
| Function (CI.Void, Returns (CI.Pointer x12)), "getoptarg" ->
  (fun x11 -> CI.make_ptr x12 (posix_getopt_6_getoptarg x11))
| Function
    (CI.Primitive CI.Int,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x15; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x19; _},
           Function
             (CI.Pointer _,
              Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))))),
  "getopt_long_only" ->
  (fun x13 x14 x18 x22 x24 ->
    let CI.CPointer x25 = x24 in
    let CI.CPointer x23 = x22 in
    let CI.CPointer x21 = x19 x18 in
    let CI.CPointer x17 = x15 x14 in
    let x16 = x17 in
    let x20 = x21 in posix_getopt_5_getopt_long_only x13 x16 x20 x23 x25)
| Function (CI.Void, Returns (CI.Primitive CI.Bool)), "has_getopt_long_only" ->
  posix_getopt_4_has_getopt_long_only
| Function
    (CI.Primitive CI.Int,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x29; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x33; _},
           Function
             (CI.Pointer _,
              Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))))),
  "getopt_long" ->
  (fun x27 x28 x32 x36 x38 ->
    let CI.CPointer x39 = x38 in
    let CI.CPointer x37 = x36 in
    let CI.CPointer x35 = x33 x32 in
    let CI.CPointer x31 = x29 x28 in
    let x30 = x31 in
    let x34 = x35 in posix_getopt_3_getopt_long x27 x30 x34 x37 x39)
| Function (CI.Void, Returns (CI.Primitive CI.Bool)), "has_getopt_long" ->
  posix_getopt_2_has_getopt_long
| Function
    (CI.Primitive CI.Int,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x43; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x47; _},
           Returns (CI.Primitive CI.Int)))),
  "getopt" ->
  (fun x41 x42 x46 ->
    let CI.CPointer x49 = x47 x46 in
    let CI.CPointer x45 = x43 x42 in
    let x44 = x45 in let x48 = x49 in posix_getopt_1_getopt x41 x44 x48)
| _, 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.