v5.1.1 2019-11-23

This is a point release to fix a regression in 5.1.0 on compilers earlier than 4.07.

The release also fixes the test suite and CI on compilers greater than 4.07.

v5.1.0 2019-11-23

v5.0.0 2019-04-19

Security: This release tightens bounds checks to ensure that data outside a given view (but still inside the underlying buffer) cannot be accessed.

Remove Unix dependency: cstruct now uses the new bigarray-compat library instead of Bigarray directly, to avoid a dependency on Unix when using OCaml compilers less than 4.06.0. This will break downstream libraries that do not have a direct dependency on Bigarray. Simply fix it in your library by adding a bigarray dependency in your dune file. (#247 @TheLortex)

Capability module: To improve the safety of future code with stronger type checking, this release introduces a new Cstruct_cap module which makes the underlying Cstruct an abstract type instead of a record. In return for this extra abstraction, the module can enforce read-only, write only, and read/write buffers by tracking them as phantom type variables. Although this library shares an implementation internally with classic Cstruct, it is a significant revision and so we will be gradually migrating to it. Feedback on it is welcome! (#237 @dinosaure and many excited reviewers)

Ppx compare functions: A new compare_X function is generated for cenum declarations. This respects custom ids supplied in the cenum declaration and so is more robust than polymorphic compare (#248 @emillon)

The CI has also been switched over to both Azure Pipelines and Drone in addition to Travis, and as a result the tests all run on Windows, macOS, various Linux distributions, on x86 and arm64 machines, and runs AFL fuzz tests on the Drone cloud (#255 @avsm).

v4.0.0 2019-03-25

v3.7.0 2019-03-10

v3.6.0 2019-03-01

v3.5.0 2019-02-26

v3.4.0 2019-02-02

v3.3.0 2019-01-22

v3.2.1 2017-12-13

v3.2.0 2017-11-17

v3.1.1 2017-07-13

v3.1.0 2017-07-12

v3.0.2 2017-06-14

v3.0.1 2017-06-09

v3.0.0 2017-05-11

v2.4.1 2017-05-03

v2.4.0 2017-03-30

Distribute the PPX extension so that it is compatible with Jbuilder. ppx_cstruct is now distributed as both a library and a binary. Findlib predicates are used to distinguish usage:

To use the PPX extension in jbuilder, just add:

  (libraries (cstruct))
  (preprocess (pps (cstruct.ppx)))

to your jbuild file. This may be renamed to ppx_cstruct in a future release so that the PPX dependency is decoupled from the main library, so this cstruct.ppx is intended to be transitional as it is what was originally used.

v2.3.3 2017-03-28

v2.3.2 2017-03-03

v2.3.1 2016-12-10

v2.3.0 2016-08-16

v2.2.0 2016-06-30

v2.1.0 2016-05-04

v2.0.0 2016-04-26

v1.9.0 2016-02-19

v1.8.0 2016-01-05

v1.7.1 2015-12-15

v1.7.0 2015-07-11

v1.6.0 2015-03-28

v1.5.0 2014-11-24

v1.4.0 2014-08-10

Comprehensive addition of bounds checking to all cstruct operations (from @pqwy in #33). The major changes are:

v1.3.1 2014-07-10

v1.3.0 2014-07-04

v1.2.0 2014-06-06

Add a sexp optional decorator to cenum to output the values as s-expressions. This is compatible with the sexplib convention. The syntax is;

cenum foo64 {
  ONE64;
  TWO64;
  THREE64
} as uint64_t(sexp)

And sexp_of_foo64 and foo64_of_sexp functions will also be available. The representation of the Sexp is the string representation of the enum.

v1.1.0 2014-02-19

v1.0.1 2013-12-09

v1.0.0 2013-12-05

v0.8.1 2013-11-06

v0.8.0 2013-10-13

v0.7.1 2013-03-06

v0.7.0 2013-02-25

v0.6.2 2013-02-08

v0.6.1 2012-12-20

v0.6.0 2012-12-20

v0.5.3 2012-12-16

v0.5.2 2012-12-11

v0.5.1 2012-09-28

v0.5.0 2012-09-20

v0.4.0 2012-09-02

v0.3 2012-08-25