From: Sam S. <sd...@gn...> - 2009-06-15 21:15:46
|
N. Raghavendra wrote: > > -xml-node is my attempt at a direct translation of _xmlNode in > <libxml2/libxml/tree.h>, which is defined there as a self-referential > structure: > > typedef struct _xmlNode xmlNode; > typedef xmlNode *xmlNodePtr; > struct _xmlNode { > void *_private; > xmlElementType type; > const xmlChar *name; > struct _xmlNode *children; > struct _xmlNode *last; > /* [snip] */ > unsigned short extra; > }; > > I translated this to > > (def-c-type xml-node (c-struct -xml-node)) > (def-c-type xml-node-ptr (c-pointer xml-node)) > (def-c-struct -xmlNode > (-private c-pointer) > (type xml-element-type) > (name (c-pointer xml-char)) > (children (c-pointer (c-struct -xml-node))) > (last (c-pointer (c-struct -xml-node))) > ;; [snip] > (extra ushort)) you do realize that you have both -xmlNode and -xml-node which _are_ different symbols, right? > Since `(c-pointer (c-struct -xml-node))' in the above seems to be the > problem, what should I use in its place? just plain c-pointer. you can cast it later. I hope Joerg will explain why you are getting all NILs |