How kojix2/c2ffi4rb works
c2ffi4rb converts c2ffi-generated JSON specifications into Ruby FFI binding code: users run the CLI with one or more specs, optionally supplying a type-conversion table, and receive generated Ruby on standard output for manual completion. The CLI delegates generation to BindGen, which dispatches declaration forms and resolves their types. The library entry point loads BindGen and version metadata. CLI internals and the type-table file format were not sampled, so those details are limited to README-documented behavior.
Main entry points: c2ffi4rb Command-line tool · bind_gen.rb Binding generator · c2ffi4rb.rb Library entry point · version.rb Version metadata
Components 10
User interface
- Command-line tool
exe/c2ffi4rb - Library entry point
lib/c2ffi4rb.rb - Version metadata
lib/c2ffi4rb/version.rb
Binding generation
- Binding generator
lib/c2ffi4rb/bind_gen.rb - Type table
- Type resolution
lib/c2ffi4rb/bind_gen.rb
Other components
- Binding author
- c2ffi compiler
- JSON spec
- Generated Ruby
Connections 11
- Binding author → c2ffi compiler: invokes
README.md - c2ffi compiler → JSON spec: produces
README.md - Binding author → Command-line tool: invokes
README.md - JSON spec → Command-line tool: supplies input
README.md - Type table → Command-line tool: optional input
README.md - Command-line tool → Binding generator: generates with
README.md - Command-line tool → Generated Ruby: writes output
README.md - Library entry point → Binding generator: loads
lib/c2ffi4rb.rb - Library entry point → Version metadata: loads
lib/c2ffi4rb.rb - Binding generator → Type resolution: resolves types
lib/c2ffi4rb/bind_gen.rb - Type resolution → Generated Ruby: emits declarations
lib/c2ffi4rb/bind_gen.rb