c2ffi4rb
c2ffi - FFI binding generator - for Ruby
installation
gem install c2ffi4rbUsage
First, produce a spec file using c2ffi.
c2ffi -M macros.h -o example.json example.h
c2ffi -o macros.json example.h macros.hNext, use c2ffi4rb to generate ruby code.
c2ffi4rb example.json macros.json > simple.rbFinally, improve simple.rb manually to complete the binding.
Options
c2ffi4rb -h # Show help
c2ffi4rb -v # Show version
c2ffi4rb -t table.tsv file.json macros.json > output.rb # Use type conversion tableDevelopment
To run tests, install c2ffi, Cairo, and pkg-config in advance.
Then execute rake test.