The text this package generates, from the shapes ExMujoco.Gen hands it.
Kept apart from the reading and the deciding so that what a generated binding
looks like can be read in one place. Every emitted body is small on purpose: a
field is one return and one FINE_NIF, a function is one call, and the only
arithmetic anywhere is a dimension.
c_src/ex_mujoco_nif.cpp is not generated. The parts that need a decision
per call — an error buffer, an output array, a state signature — are written
out by hand and listed in c_src/manifest.exs.
Summary
Functions
ExMujoco.Api — the C functions bound 1:1, under their C names.
What is bound, what is not, and why — as Markdown.
One module per enum, under ExMujoco.Types.
Whether a C function can be bound from its signature alone.
The field accessors, as NIFs.
ExMujoco.Model or ExMujoco.Data — a typed reader per field.
The bound functions, as C++ NIFs.
ExMujoco.Native — one stub per generated NIF, and the load hook.
Why a function cannot be bound, in a sentence.
Functions
ExMujoco.Api — the C functions bound 1:1, under their C names.
What is bound, what is not, and why — as Markdown.
One module per enum, under ExMujoco.Types.
Whether a C function can be bound from its signature alone.
The rules are the four questions a NIF has to answer: what to pass for a
callback (nothing), what a void* is (anything), how long an output array is
(the caller's business), and what a variadic list contains (unknown).
The field accessors, as NIFs.
ExMujoco.Model or ExMujoco.Data — a typed reader per field.
The bound functions, as C++ NIFs.
ExMujoco.Native — one stub per generated NIF, and the load hook.
Why a function cannot be bound, in a sentence.