commits
add x-maintenance-intent field to the opam file
Use Cstruct.length in docs
It does the same as to_string but without defaults, and the name
suggests it returns another cstruct but it doesn't. Instead,
Cstruct.sub_copy is a version that returns a cstruct copy.
The function `of_hex` lacks an inverse function. The hexdump functions
are useful when you want to look at them with a cup of coffee in hand, a frown on your face, and a growing feeling of existential despair; but if you just want to copy/paste data into a `utop` or a test file, `to_hex_string` will be more convenient as you can just write `Cstruct.of_hex "d3adb33f"` with the obtained string.
add `Cstruct.sub_copy`
ppx_cstruct: remove stdlib-shims dependency, it requires OCaml 4.08 already
since cstruct-unix requires 4.08+, no need for mmap -- use Unix.map_file directly
drop support for ocaml < 4.08.0, drop bigarray-compat dependency
Be compatible with OCaml 5.00.0
Lint dependencies and the CI
Implement host_endian (HE)
Mostly a mechanical change for completeness sake.
This addresses issue #72, basically host endianness means "don't swap" for
cstruct, so it's pretty straightforward.
With this I can successfully use the following code on haesbaert/rawlink:
[%%cstruct
type bpf_hdr = {
bh_sec: uint32_t;
bh_usec: uint32_t;
bh_caplen: uint32_t;
bh_datalen: uint32_t;
bh_hdrlen: uint16_t;
} [@@host_endian]]
Upgrade ocamlformat
add_len and set_len violate the invariant "no operation on [t] is allowed to
extend the view on the underlying bigarray".
Add a link to the documentation and delete the old Travis-CI build status.
Update tests to use an official bun version
The new bun release now supports dune 2.
Also, switch the base image to a modern one, with AFL pre-configured.
The function `of_hex` lacks an inverse function. The hexdump functions
are useful when you want to look at them with a cup of coffee in hand, a frown on your face, and a growing feeling of existential despair; but if you just want to copy/paste data into a `utop` or a test file, `to_hex_string` will be more convenient as you can just write `Cstruct.of_hex "d3adb33f"` with the obtained string.
This addresses issue #72, basically host endianness means "don't swap" for
cstruct, so it's pretty straightforward.
With this I can successfully use the following code on haesbaert/rawlink:
[%%cstruct
type bpf_hdr = {
bh_sec: uint32_t;
bh_usec: uint32_t;
bh_caplen: uint32_t;
bh_datalen: uint32_t;
bh_hdrlen: uint16_t;
} [@@host_endian]]