Re: FFI, cURL and function callback

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 28 Mar 2013 11:14:22 -0400

On 28 March 2013 09:25, madigest i <madigest@xxxxxxxxxxxxx> wrote:
> What people ase using to autogenerate cdef files?
>
> I need Windows, OSX and Linux. Creating cdef files by hand takes huge amount 
> of time.

I've tried numerous methods, none which I'm completely happy with.
But manual curation isn't that bad.

just run: `gcc -E -P /usr/include/someheader.h` to get all the types+functions.
For quick and dirty scripts thats enough, but for big projects I then
strip out common includes => Usually by looking in the original .h for
the first declaration, and deleting everything before it in the
output.
Then I just copy/paste the defines as lua variables.

Have a look in https://github.com/chatid/fend/tree/master/include for
how this turns out.

Other related posts: