Wrapture
¶ ↑
A tool for generating object-oriented language wrappers for C code.
Wrapture
uses YAML files that describe the C code being wrapped and the output language interface.
Installation and Dependencies¶ ↑
Wrapture
is available on RubyGems.org and can be installed with a simple:
gem install wrapture
Wrapture
is packaged with bundler, so if you want to work on the source directly you can get all dependencies with a simple bundle install
.
Running the examples will require an environment that supports the target language, for example a compiler like g++
for the C++ examples. You will need to install these on your own, as there is currently nothing in Wrapture
to manage all of the target language environments.
What about SWIG?¶ ↑
SWIG provides a very similar functionality by wrapping C code in higher-level languages. SWIG can parse C code and detect functions constants, and other symbols to wrap automatically. Wrapture
is a simpler and more deliberate tool - the author must write an interface description in YAML outlining all of these things. This results in a much more concise class definition that feels more native to the output language than an auto-generated interface. Wrapture
also has much more limited language and feature support than SWIG.