[ocaml-ctypes] Build help
andre at digirati.com.br
Mon Aug 15 21:41:17 BST 2016
On 08/15/2016 08:34 AM, Jeremy Yallop wrote:
> you'd write something like this:
> module Foreign_bindings(F: Cstubs.FOREIGN) = struct
> open F
> let mysql_library_init = foreign "mysql_server_init"
> (int @-> ptr_opt (ptr char) @-> ptr_opt (ptr char) @-> returning int)
> In this second snippet 'foreign' refers to 'F.foreign', not 'Foreign.foreign'.
In this case a binding that had type "a -> b" now became
(a -> b F.return) F.result
For example, this binding:
let mysql_init = foreign "mysql_init"
(T.mysql_opt @-> returning T.mysql_opt)
had type "T.mysql_opt -> T.mysql_opt" but after the change it became
(T.mysql_opt -> T.mysql_opt F.return) F.result
This way I can't use it as a function anymore. Is this expected?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: OpenPGP digital signature
More information about the Ctypes