Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kojix2/c2ffi4rb
Automatic Ruby-FFI Binding Generator
https://github.com/kojix2/c2ffi4rb
Last synced: 22 days ago
JSON representation
Automatic Ruby-FFI Binding Generator
- Host: GitHub
- URL: https://github.com/kojix2/c2ffi4rb
- Owner: kojix2
- Created: 2024-09-04T10:17:02.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-29T06:11:40.000Z (about 1 month ago)
- Last Synced: 2024-09-29T06:18:30.411Z (about 1 month ago)
- Language: Ruby
- Homepage:
- Size: 124 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# c2ffi4rb
[![Gem Version](https://badge.fury.io/rb/c2ffi4rb.svg)](https://badge.fury.io/rb/c2ffi4rb)
[![test](https://github.com/kojix2/c2ffi4rb/actions/workflows/ci.yml/badge.svg)](https://github.com/kojix2/c2ffi4rb/actions/workflows/ci.yml)[c2ffi](https://github.com/rpav/c2ffi) - FFI binding generator - for Ruby
## installation
```sh
gem install c2ffi4rb
```## Usage
First, produce a `spec` file using `c2ffi`.
```sh
c2ffi -M macros.h -o example.json example.h
c2ffi -o macros.json example.h macros.h
```Next, use c2ffi4rb to generate ruby code.
```sh
c2ffi4rb example.json macro.json > simple.rb
```Finally, improve simple.rb manually to complete the binding.
## Development
To run tests, install [c2ffi][c2ffi], [Cairo][cairo], and [pkg-config][pkg-config] in advance.
Then execute `rake test`.[cairo]: https://www.cairographics.org/ "Cairo"
[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/ "freedesktop.org"
[c2ffi]: https://github.com/rpav/c2ffi "GitHub"## Licence
- [LGPL-2](https://github.com/rpav/c2ffi-ruby/blob/master/c2ffi-ruby.gemspec)