Skip to content

Releases: mirage/ocaml-cstruct

Remove Camlp4 and only support PPX, support OCaml 4.03

27 Apr 14:34
Compare
Choose a tag to compare
  • Remove camlp4 extension as it is no longer maintained (#95).
  • Add support for OCaml 4.03 in the PPX extension (#96).
  • Minimum supported OCaml version for the library is now 4.02.3.
  • Fix parsing of high int32 @@enum values.

PPX support

19 Feb 17:44
Compare
Choose a tag to compare

Add support for a ppx-based extension that uses the extension point support in OCaml 4.02 and higher to generate Cstruct and Cenum function definitions. The new syntax is documented in the README file.

Safe string support and remove camlp4 hard dependency

08 Feb 20:39
Compare
Choose a tag to compare
  • Add support for -safe-string in OCaml 4.02 upwards.
    The main change is to rename blit_to_string to blit_to_bytes and
    change its type so that it writes to bytes rather than string
    (#74 by @yallop).
  • Remove strong build-time dependency on camlp4 in the base library.
    The sexplib functions were only used in the interface, so replace them
    with manually written ones. This also enables compatibility with latest
    Core that has switched to ppx.
  • Add multi-distro testing via Travis/Docker containers.

Repair `fillv` and correct error typo

15 Dec 12:48
Compare
Choose a tag to compare
  • Correct error output for LE.get_uint16 on invalid bounds (#75)
  • Fix fillv. If the source didn't fit in the buffer then we
    skipped the amount we wanted to copy, not the amount actually copied (#77).

Add concat and append and JS stubs

30 Sep 17:26
Compare
Choose a tag to compare

Add `fillv`, `memset` and comparison functions

03 Apr 18:11
Compare
Choose a tag to compare
  • Add memset to set all the bytes of a cstruct value efficiently (#49)
  • More useful Invalid_argument parameters (#48).
  • Fix to_sexp to expose only the current view (#44 from David Kaloper).
  • Add compare and equal (#23, #24 and #45 from David Kaloper).
  • Add fillv to copy over a list of buffers (from Thomas Leonard).
  • Shift to centralised Travis scripts.

Camlp4 is now an optional dependency on Cstruct

24 Nov 14:39
Compare
Choose a tag to compare

This release moves the camlp4 extension to being an optional dependency, so that libraries that manipulate Cstruct values without actually specifying C structure layouts are not forced to introduce a camlp4 dependency.

  • Make camlp4 an optional build-time dependency (#35).
  • Remove ounit as a dependency in the opam file.
  • Improve opam description file for OPAM 1.2 workflow (#36).
  • Refresh Merlin IDE description (#37).

Comprehensive bounds checking for all operations

10 Aug 18:22
Compare
Choose a tag to compare

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

  • Disallow negative indexing with all cstruct accessors.
  • Disallow negative sub and shift operations.
  • Make sure of_bigarray cannot create invalid cstruct values.

This may break some older cstruct consumers that assumed that negative shifts were allowed, and so the version has been bumped to 1.4.0.

Bounds checks on single-byte views

12 Jul 20:36
Compare
Choose a tag to compare

Also bounds test single-byte operations on views (#31 via @pqwy).

Sexp converters for Cstruct and improved bounds checking

05 Jul 22:09
Compare
Choose a tag to compare
  • Add bounds checks for Cstruct.BE/LE functions that violate a view.
    Previously, only bounds errors on the underlying buffers would raise.
    Bug #25, reported by Mindy Preston in mirage/mirage-tcpip#56.
  • Add 'Lwt_cstruct.complete' to ensure that read/write operatiosn
    run to completion.
  • Add Sexplib conversion functions to Cstruct.t values (#27 #22).