> > No. I was specifically talking about Inline building a wrapper given
> > *only* a declaration (a la Swig, and yes, I am a heretic, but at least
> > I'm trying to get better).
This is exactly the approach I took with Inline::ASM -- by necessity,
because there's no way to know the signatures of functions by looking at
assembly.
> Believe it or not, I'm thinking about autogenerating wrappers from
> headers. But not as the default behaviour. Patrick does an external
> 'STUDY' for Java classes. I'm thinking about generalizing it for C.
> Here's a first cut syntax I proposed to Patrick yesterday:
>
> use Inline C => 'EXTERNAL',
> EXAMINE => [ 'foo.h', 'bar.h' ],
> BIND => [ 'foo_func2', qr{^bar_} ];
>
> That way you're at least predeclaring what you want to bind to instead
> of just going for the whole schmear.
I really like Brian's approach here. Rather than specify wrappers by type
only, specify them by name -- the information's in the h-file. It will
require the patch floating around (to assume int if no type is given),
which is okay.
Later,
Neil