Overview
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.
Contents
- 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
not yet documented
Consult the README.md in the meanwhile…
- merlin (how to configure your editor?
ppx_cstubs.merlin
can only be used inside your editor, not inside build rules) - compilation
- dune integration - see also this example
- cross package dependencies with
ppx_cstubs -pkg ...