cstructversion

access C structures via a camlp4 extension

Cstruct is a library and syntax extension to make it easier to access C-like structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the Bigarray module.

An example pcap description is:

cstruct pcap_header {
  uint32_t magic_number;   (* magic number *)
  uint16_t version_major;  (* major version number *)
  uint16_t version_minor;  (* minor version number *)
  uint32_t thiszone;       (* GMT to local correction *)
  uint32_t sigfigs;        (* accuracy of timestamps *)
  uint32_t snaplen;        (* max length of captured packets, in octets *)
  uint32_t network         (* data link type *)
} as little_endian
Tags org:mirage org:xapi-project
AuthorAnil Madhavapeddy
LicenseISC
Published
Homepagehttps://github.com/mirage/ocaml-cstruct
Issue Trackerhttps://github.com/mirage/ocaml-cstruct/issues
Maintaineranil@recoil.org
Dependencies
Optional dependencies
Source [http] https://github.com/ocaml/opam-source-archives/raw/main/cstruct-1.6.0.tar.gz
sha256=0f90a1b7a03091cf22a3ccb11a0cce03b6500f064ad3766b5ed81418ac008ece
md5=3104c76f548aeee8715e3ba0b98c28fe
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/cstruct/cstruct.1.6.0/opam
Required by
Optionally used by