Source file libregexp__c_generated_functions__Function_description__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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
module CI = Cstubs_internals
external libregexp_stubs_1_lre_compile
: _ CI.fatptr -> _ CI.fatptr -> int -> string CI.ocaml ->
Unsigned.size_t -> int -> _ CI.fatptr -> CI.voidp
= "libregexp_stubs_1_lre_compile_byte7" "libregexp_stubs_1_lre_compile"
external libregexp_stubs_2_lre_exec
: _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int -> int -> int ->
_ CI.fatptr -> int
= "libregexp_stubs_2_lre_exec_byte7" "libregexp_stubs_2_lre_exec"
external libregexp_stubs_3_lre_get_capture_count : _ CI.fatptr -> int
= "libregexp_stubs_3_lre_get_capture_count"
external libregexp_stubs_4_lre_get_groupnames_shim : _ CI.fatptr -> CI.voidp
= "libregexp_stubs_4_lre_get_groupnames_shim"
external libregexp_stubs_5_lre_get_flags : _ CI.fatptr -> int
= "libregexp_stubs_5_lre_get_flags"
external libregexp_stubs_6_lre_is_cased : Unsigned.uint32 -> int
= "libregexp_stubs_6_lre_is_cased"
external libregexp_stubs_7_lre_is_case_ignorable : Unsigned.uint32 -> int
= "libregexp_stubs_7_lre_is_case_ignorable"
external libregexp_stubs_8_lre_is_id_start : Unsigned.uint32 -> int
= "libregexp_stubs_8_lre_is_id_start"
external libregexp_stubs_9_lre_is_id_continue : Unsigned.uint32 -> int
= "libregexp_stubs_9_lre_is_id_continue"
external libregexp_stubs_10_lre_is_space : int -> bool
= "libregexp_stubs_10_lre_is_space"
external libregexp_stubs_11_lre_case_conv
: _ CI.fatptr -> Unsigned.uint32 -> int -> int
= "libregexp_stubs_11_lre_case_conv"
external libregexp_stubs_12_lre_canonicalize : Unsigned.uint32 -> int -> int
= "libregexp_stubs_12_lre_canonicalize"
external libregexp_stubs_13_unicode_normalize_shim
: _ CI.fatptr -> int -> int -> _ CI.fatptr -> int
= "libregexp_stubs_13_unicode_normalize_shim"
external libregexp_stubs_14_unicode_normalize_free : _ CI.fatptr -> unit
= "libregexp_stubs_14_unicode_normalize_free"
external libregexp_stubs_15_js_dtoa_max_len
: float -> int -> int -> int -> int = "libregexp_stubs_15_js_dtoa_max_len"
external libregexp_stubs_16_js_dtoa
: _ CI.fatptr -> float -> int -> int -> int -> _ CI.fatptr -> int
= "libregexp_stubs_16_js_dtoa_byte6" "libregexp_stubs_16_js_dtoa"
external libregexp_stubs_17_js_atod_shim
: _ CI.fatptr -> _ CI.fatptr -> int -> int -> _ CI.fatptr -> float
= "libregexp_stubs_17_js_atod_shim"
external libregexp_stubs_18_u32toa
: _ CI.fatptr -> Unsigned.uint32 -> Unsigned.size_t
= "libregexp_stubs_18_u32toa"
external libregexp_stubs_19_i32toa : _ CI.fatptr -> int32 -> Unsigned.size_t
= "libregexp_stubs_19_i32toa"
external libregexp_stubs_20_u64toa
: _ CI.fatptr -> Unsigned.uint64 -> Unsigned.size_t
= "libregexp_stubs_20_u64toa"
external libregexp_stubs_21_i64toa : _ CI.fatptr -> int64 -> Unsigned.size_t
= "libregexp_stubs_21_i64toa"
external libregexp_stubs_22_u64toa_radix
: _ CI.fatptr -> Unsigned.uint64 -> Unsigned.uint -> Unsigned.size_t
= "libregexp_stubs_22_u64toa_radix"
external libregexp_stubs_23_i64toa_radix
: _ CI.fatptr -> int64 -> int -> Unsigned.size_t
= "libregexp_stubs_23_i64toa_radix"
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.Primitive CI.Int64_t,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Size_t)))),
"i64toa_radix" ->
(fun x1 x3 x4 ->
let CI.CPointer x2 = x1 in libregexp_stubs_23_i64toa_radix x2 x3 x4)
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Uint64_t,
Function (CI.Primitive CI.Uint, Returns (CI.Primitive CI.Size_t)))),
"u64toa_radix" ->
(fun x5 x7 x8 ->
let CI.CPointer x6 = x5 in libregexp_stubs_22_u64toa_radix x6 x7 x8)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Int64_t, Returns (CI.Primitive CI.Size_t))),
"i64toa" ->
(fun x9 x11 ->
let CI.CPointer x10 = x9 in libregexp_stubs_21_i64toa x10 x11)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Uint64_t, Returns (CI.Primitive CI.Size_t))),
"u64toa" ->
(fun x12 x14 ->
let CI.CPointer x13 = x12 in libregexp_stubs_20_u64toa x13 x14)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Int32_t, Returns (CI.Primitive CI.Size_t))),
"i32toa" ->
(fun x15 x17 ->
let CI.CPointer x16 = x15 in libregexp_stubs_19_i32toa x16 x17)
| Function
(CI.Pointer _,
Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Size_t))),
"u32toa" ->
(fun x18 x20 ->
let CI.CPointer x19 = x18 in libregexp_stubs_18_u32toa x19 x20)
| Function
(CI.View {CI.ty = CI.Pointer _; write = x22; _},
Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Double)))))),
"js_atod_shim" ->
(fun x21 x25 x27 x28 x29 ->
let CI.CPointer x30 = x29 in
let CI.CPointer x26 = x25 in
let CI.CPointer x24 = x22 x21 in
let x23 = x24 in libregexp_stubs_17_js_atod_shim x23 x26 x27 x28 x30)
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Double,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))))))),
"js_dtoa" ->
(fun x31 x33 x34 x35 x36 x37 ->
let CI.CPointer x38 = x37 in
let CI.CPointer x32 = x31 in
libregexp_stubs_16_js_dtoa x32 x33 x34 x35 x36 x38)
| Function
(CI.Primitive CI.Double,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))))),
"js_dtoa_max_len" -> libregexp_stubs_15_js_dtoa_max_len
| Function (CI.Pointer _, Returns CI.Void), "unicode_normalize_free" ->
(fun x43 ->
let CI.CPointer x44 = x43 in
libregexp_stubs_14_unicode_normalize_free x44)
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int))))),
"unicode_normalize_shim" ->
(fun x45 x47 x48 x49 ->
let CI.CPointer x50 = x49 in
let CI.CPointer x46 = x45 in
libregexp_stubs_13_unicode_normalize_shim x46 x47 x48 x50)
| Function
(CI.Primitive CI.Uint32_t,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int))),
"lre_canonicalize" -> libregexp_stubs_12_lre_canonicalize
| Function
(CI.Pointer _,
Function
(CI.Primitive CI.Uint32_t,
Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Int)))),
"lre_case_conv" ->
(fun x53 x55 x56 ->
let CI.CPointer x54 = x53 in libregexp_stubs_11_lre_case_conv x54 x55 x56)
| Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Bool)),
"lre_is_space" -> libregexp_stubs_10_lre_is_space
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Int)),
"lre_is_id_continue" -> libregexp_stubs_9_lre_is_id_continue
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Int)),
"lre_is_id_start" -> libregexp_stubs_8_lre_is_id_start
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Int)),
"lre_is_case_ignorable" -> libregexp_stubs_7_lre_is_case_ignorable
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Int)),
"lre_is_cased" -> libregexp_stubs_6_lre_is_cased
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "lre_get_flags" ->
(fun x62 ->
let CI.CPointer x63 = x62 in libregexp_stubs_5_lre_get_flags x63)
| Function
(CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x66; read = x67; _})),
"lre_get_groupnames_shim" ->
(fun x64 ->
let CI.CPointer x65 = x64 in
x67 (CI.make_ptr x66 (libregexp_stubs_4_lre_get_groupnames_shim x65)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
"lre_get_capture_count" ->
(fun x68 ->
let CI.CPointer x69 = x68 in libregexp_stubs_3_lre_get_capture_count x69)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))))))),
"lre_exec" ->
(fun x70 x72 x74 x76 x77 x78 x79 ->
let CI.CPointer x80 = x79 in
let CI.CPointer x75 = x74 in
let CI.CPointer x73 = x72 in
let CI.CPointer x71 = x70 in
libregexp_stubs_2_lre_exec x71 x73 x75 x76 x77 x78 x80)
| Function
(CI.Pointer _,
Function
(CI.Pointer _,
Function
(CI.Primitive CI.Int,
Function
(CI.OCaml CI.String,
Function
(CI.Primitive CI.Size_t,
Function
(CI.Primitive CI.Int,
Function (CI.Pointer _, Returns (CI.Pointer x91)))))))),
"lre_compile" ->
(fun x81 x83 x85 x86 x87 x88 x89 ->
let CI.CPointer x90 = x89 in
let CI.CPointer x84 = x83 in
let CI.CPointer x82 = x81 in
CI.make_ptr x91
(libregexp_stubs_1_lre_compile x82 x84 x85 x86 x87 x88 x90))
| _, 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