If you are looking for something simpler as a stop gap in the mean time, this Lua script saves the output of ./gcc -E to a file and could probably be modified to your needs https://gist.github.com/2625031 ./ffipp out.lua openssl/ssl.h should generate a lua file with all cdefs necessary to call a function in openssl/ssl.h for instance.