Re: [Vala] [Genie] Using MarkupParser



Hey Patrick,

I'm not alone going on all interesting forums !

I can't really help you because i'm learning programmation like you.

I see on the libxml2 example page a function to clean the Xml.Doc:

xmlFreeDoc(yourdoc)

But vala has on its libxml2.vapi, this:

[CCode (cname = "xmlDoc", free_function = "xmlFreeDoc", cheader_filename = "libxml/tree.h,libxml/parser.h")] probably the "free_function" is for cleaning automatically the doc when vala generate c source file ?!?!

For the node, i don't know, for example this:
http://xmlsoft.org/examples/tree1.c
use a node, and i don't see a cleanup function.

Nicolas.

Thanks Nicholas - actually I am Caleb72.

That small piece of code was the result of about a day's work trying to understand that library - looking both at the Vala documentation and the original C library reference material. Then it was down to trial and error.

By the way - do you think the concerns I raised on the Puppy forum are correct regarding this code? I'm not actually doing anything to cleanup the Xml.Doc*, Xml.Node* and Xml.Attr* pointers I create and my reading of Parser.cleanup() was that everything is not necessarily destroyed. Genie has delete which I could use - not sure if I should be using something defined in the libxml library though.

My understanding of Genie thus far is that when you specifically define pointers as I have in this case, you take the responsibility for management of the memory, the reference counter isn't applicable.

Regards
Patrick






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]