[Dream] A meta-wrapper module to interface any C dynamic library

Thomas Heller theller at python.net
Fri Jul 4 11:15:07 EDT 2003


"Simon Burton" <simonb at webone.com.au> writes:

> On Fri, 04 Jul 2003 10:59:39 +0000, Francesco Bochicchio wrote:
>
>
>> Did anybody ever attempted to do something like this?
>> 
>> Ciao
>> -----
>> FB
>
> yeah,
>
> http://arrowtheory.com/software/python/index.html
>
> it's hard :)
>
I have tried cdecl.py to parse windows header files, and it does a
pretty good job.

I say this after also having tried PLY
http://systems.cs.uchicago.edu/ply/ with a partial C grammer, and
finally gave up because I'm not sure it is possible to parse ANSI C with
a parser like this (at least its not possible for me).

I found one problem in cdecl.py (it doesn't parse hex constants
correctly), and I had to extend it somewhat for MS specific keywords
like __stdcall or so. I also ran the header files through the MSVC
preprocessor, and hand-edit them somewhat before throwing them at it.

I'm not really sure if it's a good idea to automatically create ctypes
wrappers from windows.h...

But I finally gave up when I encountered some really strange errors...

Thomas




More information about the Python-list mailing list