[Pyrex] Wrapping structs that reference each other

vng1 at mac.com vng1 at mac.com
Tue Sep 28 07:34:45 CEST 2004


Yep.  Wrapping libxml2.  :)

Ok - so my C is worse than rusty - I can barely read C anymore.

I've got the following signature that I'd like to wrap up - it's a 
function pointer.

     174 typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) 
(xmlXPathParserContextPtr ctxt,
     175                  xmlXPathObjectPtr cur);

So - how does one wrap such a beastie in Pyrex - or is it even 
possible?  The only reference I see to fp's and Pyrex are here:

http://lists.copyleft.no/pipermail/pyrex/2004-March/thread.html#623

but I'm left pretty confused - most likely because i can't remember 
what to actually _use_ function pointers for anymore.

vic

---
Don't be humble ... you're not that great.    -- Golda Meir

On 27-Sep-04, at 08:51 AM, Martijn Faassen wrote:

> vng1 at mac.com wrote:
>> How do I do forward declarations in Pyrex?  I've got C structures 
>> that I'm trying to wrap, but they reference each other.
>> The following code is  an example of what I'd like to do, but Pyrex 
>> yells at me when it gets to the "_xmlNode root" in the first struct.
>>           cdef struct _xmlDoc:
>>               _xmlNode root
>>           cdef struct _xmlNode:
>>               _xmlDoc doc
>
> This sounds suspiciously much like you're wrapping libxml2 with Pyrex, 
> is that correct? I've been working on something like that for quite a 
> while now, called lxml. Take a look here for the SVN archive, and drop 
> me a mail if you're interested in it:
>
> http://codespeak.net/svn/lxml/trunk/src/lxml/
>
> Regards,
>
> Martijn
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3901 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20040928/260a011d/smime.bin


More information about the Pyrex mailing list