Re: automatic dll wrapping

new topic     » goto parent     » topic index » view thread      » older message » newer message

Tone Skoda wrote:

> I was thinking that it could be possible to make
> a program which would automatically wrap a dll.

Yes, this can be done. at one point, I had written module for SWIG (Simple
Wrapper Interface Generator) that would automatically generate DLLs for C
and C++ modules. It wasn't very good at handling custom datatypes, though -
it treated them all as pointers.

A better approach than trying to be able to parse any C/C++ file would to
simplify the grammar that the program accepted. For example, you could
restrict it to only being able to read function prototypes, and simple
structs. It's a lot easier to clean up the code by hand than it is to make
the code smarter, and the result it the same. It's a lot easier to maintain
the code, too.

I had written another wrapper generator along the lines that I just
described, but I seem to have misplaced it. I'll have to dig it up, because
even thought it was incomplete, it did a nice job of wrapping inherited C++
methods...

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu