# `ExMujoco.Gen`
[🔗](https://github.com/d-led/ex.mujoco/blob/main/lib/ex_mujoco/gen.ex#L1)

Turns MuJoCo's headers into the bindings this package ships.

Three inputs decide the output:

  * the headers under `MUJOCO_DIR/include`, read by `ExMujoco.Gen.Header`;
  * `c_src/manifest.exs`, the one human decision — which C functions are bound
    1:1, and what was left out and why;
  * the shapes in `ExMujoco.Gen.Template`.

What comes out is committed, so the package builds without a network and
without a generator run: the C++ that Fine registers, and the Elixir that calls
it. `mix ex_mujoco.gen --check` regenerates into a temporary directory and
compares, which is how drift between the headers and the bindings is caught —
the same rule MuJoCo applies to its own `python/mujoco/introspect` output.

Everything the headers describe but this package does not bind is written to
`docs/coverage.md`, with the reason. Nothing is dropped in silence.

# `generate`

All generated content, as `%{path => content}`.

# `generated_files`

The files this generator owns.

# `run`

Regenerates everything, or — with `check: true` — compares what is on disk
against what would be generated.

Answers `{:ok, files}` with the paths written, or `{:error, stale}` naming the
files that disagree.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
