← All repos

ocaml-cstruct

Map OCaml arrays onto C-like structs

Browse cluster: OCaml Systems and Utilities
989commits
46contributors
6languages

Tech stack & purpose

Cstruct is an OCaml library and PPX syntax extension that enables direct access to C-like structures from OCaml by mapping them onto the Bigarray module, supporting both reading and writing operations. The project is built in OCaml and uses the dune build system, with several complementary packages available through the opam package manager: the core cstruct library, cstruct-sexp for s-expression serialization, cstruct-unix and cstruct-async for Unix and Async framework support, cstruct-lwt for Lwt variants, and ppx_cstruct for the PPX extension itself. The ppx_cstruct extension automatically generates accessor and mutator functions from declarative struct and enum definitions, allowing developers to work with binary protocols and data formats such as network packet headers without manual offset calculations.

Languages

OCaml
95.0%
Pawn
2.7%
C
1.2%
JavaScript
0.9%
Makefile
0.1%
Dune
0.0%

Contributors (top 30 of 46)