Releases: mirage/ocaml-cstruct
Releases · mirage/ocaml-cstruct
Remove Camlp4 and only support PPX, support OCaml 4.03
PPX support
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
- Add support for
-safe-string
in OCaml 4.02 upwards.
The main change is to renameblit_to_string
toblit_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.
Thesexplib
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
Add concat and append and JS stubs
Add `fillv`, `memset` and comparison functions
- 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
andequal
(#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
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.
Comprehensive bounds checking for all operations
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
andshift
operations. - Make sure
of_bigarray
cannot create invalidcstruct
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
Sexp converters for Cstruct and improved bounds checking
- 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 toCstruct.t
values (#27 #22).