[ocaml-ctypes] Build help

Andre Nathan andre at digirati.com.br
Mon Aug 15 21:41:17 BST 2016


Hi Jeremy

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?

Thanks,
Andre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ocaml.org/pipermail/ctypes/attachments/20160815/fe7a2c5a/attachment.sig>


More information about the Ctypes mailing list