Comments (7)
Hi, thanks for using ffi-gen.
The first define should be easy to fix, I just need to parse more
arithmetic expressions. I'll look into that soon.
The second one is more difficult. Maybe ffi-gen could detect that this is
only a call to another function and generate a wrapper function for that.
But the arguments are also difficult to handle (using sizeof, etc.). So I
think the better solution is to write these wrappers by hand. Just reopen
the generated module after including it and add the methods. Are you okay
with that?
from ffi_gen.
Yes, it's ok!
But, is it possible to collect code which cannot be processed?
Thus, we have a chance to know what could be lost.
Thanks for this magic tool!
from ffi_gen.
Good idea! I will add warnings on the console.
from ffi_gen.
I've added support for more defines in 85abca7 and warnings for unsupported values in 7f4ef20. I think I will also add support for defines like "libssh2_channel_open_session" soon, because I noticed that they are quite common in many libraries.
from ffi_gen.
Good progress! Tnx!
from ffi_gen.
I've added first processing of method-like defines in 329fda9. It is still quite rudimentary, but it does the job for most of libssh2's defines. I will close this issue now. Feel free to open new ones if you find problems concerning the generated methods.
from ffi_gen.
Thank you!
from ffi_gen.
Related Issues (20)
- Could not open library 'clang' HOT 16
- can't tokenize last macro in file HOT 3
- ncurses won't generate HOT 2
- Does this require clang 3.0 or at least 3.0? HOT 25
- Why is this gem available as ffi_gen, not ffi-gen?
- libuv won't generate HOT 4
- "No translation for values of type 114" on clang-3.5
- Add a Dockerfile to make testing reproducible
- TypeError: unable to resolve type '[:double, 16]' HOT 2
- ffi_gen-1.2.0/lib/ffi_gen.rb:451:in `read_declaration': unhandled exception
- by_ref should be used for returned structs HOT 1
- flexible arrays (char x[]) incorrectly translate as :pointer
- enum fails to parse (in `block in read_declaration': undefined method `raw' for nil:NilClass (NoMethodError))
- java generator doesn't output struct member names
- java generator doesn't output getFieldOrder
- Minor issues with libcouchbase HOT 1
- Documentation for getting started on OSX w/Hombrew? HOT 2
- Defined constant with type indication generates invalid ruby code
- Fails for LLVM 4+
- Support /* */ comments HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffi_gen.