package quickjs

  1. Overview
  2. Docs

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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
module CI = Cstubs_internals

external libregexp_stubs_1_lre_compile_shim
  : _ CI.fatptr -> _ CI.fatptr -> int -> string CI.ocaml ->
    Unsigned.size_t -> int -> _ CI.fatptr -> CI.voidp
  =
  "libregexp_stubs_1_lre_compile_shim_byte7" "libregexp_stubs_1_lre_compile_shim"
  

external libregexp_stubs_2_lre_exec_shim
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> int -> int -> int ->
    _ CI.fatptr -> int
  = "libregexp_stubs_2_lre_exec_shim_byte7" "libregexp_stubs_2_lre_exec_shim" 

external libregexp_stubs_3_lre_bytecode_free : _ CI.fatptr -> unit
  = "libregexp_stubs_3_lre_bytecode_free" 

external libregexp_stubs_4_lre_now_ms : unit -> float
  = "libregexp_stubs_4_lre_now_ms" 

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

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

external libregexp_stubs_7_lre_get_groupnames_shim : _ CI.fatptr -> CI.voidp
  = "libregexp_stubs_7_lre_get_groupnames_shim" 

external libregexp_stubs_8_lre_get_groupname_shim
  : _ CI.fatptr -> int -> CI.voidp
  = "libregexp_stubs_8_lre_get_groupname_shim" 

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

external libregexp_stubs_10_lre_is_cased : Unsigned.uint32 -> bool
  = "libregexp_stubs_10_lre_is_cased" 

external libregexp_stubs_11_lre_is_case_ignorable : Unsigned.uint32 -> bool
  = "libregexp_stubs_11_lre_is_case_ignorable" 

external libregexp_stubs_12_lre_is_id_start : Unsigned.uint32 -> bool
  = "libregexp_stubs_12_lre_is_id_start" 

external libregexp_stubs_13_lre_is_id_continue : Unsigned.uint32 -> bool
  = "libregexp_stubs_13_lre_is_id_continue" 

external libregexp_stubs_14_lre_is_space_shim : int -> bool
  = "libregexp_stubs_14_lre_is_space_shim" 

external libregexp_stubs_15_lre_case_conv
  : _ CI.fatptr -> Unsigned.uint32 -> int -> int
  = "libregexp_stubs_15_lre_case_conv" 

external libregexp_stubs_16_lre_canonicalize : Unsigned.uint32 -> bool -> int
  = "libregexp_stubs_16_lre_canonicalize" 

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

external libregexp_stubs_18_unicode_normalize_free : _ CI.fatptr -> unit
  = "libregexp_stubs_18_unicode_normalize_free" 

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

external libregexp_stubs_20_unicode_char_range_free : _ CI.fatptr -> unit
  = "libregexp_stubs_20_unicode_char_range_free" 

external libregexp_stubs_21_js_dtoa_max_len
  : float -> int -> int -> int -> int = "libregexp_stubs_21_js_dtoa_max_len" 

external libregexp_stubs_22_js_dtoa
  : _ CI.fatptr -> float -> int -> int -> int -> _ CI.fatptr -> int
  = "libregexp_stubs_22_js_dtoa_byte6" "libregexp_stubs_22_js_dtoa" 

external libregexp_stubs_23_js_atod_shim
  : _ CI.fatptr -> _ CI.fatptr -> int -> int -> _ CI.fatptr -> float
  = "libregexp_stubs_23_js_atod_shim" 

external libregexp_stubs_24_u32toa
  : _ CI.fatptr -> Unsigned.uint32 -> Unsigned.size_t
  = "libregexp_stubs_24_u32toa" 

external libregexp_stubs_25_i32toa : _ CI.fatptr -> int32 -> Unsigned.size_t
  = "libregexp_stubs_25_i32toa" 

external libregexp_stubs_26_u64toa
  : _ CI.fatptr -> Unsigned.uint64 -> Unsigned.size_t
  = "libregexp_stubs_26_u64toa" 

external libregexp_stubs_27_i64toa : _ CI.fatptr -> int64 -> Unsigned.size_t
  = "libregexp_stubs_27_i64toa" 

external libregexp_stubs_28_u64toa_radix
  : _ CI.fatptr -> Unsigned.uint64 -> Unsigned.uint -> Unsigned.size_t
  = "libregexp_stubs_28_u64toa_radix" 

external libregexp_stubs_29_i64toa_radix
  : _ CI.fatptr -> int64 -> int -> Unsigned.size_t
  = "libregexp_stubs_29_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_29_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_28_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_27_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_26_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_25_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_24_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_23_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_22_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_21_js_dtoa_max_len
| Function (CI.Pointer _, Returns CI.Void), "unicode_char_range_free" ->
  (fun x43 ->
    let CI.CPointer x44 = x43 in
    libregexp_stubs_20_unicode_char_range_free x44)
| Function
    (CI.Primitive CI.Int,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x47; _},
        Function (CI.Pointer _, Returns (CI.Primitive CI.Int)))),
  "unicode_char_range_shim" ->
  (fun x45 x46 x50 ->
    let CI.CPointer x51 = x50 in
    let CI.CPointer x49 = x47 x46 in
    let x48 = x49 in libregexp_stubs_19_unicode_char_range_shim x45 x48 x51)
| Function (CI.Pointer _, Returns CI.Void), "unicode_normalize_free" ->
  (fun x52 ->
    let CI.CPointer x53 = x52 in
    libregexp_stubs_18_unicode_normalize_free x53)
| 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 x54 x56 x57 x58 ->
    let CI.CPointer x59 = x58 in
    let CI.CPointer x55 = x54 in
    libregexp_stubs_17_unicode_normalize_shim x55 x56 x57 x59)
| Function
    (CI.Primitive CI.Uint32_t,
     Function (CI.Primitive CI.Bool, Returns (CI.Primitive CI.Int))),
  "lre_canonicalize" -> libregexp_stubs_16_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 x62 x64 x65 ->
    let CI.CPointer x63 = x62 in libregexp_stubs_15_lre_case_conv x63 x64 x65)
| Function (CI.Primitive CI.Int, Returns (CI.Primitive CI.Bool)),
  "lre_is_space_shim" -> libregexp_stubs_14_lre_is_space_shim
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Bool)),
  "lre_is_id_continue" -> libregexp_stubs_13_lre_is_id_continue
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Bool)),
  "lre_is_id_start" -> libregexp_stubs_12_lre_is_id_start
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Bool)),
  "lre_is_case_ignorable" -> libregexp_stubs_11_lre_is_case_ignorable
| Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Bool)),
  "lre_is_cased" -> libregexp_stubs_10_lre_is_cased
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)), "lre_get_flags" ->
  (fun x71 ->
    let CI.CPointer x72 = x71 in libregexp_stubs_9_lre_get_flags x72)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Int,
        Returns (CI.View {CI.ty = CI.Pointer x76; read = x77; _}))),
  "lre_get_groupname_shim" ->
  (fun x73 x75 ->
    let CI.CPointer x74 = x73 in
    x77 (CI.make_ptr x76 (libregexp_stubs_8_lre_get_groupname_shim x74 x75)))
| Function
    (CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x80; read = x81; _})),
  "lre_get_groupnames_shim" ->
  (fun x78 ->
    let CI.CPointer x79 = x78 in
    x81 (CI.make_ptr x80 (libregexp_stubs_7_lre_get_groupnames_shim x79)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "lre_get_alloc_count" ->
  (fun x82 ->
    let CI.CPointer x83 = x82 in libregexp_stubs_6_lre_get_alloc_count x83)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "lre_get_capture_count" ->
  (fun x84 ->
    let CI.CPointer x85 = x84 in libregexp_stubs_5_lre_get_capture_count x85)
| Function (CI.Void, Returns (CI.Primitive CI.Double)), "lre_now_ms" ->
  libregexp_stubs_4_lre_now_ms
| Function (CI.Pointer _, Returns CI.Void), "lre_bytecode_free" ->
  (fun x87 ->
    let CI.CPointer x88 = x87 in libregexp_stubs_3_lre_bytecode_free x88)
| 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.View {CI.ty = CI.Pointer _; write = x99; _},
                       Returns (CI.Primitive CI.Int)))))))),
  "lre_exec_shim" ->
  (fun x89 x91 x93 x95 x96 x97 x98 ->
    let CI.CPointer x101 = x99 x98 in
    let CI.CPointer x94 = x93 in
    let CI.CPointer x92 = x91 in
    let CI.CPointer x90 = x89 in
    let x100 = x101 in
    libregexp_stubs_2_lre_exec_shim x90 x92 x94 x95 x96 x97 x100)
| 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 x112)))))))),
  "lre_compile_shim" ->
  (fun x102 x104 x106 x107 x108 x109 x110 ->
    let CI.CPointer x111 = x110 in
    let CI.CPointer x105 = x104 in
    let CI.CPointer x103 = x102 in
    CI.make_ptr x112
      (libregexp_stubs_1_lre_compile_shim x103 x105 x106 x107 x108 x109 x111))
| _, 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