Subject:
Re: [ruby-ffi] auto detect?
From:
Wayne Meissner
Date:
12/17/09 6:45 PM
To:
ruby-ffi@googlegroups.com

2009/12/18 Luis Lavena <luislavena@gmail.com>:
> On Thu, Dec 17, 2009 at 7:44 PM, rogerdpack <rogerpack2005@gmail.com> wrote:
>> Is there any way for ffi to do "what dl used to"
>>
>> auto_parse "HWND CreateWindowsEX(DWORD, LPCSTR...") # it figures out
>> what is what for you?
>
> No, that is prety much beyond FFI work.

Indeed, it is.

You can write your own layer that parses & binds functions using a
different syntax fairly easily.  Thats how DL is implemented on JRuby,
using the DL ruby code (that includes the C function declaration
parser), and converts that to FFI api calls.  Or look at JRuby's
Win32API.rb, it implements the old Win32API library atop FFI.