Project

c2ffi4rb

0.0
A long-lived project that still receives updates
Import C2FFI JSON to ruby/ffi
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

 Project Readme

c2ffi4rb

Gem Version test Lines of Code

c2ffi - FFI binding generator - for Ruby

installation

gem install c2ffi4rb

Usage

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 macros.json > simple.rb

Finally, 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 table

Development

To run tests, install c2ffi, Cairo, and pkg-config in advance. Then execute rake test.

Licence