Skip to content

Releases: mirage/ocaml-cstruct

Fix composition of cstruct.ppx with other drivers

09 Jun 13:02
Compare
Choose a tag to compare
  • ppx: remove an errant standalone initialiser that was messing up
    the composition of cstruct with other ppx_driver based ppx converters
    (most notably ppx_sexp_conv. If you are having trouble with using
    ppx_cstruct with other drivers, put a constraint on ppx_cstruct>=3.0.1.
    (#151 #150 #149 #148 via @djs55 @g2p @avsm @diml).
  • ppx: also add a test case for cstruct and lwt working together, but
    this will not work until a lwt>3.0 release happens.
  • Update opam rules to use jbuilder subst for version information
    in the distribution.
  • Fix tests so that check_alignment expects a negative result.
  • Add opam test target for core library.

Split up OPAM packages into separate ones, port to Jbuilder

26 May 18:53
Compare
Choose a tag to compare
  • Split up OPAM packages into multiple independent ones. We now
    have a standalone cstruct, and then separate cstruct-lwt,
    cstruct-async, cstruct-unix packages, and a ppx_cstruct
    package for the syntax extension. Transitional findlib packages
    with the old scheme are available, but now packages should migrate
    to using cstruct-async instead of cstruct.async for example.
    This has the added benefit of the OPAM package names now matching
    the findlib names. (#138 by @avsm @rgrinberg).

  • Port build to jbuilder.
    See the README for local development instructions.

  • Ensure that check_alignment only takes a non-zero argument
    for alignment (#143 #145 by @cfcs @avsm).

Fix linking regression introduced in 2.4.0

03 May 10:23
Compare
Choose a tag to compare
  • fix missing ppx_tools_versioned dependency (#136, @et-def)

Support jbuilder and ppx_driver

30 Mar 11:22
Compare
Choose a tag to compare

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:

  • the binary is used for toplevel and simple -ppx building
  • the library is used for linking custom rewriters
  • -package cstruct.ppx alone uses the binary for rewriting.
  • -package cstruct.ppx -predicates custom_ppx,ppx_driver" is used to link the rewriter.

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.

More flexible OCaml version support

28 Mar 21:26
Compare
Choose a tag to compare

This release uses ocaml-migrate-parsetree (described here) in order to make it more independent to the base OCaml version. There should be no observable changes, but the internals are much cleaner now.

OCaml 4.05 PPX support

03 Mar 14:59
Compare
Choose a tag to compare
  • Add support for OCaml 4.05 for the PPX extension.
  • Docs: correct to description of shift function (#121 via @orbifx).

Minor updates

10 Dec 21:55
Compare
Choose a tag to compare

Add to/of_bytes functions and support OCaml 4.04.0

17 Aug 13:39
Compare
Choose a tag to compare
  • Add Cstruct.of_bytes/to_bytes. In common with the existing
    implementation, this relies on the representation of bytes and string
    being the same, which is true as of OCaml 4.04 and lower (#105 via @yallop).
  • Support OCaml 4.04 (#111 via @gasche).

Zero out new buffers by default

30 Jun 10:56
Compare
Choose a tag to compare
  • Make create zero out the new buffer. The new create_unsafe
    function can be used if you want to trade safety for speed.

Add Format-friendly hexdump_pp

04 May 17:00
Compare
Choose a tag to compare

Add hexdump_pp that uses the Format module. This works better with the Logs library than using hexdump_to_buffer, and also makes it easy to indent the hexdump (#100 via @talex5).