Thanks to Nick Roberts (@ncik-roberts) and Danny Willems (@dannywillems) for contributions to this release.
Thanks to Anil Madhavapeddy (@avsm) and Etienne Millon (@emillon) for contributing to this release.
Thanks to @houseofsuns, @ygrek, Alpha Diallo (@moyodiallo), François Bobot (@bobot) and Alfredo Tupone (@atupone) for contributions to this release.
Thanks to Antonin Décimo (@MisterDA) for contributing to this release.
brew ls --versions when detecting homebrew https://github.com/ocamllabs/ocaml-ctypes/pull/697Thanks to Martin Kletzander (@nertpinx) and Arseniy Alekseyev (@aalekseyev) for contributions to this release.
Thanks to Kate Deplaix (@kit-ty-kate) for contributing to this release.
Unix dependency by using bigarray-compat https://github.com/ocamllabs/ocaml-ctypes/pull/660const warnings in generated code https://github.com/ocamllabs/ocaml-ctypes/pull/646 https://github.com/ocamllabs/ocaml-ctypes/pull/638CArray.make with initial value https://github.com/ocamllabs/ocaml-ctypes/pull/644funptr docstring https://github.com/ocamllabs/ocaml-ctypes/pull/633Thanks to Andreas Hauptmann (@fdopen), Anil Madhavapeddy (@avsm), Anton Bachin (@aantron), Calascibetta Romain (@dinosaure), Sora Morimoto (@smorimoto) and and Stéphane Glondu (@glondu) for contributions to this release.
Foreign.dynamic_funptr, a variant of Foreign.funptr with explicit life cycle management. https://github.com/ocamllabs/ocaml-ctypes/pull/595Thanks to Andreas Hauptmann (@fdopen), Andrew Ray (@andrewray), Anil Madhavapeddy (@avsm), Armaël Guéneau (@Armael) and Matthias Horn (@tiash) for contributions to this release.
Thanks to Anton Bachin (@aantron), Andreas Hauptmann (@fdopen) and @ygrek for contributions to this release.
CArray.of_string https://github.com/ocamllabs/ocaml-ctypes/pull/562 https://github.com/ocamllabs/ocaml-ctypes/pull/563Thanks to Andreas Hauptmann (@fdopen), Rudi Grinberg (@rgrinberg) and Marcello Seri (@mseri) for contributions to this release.
Thanks to Leo White (@lpw25) for contributing to this release.
Thanks to Bertrand Bonnefoy-Claudet (@bbc2) and Leo White (@lpw25) for contributions to this release.
Thanks to Matthias Horn (@tiash) for contributing to this release.
long double functions that are not supported on NetBSD and OpenBSD https://github.com/ocamllabs/ocaml-ctypes/pull/503Thanks to Andreas Hauptmann (@fdopen) and Peter Zotov (@whitequark) for contributions to this release.
Val_int/Int_val https://github.com/ocamllabs/ocaml-ctypes/pull/492long double complex functions that are not supported on Android https://github.com/ocamllabs/ocaml-ctypes/pull/486Thanks to Peter Zotov (@whitequark) and Jeremie Dimino (@diml) for contributions to this release.
long double and long double complex types https://github.com/ocamllabs/ocaml-ctypes/pull/475is_null https://github.com/ocamllabs/ocaml-ctypes/pull/463Thanks to Andrew Ray (@andrewray) and Yunxing Dai (@yunxing) for contributions to this release.
void. https://github.com/ocamllabs/ocaml-ctypes/pull/460Thanks to David Sheets (@dsheets) for contributions to this release.
Thanks to Andreas Hauptmann (@fdopen) for contributions to this release.
CArray functions: sub, copy, fold_right, fold_left, mapi, map, iter https://github.com/ocamllabs/ocaml-ctypes/pull/323CArray https://github.com/ocamllabs/ocaml-ctypes/issues/447nativeint, not Ctypes_ptr.voidp https://github.com/ocamllabs/ocaml-ctypes/issues/445Thanks to Andreas Hauptmann (@fdopen) for contributions to this release.
Thanks to Enguerrand Decorne (@engil) for contributing to this release.
Thanks to Martin Lucina (@mato) for contributing to this release.
uint8_t and uint16_t https://github.com/ocamllabs/ocaml-ctypes/issues/413errno in Lwt jobs before invoking job function https://github.com/ocamllabs/ocaml-ctypes/issues/426~thread_registration argument to funptr to support registering C threads with the OCaml runtime. https://github.com/ocamllabs/ocaml-ctypes/issues/420-opaque for module interfaces whose cmx files are not installed. https://github.com/ocamllabs/ocaml-ctypes/issues/423cstubs cmx files. https://github.com/ocamllabs/ocaml-ctypes/issues/424Thanks to David Sheets (@dsheets) and Demi Obenour (@DemiMarie) for contributions to this release.
sint type corresponding to a full-range C integer and update errno support to use sint https://github.com/ocamllabs/ocaml-ctypes/issues/411Thanks to Stephane Glondu (@glondu) for contributions to this release.
Thanks to Andreas Hauptmann (@fdopen) for contributing to this release.
The Cstubs.FOREIGN interface has been extended with returning and @->, and some new types. See the pull request for details: https://github.com/ocamllabs/ocaml-ctypes/pull/389
NB: code that generates bindings using Cstubs may need to be updated to select return and @-> from the bindings functor argument rather than from the Ctypes module. Code that needs to be updated will fail to compile with the new interface. The pull request shows how to update your code, if necessary.
Cstubs module can now generate asynchronous bindings to C functions using the Lwt jobs framework. See the pull request for details: https://github.com/ocamllabs/ocaml-ctypes/pull/391Cstubs module now supports optionally returning errno alongside the return value of bound C functions. See the pull request for details: https://github.com/ocamllabs/ocaml-ctypes/pull/392Unsigned.S interface has new of_int64 and to_int64 functions.*:* and +:+ functions have been removed. Use Ctypes.field instead.Thanks to Spiros Eliopoulos (@seliopou), @orbitz, Leonid Rozenberg (@rleonid) and Peter Zotov (@whitequark) for contributions to this release.
Pervasives.ignore, to keep values alive.Thanks to Andreas Hauptmann (@fdopen), David Sheets (@dsheets), Etienne Millon (@emillon), Goswin von Brederlow (@mrvn), Leonid Rozenberg (@rleonid), @orbitz, Max Mouratov (@cakeplus), and Peter Zotov (@whitequark) for contributions to this release.
*.cmt and *.cmti files.time_t as an unsigned valueSigned.Int module.Uncoercible exception.allocate_n now defaults to zeroing its memory.Add public root management interface.
NB: the interface is experimental and subject to change.
ssize_t.ptrdiff_t as a typedef for a signed integer type.intptr_t and uintptr_t as typedefsfunptr_of_raw_address function.static_funptr coercionsAdd function pointers to the core type language
(See the Ctypes_static.static_funptr type, on which Foreign.funptr and Foreign.foreign are now based.)
caml_stat_* functionsctypes_caml_roots_releaseThanks to Etienne Millon (@emillon) for contributing to this release.
Thanks to A. Hauptmann (@fdopen), David Sheets (@dsheets), Maverick Woo (@maverickwoo), Peter Zotov (@whitequark), David Kaloper (@pqwy), Ramkumar Ramachandra (@artagnon), Thomas Braibant (@braibant), Hugo Heuzard (@hhugo) and Edwin Török (@edwintorok) for contributions to this release.
Windows support
There is now support for Windows (32-bit and 64-bit, using MinGW) and automatic building and testing on Windows using Appveyor.
Support for releasing the runtime lock in C calls
The new release_runtime_lock argument to Foreign.foreign indicates whether the OCaml runtime lock should be released during the call to the bound C function, allowing other threads to run.
Support for acquiring the runtime lock in callbacks
There is a new runtime_lock argument to Foreign.funptr. Setting runtime_lock to true indicates that the OCaml runtime lock should be acquired during calls from C to OCaml and released during calls through function pointers from OCaml to C.
Support for passing 'bytes' values directly to C
See the relevant section of the FAQ.
Thanks to Yakov Zaytsev (@ysz) for contributing to this release.
pbyte_offset with cstubsThanks to Peter Zotov (@whitequark), David Sheets (@dsheets), Mike McClurg (@mcclurmc) and Anil Madhavapeddy (@avsm) for contributions to this release.
(Patch by Peter Zotov.)
The implications are discussed in the FAQ.
There are various examples available of packages which use stub support: see the fts example in the distribution (which uses a custom Makefile), this fork of async_ssl (which uses OCamlMakefile), and the cstubs branch of ocaml-lz4 (which uses oasis and ocamlbuild).
See the ocaml-ctypes-inverted-stubs-example repository for a sample project which exposes a part of Xmlm's API to C.
string_from_ptr for creating a string from an address and length.raw_address_of_ptr, an inverse of ptr_of_raw_address.typ_of_bigarray_kind for converting Bigarray.kind values to Ctypes.typ values.Array has been renamed to CArray.Thanks to Ivan Gotovchits, Greg Perkins, Daniel Bünzli, Rob Hoes and Anil Madhavapeddy for contributions to this release.
See Bigarray types and Bigarray values for details.
See the FAQ for details.
Loading the new findlib package ctypes.top in the toplevel will install custom printers for C types and values.
returning_checking_errno; pass a flag to foreign instead.Foreign.foreign that ignores absent symbols. (Patch by Daniel Bünzli.)*:* and +:+ are deprecated, but still supported for now.)UInt32.of_int32, UInt32.to_int32, UInt64.of_int64, and UInt64.to_int64 functions.string_opt view (Patch by Rob Hoes.)initial release