c2ffi - FFI binding generator - for Ruby
gem install c2ffi4rb
First, produce a spec
file using c2ffi
.
c2ffi -M macros.h -o example.json example.h
c2ffi -o macros.json example.h macros.h
Next, use c2ffi4rb to generate ruby code.
c2ffi4rb example.json macro.json > simple.rb
Finally, improve simple.rb manually to complete the binding.
To run tests, install c2ffi, Cairo, and pkg-config in advance.
Then execute rake test
.