Note: i dont work on this anymore atm, i moved stuff still worked on to julia-ffi a parser is WIP there aswel.
Parse C headers
I wrote this Common Lisp code to parse preprocessed C headers and use that data to generate cffi code(inside macro). (I have had trouble using other peoples' code like the 'groveller')
There is also a Julia code outputter.(see note above)
julia-src/ contains code that is autogenerated, and other code to help
use Julia's features. Only some openGL stuff and SDL stuff is very usable at
the moment. (The SDL stuff doesn't use the parser, just some basic hooks into
it) See the julia-src/ readme for more.
As parser, the current status is 'maybe it works', at best, but for me it is very useful to not have to do stuff manually.(However there not seeming a good program/lib to get this data from include files kindah sucks..)
Of course multiple ways of doing things; getting an FFI using an include file
could just be
(ffi-using-include-file "include-file" :package-name ...other options..)
or some such. But i think it is better to have a file, firstly to 'memoize'
the result so no parsing has to place in development, and secondly to guard
against the possibility of suddenly the output changing subtilly or worries
like that.. You keep the script at hand, and try only using that to change
I do want to keep the automatedly created files completely automated and anything beyond that in separate files. Also any operations on how the FFI is done should be transparent..
Currently there is just a function to throw things out from being FFI-ed,
structs, for instance, as not yet supported, and some
#defines because for
@define APIENTRY extern would give Julia an entry
APIENTRY = extern, which doesn't make sense. Problem of course is that the
parser doesn't know if C's
#defines are values or not.
(Common Lisp side)Dependencies
:to-cffi needs to make symbols in
:header-cffi helps using the program to preprocess, as such it uses
I want to have structs accessible for Julia. Automatically make a creator of a struct and accessor.
Trying to get more stuff parsed and ffi'ed in /usr/include/
Convert to Julia entirely?
Everything is under GPLv3, license included under
Jasper den Ouden