SWIG and Callbacks

David Abrahams david.abrahams at rcn.com
Fri Jun 14 21:53:01 EDT 2002


"Michael 'Mickey' Lauer" <mickey at tm.informatik.uni-frankfurt.de> wrote in
message news:3d0a8b6e at nntp.server.uni-frankfurt.de...


> I had a quick look at the other wrappers (SILOON, GRAD, CXX, etc.)
> but most look either outdated or not appropriate for this task.
> Do you know an (automatic) wrapper generator which has this feature?
>
> I know sip can do this for c++ libraries - can sip also be used
> to wrap plain c-libs without "handwriting" code?

On most platforms, Boost.Python would work for you. The determining issue is
whether or not the C++ compiler treats "C" and "C++" linkage function
pointers the same way. If the appended program will compile with your C++
compiler, you're probably OK:

-Dave

extern "C" void f() {}
void g(void (*)());
int main()
{
    g(f);
    return 0;
}






More information about the Python-list mailing list