Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktakashi/sagittarius-ffi-helper
FFI binding generation tools
https://github.com/ktakashi/sagittarius-ffi-helper
Last synced: 13 days ago
JSON representation
FFI binding generation tools
- Host: GitHub
- URL: https://github.com/ktakashi/sagittarius-ffi-helper
- Owner: ktakashi
- Created: 2013-06-14T16:36:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-09T10:59:33.000Z (about 10 years ago)
- Last Synced: 2024-10-06T01:23:02.509Z (about 1 month ago)
- Language: Scheme
- Size: 242 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FFI binding tools
The goal of this tools is to make FFI binding creation easier means it
read C headers and generate binding definitions automaticall. I think
writing those file is not something human should do.# How to use
The `genbind` is the script to generate a binding files. Following is the
example command.$ genbind -o "(foo)" -t intptr_t=int -t uintptr_t -s shared.txt \
test_files/includes/defs.hThis creates 4 files with following structure
- generated
- foo.scm
- apis.scm
- constants.scm
- types.scmCommand line options are followings;
-o,--output Top most output library name.
-s,--shared Shared object location definition file.
-t,--typedef Predefined typedef.
This can have following forms;
_name_
_name_=_value_
_name_ is the defined name. If _value_ is given then following form
will be emit in the `type.scm` file.
(define-c-typedef _value_ _name_)
-D,--define Preprocessor definition.
-c,--convert C function name conversion type.
scheme: convert camel to snake and '_' to '-'.
snake: convert camel to snake.
under: convert '_' to '-'
none: no conversion.# TODO
- resolving preprocessor should be done in C parser.
- creating better AST representation.
- better error reporting.
- better source tracking.Your contribution is always welcome :)