Re: [xml] xmlwriter function naming convention

On Tue, Feb 12, 2008 at 12:15:43PM +0100, Mickautsch, Alfred wrote:
I propose that xmlFreeTextWriter be renamed to xmlCloseTextWriter. This
follows the convention of file I/O through stdio. After fopen(), one
uses the fclose() function to flush out the buffers and deallocate
resources. One cannot use free() on the file pointer without potentially
disasterous results. This is the distinction between a "close" function
and a "free" function. A "close" function flushes data from buffers
before freeing resources, whereas a "free" function only frees

Since xmlFreeTextWriter behaves more like a destructor it could as well be called xmlDeleteTextWriter. From 
another point of view, maybe xmlTextWriterEndDocument should call xmlTextWriterFlush, so there would be no 
need for xmlOutputBufferClose to flush the buffer itself and the behaviour of xmlFreeTextWriter would match 
the behaviour you expect from it.

  yes, Flushing at the end of the EndDocument functions would make sense,
could you design such a patch ?

 thanks !


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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