Skip to content

Releases: mirage/ocaml-cstruct

Add `sexp` decorator for cenum values

08 Jun 14:36
Compare
Choose a tag to compare

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.

Add `to_bigarray`

19 Apr 19:10
Compare
Choose a tag to compare

Add a (sadly rather slow but sometimes necessary) function to convert a Cstruct back into a Bigarray slice of the right length and offset.

Bug fix for Cstruct.shift

19 Apr 19:10
Compare
Choose a tag to compare

Important bugfix for Cstruct.shift that affected the v1.0.0 release. Use this release in preference.

First stable release

19 Apr 19:10
Compare
Choose a tag to compare

Documentation and bounds checking improvements

More permissive grammar, and variable length buffers

19 Apr 19:10
Compare
Choose a tag to compare
  • Trailing semicolons are allowed in cstruct field definitions.
  • Buffer elements can be any primitive integer, not just uint8.

bug fixes, Travis and hexdump pretty printing

19 Apr 19:10
Compare
Choose a tag to compare
  • Improved ocamldoc for BE/LE modules.
  • Add Travis-CI test scripts and fix test.sh script compilation.
  • Support int32/int64 constant values in cenum like VAL = 0xffffffffl, useful for 32-bit hosts.
  • Check and raise error in case of negative offsets for blits (#4).
  • Correctly preserve the sequence after a constant constructor is set during a cenum definition.
  • Do not repeat the sizeof_<field> binding for every get/set field (should be no externally observable change).
  • Add Cstruct.hexdump_to_buffer to make spooling hexdump output easier.
  • Generate hexdump_foo and hexdump_foo_to_buffer prettyprinting functions for a cstruct foo.