ppx_cstubs is a ppx-based preprocessor for stub generation with ctypes.
ppx_cstubs creates two files from a single ml file: a file with c stub code and a ml file with all additional boilerplate code.
- Calling C functions from OCaml
- Enum Types
- Struct and Union Types
- Dealing with Opaque Types and Integers
- Retrieving Constants
- C #include Guards
- Static OCaml Callbacks
- Pointers to C Objects
- Scoping Rules
Consult the README.md in the meanwhile…
- merlin (how to configure your editor?
ppx_cstubs.merlincan only be used inside your editor, not inside build rules)
- dune integration - see also this example
- cross package dependencies with
ppx_cstubs -pkg ...