Would it be possible to write a program that converts a module that uses
ctypes to interface to a dll to a corresponding C extension program that
would compile to a drop in replacement extension module?

If implemented at all, I think the ctypes implementation itself could do
that. I.e. create all the function objects, let the Python script declare the APIs, and then generate C code from those signatures.

The C code would then best be adjusted: you'd rather use the struct declarations from the header files instead of the one you learned from ctypes (which may be wrong, or processor-dependent, or version-dependent). So a manual adjustment of header files would be necessary afterwards.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to