Comments (4)
Hmm, there seem to be more customizations I'd like to make, for example to replace
function somefunction(arg::Ptr{Cint})
with something either untyped or as
function somefunction(arg::Array{Cint})
(this is for functions that return values via pointers). It gets hard to imagine being able to cover the range of possible tweaks through hooks. Perhaps replacing wrap_c.wrap((buf::IO, funcdecl::FunctionDecl, libname::ASCIIString)
is the real way to go.
from clang.jl.
Yes, I've thought about this sort of thing - far too much, actually, without just trying something... This comes up for C++ too because I want to inject type translations at various points, for classes or templates that need getter/setter helpers. I might do something like:
type Wrap
pre_wrap::Function
ccall_wrap::Function
post_wrap::Function
...
end
Dict{ASCIIString => WrapHelpers}()
The dictionary would be part of WrapContext so you could inject various helpers that way.
But, the ideal solution would probably be to reflect the AST in pure Julia and then provide hooks for people to do pattern matching and transformations on that... Everything is more awkward than it should be right now because the AST is read-only.
I'll see what I can do :)
Your second comment is the reason I suggested disabling type signatures in the function call - then I think it should just work via ccall
auto-conversion (not sure about performance).
from clang.jl.
It won't have any impact on performance whatsoever. You're right, perhaps removing them is easiest. (I was originally thinking they were extra protection against segfaults, but now I don't think so; ccall itself should complain, I imagine, if the type can't be converted appropriately.)
from clang.jl.
#71 basically implements this.
from clang.jl.
Related Issues (20)
- Respect `output_ignorelist` for macro definitions HOT 5
- Error when parsing alignas(64) HOT 3
- Various non-valid Julia code output HOT 8
- MIOpen generator fails HOT 4
- Support `_Atomic` HOT 2
- Support variable array function parameters
- C_LONG_LONG and C_INT64_T represented as Clong HOT 4
- `__restrict not defined` Error HOT 3
- Edge cases encountered while generating bindings for Hwloc HOT 1
- Enumerations with a fixed underlying type, via typedef HOT 1
- Bug introduced in Clang.jl v0.16.6 HOT 10
- Definitions of function pointer types should appear before their first use HOT 4
- Creating bindings for libwinit HOT 11
- size_t wrongly translated to Cint HOT 2
- Feature Request: implement `smart_deanonymize` for cenums HOT 1
- Using `fieldnames` (and similar) for wrapped C `union`s HOT 2
- Unexpected assertion error: ERROR: AssertionError: length(child_nodes) == length(fields) HOT 1
- Support for `using` HOT 3
- generating julia wrapper for C library
- Unknown CXCursorKind with Julia master/Clang.jl master HOT 2
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 clang.jl.