Re: [pygccxml-development] ctypes code generation?
Brought to you by:
mbaas,
roman_yakovenko
From: Gordon K. <gk...@bw...> - 2008-10-16 15:54:51
|
hello- Okay, thanks for these links and ideas. I encourage you to work on a pygccxml-to-ctypes-wrapper-code-generator in all your free time :) Gordon On Oct 15, 2008, at 2:58 PM, Roman Yakovenko wrote: > On Wed, Oct 15, 2008 at 6:43 PM, Gordon Kindlmann > <gk...@bw...> wrote: >> Would it be possible to point me to an existing example of doing >> this? Or >> any hints about how to do it myself? > > I am not sure you need this, but if you ask: > http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/ > docs/documentation/ctypes/ > > The link contains few documents, which describes the idea and > implementation behind "Py++ & ctypes integration". > >> I'm relatively new to python, so I have to admit I don't grasp the >> significance of what this page describes. Again, some simple >> examples of >> wrapping C code would really help me understand how I could use >> your tools. > > If you are wrapping pure C code, I suggest you to stay with ctypeslib > only. The overhead is too big. > >>> May be the best solution for you is to add missing functionality to >>> ctypeslib? It is not too difficult after all. I can help you with >>> gccxml. >>> ... >> Well, in the mean time I have in fact found a way to tweak the >> xml2py script >> of ctypeslib, and I've announced the patch on the ctypes-users >> mailing list, >> which I can forward to you if interested. So ctypeslib is working >> again for >> me, with gcc 4.0.1 and gccxml 0.9.0, but there are probably still >> some small >> problems. >> >> I do think it would be very good if ctypeslib is still maintained by >> someone. To me it seems like a tool that is very good at its one >> thing, and >> its a shame when those tools stop working. Alternatively, from >> what I >> understand, it seems like the pygccxml output could also be parsed to >> generate the same ctypes code that ctypeslib generates- that is, >> the brains >> of ctypeslib's xml2py script could operate on the pygccxml parse tree >> instead of the XML file directly. But I barely know what I'm >> talking about! > > This is exactly my plan - to port current code generator to deal with > pygccxml and not with xml directly. > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ |