Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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 those files.

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 instance in GL/gl.h, @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

Uses some stuff like Alexandria, and some of my string stuff from j-basic. (notably j-string-utils:tokenize), as usual.

:to-cffi needs to make symbols in CFFI

:header-cffi helps using the program to preprocess, as such it uses external-program.


  • 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 doc/


Jasper den Ouden


CL lib to parse C headers, and generate FFI for CL(CFFI) and Julia



No releases published


No packages published
You can’t perform that action at this time.