Re: Automatically generating ctypes bindings with ctypesgen

Chris Clark <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
Roman Yakovenko wrote:
> On Sun, Sep 5, 2010 at 8:41 PM, Chris Clark <[email protected]> wrote:
>   
>> ctypesgen can generate ctype based bindings for you automatically, all
>> you need is GCC.
>>
>> For more information see:
>>
>> http://code.google.com/p/ctypesgen/
>> http://code.google.com/p/ctypesgen/wiki/GettingStarted
>>     
> Please correct me if I wrong: the project uses hand-crafted C parser,
> right? If so, how much of C code it ables to handle?
>   

Not quite, it uses something yacc-like so it isn't exactly hand crafted 
per-se. If you are asking is this a fully capable C parser then the 
answer is no (it doesn't need to be). I have to confess I've not had to 
deal with the parser as it appear to just work with the output from GCC :-)

RE how much, GCC gets called to process header files (and only header 
files, it doesn't try and deal with regular C code). So ctypesgen only 
has to process, a (single) pre-processed header file in. It only handles 
GCC. I briefly experimented with the Microsoft Visual C++ pre-processor 
but that doesn't work at all.

Chris


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.