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
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 : _ CI.fatptr -> CI.voidp
  = "libregexp_stubs_4_lre_get_groupnames" 

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

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)), "lre_get_flags" ->
  (fun x1 -> let CI.CPointer x2 = x1 in libregexp_stubs_5_lre_get_flags x2)
| Function
    (CI.Pointer _, Returns (CI.View {CI.ty = CI.Pointer x5; read = x6; _})),
  "lre_get_groupnames" ->
  (fun x3 ->
    let CI.CPointer x4 = x3 in
    x6 (CI.make_ptr x5 (libregexp_stubs_4_lre_get_groupnames x4)))
| Function (CI.Pointer _, Returns (CI.Primitive CI.Int)),
  "lre_get_capture_count" ->
  (fun x7 ->
    let CI.CPointer x8 = x7 in libregexp_stubs_3_lre_get_capture_count x8)
| 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 x9 x11 x13 x15 x16 x17 x18 ->
    let CI.CPointer x19 = x18 in
    let CI.CPointer x14 = x13 in
    let CI.CPointer x12 = x11 in
    let CI.CPointer x10 = x9 in
    libregexp_stubs_2_lre_exec x10 x12 x14 x15 x16 x17 x19)
| 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 x30)))))))),
  "lre_compile" ->
  (fun x20 x22 x24 x25 x26 x27 x28 ->
    let CI.CPointer x29 = x28 in
    let CI.CPointer x23 = x22 in
    let CI.CPointer x21 = x20 in
    CI.make_ptr x30
      (libregexp_stubs_1_lre_compile x21 x23 x24 x25 x26 x27 x29))
| _, 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.