Source file posix_stat_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
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
151
152
153
154
155
156
157
158
159
160
161
module CI = Cstubs_internals
external posix_stat_1_stat : _ CI.fatptr -> _ CI.fatptr -> int
= "posix_stat_1_stat"
external posix_stat_2_fstat : int -> _ CI.fatptr -> int
= "posix_stat_2_fstat"
external posix_stat_3_lstat : _ CI.fatptr -> _ CI.fatptr -> int
= "posix_stat_3_lstat"
external posix_stat_4_chmod : _ CI.fatptr -> Unsigned.uint32 -> int
= "posix_stat_4_chmod"
external posix_stat_5_fchmod : int -> Unsigned.uint32 -> int
= "posix_stat_5_fchmod"
external posix_stat_6_mkdir : _ CI.fatptr -> Unsigned.uint32 -> int
= "posix_stat_6_mkdir"
external posix_stat_7_mkfifo : _ CI.fatptr -> Unsigned.uint32 -> int
= "posix_stat_7_mkfifo"
external posix_stat_8_umask : Unsigned.uint32 -> Unsigned.uint32
= "posix_stat_8_umask"
external posix_stat_9_fstatat
: int -> _ CI.fatptr -> _ CI.fatptr -> int -> int = "posix_stat_9_fstatat"
external posix_stat_10_fchmodat
: int -> _ CI.fatptr -> Unsigned.uint32 -> int -> int
= "posix_stat_10_fchmodat"
external posix_stat_11_mkdirat : int -> _ CI.fatptr -> Unsigned.uint32 -> int
= "posix_stat_11_mkdirat"
external posix_stat_12_mkfifoat
: int -> _ CI.fatptr -> Unsigned.uint32 -> int = "posix_stat_12_mkfifoat"
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.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Pointer _; write = x3; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x7; _},
Returns (CI.Primitive CI.Int)))),
"mkfifoat" ->
(fun x1 x2 x6 ->
let CI.CPointer x5 = x3 x2 in
let x4 = x5 in let x8 = x7 x6 in posix_stat_12_mkfifoat x1 x4 x8)
| Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Pointer _; write = x11; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x15; _},
Returns (CI.Primitive CI.Int)))),
"mkdirat" ->
(fun x9 x10 x14 ->
let CI.CPointer x13 = x11 x10 in
let x12 = x13 in let x16 = x15 x14 in posix_stat_11_mkdirat x9 x12 x16)
| Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Pointer _; write = x19; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x23; _},
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
"fchmodat" ->
(fun x17 x18 x22 x25 ->
let CI.CPointer x21 = x19 x18 in
let x20 = x21 in
let x24 = x23 x22 in posix_stat_10_fchmodat x17 x20 x24 x25)
| Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Pointer _; write = x28; _},
Function
(CI.Pointer _,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
"fstatat" ->
(fun x26 x27 x31 x33 ->
let CI.CPointer x32 = x31 in
let CI.CPointer x30 = x28 x27 in
let x29 = x30 in posix_stat_9_fstatat x26 x29 x32 x33)
| Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x35; _},
Returns (CI.View {CI.ty = CI.Primitive CI.Uint32_t; read = x37; _})),
"umask" -> (fun x34 -> let x36 = x35 x34 in x37 (posix_stat_8_umask x36))
| Function
(CI.View {CI.ty = CI.Pointer _; write = x39; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x43; _},
Returns (CI.Primitive CI.Int))),
"mkfifo" ->
(fun x38 x42 ->
let CI.CPointer x41 = x39 x38 in
let x40 = x41 in let x44 = x43 x42 in posix_stat_7_mkfifo x40 x44)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x46; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x50; _},
Returns (CI.Primitive CI.Int))),
"mkdir" ->
(fun x45 x49 ->
let CI.CPointer x48 = x46 x45 in
let x47 = x48 in let x51 = x50 x49 in posix_stat_6_mkdir x47 x51)
| Function
(CI.Primitive CI.Int,
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x54; _},
Returns (CI.Primitive CI.Int))),
"fchmod" ->
(fun x52 x53 -> let x55 = x54 x53 in posix_stat_5_fchmod x52 x55)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x57; _},
Function
(CI.View {CI.ty = CI.Primitive CI.Uint32_t; write = x61; _},
Returns (CI.Primitive CI.Int))),
"chmod" ->
(fun x56 x60 ->
let CI.CPointer x59 = x57 x56 in
let x58 = x59 in let x62 = x61 x60 in posix_stat_4_chmod x58 x62)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x64; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"lstat" ->
(fun x63 x67 ->
let CI.CPointer x68 = x67 in
let CI.CPointer x66 = x64 x63 in
let x65 = x66 in posix_stat_3_lstat x65 x68)
| Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"fstat" ->
(fun x69 x70 -> let CI.CPointer x71 = x70 in posix_stat_2_fstat x69 x71)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x73; _},
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))),
"stat" ->
(fun x72 x76 ->
let CI.CPointer x77 = x76 in
let CI.CPointer x75 = x73 x72 in
let x74 = x75 in posix_stat_1_stat x74 x77)
| _, 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