I am created inverted bindings. I have a structure in C where one of the elements is a rational number. I defined it in a struct in OCaml as MPQ.zarith, and in C, it is
mpq_ptr x
I was wondering how I could intitialize this field in c, and pass a value to OCaml. I haven't found much documentation. I tried to expose it as a void pointer, but it couldn't receive an input from c. Is defining a struct that has an rational number as simple as this? Or is there more to it.
let x : [`x] structure typ = structure "x"
let y = field x "z" (MPQ.zarith)
let () = seal x
I am created inverted bindings. I have a structure in C where one of the elements is a rational number. I defined it in a struct in OCaml as MPQ.zarith, and in C, it is
mpq_ptr x
I was wondering how I could intitialize this field in c, and pass a value to OCaml. I haven't found much documentation. I tried to expose it as a void pointer, but it couldn't receive an input from c. Is defining a struct that has an rational number as simple as this? Or is there more to it.